2022-03-02 23:59:19 +01:00
|
|
|
#pragma once
|
2019-03-28 02:17:15 +01:00
|
|
|
|
2022-03-26 00:23:13 +01:00
|
|
|
#include <filesystem>
|
|
|
|
#include <optional>
|
|
|
|
#include <variant>
|
|
|
|
#include <utility>
|
|
|
|
|
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"
|
2022-11-20 00:02:14 +01:00
|
|
|
#include "config.hpp"
|
2022-03-26 00:23:13 +01:00
|
|
|
#include "generic_interval.hpp"
|
2021-12-31 14:59:39 +01:00
|
|
|
#include "history.hpp"
|
2022-04-16 02:26:37 +02:00
|
|
|
#include "long_note_dummy.hpp"
|
2022-11-09 01:01:58 +01:00
|
|
|
#include "clipboard.hpp"
|
2022-03-27 03:32:13 +02:00
|
|
|
#include "notifications_queue.hpp"
|
2021-12-31 00:57:06 +01:00
|
|
|
#include "widgets/density_graph.hpp"
|
2019-04-06 22:35:17 +02:00
|
|
|
|
2022-03-16 02:10:18 +01:00
|
|
|
struct ChartState {
|
2022-10-13 00:59:40 +02:00
|
|
|
ChartState(
|
|
|
|
better::Chart& c,
|
|
|
|
const std::string& name,
|
|
|
|
History& history,
|
2022-11-20 00:02:14 +01:00
|
|
|
std::filesystem::path assets,
|
|
|
|
const config::Config& config
|
2022-10-13 00:59:40 +02:00
|
|
|
);
|
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-11-20 00:02:14 +01:00
|
|
|
|
|
|
|
const config::Config& config;
|
2022-03-27 03:32:13 +02:00
|
|
|
|
2022-11-09 01:01:58 +01:00
|
|
|
void cut(
|
|
|
|
NotificationsQueue& nq,
|
|
|
|
better::Timing& timing,
|
|
|
|
const TimingOrigin& timing_origin
|
|
|
|
);
|
2022-03-27 03:32:13 +02:00
|
|
|
void copy(NotificationsQueue& nq);
|
2022-11-09 01:01:58 +01:00
|
|
|
void paste(
|
|
|
|
Fraction at_beat,
|
|
|
|
NotificationsQueue& nq,
|
|
|
|
better::Timing& timing,
|
|
|
|
const TimingOrigin& timing_origin
|
|
|
|
);
|
|
|
|
void delete_(
|
|
|
|
NotificationsQueue& nq,
|
|
|
|
better::Timing& timing,
|
|
|
|
const TimingOrigin& timing_origin
|
|
|
|
);
|
2022-03-27 03:32:13 +02:00
|
|
|
|
2022-12-31 23:54:59 +01:00
|
|
|
void transform_selected_notes(std::function<better::Note(const better::Note&)> transform);
|
|
|
|
void mirror_selected_horizontally(NotificationsQueue& nq);
|
|
|
|
void mirror_selected_vertically(NotificationsQueue& nq);
|
|
|
|
void rotate_selected_90_clockwise(NotificationsQueue& nq);
|
|
|
|
void rotate_selected_90_counter_clockwise(NotificationsQueue& nq);
|
|
|
|
void rotate_selected_180(NotificationsQueue& nq);
|
|
|
|
|
2022-04-04 04:30:02 +02:00
|
|
|
Interval<Fraction> visible_beats(const sf::Time& playback_position, const better::Timing& timing);
|
|
|
|
void update_visible_notes(const sf::Time& playback_position, const better::Timing& timing);
|
2022-04-19 02:07:56 +02:00
|
|
|
better::Notes visible_notes;
|
2022-03-27 03:32:13 +02:00
|
|
|
|
2022-04-04 04:30:02 +02:00
|
|
|
void toggle_note(
|
|
|
|
const sf::Time& playback_position,
|
|
|
|
std::uint64_t snap,
|
|
|
|
const better::Position& button,
|
|
|
|
const better::Timing& timing
|
|
|
|
);
|
2022-03-27 03:32:13 +02:00
|
|
|
|
2022-12-31 23:54:59 +01:00
|
|
|
NoteAndBPMSelection selected_stuff;
|
2022-11-09 01:01:58 +01:00
|
|
|
Clipboard clipboard;
|
2022-04-04 04:30:02 +02:00
|
|
|
|
|
|
|
void handle_time_selection_tab(Fraction beats);
|
2022-03-26 00:23:13 +01:00
|
|
|
std::optional<Interval<Fraction>> 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;
|
2022-10-26 02:08:19 +02:00
|
|
|
|
|
|
|
void insert_long_note_just_created(std::uint64_t snap);
|
|
|
|
|
2022-10-13 00:59:40 +02:00
|
|
|
History& history;
|
2022-03-16 02:10:18 +01:00
|
|
|
DensityGraph density_graph;
|
2019-03-28 02:17:15 +01:00
|
|
|
};
|