Mac OS 9
MIDI.h
Go to the documentation of this file.
1 
19 #ifndef __MIDI__
20 #define __MIDI__
21 
22 #ifndef __MACERRORS__
23 #include <MacErrors.h>
24 #endif
25 
26 #ifndef __MACTYPES__
27 #include <MacTypes.h>
28 #endif
29 
30 #ifndef __MIXEDMODE__
31 #include <MixedMode.h>
32 #endif
33 
34 #if PRAGMA_ONCE
35 #pragma once
36 #endif
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 #if PRAGMA_IMPORT
44 #pragma import on
45 #endif
46 
47 #if PRAGMA_STRUCT_ALIGN
48 #pragma options align = mac68k
49 #elif PRAGMA_STRUCT_PACKPUSH
50 #pragma pack(push, 2)
51 #elif PRAGMA_STRUCT_PACK
52 #pragma pack(2)
53 #endif
54 
66  enum
67  {
68  midiMaxNameLen = 31
69  };
70 
71  enum
72  {
84  };
85 
86  enum
87  {
88  midiInternalSync = 0,
89  midiExternalSync = 1
90  };
91 
92  enum
93  {
100  0x8000,
101  midiPortTypeMask = 0x0007
103  };
104 
105  enum
106  {
109  0x7FFFFFFF,
111  (long)0x80000000,
112  midiGetCurrent = 0x00000000
113  };
114 
131  enum
132  {
133  midiContMask = 0x03,
134  midiNoCont = 0x00,
135  midiStartCont = 0x01,
136  midiMidCont = 0x03,
137  midiEndCont = 0x02,
138  midiTypeMask = 0x70,
139  midiMsgType = 0x00,
140  midiMgrType = 0x10,
141  midiTimeStampMask = 0x80,
142  midiTimeStampCurrent = 0x80,
143  midiTimeStampValid = 0x00
144  };
145 
146  enum
147  {
150  midiOverflowErr = 0x0001,
151  midiSCCErr = 0x0002,
152  midiPacketErr =
153  0x0003,
154  midiMaxErr = 0x00FF
155  };
156 
157  enum
158  {
161  midiMorePacket = 1,
162  midiNoMorePacket = 2,
163  midiHoldPacket = 3
164  };
165 
166  enum
167  {
170  midiCloseDriver = 2
171  };
172 
173  enum
174  {
175  mdvrAbortNotesOff = 0,
177  mdvrAllNotesOff = 2
178  };
179 
180  enum
181  {
182  mdvrStopOut = 0,
183  mdvrStartOut = 1
184  };
185 
186  struct MIDIPacket
187  {
188  UInt8 flags;
189  UInt8 len;
190  long tStamp;
191  UInt8 data[249];
192  };
193  typedef struct MIDIPacket MIDIPacket;
194  typedef MIDIPacket *MIDIPacketPtr;
195  typedef CALLBACK_API(short, MIDIReadHookProcPtr)(MIDIPacketPtr myPacket,
196  long myRefCon);
197  typedef CALLBACK_API(void, MIDITimeProcPtr)(long curTime, long myRefCon);
198  typedef CALLBACK_API(void,
199  MIDIConnectionProcPtr)(short refnum, long refcon,
200  short portType, OSType clientID,
201  OSType portID, Boolean connect,
202  short direction);
203  typedef CALLBACK_API(long, MDVRCommProcPtr)(short refnum, short request,
204  long refCon);
205  typedef CALLBACK_API(void, MDVRTimeCodeProcPtr)(short refnum, short newFormat,
206  long refCon);
207  typedef CALLBACK_API(void, MDVRReadProcPtr)(char *midiChars, short length,
208  long refCon);
209  typedef STACK_UPP_TYPE(MIDIReadHookProcPtr) MIDIReadHookUPP;
210  typedef STACK_UPP_TYPE(MIDITimeProcPtr) MIDITimeUPP;
211  typedef STACK_UPP_TYPE(MIDIConnectionProcPtr) MIDIConnectionUPP;
212  typedef STACK_UPP_TYPE(MDVRCommProcPtr) MDVRCommUPP;
213  typedef STACK_UPP_TYPE(MDVRTimeCodeProcPtr) MDVRTimeCodeUPP;
214  typedef STACK_UPP_TYPE(MDVRReadProcPtr) MDVRReadUPP;
215  struct MIDIClkInfo
216  {
217  short syncType;
218  long curTime;
219  short format;
220  };
221  typedef struct MIDIClkInfo MIDIClkInfo;
222  struct MIDIIDRec
223  {
224  OSType clientID;
225  OSType portID;
226  };
227  typedef struct MIDIIDRec MIDIIDRec;
229  {
230  short portType;
232  short numConnects;
234  };
235  typedef struct MIDIPortInfo MIDIPortInfo;
236  typedef MIDIPortInfo *MIDIPortInfoPtr;
240  {
241  OSType portID;
242  short portType;
243  short timeBase;
244  long offsetTime;
245  MIDIReadHookUPP readHook;
246  long refCon;
248  Str255 name;
249  };
250  typedef struct MIDIPortParams MIDIPortParams;
252  struct MIDIIDList
253  {
254  short numIDs;
255  OSType list[1];
256  };
257  typedef struct MIDIIDList MIDIIDList;
258  typedef MIDIIDList *MIDIIDListPtr;
259  typedef MIDIIDListPtr *MIDIIDListHdl;
263  {
264  short timeCodeClock;
266  MDVRReadUPP readProc;
267  MDVRCommUPP commProc;
268  long refCon;
269  };
270  typedef struct MDVRInCtlRec MDVRInCtlRec;
271  typedef MDVRInCtlRec *MDVRInCtlPtr;
273  {
274  short timeCodeClock;
276  MDVRTimeCodeUPP timeCodeProc;
277  MDVRCommUPP commProc;
278  long refCon;
280  UInt8 padding;
283  };
284  typedef struct MDVROutCtlRec MDVROutCtlRec;
285  typedef MDVROutCtlRec *MDVROutCtlPtr;
286  typedef void *MDVRPtr;
287 #if CALL_NOT_IN_CARBON
296  NumVersion
297  MIDIVersion(void);
298 
307  OSErr
308  MIDISignIn(OSType clientID, long refCon, Handle icon, ConstStr255Param name);
309 
318  void
319  MIDISignOut(OSType clientID);
320 
331 
340  void
341  MIDIGetClientName(OSType clientID, Str255 name);
342 
351  void
352  MIDISetClientName(OSType clientID, ConstStr255Param name);
353 
363  MIDIGetPorts(OSType clientID);
364 
373  OSErr
374  MIDIAddPort(OSType clientID, short BufSize, short *refnum,
375  MIDIPortParamsPtr init);
376 
386  MIDIGetPortInfo(OSType clientID, OSType portID);
387 
396  OSErr
397  MIDIConnectData(OSType srcClID, OSType srcPortID, OSType dstClID,
398  OSType dstPortID);
399 
408  OSErr
409  MIDIUnConnectData(OSType srcClID, OSType srcPortID, OSType dstClID,
410  OSType dstPortID);
411 
420  OSErr
421  MIDIConnectTime(OSType srcClID, OSType srcPortID, OSType dstClID,
422  OSType dstPortID);
423 
432  OSErr
433  MIDIUnConnectTime(OSType srcClID, OSType srcPortID, OSType dstClID,
434  OSType dstPortID);
435 
444  void
445  MIDIFlush(short refnum);
446 
455  ProcPtr
456  MIDIGetReadHook(short refnum);
457 
466  void
467  MIDISetReadHook(short refnum, ProcPtr hook);
468 
477  void
478  MIDIGetPortName(OSType clientID, OSType portID, Str255 name);
479 
488  void
489  MIDISetPortName(OSType clientID, OSType portID, ConstStr255Param name);
490 
499  void
500  MIDIWakeUp(short refnum, long time, long period, MIDITimeUPP timeProc);
501 
510  void
511  MIDIRemovePort(short refnum);
512 
521  short
522  MIDIGetSync(short refnum);
523 
532  void
533  MIDISetSync(short refnum, short sync);
534 
543  long
544  MIDIGetCurTime(short refnum);
545 
554  void
555  MIDISetCurTime(short refnum, long time);
556 
565  void
566  MIDIStartTime(short refnum);
567 
576  void
577  MIDIStopTime(short refnum);
578 
587  void
588  MIDIPoll(short refnum, long offsetTime);
589 
598  OSErr
599  MIDIWritePacket(short refnum, MIDIPacketPtr packet);
600 
609  Boolean
610  MIDIWorldChanged(OSType clientID);
611 
620  long
621  MIDIGetOffsetTime(short refnum);
622 
631  void
632  MIDISetOffsetTime(short refnum, long offsetTime);
633 
642  long
643  MIDIConvertTime(short srcFormat, short dstFormat, long time);
644 
653  long
654  MIDIGetRefCon(short refnum);
655 
664  void
665  MIDISetRefCon(short refnum, long refCon);
666 
675  long
676  MIDIGetClRefCon(OSType clientID);
677 
686  void
687  MIDISetClRefCon(OSType clientID, long refCon);
688 
697  short
698  MIDIGetTCFormat(short refnum);
699 
708  void
709  MIDISetTCFormat(short refnum, short format);
710 
719  void
720  MIDISetRunRate(short refnum, short rate, long time);
721 
730  Handle
731  MIDIGetClientIcon(OSType clientID);
732 
741  ProcPtr
742  MIDICallAddress(short callNum);
743 
752  void
753  MIDISetConnectionProc(short refNum, ProcPtr connectionProc, long refCon);
754 
763  void
764  MIDIGetConnectionProc(short refnum, ProcPtr *connectionProc, long *refCon);
765 
774  void
775  MIDIDiscardPacket(short refnum, MIDIPacketPtr packet);
776 
785  OSErr
786  MDVRSignIn(OSType clientID, long refCon, Handle icon, Str255 name);
787 
796  void
797  MDVRSignOut(OSType clientID);
798 
807  MDVRPtr
808  MDVROpen(short portType, short refnum);
809 
818  void
819  MDVRClose(MDVRPtr driverPtr);
820 
829  void
830  MDVRControlIn(MDVRPtr portPtr, MDVRInCtlPtr inputCtl);
831 
840  void
841  MDVRControlOut(MDVRPtr portPtr, MDVROutCtlPtr outputCtl);
842 
851  void
852  MDVRIn(MDVRPtr portPtr);
853 
862  void
863  MDVROut(MDVRPtr portPtr, char *dataPtr, short length);
864 
873  void
874  MDVRNotesOff(MDVRPtr portPtr, short mode);
875 
876 #endif
878 #if CALL_NOT_IN_CARBON
887  MIDIReadHookUPP
888  NewMIDIReadHookUPP(MIDIReadHookProcPtr userRoutine);
889 #if !OPAQUE_UPP_TYPES
890  enum
891  {
892  uppMIDIReadHookProcInfo = 0x000003E0
893  };
894 #ifdef __cplusplus
895  inline MIDIReadHookUPP NewMIDIReadHookUPP(MIDIReadHookProcPtr userRoutine)
896  {
897  return (MIDIReadHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
898  uppMIDIReadHookProcInfo,
899  GetCurrentArchitecture());
900  }
901 #else
902 #define NewMIDIReadHookUPP(userRoutine) \
903  (MIDIReadHookUPP) \
904  NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIReadHookProcInfo, \
905  GetCurrentArchitecture())
906 #endif
907 #endif
908 
917  MIDITimeUPP
918  NewMIDITimeUPP(MIDITimeProcPtr userRoutine);
919 #if !OPAQUE_UPP_TYPES
920  enum
921  {
922  uppMIDITimeProcInfo = 0x000003C0
923  };
924 #ifdef __cplusplus
925  inline MIDITimeUPP NewMIDITimeUPP(MIDITimeProcPtr userRoutine)
926  {
927  return (MIDITimeUPP)NewRoutineDescriptor(
928  (ProcPtr)(userRoutine), uppMIDITimeProcInfo, GetCurrentArchitecture());
929  }
930 #else
931 #define NewMIDITimeUPP(userRoutine) \
932  (MIDITimeUPP) NewRoutineDescriptor( \
933  (ProcPtr)(userRoutine), uppMIDITimeProcInfo, GetCurrentArchitecture())
934 #endif
935 #endif
936 
945  MIDIConnectionUPP
946  NewMIDIConnectionUPP(MIDIConnectionProcPtr userRoutine);
947 #if !OPAQUE_UPP_TYPES
948  enum
949  {
950  uppMIDIConnectionProcInfo = 0x0009FB80
951  };
953 #ifdef __cplusplus
954  inline MIDIConnectionUPP
955  NewMIDIConnectionUPP(MIDIConnectionProcPtr userRoutine)
956  {
957  return (MIDIConnectionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
958  uppMIDIConnectionProcInfo,
959  GetCurrentArchitecture());
960  }
961 #else
962 #define NewMIDIConnectionUPP(userRoutine) \
963  (MIDIConnectionUPP) \
964  NewRoutineDescriptor((ProcPtr)(userRoutine), uppMIDIConnectionProcInfo, \
965  GetCurrentArchitecture())
966 #endif
967 #endif
968 
977  MDVRCommUPP
978  NewMDVRCommUPP(MDVRCommProcPtr userRoutine);
979 #if !OPAQUE_UPP_TYPES
980  enum
981  {
982  uppMDVRCommProcInfo = 0x00000EB0
983  };
984 #ifdef __cplusplus
985  inline MDVRCommUPP NewMDVRCommUPP(MDVRCommProcPtr userRoutine)
986  {
987  return (MDVRCommUPP)NewRoutineDescriptor(
988  (ProcPtr)(userRoutine), uppMDVRCommProcInfo, GetCurrentArchitecture());
989  }
990 #else
991 #define NewMDVRCommUPP(userRoutine) \
992  (MDVRCommUPP) NewRoutineDescriptor( \
993  (ProcPtr)(userRoutine), uppMDVRCommProcInfo, GetCurrentArchitecture())
994 #endif
995 #endif
996 
1005  MDVRTimeCodeUPP
1006  NewMDVRTimeCodeUPP(MDVRTimeCodeProcPtr userRoutine);
1007 #if !OPAQUE_UPP_TYPES
1008  enum
1009  {
1010  uppMDVRTimeCodeProcInfo = 0x00000E80
1011  };
1012 #ifdef __cplusplus
1013  inline MDVRTimeCodeUPP NewMDVRTimeCodeUPP(MDVRTimeCodeProcPtr userRoutine)
1014  {
1015  return (MDVRTimeCodeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
1016  uppMDVRTimeCodeProcInfo,
1017  GetCurrentArchitecture());
1018  }
1019 #else
1020 #define NewMDVRTimeCodeUPP(userRoutine) \
1021  (MDVRTimeCodeUPP) \
1022  NewRoutineDescriptor((ProcPtr)(userRoutine), uppMDVRTimeCodeProcInfo, \
1023  GetCurrentArchitecture())
1024 #endif
1025 #endif
1026 
1035  MDVRReadUPP
1036  NewMDVRReadUPP(MDVRReadProcPtr userRoutine);
1037 #if !OPAQUE_UPP_TYPES
1038  enum
1039  {
1040  uppMDVRReadProcInfo = 0x00000EC0
1041  };
1042 #ifdef __cplusplus
1043  inline MDVRReadUPP NewMDVRReadUPP(MDVRReadProcPtr userRoutine)
1044  {
1045  return (MDVRReadUPP)NewRoutineDescriptor(
1046  (ProcPtr)(userRoutine), uppMDVRReadProcInfo, GetCurrentArchitecture());
1047  }
1048 #else
1049 #define NewMDVRReadUPP(userRoutine) \
1050  (MDVRReadUPP) NewRoutineDescriptor( \
1051  (ProcPtr)(userRoutine), uppMDVRReadProcInfo, GetCurrentArchitecture())
1052 #endif
1053 #endif
1054 
1063  void
1064  DisposeMIDIReadHookUPP(MIDIReadHookUPP userUPP);
1065 #if !OPAQUE_UPP_TYPES
1066 #ifdef __cplusplus
1067  inline void DisposeMIDIReadHookUPP(MIDIReadHookUPP userUPP)
1068  {
1069  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1070  }
1071 #else
1072 #define DisposeMIDIReadHookUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1073 #endif
1074 #endif
1075 
1084  void
1085  DisposeMIDITimeUPP(MIDITimeUPP userUPP);
1086 #if !OPAQUE_UPP_TYPES
1087 #ifdef __cplusplus
1088  inline void DisposeMIDITimeUPP(MIDITimeUPP userUPP)
1089  {
1090  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1091  }
1092 #else
1093 #define DisposeMIDITimeUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1094 #endif
1095 #endif
1096 
1105  void
1106  DisposeMIDIConnectionUPP(MIDIConnectionUPP userUPP);
1107 #if !OPAQUE_UPP_TYPES
1108 #ifdef __cplusplus
1109  inline void DisposeMIDIConnectionUPP(MIDIConnectionUPP userUPP)
1110  {
1111  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1112  }
1113 #else
1114 #define DisposeMIDIConnectionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1115 #endif
1116 #endif
1117 
1126  void
1127  DisposeMDVRCommUPP(MDVRCommUPP userUPP);
1128 #if !OPAQUE_UPP_TYPES
1129 #ifdef __cplusplus
1130  inline void DisposeMDVRCommUPP(MDVRCommUPP userUPP)
1131  {
1132  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1133  }
1134 #else
1135 #define DisposeMDVRCommUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1136 #endif
1137 #endif
1138 
1147  void
1148  DisposeMDVRTimeCodeUPP(MDVRTimeCodeUPP userUPP);
1149 #if !OPAQUE_UPP_TYPES
1150 #ifdef __cplusplus
1151  inline void DisposeMDVRTimeCodeUPP(MDVRTimeCodeUPP userUPP)
1152  {
1153  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1154  }
1155 #else
1156 #define DisposeMDVRTimeCodeUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1157 #endif
1158 #endif
1159 
1168  void
1169  DisposeMDVRReadUPP(MDVRReadUPP userUPP);
1170 #if !OPAQUE_UPP_TYPES
1171 #ifdef __cplusplus
1172  inline void DisposeMDVRReadUPP(MDVRReadUPP userUPP)
1173  {
1174  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1175  }
1176 #else
1177 #define DisposeMDVRReadUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1178 #endif
1179 #endif
1180 
1189  short
1190  InvokeMIDIReadHookUPP(MIDIPacketPtr myPacket, long myRefCon,
1191  MIDIReadHookUPP userUPP);
1192 #if !OPAQUE_UPP_TYPES
1193 #ifdef __cplusplus
1194  inline short InvokeMIDIReadHookUPP(MIDIPacketPtr myPacket, long myRefCon,
1195  MIDIReadHookUPP userUPP)
1196  {
1197  return (short)CALL_TWO_PARAMETER_UPP(userUPP, uppMIDIReadHookProcInfo,
1198  myPacket, myRefCon);
1199  }
1200 #else
1201 #define InvokeMIDIReadHookUPP(myPacket, myRefCon, userUPP) \
1202  (short)CALL_TWO_PARAMETER_UPP((userUPP), uppMIDIReadHookProcInfo, \
1203  (myPacket), (myRefCon))
1204 #endif
1205 #endif
1206 
1215  void
1216  InvokeMIDITimeUPP(long curTime, long myRefCon, MIDITimeUPP userUPP);
1217 #if !OPAQUE_UPP_TYPES
1218 #ifdef __cplusplus
1219  inline void InvokeMIDITimeUPP(long curTime, long myRefCon,
1220  MIDITimeUPP userUPP)
1221  {
1222  CALL_TWO_PARAMETER_UPP(userUPP, uppMIDITimeProcInfo, curTime, myRefCon);
1223  }
1224 #else
1225 #define InvokeMIDITimeUPP(curTime, myRefCon, userUPP) \
1226  CALL_TWO_PARAMETER_UPP((userUPP), uppMIDITimeProcInfo, (curTime), (myRefCon))
1227 #endif
1228 #endif
1229 
1238  void
1239  InvokeMIDIConnectionUPP(short refnum, long refcon, short portType,
1240  OSType clientID, OSType portID, Boolean connect,
1241  short direction, MIDIConnectionUPP userUPP);
1242 #if !OPAQUE_UPP_TYPES
1243 #ifdef __cplusplus
1244  inline void InvokeMIDIConnectionUPP(short refnum, long refcon, short portType,
1245  OSType clientID, OSType portID,
1246  Boolean connect, short direction,
1247  MIDIConnectionUPP userUPP)
1248  {
1249  CALL_SEVEN_PARAMETER_UPP(userUPP, uppMIDIConnectionProcInfo, refnum, refcon,
1250  portType, clientID, portID, connect, direction);
1251  }
1252 #else
1253 #define InvokeMIDIConnectionUPP(refnum, refcon, portType, clientID, portID, \
1254  connect, direction, userUPP) \
1255  CALL_SEVEN_PARAMETER_UPP((userUPP), uppMIDIConnectionProcInfo, (refnum), \
1256  (refcon), (portType), (clientID), (portID), \
1257  (connect), (direction))
1258 #endif
1259 #endif
1260 
1269  long
1270  InvokeMDVRCommUPP(short refnum, short request, long refCon,
1271  MDVRCommUPP userUPP);
1272 #if !OPAQUE_UPP_TYPES
1273 #ifdef __cplusplus
1274  inline long InvokeMDVRCommUPP(short refnum, short request, long refCon,
1275  MDVRCommUPP userUPP)
1276  {
1277  return (long)CALL_THREE_PARAMETER_UPP(userUPP, uppMDVRCommProcInfo, refnum,
1278  request, refCon);
1279  }
1280 #else
1281 #define InvokeMDVRCommUPP(refnum, request, refCon, userUPP) \
1282  (long)CALL_THREE_PARAMETER_UPP((userUPP), uppMDVRCommProcInfo, (refnum), \
1283  (request), (refCon))
1284 #endif
1285 #endif
1286 
1295  void
1296  InvokeMDVRTimeCodeUPP(short refnum, short newFormat, long refCon,
1297  MDVRTimeCodeUPP userUPP);
1298 #if !OPAQUE_UPP_TYPES
1299 #ifdef __cplusplus
1300  inline void InvokeMDVRTimeCodeUPP(short refnum, short newFormat, long refCon,
1301  MDVRTimeCodeUPP userUPP)
1302  {
1303  CALL_THREE_PARAMETER_UPP(userUPP, uppMDVRTimeCodeProcInfo, refnum, newFormat,
1304  refCon);
1305  }
1306 #else
1307 #define InvokeMDVRTimeCodeUPP(refnum, newFormat, refCon, userUPP) \
1308  CALL_THREE_PARAMETER_UPP((userUPP), uppMDVRTimeCodeProcInfo, (refnum), \
1309  (newFormat), (refCon))
1310 #endif
1311 #endif
1312 
1321  void
1322  InvokeMDVRReadUPP(char *midiChars, short length, long refCon,
1323  MDVRReadUPP userUPP);
1324 #if !OPAQUE_UPP_TYPES
1325 #ifdef __cplusplus
1326  inline void InvokeMDVRReadUPP(char *midiChars, short length, long refCon,
1327  MDVRReadUPP userUPP)
1328  {
1329  CALL_THREE_PARAMETER_UPP(userUPP, uppMDVRReadProcInfo, midiChars, length,
1330  refCon);
1331  }
1332 #else
1333 #define InvokeMDVRReadUPP(midiChars, length, refCon, userUPP) \
1334  CALL_THREE_PARAMETER_UPP((userUPP), uppMDVRReadProcInfo, (midiChars), \
1335  (length), (refCon))
1336 #endif
1337 #endif
1338 
1339 #endif
1341 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
1343 #define NewMIDIReadHookProc(userRoutine) NewMIDIReadHookUPP(userRoutine)
1344 #define NewMIDITimeProc(userRoutine) NewMIDITimeUPP(userRoutine)
1345 #define NewMIDIConnectionProc(userRoutine) NewMIDIConnectionUPP(userRoutine)
1346 #define NewMDVRCommProc(userRoutine) NewMDVRCommUPP(userRoutine)
1347 #define NewMDVRTimeCodeProc(userRoutine) NewMDVRTimeCodeUPP(userRoutine)
1348 #define NewMDVRReadProc(userRoutine) NewMDVRReadUPP(userRoutine)
1349 #define CallMIDIReadHookProc(userRoutine, myPacket, myRefCon) \
1350  InvokeMIDIReadHookUPP(myPacket, myRefCon, userRoutine)
1351 #define CallMIDITimeProc(userRoutine, curTime, myRefCon) \
1352  InvokeMIDITimeUPP(curTime, myRefCon, userRoutine)
1353 #define CallMIDIConnectionProc(userRoutine, refnum, refcon, portType, \
1354  clientID, portID, connect, direction) \
1355  InvokeMIDIConnectionUPP(refnum, refcon, portType, clientID, portID, connect, \
1356  direction, userRoutine)
1357 #define CallMDVRCommProc(userRoutine, refnum, request, refCon) \
1358  InvokeMDVRCommUPP(refnum, request, refCon, userRoutine)
1359 #define CallMDVRTimeCodeProc(userRoutine, refnum, newFormat, refCon) \
1360  InvokeMDVRTimeCodeUPP(refnum, newFormat, refCon, userRoutine)
1361 #define CallMDVRReadProc(userRoutine, midiChars, length, refCon) \
1362  InvokeMDVRReadUPP(midiChars, length, refCon, userRoutine)
1363 #endif
1365 #if PRAGMA_STRUCT_ALIGN
1366 #pragma options align = reset
1367 #elif PRAGMA_STRUCT_PACKPUSH
1368 #pragma pack(pop)
1369 #elif PRAGMA_STRUCT_PACK
1370 #pragma pack()
1371 #endif
1372 
1373 #ifdef PRAGMA_IMPORT_OFF
1374 #pragma import off
1375 #elif PRAGMA_IMPORT
1376 #pragma import reset
1377 #endif
1378 
1379 #ifdef __cplusplus
1380 }
1381 #endif
1382 
1383 #endif
void MIDISignOut(OSType clientID)
#define NewMIDIReadHookUPP(userRoutine)
Definition: MIDI.h:902
void MIDIGetConnectionProc(short refnum, ProcPtr *connectionProc, long *refCon)
void DisposeMIDIReadHookUPP(MIDIReadHookUPP userUPP)
void MIDISetClientName(OSType clientID, ConstStr255Param name)
void InvokeMDVRReadUPP(char *midiChars, short length, long refCon, MDVRReadUPP userUPP)
OSErr MIDIUnConnectTime(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
#define NewMIDIConnectionUPP(userRoutine)
Definition: MIDI.h:962
void DisposeMDVRTimeCodeUPP(MDVRTimeCodeUPP userUPP)
void MDVRNotesOff(MDVRPtr portPtr, short mode)
long MIDIGetOffsetTime(short refnum)
NumVersion MIDIVersion(void)
void MIDIStartTime(short refnum)
void MIDIRemovePort(short refnum)
void DisposeMIDITimeUPP(MIDITimeUPP userUPP)
@ mdvrAllNotesOff
Definition: MIDI.h:177
@ mdvrChanNotesOff
Definition: MIDI.h:176
void MDVRControlIn(MDVRPtr portPtr, MDVRInCtlPtr inputCtl)
@ midiKeepPacket
Definition: MIDI.h:160
ProcPtr MIDIGetReadHook(short refnum)
short MIDIGetSync(short refnum)
void MIDISetCurTime(short refnum, long time)
void MIDISetConnectionProc(short refNum, ProcPtr connectionProc, long refCon)
void DisposeMDVRCommUPP(MDVRCommUPP userUPP)
void MIDISetClRefCon(OSType clientID, long refCon)
@ mdvrStartOut
Definition: MIDI.h:183
@ midiPortTypeOutput
Definition: MIDI.h:97
@ midiPortTypeInput
Definition: MIDI.h:96
@ midiPortTypeTimeInv
Definition: MIDI.h:98
@ midiPortInvisible
Definition: MIDI.h:99
@ midiPortTypeTime
Definition: MIDI.h:95
@ midiPortTypeMask
Definition: MIDI.h:101
@ midiFormat24fpsQF
Definition: MIDI.h:80
@ midiFormat30fpsBit
Definition: MIDI.h:79
@ midiFormat30fpsQF
Definition: MIDI.h:83
@ midiFormatBeats
Definition: MIDI.h:75
@ midiFormat25fpsQF
Definition: MIDI.h:81
@ midiFormatMSec
Definition: MIDI.h:74
@ midiFormat30fpsDBit
Definition: MIDI.h:78
@ midiFormat30fpsDQF
Definition: MIDI.h:82
@ midiFormat24fpsBit
Definition: MIDI.h:76
@ midiFormat25fpsBit
Definition: MIDI.h:77
void MIDIPoll(short refnum, long offsetTime)
OSErr MIDIUnConnectData(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
long MIDIGetCurTime(short refnum)
void MIDISetReadHook(short refnum, ProcPtr hook)
OSErr MIDIConnectData(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
void MIDIFlush(short refnum)
long MIDIConvertTime(short srcFormat, short dstFormat, long time)
void InvokeMIDIConnectionUPP(short refnum, long refcon, short portType, OSType clientID, OSType portID, Boolean connect, short direction, MIDIConnectionUPP userUPP)
long MIDIGetClRefCon(OSType clientID)
OSErr MIDISignIn(OSType clientID, long refCon, Handle icon, ConstStr255Param name)
#define NewMDVRCommUPP(userRoutine)
Definition: MIDI.h:991
void MIDISetRefCon(short refnum, long refCon)
void DisposeMIDIConnectionUPP(MIDIConnectionUPP userUPP)
void MIDIGetClientName(OSType clientID, Str255 name)
void MIDISetTCFormat(short refnum, short format)
void MIDIStopTime(short refnum)
OSErr MIDIConnectTime(OSType srcClID, OSType srcPortID, OSType dstClID, OSType dstPortID)
void MIDISetPortName(OSType clientID, OSType portID, ConstStr255Param name)
long MIDIGetRefCon(short refnum)
short MIDIGetTCFormat(short refnum)
ProcPtr MIDICallAddress(short callNum)
void MIDISetRunRate(short refnum, short rate, long time)
MIDIIDListHandle MIDIGetClients(void)
MIDIPortInfoHandle MIDIGetPortInfo(OSType clientID, OSType portID)
@ midiGetEverything
Definition: MIDI.h:108
@ midiGetNothing
Definition: MIDI.h:110
@ midiGetCurrent
Definition: MIDI.h:112
void MDVRIn(MDVRPtr portPtr)
@ midiOpenDriver
Definition: MIDI.h:169
void MDVROut(MDVRPtr portPtr, char *dataPtr, short length)
void DisposeMDVRReadUPP(MDVRReadUPP userUPP)
void MDVRSignOut(OSType clientID)
long InvokeMDVRCommUPP(short refnum, short request, long refCon, MDVRCommUPP userUPP)
OSErr MIDIAddPort(OSType clientID, short BufSize, short *refnum, MIDIPortParamsPtr init)
void MDVRControlOut(MDVRPtr portPtr, MDVROutCtlPtr outputCtl)
void MIDISetSync(short refnum, short sync)
MDVRPtr MDVROpen(short portType, short refnum)
void MIDIGetPortName(OSType clientID, OSType portID, Str255 name)
Handle MIDIGetClientIcon(OSType clientID)
void InvokeMIDITimeUPP(long curTime, long myRefCon, MIDITimeUPP userUPP)
#define NewMDVRReadUPP(userRoutine)
Definition: MIDI.h:1049
OSErr MDVRSignIn(OSType clientID, long refCon, Handle icon, Str255 name)
MIDIIDListHandle MIDIGetPorts(OSType clientID)
void MIDISetOffsetTime(short refnum, long offsetTime)
@ midiOverflowErr
Definition: MIDI.h:150
@ midiMaxErr
Definition: MIDI.h:154
#define NewMDVRTimeCodeUPP(userRoutine)
Definition: MIDI.h:1020
#define NewMIDITimeUPP(userRoutine)
Definition: MIDI.h:931
void InvokeMDVRTimeCodeUPP(short refnum, short newFormat, long refCon, MDVRTimeCodeUPP userUPP)
Boolean MIDIWorldChanged(OSType clientID)
OSErr MIDIWritePacket(short refnum, MIDIPacketPtr packet)
void MIDIDiscardPacket(short refnum, MIDIPacketPtr packet)
void MIDIWakeUp(short refnum, long time, long period, MIDITimeUPP timeProc)
short InvokeMIDIReadHookUPP(MIDIPacketPtr myPacket, long myRefCon, MIDIReadHookUPP userUPP)
void MDVRClose(MDVRPtr driverPtr)
@ midiExternalSync
Definition: MIDI.h:89
OSErr codes.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Definition: MIDI.h:263
long refCon
Definition: MIDI.h:268
short timeCodeFormat
Definition: MIDI.h:265
MDVRReadUPP readProc
Definition: MIDI.h:266
MDVRCommUPP commProc
Definition: MIDI.h:267
Definition: MIDI.h:273
Boolean timeCodeFilter
Definition: MIDI.h:279
long midiMsgTicks
Definition: MIDI.h:281
UInt8 padding
Definition: MIDI.h:280
long timeCodeTicks
Definition: MIDI.h:282
MDVRCommUPP commProc
Definition: MIDI.h:277
MDVRTimeCodeUPP timeCodeProc
Definition: MIDI.h:276
short timeCodeFormat
Definition: MIDI.h:275
long refCon
Definition: MIDI.h:278
Definition: MIDI.h:216
long curTime
Definition: MIDI.h:218
short format
Definition: MIDI.h:219
Definition: MIDI.h:253
Definition: MIDI.h:223
Definition: MIDI.h:187
Definition: MIDI.h:229
short numConnects
Definition: MIDI.h:232
MIDIIDRec timeBase
Definition: MIDI.h:231
MIDIIDRec cList[1]
Definition: MIDI.h:233
Definition: MIDI.h:240
long refCon
Definition: MIDI.h:246
Str255 name
Definition: MIDI.h:248
short portType
Definition: MIDI.h:242
short timeBase
Definition: MIDI.h:243
long offsetTime
Definition: MIDI.h:244
MIDIClkInfo initClock
Definition: MIDI.h:247
MIDIReadHookUPP readHook
Definition: MIDI.h:245
Definition: MacTypes.h:638
Definition: TranslationExtensions.h:114