winecoreaudio: Move midi_out_reset to the unixlib.
[wine.git] / dlls / winecoreaudio.drv / coremidi.h
blobe6d5c8c18c843aeb2673e6a7c06edaea5204c518
1 /*
2 * Wine Midi driver for Mac OS X
4 * Copyright 2006 Emmanuel Maillard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef WINE_COREMIDI_H
22 #define WINE_COREMIDI_H
24 #include <CoreFoundation/CoreFoundation.h>
26 #define MAX_MIDI_SYNTHS 1
28 #ifdef WINE_DEFINITIONS
30 * Due to CoreMIDI headers conflict redefine some types for Wine
32 typedef void *MIDIClientRef;
33 typedef void *MIDIEndpointRef;
34 typedef void *MIDIPortRef;
35 typedef void *MIDIObjectRef;
37 typedef struct MIDIPacketList MIDIPacketList;
40 * functions
42 extern OSStatus MIDIClientDispose(MIDIClientRef client);
43 extern unsigned MIDIGetNumberOfDestinations(void);
44 extern MIDIEndpointRef MIDIGetDestination(unsigned i);
45 extern unsigned MIDIGetNumberOfSources(void);
46 extern MIDIEndpointRef MIDIGetSource(unsigned i);
47 extern OSStatus MIDIOutputPortCreate(MIDIClientRef client, CFStringRef portName, MIDIPortRef *outPort);
49 typedef void (*MIDIReadProc)(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon);
50 extern OSStatus MIDIInputPortCreate(MIDIClientRef client, CFStringRef portName, MIDIReadProc readProc, void *refCon, MIDIPortRef *outPort);
52 extern OSStatus MIDIObjectGetProperties(MIDIObjectRef obj, CFPropertyListRef *outProperties, Boolean deep);
54 extern OSStatus MIDIPortConnectSource(MIDIPortRef port, MIDIEndpointRef source, void *connRefCon);
57 * Due to AudioUnit headers conflict redefine some types.
59 typedef void *AudioUnit;
60 typedef void *AUGraph;
62 extern OSStatus MusicDeviceMIDIEvent(AudioUnit au, UInt32 inStatus, UInt32 inData1, UInt32 inData2, UInt32 inOffsetSampleFrame);
63 extern OSStatus MusicDeviceSysEx(AudioUnit au, const UInt8 *inData, UInt32 inLength);
64 #endif
66 /* midi.c */
67 typedef struct midi_src
69 MIDIEndpointRef source;
71 WORD wDevID;
72 int state; /* 0 is no recording started, 1 in recording, bit 2 set if in sys exclusive recording */
73 MIDIINCAPSW caps;
74 MIDIOPENDESC midiDesc;
75 LPMIDIHDR lpQueueHdr;
76 WORD wFlags;
77 DWORD startTime;
78 } MIDISource;
80 typedef struct {
81 UInt16 devID;
82 UInt16 length;
83 Byte data[];
84 } MIDIMessage;
86 #endif