| @@ -44,6 +44,8 @@ namespace Jack { | |||||
| public: | public: | ||||
| using JackMidiAsyncQueue::EnqueueEvent; | |||||
| /** | /** | ||||
| * Creates a new asynchronous MIDI wait message queue. The queue can | * Creates a new asynchronous MIDI wait message queue. The queue can | ||||
| * store up to `max_messages` MIDI messages and up to `max_bytes` of | * store up to `max_messages` MIDI messages and up to `max_bytes` of | ||||
| @@ -26,8 +26,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #include "JackCoreMidiUtil.h" | #include "JackCoreMidiUtil.h" | ||||
| #include "JackEngineControl.h" | #include "JackEngineControl.h" | ||||
| namespace Jack | |||||
| { | |||||
| using Jack::JackCoreMidiDriver; | |||||
| /////////////////////////////////////////////////////////////////////////////// | /////////////////////////////////////////////////////////////////////////////// | ||||
| // Static callbacks | // Static callbacks | ||||
| @@ -632,8 +631,6 @@ JackCoreMidiDriver::Write() | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| } // end of namespace | |||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| @@ -100,9 +100,8 @@ JackCoreMidiInputPort::ProcessCoreMidi(const MIDIPacketList *packet_list) | |||||
| sysex_bytes_sent = 0; | sysex_bytes_sent = 0; | ||||
| goto get_next_packet; | goto get_next_packet; | ||||
| } | } | ||||
| event.data = sysex_buffer; | |||||
| event.buffer = sysex_buffer; | |||||
| event.size = sysex_bytes_sent; | event.size = sysex_bytes_sent; | ||||
| event.time = ; | |||||
| sysex_bytes_sent = 0; | sysex_bytes_sent = 0; | ||||
| goto send_event; | goto send_event; | ||||
| } | } | ||||
| @@ -115,7 +114,7 @@ JackCoreMidiInputPort::ProcessCoreMidi(const MIDIPacketList *packet_list) | |||||
| goto buffer_sysex_bytes; | goto buffer_sysex_bytes; | ||||
| } | } | ||||
| } | } | ||||
| event.data = data; | |||||
| event.buffer = data; | |||||
| event.size = size; | event.size = size; | ||||
| send_event: | send_event: | ||||
| @@ -60,7 +60,7 @@ JackCoreMidiOutputPort::Execute() | |||||
| if (! event) { | if (! event) { | ||||
| event = thread_queue->DequeueEvent((long) 0); | event = thread_queue->DequeueEvent((long) 0); | ||||
| } | } | ||||
| jack_midi_data_t *data = event->data; | |||||
| jack_midi_data_t *data = event->buffer; | |||||
| // This is the latest time that the packet list can be sent out. We | // This is the latest time that the packet list can be sent out. We | ||||
| // may want to consider subtracting some frames to leave room for the | // may want to consider subtracting some frames to leave room for the | ||||
| @@ -79,10 +79,10 @@ JackCoreMidiOutputPort::Execute() | |||||
| if (! event) { | if (! event) { | ||||
| break; | break; | ||||
| } | } | ||||
| packet = MIDIPacketListAdd(packet_list, midi_buffer_size, | |||||
| packet = MIDIPacketListAdd(packet_list, sizeof(packet_buffer), | |||||
| packet, | packet, | ||||
| GetTimeStampFromFrames(event->time), | GetTimeStampFromFrames(event->time), | ||||
| event->size, event->data); | |||||
| event->size, event->buffer); | |||||
| if (! packet) { | if (! packet) { | ||||
| break; | break; | ||||
| } | } | ||||
| @@ -107,8 +107,9 @@ JackCoreMidiOutputPort::Execute() | |||||
| if (num_bytes > 256) { | if (num_bytes > 256) { | ||||
| num_bytes = 256; | num_bytes = 256; | ||||
| } | } | ||||
| packet = MIDIPacketListAdd(packet_list, midi_buffer_size, | |||||
| packet, timestamp, num_bytes, | |||||
| packet = MIDIPacketListAdd(packet_list, | |||||
| sizeof(packet_buffer), packet, | |||||
| timestamp, num_bytes, | |||||
| data + bytes_sent); | data + bytes_sent); | ||||
| if (! packet) { | if (! packet) { | ||||
| break; | break; | ||||
| @@ -21,15 +21,12 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #include "JackError.h" | #include "JackError.h" | ||||
| #include "JackCoreMidiUtil.h" | #include "JackCoreMidiUtil.h" | ||||
| #import <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h> | |||||
| std::string | std::string | ||||
| Jack::GetMacOSErrorString(OSStatus status) | Jack::GetMacOSErrorString(OSStatus status) | ||||
| { | { | ||||
| char message[kMaxErrorLength + 1]; | |||||
| OSStatus result = GetErrorLongString(error, message, | |||||
| (long) sizeof(message)); | |||||
| if (result != noErr) { | |||||
| const char *message = GetMacOSStatusErrorString(status); | |||||
| if (! message) { | |||||
| std::stringstream stream; | std::stringstream stream; | ||||
| stream << "error (code: '" << status << "')"; | stream << "error (code: '" << status << "')"; | ||||
| return stream.str(); | return stream.str(); | ||||
| @@ -42,6 +39,5 @@ Jack::WriteMacOSError(const char *jack_function, const char *mac_function, | |||||
| OSStatus status) | OSStatus status) | ||||
| { | { | ||||
| jack_error("%s - %s: %s", jack_function, mac_function, | jack_error("%s - %s: %s", jack_function, mac_function, | ||||
| GetMacOSStatusString(status).c_str()); | |||||
| GetMacOSErrorString(status).c_str()); | |||||
| } | } | ||||
| @@ -20,9 +20,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #ifndef __JackCoreMidiUtil__ | #ifndef __JackCoreMidiUtil__ | ||||
| #define __JackCoreMidiUtil__ | #define __JackCoreMidiUtil__ | ||||
| #import <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h> | |||||
| #include <string> | #include <string> | ||||
| #include <CarbonCore/Debugging.h> | |||||
| // Import? What does this line do? Is it necessary now that I'm not including | |||||
| // the same library I was including? | |||||
| #import <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h> | |||||
| namespace Jack { | namespace Jack { | ||||
| std::string | std::string | ||||
| @@ -19,7 +19,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |||||
| #include <sstream> | #include <sstream> | ||||
| #include <stdexcept> | #include <stdexcept> | ||||
| #import <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacTypes.h> | |||||
| #include "JackCoreMidiUtil.h" | #include "JackCoreMidiUtil.h" | ||||
| #include "JackCoreMidiVirtualOutputPort.h" | #include "JackCoreMidiVirtualOutputPort.h" | ||||