tracktion-engine
3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_engine
playback
graph
tracktion_MidiNode.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
17
class
MidiNode
final :
public
tracktion::graph::Node
,
18
public
TracktionEngineNode
19
{
20
public
:
21
MidiNode
(
std::vector<juce::MidiMessageSequence>
sequences,
22
MidiList::TimeBase
,
23
juce::Range<int>
midiChannelNumbers,
24
bool
useMPE,
25
juce::Range<double>
editSection,
26
LiveClipLevel
,
27
ProcessState
&,
28
EditItemID
,
29
std::function
<
bool
()> shouldBeMutedDelegate =
nullptr
);
30
31
tracktion::graph::NodeProperties
getNodeProperties
()
override
;
32
void
prepareToPlay
(
const
tracktion::graph::PlaybackInitialisationInfo
&)
override
;
33
bool
isReadyToProcess
()
override
;
34
void
process
(
ProcessContext
&)
override
;
35
36
private
:
37
//==============================================================================
38
std::vector<juce::MidiMessageSequence>
ms;
39
const
MidiList::TimeBase
timeBase;
40
int64_t
lastStart = 0;
41
size_t
currentSequence = 0;
42
juce::Range<int>
channelNumbers;
43
bool
useMPEChannelMode;
44
juce::Range<double>
editRange;
45
LiveClipLevel
clipLevel;
46
EditItemID
editItemID;
47
std::function
<bool()> shouldBeMutedDelegate =
nullptr
;
48
49
double
sampleRate = 44100.0;
50
int
currentIndex = 0;
51
MidiMessageArray::MPESourceID midiSourceID = MidiMessageArray::createUniqueMPESourceID();
52
bool
wasMute =
false
, shouldCreateMessagesForTime =
false
;
53
54
juce::Array<juce::MidiMessage>
controllerMessagesScratchBuffer;
55
56
//==============================================================================
57
void
processSection (
Node::ProcessContext
&,
58
juce::Range<double>
sectionEditTime,
59
double
secondsPerTimeBase,
60
juce::MidiMessageSequence
&);
61
};
62
63
}}
// namespace tracktion { inline namespace engine
juce::Array
juce::MidiMessageSequence
juce::Range
tracktion::engine::MidiList::TimeBase
TimeBase
Determines MIDI event timing.
Definition
tracktion_MidiList.h:138
tracktion::engine::MidiNode
A Node that plays MIDI data from a MidiMessageSequence, at a specific MIDI channel.
Definition
tracktion_MidiNode.h:19
tracktion::engine::MidiNode::prepareToPlay
void prepareToPlay(const tracktion::graph::PlaybackInitialisationInfo &) override
Called once before playback begins for each node.
Definition
tracktion_MidiNode.cpp:55
tracktion::engine::MidiNode::getNodeProperties
tracktion::graph::NodeProperties getNodeProperties() override
Should return the properties of the node.
Definition
tracktion_MidiNode.cpp:47
tracktion::engine::MidiNode::isReadyToProcess
bool isReadyToProcess() override
Should return true when this node is ready to be processed.
Definition
tracktion_MidiNode.cpp:63
tracktion::engine::MidiNode::process
void process(ProcessContext &) override
Called when the node is to be processed.
Definition
tracktion_MidiNode.cpp:68
tracktion::engine::TracktionEngineNode
Base class for Nodes that provides information about the current process call.
Definition
tracktion_TracktionEngineNode.h:100
tracktion::graph::Node
Main graph Node processor class.
Definition
tracktion_Node.h:217
tracktion::graph::Node::ProcessContext
Struct to describe a single iteration of a process call.
Definition
tracktion_Node.h:303
std::function
tracktion
Definition
tracktion_AudioReader.h:23
int64_t
typedef int64_t
tracktion::engine::EditItemID
ID for objects of type EditElement - e.g.
Definition
tracktion_EditItem.h:19
tracktion::engine::LiveClipLevel
Provides a thread-safe way to share a clip's levels with an audio engine without worrying about the C...
Definition
tracktion_Clip.h:28
tracktion::engine::ProcessState
Holds the state of a process call.
Definition
tracktion_TracktionEngineNode.h:20
tracktion::graph::NodeProperties
Holds some really basic properties of a node.
Definition
tracktion_Node.h:152
tracktion::graph::PlaybackInitialisationInfo
Passed into Nodes when they are being initialised, to give them useful contextual information that th...
Definition
tracktion_Node.h:140
std::vector
« « « Anklang Documentation