Loading...
Searching...
No Matches
juce_MidiMessageSequence.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
class JUCE_API MidiMessageSequence
{
public:
//==============================================================================
MidiMessageSequence();
MidiMessageSequence (const MidiMessageSequence&);
MidiMessageSequence& operator= (const MidiMessageSequence&);
MidiMessageSequence (MidiMessageSequence&&) noexcept;
MidiMessageSequence& operator= (MidiMessageSequence&&) noexcept;
//==============================================================================
class MidiEventHolder
{
public:
//==============================================================================
MidiMessage message;
MidiEventHolder* noteOffObject = nullptr;
private:
//==============================================================================
friend class MidiMessageSequence;
MidiEventHolder (const MidiMessage&);
MidiEventHolder (MidiMessage&&);
JUCE_LEAK_DETECTOR (MidiEventHolder)
};
//==============================================================================
void clear();
int getNumEvents() const noexcept;
MidiEventHolder* getEventPointer (int index) const noexcept;
MidiEventHolder** begin() noexcept;
MidiEventHolder* const* begin() const noexcept;
MidiEventHolder** end() noexcept;
MidiEventHolder* const* end() const noexcept;
double getTimeOfMatchingKeyUp (int index) const noexcept;
int getIndexOfMatchingKeyUp (int index) const noexcept;
int getIndexOf (const MidiEventHolder* event) const noexcept;
int getNextIndexAtTime (double timeStamp) const noexcept;
//==============================================================================
double getStartTime() const noexcept;
double getEndTime() const noexcept;
double getEventTime (int index) const noexcept;
//==============================================================================
MidiEventHolder* addEvent (const MidiMessage& newMessage, double timeAdjustment = 0);
MidiEventHolder* addEvent (MidiMessage&& newMessage, double timeAdjustment = 0);
void deleteEvent (int index, bool deleteMatchingNoteUp);
void addSequence (const MidiMessageSequence& other,
double timeAdjustmentDelta,
double firstAllowableDestTime,
double endOfAllowableDestTimes);
void addSequence (const MidiMessageSequence& other,
double timeAdjustmentDelta);
//==============================================================================
void updateMatchedPairs() noexcept;
void sort() noexcept;
//==============================================================================
void extractMidiChannelMessages (int channelNumberToExtract,
MidiMessageSequence& destSequence,
bool alsoIncludeMetaEvents) const;
void extractSysExMessages (MidiMessageSequence& destSequence) const;
void deleteMidiChannelMessages (int channelNumberToRemove);
void deleteSysExMessages();
void addTimeToMessages (double deltaTime) noexcept;
//==============================================================================
void createControllerUpdatesForTime (int channelNumber, double time,
Array<MidiMessage>& resultMessages);
//==============================================================================
void swapWith (MidiMessageSequence&) noexcept;
private:
//==============================================================================
friend class MidiFile;
OwnedArray<MidiEventHolder> list;
MidiEventHolder* addEvent (MidiEventHolder*, double);
JUCE_LEAK_DETECTOR (MidiMessageSequence)
};
} // 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