26class MidiDeviceListConnectionBroadcaster;
60 : broadcaster (std::exchange (other.broadcaster,
nullptr)),
61 key (std::exchange (other.key,
Key{}))
72 ~MidiDeviceListConnection() noexcept;
94 : broadcaster (b), key (
k) {}
98 std::swap (other.broadcaster, broadcaster);
99 std::swap (other.key, key);
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.")]]
260 std::unique_ptr<Pimpl> internal;
262 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
MidiInput)
307 virtual void handlePartialSysexMessage (
MidiInput* source,
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,
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.")]]
437 static std::unique_ptr<MidiOutput> openDevice (
int);
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;
462 std::unique_ptr<Pimpl> internal;
464 CriticalSection lock;
465 PendingMessage* firstMessage =
nullptr;
467 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiOutput)
static MidiDeviceListConnection make(std::function< void()>)
MidiDeviceListConnection()=default
static MidiDeviceInfo getDefaultDevice()
String getName() const noexcept
void setName(const String &newName) noexcept
String getIdentifier() const noexcept
static std::unique_ptr< MidiOutput > openDevice(const String &deviceIdentifier)
MidiDeviceInfo getDeviceInfo() const noexcept
bool isBackgroundThreadRunning() const noexcept
void sendMessageNow(const MidiMessage &message)
static Array< MidiDeviceInfo > getAvailableDevices()