MusicKit  0.0.0
PerformSound.h
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  2000/12/07 19:32:34  leigh
00019   Initial revision
00020 
00021   Revision 1.2  2000/05/05 22:43:56  leigh
00022   ensure we don't have boolean constants predefined
00023 
00024   Revision 1.1  2000/03/11 01:42:19  leigh
00025   Initial Release
00026 
00027   Revision 1.1.1.1  2000/01/14 00:14:34  leigh
00028   Initial revision
00029 
00030   Revision 1.1.1.1  1999/11/17 17:57:14  leigh
00031   Initial working version
00032 
00033   Revision 1.2  1999/07/21 19:19:42  leigh
00034   Single Sound playback working
00035 */
00036 
00037 #define PERFORM_API 
00038 
00039 // these don't seem to be defined anywhere standard - probably they
00040 // are in GnuStep
00041 typedef int BOOL;
00042 #ifndef FALSE
00043 #define FALSE 0
00044 #define TRUE !(FALSE)
00045 #endif
00046 
00047 #include <stdlib.h> // for NULL definition
00048 #include "soundstruct.h"
00049 
00050 #ifdef __cplusplus
00051 extern "C" {
00052 #endif 
00053 
00054 typedef int (*SNDNotificationFun)(SNDSoundStruct *s, int tag, int err);
00055 
00056 #define SND_NULL_FUN ((SNDNotificationFun)0)
00057 
00058 PERFORM_API BOOL SNDInit(BOOL guessTheDevice);
00059 
00060 // retrieve a list of available driver descriptions
00061 PERFORM_API char **SNDGetAvailableDriverNames(void);
00062 
00063 // assign currently active driver
00064 PERFORM_API BOOL SNDSetDriverIndex(unsigned int selectedIndex);
00065 
00066 // return the index into driverList currently selected.
00067 PERFORM_API unsigned int SNDGetAssignedDriverIndex(void);
00068 
00069 PERFORM_API void SNDGetVolume(float *left, float * right);
00070 
00071 PERFORM_API void SNDSetVolume(float left, float right);
00072 
00073 PERFORM_API BOOL SNDIsMuted(void);
00074 
00075 PERFORM_API void SNDSetMute(BOOL aFlag);
00076 
00077 PERFORM_API int SNDStartPlaying(SNDSoundStruct *soundStruct, int tag, int priority,  int preempt, 
00078   SNDNotificationFun beginFun, SNDNotificationFun endFun);
00079 
00080 PERFORM_API int SNDStartRecording(SNDSoundStruct *soundStruct, int tag, int priority, int preempt, 
00081   SNDNotificationFun beginRecFun, SNDNotificationFun endRecFun);
00082  
00083 PERFORM_API int SNDSamplesProcessed(int tag);
00084 
00085 PERFORM_API void SNDStop(int tag);
00086 
00087 PERFORM_API void SNDPause(int tag);
00088 
00089 PERFORM_API void SNDResume(int tag);
00090 
00091 PERFORM_API int SNDUnreserve(int dunno);
00092 
00093 PERFORM_API void SNDTerminate(void);
00094 
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098