OpenShot Audio Library | OpenShotAudio 0.3.2
|
#include <juce_MidiDevices.h>
Public Member Functions | |
~MidiOutput () override | |
MidiDeviceInfo | getDeviceInfo () const noexcept |
String | getIdentifier () const noexcept |
String | getName () const noexcept |
void | setName (const String &newName) noexcept |
void | sendMessageNow (const MidiMessage &message) |
void | sendBlockOfMessagesNow (const MidiBuffer &buffer) |
void | sendBlockOfMessages (const MidiBuffer &buffer, double millisecondCounterToStartAt, double samplesPerSecondForBuffer) |
void | clearAllPendingMessages () |
void | startBackgroundThread () |
void | stopBackgroundThread () |
Static Public Member Functions | |
static Array< MidiDeviceInfo > | getAvailableDevices () |
static MidiDeviceInfo | getDefaultDevice () |
static std::unique_ptr< MidiOutput > | openDevice (const String &deviceIdentifier) |
static StringArray | getDevices () |
static int | getDefaultDeviceIndex () |
static std::unique_ptr< MidiOutput > | openDevice (int) |
Represents a midi output device.
To create one of these, use the static getAvailableDevices() method to find out what outputs are available, and then use the openDevice() method to try to open one.
Definition at line 239 of file juce_MidiDevices.h.
|
override |
Destructor.
void juce::MidiOutput::clearAllPendingMessages | ( | ) |
Gets rid of any midi messages that had been added by sendBlockOfMessages().
Definition at line 83 of file juce_MidiDevices.cpp.
|
static |
Returns a list of the available midi output devices.
You can open one of the devices by passing its identifier into the openDevice() method.
Referenced by juce::AudioDeviceManager::setDefaultMidiOutput().
|
static |
Returns the MidiDeviceInfo of the default midi output device to use.
|
inlinenoexcept |
Returns the MidiDeviceInfo struct containing some information about this device.
Definition at line 288 of file juce_MidiDevices.h.
|
static |
Deprecated.
|
inlinenoexcept |
Returns the identifier of this device.
Definition at line 291 of file juce_MidiDevices.h.
|
inlinenoexcept |
Returns the name of this device.
Definition at line 294 of file juce_MidiDevices.h.
|
static |
Tries to open one of the midi output devices.
This will return a MidiOutput object if it manages to open it, you can then send messages to this device.
If the device can't be opened, this will return an empty object.
deviceIdentifier | the ID of the device to open - use the getAvailableDevices() method to find the available devices that can be opened |
Referenced by juce::AudioDeviceManager::setDefaultMidiOutputDevice().
|
static |
Deprecated.
void juce::MidiOutput::sendBlockOfMessages | ( | const MidiBuffer & | buffer, |
double | millisecondCounterToStartAt, | ||
double | samplesPerSecondForBuffer | ||
) |
This lets you supply a block of messages that will be sent out at some point in the future.
The MidiOutput class has an internal thread that can send out timestamped messages - this appends a set of messages to its internal buffer, ready for sending.
This will only work if you've already started the thread with startBackgroundThread().
A time is specified, at which the block of messages should be sent. This time uses the same time base as Time::getMillisecondCounter(), and must be in the future.
The samplesPerSecondForBuffer parameter indicates the number of samples per second used by the MidiBuffer. Each event in a MidiBuffer has a sample position, and the samplesPerSecondForBuffer value is needed to convert this sample position to a real time.
Definition at line 41 of file juce_MidiDevices.cpp.
void juce::MidiOutput::sendBlockOfMessagesNow | ( | const MidiBuffer & | buffer | ) |
Sends out a sequence of MIDI messages immediately.
Definition at line 31 of file juce_MidiDevices.cpp.
void juce::MidiOutput::sendMessageNow | ( | const MidiMessage & | message | ) |
Sends out a MIDI message immediately.
Sets a custom name for the device.
Definition at line 297 of file juce_MidiDevices.h.
void juce::MidiOutput::startBackgroundThread | ( | ) |
Starts up a background thread so that the device can send blocks of data. Call this to get the device ready, before using sendBlockOfMessages().
Definition at line 95 of file juce_MidiDevices.cpp.
void juce::MidiOutput::stopBackgroundThread | ( | ) |
Stops the background thread, and clears any pending midi events.
Definition at line 100 of file juce_MidiDevices.cpp.