Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

hpux_audiodrv.h

Go to the documentation of this file.
00001 //
00002 // 1997/09/27 21:38:01
00003 //
00004 
00005 #ifndef AUDIODRV_H
00006 #define AUDIODRV_H
00007 
00008 
00009 #include <unistd.h>
00010 #include <fcntl.h>
00011 #include <sys/ioctl.h>
00012 #include <sys/audio.h>
00013 
00014 #include "mytypes.h"
00015 #include "emucfg.h"
00016 
00017 class audioDriver
00018 {
00019         
00020  public:  // --------------------------------------------------------- public
00021   
00022         bool IsThere();
00023         
00024         bool Open(udword freq, int precision, int channels,
00025                           int fragments, int fragBase);
00026         
00027         void Close();
00028         
00029         void Play(ubyte* buffer, int bufferSize);
00030 
00031         bool Reset()
00032         {
00033                 return false;  // not available
00034         }
00035         
00036         int GetAudioHandle()
00037         {
00038                 return audioHd;
00039         }
00040         
00041         udword GetFrequency()
00042     { 
00043                 return frequency;
00044     }
00045         
00046         int GetChannels()
00047     {
00048                 return channels;
00049     }
00050         
00051         int GetSamplePrecision()
00052     {
00053                 return precision;
00054     }
00055         
00056         int GetSampleEncoding()
00057     {
00058                 return encoding;
00059     }
00060         
00061         int GetBlockSize()
00062         {
00063                 return blockSize;
00064         }
00065         
00066         int GetFragments()
00067     {
00068                 return 1;  //fragments;
00069     }
00070         
00071         int GetFragSizeBase()
00072         {
00073                 return 0;  //fragSizeBase;
00074         }
00075         
00076         const char* GetErrorString()
00077         {
00078                 return errorString;
00079         }
00080                         
00081  private:  // ------------------------------------------------------- private
00082 
00083     const char AUDIODEVICE[] = "/dev/audio";
00084         int audioHd;
00085         
00086         const char* errorString;
00087 
00088         int blockSize;
00089         
00090         udword frequency;
00091         
00092         // These are constants/enums from ``libsidplay/include/emucfg.h''.
00093         int encoding;
00094         int precision;
00095         int channels;
00096 };
00097 
00098 
00099 #endif  // AUDIODRV_H

Generated on Tue Feb 8 04:13:58 2005 for Esidplay by doxygen 1.3.3