26class MidiDeviceListConnectionBroadcaster;
72 ~MidiDeviceListConnection() noexcept;
94 : broadcaster (b), key (k) {}
102 MidiDeviceListConnectionBroadcaster* broadcaster =
nullptr;
147 bool operator!= (
const MidiDeviceInfo&
other)
const noexcept {
return tie() !=
other.tie(); }
150class MidiInputCallback;
193 #if JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_IOS || DOXYGEN
239 void setName (
const String& newName)
noexcept { deviceInfo.name = newName; }
243 [[deprecated (
"Use getAvailableDevices instead.")]]
245 [[deprecated (
"Use getDefaultDevice instead.")]]
246 static int getDefaultDeviceIndex();
247 [[deprecated (
"Use openDevice that takes a device identifier instead.")]]
307 virtual void handlePartialSysexMessage (
MidiInput* source,
308 const uint8* messageData,
352 #if JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_IOS || DOXYGEN
382 void setName (
const String& newName)
noexcept { deviceInfo.name = newName; }
389 void sendBlockOfMessagesNow (
const MidiBuffer& buffer);
408 void sendBlockOfMessages (
const MidiBuffer& buffer,
409 double millisecondCounterToStartAt,
410 double samplesPerSecondForBuffer);
413 void clearAllPendingMessages();
418 void startBackgroundThread();
423 void stopBackgroundThread();
432 [[deprecated (
"Use getAvailableDevices instead.")]]
434 [[deprecated (
"Use getDefaultDevice instead.")]]
435 static int getDefaultDeviceIndex();
436 [[deprecated (
"Use openDevice that takes a device identifier instead.")]]
445 struct PendingMessage
447 PendingMessage (
const void* data,
int len,
double timeStamp)
448 : message (data, len, timeStamp)
453 PendingMessage* next;
457 explicit MidiOutput (
const String&,
const String&);
460 MidiDeviceInfo deviceInfo;
464 CriticalSection
lock;
465 PendingMessage* firstMessage =
nullptr;
Holds a resizable array of primitive or copy-by-value objects.
Holds a sequence of time-stamped midi events.
To find out when the available MIDI devices change, call MidiDeviceListConnection::make(),...
static MidiDeviceListConnection make(std::function< void()>)
Registers a function to be called whenever the midi device list changes.
MidiDeviceListConnection()=default
Constructs an inactive connection.
void reset() noexcept
Clears this connection.
Encapsulates a MIDI message.
Represents a midi output device.
String getName() const noexcept
Returns the name of this device.
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.
bool isBackgroundThreadRunning() const noexcept
Returns true if the background thread used to send blocks of data is running.
A special array for holding a list of strings.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
unsigned char uint8
A platform-independent 8-bit unsigned integer type.
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.