2022-11-09 01:01:58 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "better_note.hpp"
|
|
|
|
#include "better_notes.hpp"
|
|
|
|
#include "special_numeric_types.hpp"
|
|
|
|
#include "src/better_timing.hpp"
|
|
|
|
#include "variant_visitor.hpp"
|
|
|
|
|
2022-12-31 23:54:59 +01:00
|
|
|
struct NoteAndBPMSelection {
|
2022-11-09 01:01:58 +01:00
|
|
|
better::Notes notes;
|
|
|
|
std::set<better::BPMAtBeat, better::Timing::beat_order_for_events> bpm_events;
|
|
|
|
|
2022-12-31 23:54:59 +01:00
|
|
|
NoteAndBPMSelection shifted_by(Fraction offset) const;
|
2022-11-09 01:01:58 +01:00
|
|
|
bool empty() const;
|
|
|
|
void clear();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Stores a collection of notes with times relative to the first note in the vector,
|
|
|
|
to allow pasting notes at another time in the chart by simply shifting
|
|
|
|
all the note starting times.
|
|
|
|
*/
|
|
|
|
class Clipboard {
|
|
|
|
public:
|
|
|
|
Clipboard() = default;
|
2022-12-31 23:54:59 +01:00
|
|
|
void copy(const NoteAndBPMSelection& contents);
|
|
|
|
NoteAndBPMSelection paste(Fraction beat) const;
|
2022-11-09 01:01:58 +01:00
|
|
|
|
|
|
|
bool empty() const;
|
|
|
|
private:
|
2022-12-31 23:54:59 +01:00
|
|
|
NoteAndBPMSelection contents;
|
2022-11-09 01:01:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|