server: Consume events triggered.
[wine/hramrach.git] / dlls / winecoreaudio.drv / coremidi.h
blobc93edc6c31d1291335e5a88be2d1ec45439c1e6d
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 #ifdef WINE_DEFINITIONS
28 * Due to CoreMIDI headers conflict redefine some types for Wine
30 typedef void *MIDIClientRef;
31 typedef void *MIDIEndpointRef;
32 typedef void *MIDIPortRef;
33 typedef void *MIDIObjectRef;
35 typedef struct MIDIPacketList MIDIPacketList;
38 * functions
40 extern OSStatus MIDIClientDispose(MIDIClientRef client);
41 extern unsigned MIDIGetNumberOfDestinations(void);
42 extern MIDIEndpointRef MIDIGetDestination(unsigned i);
43 extern unsigned MIDIGetNumberOfSources(void);
44 extern MIDIEndpointRef MIDIGetSource(unsigned i);
45 extern OSStatus MIDIOutputPortCreate(MIDIClientRef client, CFStringRef portName, MIDIPortRef *outPort);
47 typedef void (*MIDIReadProc)(const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon);
48 extern OSStatus MIDIInputPortCreate(MIDIClientRef client, CFStringRef portName, MIDIReadProc readProc, void *refCon, MIDIPortRef *outPort);
50 extern OSStatus MIDIObjectGetProperties(MIDIObjectRef obj, CFPropertyListRef *outProperties, Boolean deep);
52 extern OSStatus MIDIPortConnectSource(MIDIPortRef port, MIDIEndpointRef source, void *connRefCon);
55 * Due to AudioUnit headers conflict redefine some types.
57 typedef void *AudioUnit;
58 typedef void *AUGraph;
60 extern OSStatus MusicDeviceMIDIEvent(AudioUnit au, UInt32 inStatus, UInt32 inData1, UInt32 inData2, UInt32 inOffsetSampleFrame);
61 extern OSStatus MusicDeviceSysEx(AudioUnit au, const UInt8 *inData, UInt32 inLength);
63 /* audiounit.c */
64 extern int AudioUnit_SetVolume(AudioUnit au, float left, float right);
65 extern int AudioUnit_GetVolume(AudioUnit au, float *left, float *right);
66 #endif
68 typedef struct {
69 UInt16 devID;
70 UInt16 length;
71 Byte data[256];
72 } MIDIMessage;
74 /* coremidi.c */
75 extern MIDIClientRef CoreMIDI_CreateClient(CFStringRef name);
76 extern void CoreMIDI_GetObjectName(MIDIObjectRef obj, char *name, int size);
77 extern void MIDIIn_ReadProc(const MIDIPacketList *pktlist, void *refCon, void *connRefCon);
79 extern void MIDIOut_Send(MIDIPortRef port, MIDIEndpointRef dest, UInt8 *buffer, unsigned length);
81 /* midi.c */
82 void MIDIIn_SendMessage(MIDIMessage msg);
84 #endif