OpenShot Audio Library | OpenShotAudio 0.3.2
Loading...
Searching...
No Matches
juce::MidiInput Class Referencefinal

#include <juce_MidiDevices.h>

Public Member Functions

 ~MidiInput ()
 
void start ()
 
void stop ()
 
MidiDeviceInfo getDeviceInfo () const noexcept
 
String getIdentifier () const noexcept
 
String getName () const noexcept
 
void setName (const String &newName) noexcept
 

Static Public Member Functions

static Array< MidiDeviceInfogetAvailableDevices ()
 
static MidiDeviceInfo getDefaultDevice ()
 
static std::unique_ptr< MidiInputopenDevice (const String &deviceIdentifier, MidiInputCallback *callback)
 
static StringArray getDevices ()
 
static int getDefaultDeviceIndex ()
 
static std::unique_ptr< MidiInputopenDevice (int, MidiInputCallback *)
 

Detailed Description

Represents a midi input device.

To create one of these, use the static getAvailableDevices() method to find out what inputs are available, and then use the openDevice() method to try to open one.

See also
MidiOutput

Definition at line 81 of file juce_MidiDevices.h.

Constructor & Destructor Documentation

◆ ~MidiInput()

juce::MidiInput::~MidiInput ( )

Destructor.

Member Function Documentation

◆ getAvailableDevices()

static Array< MidiDeviceInfo > juce::MidiInput::getAvailableDevices ( )
static

◆ getDefaultDevice()

static MidiDeviceInfo juce::MidiInput::getDefaultDevice ( )
static

Returns the MidiDeviceInfo of the default midi input device to use.

◆ getDefaultDeviceIndex()

static int juce::MidiInput::getDefaultDeviceIndex ( )
static

Deprecated.

◆ getDeviceInfo()

MidiDeviceInfo juce::MidiInput::getDeviceInfo ( ) const
inlinenoexcept

Returns the MidiDeviceInfo struct containing some information about this device.

Definition at line 148 of file juce_MidiDevices.h.

◆ getDevices()

static StringArray juce::MidiInput::getDevices ( )
static

Deprecated.

◆ getIdentifier()

String juce::MidiInput::getIdentifier ( ) const
inlinenoexcept

Returns the identifier of this device.

Definition at line 151 of file juce_MidiDevices.h.

◆ getName()

String juce::MidiInput::getName ( ) const
inlinenoexcept

Returns the name of this device.

Definition at line 154 of file juce_MidiDevices.h.

◆ openDevice() [1/2]

static std::unique_ptr< MidiInput > juce::MidiInput::openDevice ( const String deviceIdentifier,
MidiInputCallback callback 
)
static

Tries to open one of the midi input devices.

This will return a MidiInput object if it manages to open it, you can then call start() and stop() on this device.

If the device can't be opened, this will return an empty object.

Parameters
deviceIdentifierthe ID of the device to open - use the getAvailableDevices() method to find the available devices that can be opened
callbackthe object that will receive the midi messages from this device
See also
MidiInputCallback, getDevices

Referenced by juce::AudioDeviceManager::setMidiInputDeviceEnabled().

◆ openDevice() [2/2]

static std::unique_ptr< MidiInput > juce::MidiInput::openDevice ( int  ,
MidiInputCallback  
)
static

Deprecated.

◆ setName()

void juce::MidiInput::setName ( const String newName)
inlinenoexcept

Sets a custom name for the device.

Definition at line 157 of file juce_MidiDevices.h.

◆ start()

void juce::MidiInput::start ( )

Starts the device running.

After calling this, the device will start sending midi messages to the MidiInputCallback object that was specified when the openDevice() method was called.

See also
stop

◆ stop()

void juce::MidiInput::stop ( )

Stops the device running.

See also
start

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