score
Home
Classes
Namespaces
Files
MidiDrop.hpp
1
#pragma once
2
#include <Process/Drop/ProcessDropHandler.hpp>
3
#include <Process/TimeValue.hpp>
4
5
#include <Midi/MidiNote.hpp>
6
namespace
Midi
7
{
8
9
class
DropHandler
final :
public
Process::ProcessDropHandler
10
{
11
SCORE_CONCRETE(
"8F162598-9E4E-4865-A861-81DF01D2CDF0"
)
12
13
public
:
14
QSet<QString> mimeTypes()
const
noexcept
override
;
15
QSet<QString> fileExtensions()
const
noexcept
override
;
16
void
dropData(
17
std::vector<ProcessDrop>& drops,
const
DroppedFile
& data,
18
const
score::DocumentContext
& ctx)
const
noexcept
override
;
19
};
20
21
struct
MidiTrack
22
{
23
QString name;
24
25
std::vector<Midi::NoteData> notes;
26
int
min{127}, max{0};
27
28
struct
MidiSong
29
{
30
std::vector<MidiTrack> tracks;
31
double
duration{};
32
float
tempo{};
33
float
tickPerBeat{};
34
35
double
durationInMs{};
36
};
37
static
std::vector<MidiTrack::MidiSong>
38
parse(
const
QMimeData& dat,
const
score::DocumentContext
& ctx);
39
static
MidiSong
parse(
const
QByteArray& dat,
const
score::DocumentContext
& ctx);
40
};
41
}
Midi::DropHandler
Definition:
MidiDrop.hpp:10
Process::ProcessDropHandler
Definition:
ProcessDropHandler.hpp:25
Midi::MidiTrack::MidiSong
Definition:
MidiDrop.hpp:29
Midi::MidiTrack
Definition:
MidiDrop.hpp:22
Process::ProcessDropHandler::DroppedFile
Definition:
ProcessDropHandler.hpp:36
score::DocumentContext
Definition:
DocumentContext.hpp:18