69 bool operator!= (
const MidiDeviceInfo& other)
const noexcept {
return ! operator== (other); }
72 class MidiInputCallback;
115 #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN
161 void setName (
const String& newName) noexcept { deviceInfo.name = newName; }
176 void*
internal =
nullptr;
178 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
MidiInput)
224 const uint8* messageData,
228 ignoreUnused (source, messageData, numBytesSoFar, timestamp);
271 #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN
301 void setName (
const String& newName) noexcept { deviceInfo.name = newName; }
308 void sendBlockOfMessagesNow (
const MidiBuffer& buffer);
327 void sendBlockOfMessages (
const MidiBuffer& buffer,
328 double millisecondCounterToStartAt,
329 double samplesPerSecondForBuffer);
332 void clearAllPendingMessages();
337 void startBackgroundThread();
342 void stopBackgroundThread();
354 struct PendingMessage
356 PendingMessage (
const void* data,
int len,
double timeStamp)
357 : message (data, len, timeStamp)
362 PendingMessage* next;
366 explicit MidiOutput (
const String&,
const String&);
369 MidiDeviceInfo deviceInfo;
370 void*
internal =
nullptr;
371 CriticalSection lock;
372 PendingMessage* firstMessage =
nullptr;
374 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiOutput)
Holds a resizable array of primitive or copy-by-value objects.
Holds a sequence of time-stamped midi events.
Encapsulates a MIDI message.
Represents a midi output device.
static MidiDeviceInfo getDefaultDevice()
Returns the MidiDeviceInfo of the default midi output device to use.
static Array< MidiDeviceInfo > getAvailableDevices()
Returns a list of the available midi output devices.
String getName() const noexcept
Returns the name of this device.
static std::unique_ptr< MidiOutput > openDevice(int)
Deprecated.
static int getDefaultDeviceIndex()
Deprecated.
static std::unique_ptr< MidiOutput > openDevice(const String &deviceIdentifier)
Tries to open one of the midi output devices.
static std::unique_ptr< MidiOutput > createNewDevice(const String &deviceName)
This will try to create a new midi output device (only available on Linux, macOS and iOS).
void setName(const String &newName) noexcept
Sets a custom name for the device.
String getIdentifier() const noexcept
Returns the identifier of this device.
MidiDeviceInfo getDeviceInfo() const noexcept
Returns the MidiDeviceInfo struct containing some information about this device.
void sendMessageNow(const MidiMessage &message)
Sends out a MIDI message immediately.
static StringArray getDevices()
Deprecated.
~MidiOutput() override
Destructor.
A special array for holding a list of strings.
#define JUCE_API
This macro is added to all JUCE public class declarations.
This struct contains information about a MIDI input or output device.
String name
The name of this device.
String identifier
The identifier for this device.