tracktion-engine
3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_engine
playback
tracktion_MidiNoteDispatcher.h
Go to the documentation of this file.
1
/*
2
,--. ,--. ,--. ,--.
3
,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4
'-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5
| | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6
`---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8
Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9
*/
10
11
namespace
tracktion
{
inline
namespace
engine
12
{
13
14
class
MidiNoteDispatcher
:
private
juce::HighResolutionTimer
15
{
16
public
:
17
MidiNoteDispatcher
();
18
~MidiNoteDispatcher
()
override
;
19
20
//==============================================================================
21
void
setMidiDeviceList (
const
juce::OwnedArray<MidiOutputDeviceInstance>
&);
22
23
void
dispatchPendingMessagesForDevices (
TimePosition
editTime);
24
25
void
masterTimeUpdate (
TimePosition
editTime);
26
void
prepareToPlay (
TimePosition
editTime);
27
28
void
hiResTimerCallback()
override
;
29
30
private
:
31
//==============================================================================
32
struct
DeviceState
33
{
34
DeviceState (
MidiOutputDeviceInstance
& d) : device (d) {}
35
36
MidiOutputDeviceInstance
& device;
37
MidiMessageArray
buffer;
38
};
39
40
//==============================================================================
41
juce::OwnedArray<DeviceState>
devices;
42
mutable
RealTimeSpinLock
timeLock;
43
std::shared_mutex
deviceMutex;
44
TimePosition
masterTime;
45
double
hiResClockOfMasterTime = 0;
46
47
TimePosition
getCurrentTime()
const
;
48
void
dispatchPendingMessages (DeviceState&,
TimePosition
editTime);
49
50
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
MidiNoteDispatcher
)
51
};
52
53
}}
// namespace tracktion { inline namespace engine
juce::HighResolutionTimer
juce::OwnedArray
tracktion::engine::MidiNoteDispatcher
Definition
tracktion_MidiNoteDispatcher.h:15
tracktion::engine::MidiOutputDeviceInstance
Definition
tracktion_MidiOutputDevice.h:131
tracktion::graph::RealTimeSpinLock
A basic spin lock that uses an atomic_flag to store the locked state so should never result in a syst...
Definition
tracktion_RealTimeSpinLock.h:24
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
tracktion
Definition
tracktion_AudioReader.h:23
std::shared_mutex
tracktion::TimePosition
Represents a position in real-life time.
Definition
tracktion_Time.h:30
tracktion::engine::MidiMessageArray
Definition
tracktion_MidiMessageArray.h:17
« « « Anklang Documentation