From 13b6228c8e1d03d15ae9d86303d16abc4798264f Mon Sep 17 00:00:00 2001
From: qbix79 <qbix79@ed541006-0bf7-43e9-8c4d-6fc63c346d47>
Date: Mon, 21 Oct 2013 20:54:22 +0000
Subject: [PATCH] Implement mixer /listmidi for coremidi. Thanks for the
assistance Dominus
git-svn-id: http://svn.code.sf.net/p/dosbox/code-0@3838 ed541006-0bf7-43e9-8c4d-6fc63c346d47
---
dosbox/trunk/src/gui/midi_coremidi.h | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/dosbox/trunk/src/gui/midi_coremidi.h b/dosbox/trunk/src/gui/midi_coremidi.h
index 460b44f..01f8592 100644
a
|
b
|
private:
|
25 | 25 | public: |
26 | 26 | MidiHandler_coremidi() {m_pCurPacket = 0;} |
27 | 27 | const char * GetName(void) { return "coremidi"; } |
28 | | bool Open(const char * conf) { |
29 | | |
| 28 | bool Open(const char * conf) { |
30 | 29 | // Get the MIDIEndPoint |
31 | 30 | m_endpoint = 0; |
32 | 31 | OSStatus result; |
33 | 32 | Bitu numDests = MIDIGetNumberOfDestinations(); |
34 | | Bitu destId = 0; |
35 | | if(conf && conf[0]) destId = atoi(conf); |
| 33 | Bitu destId = 0; |
| 34 | if(conf && conf[0]) destId = atoi(conf); |
| 35 | |
36 | 36 | if (destId < numDests) |
37 | 37 | { |
38 | 38 | m_endpoint = MIDIGetDestination(destId); |
… |
… |
public:
|
67 | 67 | MIDIClientDispose(m_client); |
68 | 68 | |
69 | 69 | // Dispose the endpoint |
70 | | MIDIEndpointDispose(m_endpoint); |
| 70 | // Not, as it is for Endpoints created by us |
| 71 | // MIDIEndpointDispose(m_endpoint); |
71 | 72 | } |
72 | 73 | |
73 | 74 | void PlayMsg(Bit8u * msg) { |
… |
… |
public:
|
99 | 100 | // Send the MIDIPacketList |
100 | 101 | MIDISend(m_port,m_endpoint,packetList); |
101 | 102 | } |
| 103 | void ListAll(Program* base) { |
| 104 | Bitu numDests = MIDIGetNumberOfDestinations(); |
| 105 | for(Bitu i = 0; i < numDests; i++){ |
| 106 | MIDIEndpointRef dest = MIDIGetDestination(i); |
| 107 | if(!dest) continue; |
| 108 | CFStringRef midiname = 0; |
| 109 | if(MIDIObjectGetStringProperty(dest, kMIDIPropertyDisplayName, &midiname) == noErr) { |
| 110 | const char * s = CFStringGetCStringPtr(midiname, kCFStringEncodingMacRoman); |
| 111 | if(s) base->WriteOut("%02d\t%s\n",i,s); |
| 112 | } |
| 113 | //This is for EndPoints created by us. |
| 114 | //MIDIEndpointDispose(dest); |
| 115 | } |
| 116 | |
| 117 | } |
102 | 118 | }; |
103 | 119 | |
104 | 120 | MidiHandler_coremidi Midi_coremidi; |