MusicKit  0.0.0
mididriverUser.h
00001 /*
00002   $Id$
00003   Defined In: The MusicKit
00004 
00005   Description:
00006   Original Author: Leigh M. Smith <leigh@tomandandy.com>
00007 
00008  Copyright (c) Copyright (c) 1999 tomandandy.
00009 
00010   Permission is granted to use and modify this code for commercial and non-commercial
00011   purposes so long as the author attribution and this copyright message remains intact
00012   and accompanies all derived code.
00013 
00014   Just to cover my ass: DirectMusic and DirectX are registered trademarks
00015   of Microsoft Corp and they can have them.
00016 
00017 */
00018 /*
00019 Modification history:
00020 
00021   $Log$
00022   Revision 1.1  1999/11/17 17:57:14  leigh
00023   Initial revision
00024 
00025 
00026 */
00027 // The following ifdef block is the standard way of creating macros which make exporting 
00028 // from a DLL simpler. All files within this DLL are compiled with the PERFORMMIDI_EXPORTS
00029 // symbol defined on the command line. this symbol should not be defined on any project
00030 // that uses this DLL. This way any other project whose source files include this file see 
00031 // PERFORMMIDI_API functions as being imported from a DLL, wheras this DLL sees symbols
00032 // defined with this macro as being exported.
00033 #ifdef MKPERFORMSNDMIDI_EXPORTS
00034 #define PERFORM_API __declspec(dllexport)
00035 #else
00036 #define PERFORM_API __declspec(dllimport)
00037 #endif
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif 
00042 
00043 typedef int kern_return_t;
00044 //typedef void *MDRawEventPtr;
00045 //typedef int *MDReplyFunctions;
00046 typedef int msg_header_t;
00047 
00048 /* Routine MDBecomeOwner */
00049 PERFORM_API kern_return_t MDBecomeOwner (
00050         port_t mididriver_port,
00051         port_t owner_port);
00052 
00053 /* Routine MDReleaseOwnership */
00054 PERFORM_API kern_return_t MDReleaseOwnership (
00055         port_t mididriver_port,
00056         port_t owner_port);
00057 
00058 /* Routine MDSetClockMode */
00059 PERFORM_API kern_return_t MDSetClockMode (
00060         port_t mididriver_port,
00061         port_t owner_port,
00062         short unit,
00063         int clock_mode);
00064 
00065 /* Routine MDGetClockTime */
00066 PERFORM_API kern_return_t MDGetClockTime (
00067         port_t mididriver_port,
00068         port_t owner_port,
00069         int *time);
00070 
00071 /* Routine MDGetMTCTime */
00072 PERFORM_API kern_return_t MDGetMTCTime (
00073         port_t mididriver_port,
00074         port_t owner_port,
00075         short *format,
00076         short *hours,
00077         short *minutes,
00078         short *seconds,
00079         short *frames);
00080 
00081 /* Routine MDSetClockTime */
00082 PERFORM_API kern_return_t MDSetClockTime (
00083         port_t mididriver_port,
00084         port_t owner_port,
00085         int time);
00086 
00087 /* SimpleRoutine MDRequestAlarm */
00088 PERFORM_API kern_return_t MDRequestAlarm (
00089         port_t mididriver_port,
00090         port_t owner_port,
00091         port_t reply_port,
00092         int time);
00093 
00094 /* Routine MDStartClock */
00095 PERFORM_API kern_return_t MDStartClock (
00096         port_t mididriver_port,
00097         port_t owner_port);
00098 
00099 /* Routine MDStopClock */
00100 PERFORM_API kern_return_t MDStopClock (
00101         port_t mididriver_port,
00102         port_t owner_port);
00103 
00104 /* Routine MDClaimUnit */
00105 PERFORM_API kern_return_t MDClaimUnit (
00106         port_t mididriver_port,
00107         port_t owner_port,
00108         short unit);
00109 
00110 /* Routine MDReleaseUnit */
00111 PERFORM_API kern_return_t MDReleaseUnit (
00112         port_t mididriver_port,
00113         port_t owner_port,
00114         short unit);
00115 
00116 /* Routine MDRequestExceptions */
00117 PERFORM_API kern_return_t MDRequestExceptions (
00118         port_t mididriver_port,
00119         port_t owner_port,
00120         port_t error_port);
00121 
00122 /* Routine MDRequestData */
00123 PERFORM_API kern_return_t MDRequestData (
00124         port_t mididriver_port,
00125         port_t owner_port,
00126         short unit,
00127         port_t reply_port);
00128 
00129 /* Routine MDSendData */
00130 PERFORM_API kern_return_t MDSendData (
00131         port_t mididriver_port,
00132         port_t owner_port,
00133         short unit,
00134         MDRawEventPtr data,
00135         unsigned int dataCnt);
00136 
00137 /* Routine MDGetAvailableQueueSize */
00138 PERFORM_API kern_return_t MDGetAvailableQueueSize (
00139         port_t mididriver_port,
00140         port_t owner_port,
00141         short unit,
00142         int *size);
00143 
00144 /* Routine MDRequestQueueNotification */
00145 PERFORM_API kern_return_t MDRequestQueueNotification (
00146         port_t mididriver_port,
00147         port_t owner_port,
00148         short unit,
00149         port_t notification_port,
00150         int size);
00151 
00152 /* Routine MDClearQueue */
00153 PERFORM_API kern_return_t MDClearQueue (
00154         port_t mididriver_port,
00155         port_t owner_port,
00156         short unit);
00157 
00158 /* Routine MDFlushQueue */
00159 PERFORM_API kern_return_t MDFlushQueue (
00160         port_t mididriver_port,
00161         port_t owner_port,
00162         short unit);
00163 
00164 /* Routine MDSetSystemIgnores */
00165 PERFORM_API kern_return_t MDSetSystemIgnores (
00166         port_t mididriver_port,
00167         port_t owner_port,
00168         short unit,
00169         int sys_ignores);
00170 
00171 /* Routine MDSetClockQuantum */
00172 PERFORM_API kern_return_t MDSetClockQuantum (
00173         port_t mididriver_port,
00174         port_t owner_port,
00175         int microseconds);
00176 
00177 PERFORM_API kern_return_t MDAwaitReply(
00178   port_t port_set, 
00179   MDReplyFunctions *funcs,
00180   int timeout);
00181 
00182 PERFORM_API kern_return_t MDHandleReply(
00183   msg_header_t *msg,
00184   MDReplyFunctions *funcs);
00185 
00186 /* download the patch numbers (MSB,LSB,patch) to the sound card */
00187 PERFORM_API kern_return_t MIDIDownloadDLSInstruments(
00188   unsigned int *instruments,
00189   int instrCount);
00190 
00191 /* return the available drivers */
00192 PERFORM_API const char **MIDIGetAvailableDrivers(
00193   unsigned int *selectedDriver);
00194 
00195 #ifdef __cplusplus
00196 }
00197 #endif