openshot-audio  0.1.7
Classes | Public Member Functions | Static Public Member Functions | List of all members
juce::MidiOutput Class Reference

#include <juce_audio_devices.h>

Inheritance diagram for juce::MidiOutput:
juce::Thread

Classes

struct  PendingMessage
 

Public Member Functions

 ~MidiOutput ()
 
void sendMessageNow (const MidiMessage &message)
 
void sendBlockOfMessages (const MidiBuffer &buffer, double millisecondCounterToStartAt, double samplesPerSecondForBuffer)
 
void clearAllPendingMessages ()
 
void startBackgroundThread ()
 
void stopBackgroundThread ()
 

Static Public Member Functions

static StringArray getDevices ()
 
static int getDefaultDeviceIndex ()
 
static MidiOutputopenDevice (int deviceIndex)
 

Detailed Description

Controls a physical MIDI output device.

To create one of these, use the static getDevices() method to get a list of the available output devices, then use the openDevice() method to try to open one.

See Also
MidiInput

Constructor & Destructor Documentation

juce::MidiOutput::~MidiOutput ( )

Destructor.

Member Function Documentation

void MidiOutput::clearAllPendingMessages ( )

Gets rid of any midi messages that had been added by sendBlockOfMessages().

static int juce::MidiOutput::getDefaultDeviceIndex ( )
static

Returns the index of the default midi output device to use.

This refers to the index in the list returned by getDevices().

static StringArray juce::MidiOutput::getDevices ( )
static

Returns a list of the available midi output devices.

You can open one of the devices by passing its index into the openDevice() method.

See Also
getDefaultDeviceIndex, openDevice
static MidiOutput* juce::MidiOutput::openDevice ( int  deviceIndex)
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, and delete it when no longer needed.

If the device can't be opened, this will return a null pointer.

Parameters
deviceIndexthe index of a device from the list returned by getDevices()
See Also
getDevices
void 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.

void juce::MidiOutput::sendMessageNow ( const MidiMessage message)

Makes this device output a midi message.

See Also
MidiMessage
void 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().

void MidiOutput::stopBackgroundThread ( )

Stops the background thread, and clears any pending midi events.

See Also
startBackgroundThread

The documentation for this class was generated from the following files: