MusicKit
0.0.0
|
00001 /* 00002 $Id$ 00003 Description: 00004 This is basically a bare-bones duplicate of NeXT/Apples' performsound module 00005 functionality. Compilable with VC++ 6.0 and typically for interface with 00006 Objective C routines, in particular, the SndKit. 00007 00008 Only C functions are exported to avoid different C++ name mangling between VC++ and gcc 00009 00010 Original Author: Leigh Smith <leigh@tomandandy.com> 00011 00012 Copyright (C) 1999 Permission is granted to use this code for commercial and 00013 non-commercial purposes so long as this copyright statement (noting the author) is 00014 preserved. 00015 */ 00016 /* 00017 $Log$ 00018 Revision 1.1 1999/11/17 17:57:14 leigh 00019 Initial revision 00020 00021 Revision 1.2 1999/07/21 19:19:42 leigh 00022 Single Sound playback working 00023 */ 00024 00025 // The following ifdef block is the standard way of creating macros which make exporting 00026 // from a DLL simpler. All files within this DLL are compiled with the PERFORMMIDI_EXPORTS 00027 // symbol defined on the command line. this symbol should not be defined on any project 00028 // that uses this DLL. This way any other project whose source files include this file see 00029 // PERFORMMIDI_API functions as being imported from a DLL, wheras this DLL sees symbols 00030 // defined with this macro as being exported. 00031 #ifdef MKPERFORMSNDMIDI_EXPORTS 00032 #define PERFORM_API __declspec(dllexport) 00033 #else 00034 #define PERFORM_API __declspec(dllimport) 00035 #endif 00036 00037 #include "soundstruct.h" 00038 00039 #ifdef __cplusplus 00040 extern "C" { 00041 #endif 00042 00043 typedef int (*SNDNotificationFun)(SNDSoundStruct *s, int tag, int err); 00044 00045 #define SND_NULL_FUN ((SNDNotificationFun)0) 00046 00047 PERFORM_API BOOL SNDInit(BOOL guessTheDevice); 00048 00049 // retrieve a list of available driver descriptions 00050 PERFORM_API char **SNDGetAvailableDriverNames(void); 00051 00052 // assign currently active driver 00053 PERFORM_API BOOL SNDSetDriverIndex(unsigned int selectedIndex); 00054 00055 // return the index into driverList currently selected. 00056 PERFORM_API unsigned int SNDGetAssignedDriverIndex(void); 00057 00058 PERFORM_API void SNDGetVolume(float *left, float * right); 00059 00060 PERFORM_API void SNDSetVolume(float left, float right); 00061 00062 PERFORM_API BOOL SNDIsMuted(void); 00063 00064 PERFORM_API void SNDSetMute(BOOL aFlag); 00065 00066 PERFORM_API int SNDStartPlaying(SNDSoundStruct *soundStruct, int tag, int priority, int preempt, 00067 SNDNotificationFun beginFun, SNDNotificationFun endFun); 00068 00069 PERFORM_API int SNDStartRecording(SNDSoundStruct *soundStruct, int tag, int priority, int preempt, 00070 SNDNotificationFun beginRecFun, SNDNotificationFun endRecFun); 00071 00072 PERFORM_API int SNDSamplesProcessed(int tag); 00073 00074 PERFORM_API void SNDStop(int tag); 00075 00076 PERFORM_API void SNDPause(int tag); 00077 00078 PERFORM_API void SNDResume(int tag); 00079 00080 PERFORM_API int SNDUnreserve(int dunno); 00081 00082 PERFORM_API void SNDTerminate(void); 00083 00084 #ifdef __cplusplus 00085 } 00086 #endif 00087