00001 00011 #ifndef AUDIODRV_H 00012 #define AUDIODRV_H 00013 00014 00015 #include <e32std.h> 00016 00017 #ifdef __ER6__ 00018 #include <mdasound.h> 00019 #else 00020 #include <d32snd.h> 00021 #endif 00022 00023 #include "mytypes.h" 00024 #include "emucfg.h" 00025 00026 00033 class audioDriver 00034 { 00035 public: 00036 audioDriver(); 00037 ~audioDriver(); 00038 bool IsThere(); 00039 bool Open(udword freq, int precision, int channels, int fragments, int fragBase); 00040 void Close(); 00041 void Play(ubyte* buffer, int bufferSize); 00042 TInt VolumeDelta(TInt aDelta); 00043 00044 bool Reset() 00045 { 00046 return 0; //TODO - ALFRED 00047 } 00048 00049 int GetAudioHandle(){return audioHd;} 00050 udword GetFrequency(){return frequency;} 00051 int GetChannels(){return channels;} 00052 int GetSamplePrecision(){return precision;} 00053 int GetSampleEncoding(){return encoding;} 00054 int GetBlockSize(){return blockSize;} 00055 int GetFragments(){return fragments;} 00056 int GetFragSizeBase(){return fragSizeBase;} 00057 const char* GetErrorString(){return errorString;} 00058 00059 private: // ------------------------------------------------------- private 00060 int audioHd; 00061 const char* errorString; 00062 int blockSize; 00063 int fragments; 00064 int fragSizeBase; 00065 udword frequency; 00066 00067 // These are constants/enums from ``libsidplay/include/emucfg.h''. 00068 int encoding; 00069 int precision; 00070 int channels; 00071 00072 #ifdef __ER6__ 00073 RMdaDevSound iDevSound; 00074 #else 00075 // Epoc specific stuff 00076 RDevSound iDevSound; 00077 HBufC8* iAlawBuffer; 00078 #endif 00079 00080 }; 00081 00082 00083 #endif // AUDIODRV_H