Represents a midi input device.
More...
#include <juce_MidiDevices.h>
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
@tags{Audio}
◆ ~MidiInput()
juce::MidiInput::~MidiInput |
( |
| ) |
|
◆ MidiInput()
juce::MidiInput::MidiInput |
( |
const String & |
, |
|
|
const String & |
|
|
) |
| |
|
explicitprivate |
◆ createNewDevice()
This will try to create a new midi input device (only available on Linux, macOS and iOS).
This will attempt to create a new midi input device with the specified name for other apps to connect to.
NB - if you are calling this method on iOS you must have enabled the "Audio Background Capability" setting in the iOS exporter otherwise this method will fail.
Returns an empty object if a device can't be created.
- Parameters
-
deviceName | the name of the device to create |
callback | the object that will receive the midi messages from this device |
◆ getAvailableDevices()
◆ getDefaultDevice()
◆ getDeviceInfo()
Returns the MidiDeviceInfo struct containing some information about this device.
◆ getIdentifier()
String juce::MidiInput::getIdentifier |
( |
| ) |
const |
|
inlinenoexcept |
Returns the identifier of this device.
◆ getName()
String juce::MidiInput::getName |
( |
| ) |
const |
|
inlinenoexcept |
Returns the name of this device.
◆ openDevice()
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
-
deviceIdentifier | the ID of the device to open - use the getAvailableDevices() method to find the available devices that can be opened |
callback | the object that will receive the midi messages from this device |
- See also
- MidiInputCallback, getDevices
◆ setName()
void juce::MidiInput::setName |
( |
const String & |
newName | ) |
|
|
inlinenoexcept |
Sets a custom name for the device.
◆ 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
◆ deviceInfo
◆ internal
std::unique_ptr<Pimpl> juce::MidiInput::internal |
|
private |
The documentation for this class was generated from the following file: