23 #include "JackCoreMidiPhysicalOutputPort.h"
24 #include "JackCoreMidiUtil.h"
28 JackCoreMidiPhysicalOutputPort::
29 JackCoreMidiPhysicalOutputPort(
const char *alias_name,
const char *client_name,
30 const char *driver_name,
int index,
32 MIDIPortRef internal_output,
double time_ratio,
35 JackCoreMidiOutputPort(time_ratio, max_bytes,
38 MIDIEndpointRef destination = MIDIGetDestination(index);
41 std::stringstream stream;
42 stream <<
"The destination at index '" << index
43 <<
"' is not available";
44 throw std::runtime_error(stream.str().c_str());
46 SInt32 advance_schedule_time;
48 MIDIObjectGetIntegerProperty(destination,
49 kMIDIPropertyAdvanceScheduleTimeMuSec,
50 &advance_schedule_time);
51 if (status != noErr) {
52 WriteMacOSError(
"JackCoreMidiPhysicalOutputPort [constructor]",
53 "MIDIObjectGetIntegerProperty", status);
54 advance_schedule_time = 0;
55 }
else if (advance_schedule_time < 0) {
56 advance_schedule_time = 0;
58 Initialize(alias_name, client_name, driver_name, index, destination,
59 advance_schedule_time);
60 this->internal_output = internal_output;
63 JackCoreMidiPhysicalOutputPort::~JackCoreMidiPhysicalOutputPort()
69 JackCoreMidiPhysicalOutputPort::SendPacketList(MIDIPacketList *packet_list)
71 OSStatus status = MIDISend(internal_output, endpoint, packet_list);
72 bool result = status == noErr;
74 WriteMacOSError(
"JackCoreMidiPhysicalOutputPort::SendPacketList",