2022-03-02 23:59:19 +01:00
|
|
|
#pragma once
|
2019-03-28 02:17:15 +01:00
|
|
|
|
2022-03-17 02:50:30 +01:00
|
|
|
#include "better_note.hpp"
|
2022-03-23 02:20:07 +01:00
|
|
|
#include "better_notes.hpp"
|
2022-03-16 02:10:18 +01:00
|
|
|
#include "better_song.hpp"
|
2021-12-31 14:59:39 +01:00
|
|
|
#include "history.hpp"
|
|
|
|
#include "history_actions.hpp"
|
2021-12-31 00:57:06 +01:00
|
|
|
#include "notes_clipboard.hpp"
|
|
|
|
#include "time_selection.hpp"
|
|
|
|
#include "widgets/density_graph.hpp"
|
2019-04-06 22:35:17 +02:00
|
|
|
|
2022-03-23 02:20:07 +01:00
|
|
|
#include <boost/concept_check.hpp>
|
|
|
|
#include <boost/multiprecision/detail/default_ops.hpp>
|
2022-01-04 01:31:17 +01:00
|
|
|
#include <filesystem>
|
2022-03-23 02:20:07 +01:00
|
|
|
#include <variant>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
using TapNotePair = std::pair<better::TapNote, better::TapNote>;
|
2022-01-04 01:31:17 +01:00
|
|
|
|
2022-03-16 02:10:18 +01:00
|
|
|
struct ChartState {
|
2022-03-24 01:42:41 +01:00
|
|
|
ChartState(better::Chart& c, const std::string& name, std::filesystem::path assets);
|
2022-03-16 02:10:18 +01:00
|
|
|
better::Chart& chart;
|
2022-03-24 01:42:41 +01:00
|
|
|
const std::string& difficulty_name;
|
2022-03-23 02:20:07 +01:00
|
|
|
better::Notes selected_notes;
|
2022-03-16 02:10:18 +01:00
|
|
|
NotesClipboard notes_clipboard;
|
|
|
|
SelectionState time_selection;
|
2022-03-23 02:20:07 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
The long note currently being created, represented as a pair of tap notes.
|
|
|
|
Time span of the represented long note is the span between both taps
|
|
|
|
1st note's position defines the long note's position
|
|
|
|
2nd note's position suggests where the tail should start
|
|
|
|
*/
|
|
|
|
std::optional<TapNotePair> long_note_being_created;
|
|
|
|
|
|
|
|
// Is the user currently holding right click ? (over the playfield or not)
|
2022-03-16 02:10:18 +01:00
|
|
|
bool creating_long_note;
|
2019-03-28 02:17:15 +01:00
|
|
|
History<std::shared_ptr<ActionWithMessage>> history;
|
2022-03-16 02:10:18 +01:00
|
|
|
DensityGraph density_graph;
|
2019-03-28 02:17:15 +01:00
|
|
|
};
|
2022-03-23 02:20:07 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
Construct a note to be displayed to preview the long note currently being
|
|
|
|
created. It's basically the same at the real long note being created but
|
|
|
|
its start time is set to exactly the (given) current beat so the long note
|
|
|
|
drawing routine can be repurposed as-is for the preview
|
|
|
|
*/
|
|
|
|
better::LongNote make_long_note_dummy(
|
|
|
|
Fraction current_beat,
|
|
|
|
const TapNotePair& long_note_being_created
|
|
|
|
);
|
|
|
|
|
|
|
|
// Turn the tap pair into the real long note the user wants to create
|
|
|
|
better::LongNote make_long_note(const TapNotePair& long_note_being_created);
|
|
|
|
|
|
|
|
better::Position closest_tail_position(
|
|
|
|
const better::Position& anchor,
|
|
|
|
const better::Position& requested_tail
|
|
|
|
);
|
|
|
|
|
|
|
|
better::Position smallest_possible_tail(const better::Position& anchor);
|