OpenShot Audio Library | OpenShotAudio 0.3.2
Loading...
Searching...
No Matches
juce_MidiMessageSequence.h
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2017 - ROLI Ltd.
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//==============================================================================
37class JUCE_API MidiMessageSequence
38{
39public:
40 //==============================================================================
43
46
49
52
55
58
59 //==============================================================================
68 {
69 public:
70 //==============================================================================
73
76
85 MidiEventHolder* noteOffObject = nullptr;
86
87 private:
88 //==============================================================================
89 friend class MidiMessageSequence;
92 JUCE_LEAK_DETECTOR (MidiEventHolder)
93 };
94
95 //==============================================================================
97 void clear();
98
100 int getNumEvents() const noexcept;
101
103 MidiEventHolder* getEventPointer (int index) const noexcept;
104
106 MidiEventHolder** begin() noexcept;
107
110
113
116
121 double getTimeOfMatchingKeyUp (int index) const noexcept;
122
127 int getIndexOfMatchingKeyUp (int index) const noexcept;
128
130 int getIndexOf (const MidiEventHolder* event) const noexcept;
131
136 int getNextIndexAtTime (double timeStamp) const noexcept;
137
138 //==============================================================================
142 double getStartTime() const noexcept;
143
147 double getEndTime() const noexcept;
148
152 double getEventTime (int index) const noexcept;
153
154 //==============================================================================
168
181 MidiEventHolder* addEvent (MidiMessage&& newMessage, double timeAdjustment = 0);
182
191 void deleteEvent (int index, bool deleteMatchingNoteUp);
192
206 void addSequence (const MidiMessageSequence& other,
207 double timeAdjustmentDelta,
210
218 void addSequence (const MidiMessageSequence& other,
219 double timeAdjustmentDelta);
220
221 //==============================================================================
228 void updateMatchedPairs() noexcept;
229
234 void sort() noexcept;
235
236 //==============================================================================
245 void extractMidiChannelMessages (int channelNumberToExtract,
248
254 void extractSysExMessages (MidiMessageSequence& destSequence) const;
255
259 void deleteMidiChannelMessages (int channelNumberToRemove);
260
262 void deleteSysExMessages();
263
267 void addTimeToMessages (double deltaTime) noexcept;
268
269 //==============================================================================
289 void createControllerUpdatesForTime (int channelNumber, double time,
291
292 //==============================================================================
294 void swapWith (MidiMessageSequence&) noexcept;
295
296private:
297 //==============================================================================
300
301 MidiEventHolder* addEvent (MidiEventHolder*, double);
302
303 JUCE_LEAK_DETECTOR (MidiMessageSequence)
304};
305
306} // namespace juce