mirror of
https://gitlab.com/square-game-liberation-front/F.E.I.S.git
synced 2025-02-24 05:53:23 +01:00
- Cut/Copy/Paste selected notes - LN displayed correctly in the Linear View - bunch of other small stuff
28 lines
741 B
C++
28 lines
741 B
C++
//
|
|
// Created by Syméon on 27/03/2019.
|
|
//
|
|
|
|
#include "NotesClipboard.h"
|
|
|
|
NotesClipboard::NotesClipboard(const std::set<Note> ¬es) {
|
|
copy(notes);
|
|
}
|
|
|
|
void NotesClipboard::copy(const std::set<Note> ¬es) {
|
|
contents.clear();
|
|
if (not notes.empty()) {
|
|
int timing_offset = notes.cbegin()->getTiming();
|
|
for (const auto ¬e : notes) {
|
|
contents.emplace(note.getPos(), note.getTiming()-timing_offset, note.getLength(), note.getTail_pos());
|
|
}
|
|
}
|
|
}
|
|
|
|
std::set<Note> NotesClipboard::paste(int tick_offset) {
|
|
std::set<Note> res = {};
|
|
for (auto note : contents) {
|
|
res.emplace(note.getPos(), note.getTiming()+tick_offset, note.getLength(), note.getTail_pos());
|
|
}
|
|
return res;
|
|
}
|