libremidi update to v5.4.3 and added virtual midi out as default

This commit is contained in:
Sebastian
2026-06-23 00:05:41 +02:00
parent dc0003232a
commit 51cd271b6f
166 changed files with 8135 additions and 2009 deletions
@@ -3,7 +3,7 @@
#include <libremidi/backends/coremidi/helpers.hpp>
#include <libremidi/detail/midi_out.hpp>
namespace libremidi
NAMESPACE_LIBREMIDI
{
class midi_out_core final
: public midi1::out_api
@@ -24,8 +24,7 @@ public:
if (auto result = init_client(configuration); result != noErr)
{
libremidi_handle_error(
this->configuration,
"error creating MIDI client object: " + std::to_string(result));
this->configuration, "error creating MIDI client object: " + std::to_string(result));
client_open_ = from_osstatus(result);
return;
}
@@ -60,8 +59,7 @@ public:
if (result != noErr)
{
close_client(*this);
libremidi_handle_error(
this->configuration, "error creating macOS MIDI output port.");
libremidi_handle_error(this->configuration, "error creating macOS MIDI output port.");
return from_osstatus(result);
}
@@ -80,9 +78,7 @@ public:
if (result != noErr)
{
libremidi_handle_error(
this->configuration,
"error creating macOS virtual MIDI source.");
libremidi_handle_error(this->configuration, "error creating macOS virtual MIDI source.");
return from_osstatus(result);
}
@@ -92,10 +88,7 @@ public:
return stdx::error{};
}
stdx::error close_port() override
{
return coremidi_data::close_port();
}
stdx::error close_port() override { return coremidi_data::close_port(); }
stdx::error send_message(const unsigned char* message, size_t size) override
{
@@ -118,8 +111,8 @@ public:
const MIDITimeStamp timestamp = LIBREMIDI_AUDIO_GET_CURRENT_HOST_TIME();
const ByteCount bufsize = nBytes > 65535 ? 65535 : nBytes;
Byte buffer[bufsize + 16]; // pad for other struct members
ByteCount listSize = sizeof(buffer);
Byte* buffer = (Byte*)alloca(bufsize + 16); // pad for other struct members
ByteCount listSize = bufsize + 16;
MIDIPacketList* packetList = (MIDIPacketList*)buffer;
ByteCount remainingBytes = nBytes;
@@ -137,8 +130,7 @@ public:
if (!packet)
{
libremidi_handle_error(
this->configuration, "could not allocate packet list");
libremidi_handle_error(this->configuration, "could not allocate packet list");
return std::errc::message_size;
}
@@ -163,9 +155,7 @@ public:
auto result = MIDISend(this->port, this->destinationId, packetList);
if (result != noErr)
{
libremidi_handle_warning(
this->configuration,
"error sending MIDI message to port.");
libremidi_handle_warning(this->configuration, "error sending MIDI message to port.");
return std::errc::io_error;
}
}