OpenShot Audio Library | OpenShotAudio: juce_MidiMessageSequence.h Source File

OpenShot Audio Library | OpenShotAudio 0.4.0 |

Loading...
Searching...
No Matches
juce_MidiMessageSequence.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 The code included in this file is provided under the terms of the ISC license
11 http://www.isc.org/downloads/software-support-policy/isc-license. Permission
12 To use, copy, modify, and/or distribute this software for any purpose with or
13 without fee is hereby granted provided that the above copyright notice and
14 this permission notice appear in all copies.
15
16 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
17 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
18 DISCLAIMED.
19
20 ==============================================================================
21*/
22
23namespace juce
24{
25
26//==============================================================================
37 class JUCE_API MidiMessageSequence
38{
39public:
40 //==============================================================================
42 MidiMessageSequence();
43
45 MidiMessageSequence (const MidiMessageSequence&);
46
48 MidiMessageSequence& operator= (const MidiMessageSequence&);
49
51 MidiMessageSequence (MidiMessageSequence&&) noexcept;
52
54 MidiMessageSequence& operator= (MidiMessageSequence&&) noexcept;
55
56 //==============================================================================
64 class MidiEventHolder
65 {
66 public:
67 //==============================================================================
69 MidiMessage message;
70
79 MidiEventHolder* noteOffObject = nullptr;
80
81 private:
82 //==============================================================================
83 friend class MidiMessageSequence;
84 MidiEventHolder (const MidiMessage&);
85 MidiEventHolder (MidiMessage&&);
86 JUCE_LEAK_DETECTOR (MidiEventHolder)
87 };
88
89 //==============================================================================
91 void clear();
92
94 int getNumEvents() const noexcept;
95
97 MidiEventHolder* getEventPointer (int index) const noexcept;
98
100 MidiEventHolder** begin() noexcept;
101
103 MidiEventHolder* const* begin() const noexcept;
104
106 MidiEventHolder** end() noexcept;
107
109 MidiEventHolder* const* end() const noexcept;
110
115 double getTimeOfMatchingKeyUp (int index) const noexcept;
116
121 int getIndexOfMatchingKeyUp (int index) const noexcept;
122
124 int getIndexOf (const MidiEventHolder* event) const noexcept;
125
130 int getNextIndexAtTime (double timeStamp) const noexcept;
131
132 //==============================================================================
136 double getStartTime() const noexcept;
137
141 double getEndTime() const noexcept;
142
146 double getEventTime (int index) const noexcept;
147
148 //==============================================================================
161 MidiEventHolder* addEvent (const MidiMessage& newMessage, double timeAdjustment = 0);
162
175 MidiEventHolder* addEvent (MidiMessage&& newMessage, double timeAdjustment = 0);
176
185 void deleteEvent (int index, bool deleteMatchingNoteUp);
186
200 void addSequence (const MidiMessageSequence& other,
201 double timeAdjustmentDelta,
202 double firstAllowableDestTime,
203 double endOfAllowableDestTimes);
204
212 void addSequence (const MidiMessageSequence& other,
213 double timeAdjustmentDelta);
214
215 //==============================================================================
222 void updateMatchedPairs() noexcept;
223
228 void sort() noexcept;
229
230 //==============================================================================
239 void extractMidiChannelMessages (int channelNumberToExtract,
240 MidiMessageSequence& destSequence,
241 bool alsoIncludeMetaEvents) const;
242
248 void extractSysExMessages (MidiMessageSequence& destSequence) const;
249
253 void deleteMidiChannelMessages (int channelNumberToRemove);
254
256 void deleteSysExMessages();
257
261 void addTimeToMessages (double deltaTime) noexcept;
262
263 //==============================================================================
298 void createControllerUpdatesForTime (int channelNumber, double time,
299 Array<MidiMessage>& resultMessages);
300
301 //==============================================================================
303 void swapWith (MidiMessageSequence&) noexcept;
304
305private:
306 //==============================================================================
307 friend class MidiFile;
308 OwnedArray<MidiEventHolder> list;
309
310 MidiEventHolder* addEvent (MidiEventHolder*, double);
311
312 JUCE_LEAK_DETECTOR (MidiMessageSequence)
313};
314
315} // namespace juce
juce::Array
Definition juce_Array.h:56
juce::MidiMessageSequence::MidiEventHolder
Definition juce_MidiMessageSequence.h:65
juce::MidiMessageSequence::MidiEventHolder::message
MidiMessage message
Definition juce_MidiMessageSequence.h:69
juce::MidiMessageSequence::MidiEventHolder::noteOffObject
MidiEventHolder * noteOffObject
Definition juce_MidiMessageSequence.h:79
juce::MidiMessageSequence::extractMidiChannelMessages
void extractMidiChannelMessages(int channelNumberToExtract, MidiMessageSequence &destSequence, bool alsoIncludeMetaEvents) const
Definition juce_MidiMessageSequence.cpp:275
juce::MidiMessageSequence::getEventTime
double getEventTime(int index) const noexcept
Definition juce_MidiMessageSequence.cpp:144
juce::MidiMessageSequence::deleteSysExMessages
void deleteSysExMessages()
Definition juce_MidiMessageSequence.cpp:299
juce::MidiMessageSequence::clear
void clear()
Definition juce_MidiMessageSequence.cpp:70
juce::MidiMessageSequence::MidiMessageSequence
MidiMessageSequence()
Definition juce_MidiMessageSequence.cpp:30
juce::MidiMessageSequence::createControllerUpdatesForTime
void createControllerUpdatesForTime(int channelNumber, double time, Array< MidiMessage > &resultMessages)
Definition juce_MidiMessageSequence.cpp:420
juce::MidiMessageSequence::getTimeOfMatchingKeyUp
double getTimeOfMatchingKeyUp(int index) const noexcept
Definition juce_MidiMessageSequence.cpp:90
juce::MidiMessageSequence::addEvent
MidiEventHolder * addEvent(const MidiMessage &newMessage, double timeAdjustment=0)
Definition juce_MidiMessageSequence.cpp:167
juce::MidiMessageSequence::getIndexOf
int getIndexOf(const MidiEventHolder *event) const noexcept
Definition juce_MidiMessageSequence.cpp:116
juce::MidiMessageSequence::updateMatchedPairs
void updateMatchedPairs() noexcept
Definition juce_MidiMessageSequence.cpp:226
juce::MidiMessageSequence::getIndexOfMatchingKeyUp
int getIndexOfMatchingKeyUp(int index) const noexcept
Definition juce_MidiMessageSequence.cpp:99
juce::MidiMessageSequence::addTimeToMessages
void addTimeToMessages(double deltaTime) noexcept
Definition juce_MidiMessageSequence.cpp:267
juce::MidiMessageSequence::swapWith
void swapWith(MidiMessageSequence &) noexcept
Definition juce_MidiMessageSequence.cpp:65
juce::MidiMessageSequence::deleteMidiChannelMessages
void deleteMidiChannelMessages(int channelNumberToRemove)
Definition juce_MidiMessageSequence.cpp:292
juce::MidiMessageSequence::sort
void sort() noexcept
Definition juce_MidiMessageSequence.cpp:220
juce::MidiMessageSequence::getStartTime
double getStartTime() const noexcept
Definition juce_MidiMessageSequence.cpp:134
juce::MidiMessageSequence::deleteEvent
void deleteEvent(int index, bool deleteMatchingNoteUp)
Definition juce_MidiMessageSequence.cpp:177
juce::MidiMessageSequence::getEndTime
double getEndTime() const noexcept
Definition juce_MidiMessageSequence.cpp:139
juce::MidiMessageSequence::end
MidiEventHolder ** end() noexcept
Definition juce_MidiMessageSequence.cpp:87
juce::MidiMessageSequence::getNextIndexAtTime
int getNextIndexAtTime(double timeStamp) const noexcept
Definition juce_MidiMessageSequence.cpp:121
juce::MidiMessageSequence::getEventPointer
MidiEventHolder * getEventPointer(int index) const noexcept
Definition juce_MidiMessageSequence.cpp:80
juce::MidiMessageSequence::begin
MidiEventHolder ** begin() noexcept
Definition juce_MidiMessageSequence.cpp:85
juce::MidiMessageSequence::getNumEvents
int getNumEvents() const noexcept
Definition juce_MidiMessageSequence.cpp:75
juce::MidiMessageSequence::addSequence
void addSequence(const MidiMessageSequence &other, double timeAdjustmentDelta, double firstAllowableDestTime, double endOfAllowableDestTimes)
Definition juce_MidiMessageSequence.cpp:200
juce::MidiMessageSequence::extractSysExMessages
void extractSysExMessages(MidiMessageSequence &destSequence) const
Definition juce_MidiMessageSequence.cpp:285
juce::MidiMessage
Definition juce_MidiMessage.h:35
juce::OwnedArray
Definition juce_OwnedArray.h:50