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

sparc_audiodrv.h

Go to the documentation of this file.
00001 //
00002 // /home/ms/sidplay/audio/RCS/sparc_audiodrv.h,v
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 
00013 //#if defined(sun) && defined(sparc)
00014 #if defined(solaris2)
00015   #include <sys/audioio.h>
00016 #else
00017   #include <sun/audioio.h>
00018 //  #include <sun/dbriio.h>
00019 #endif
00020 //#endif
00021 
00022 #include "mytypes.h"
00023 #include "emucfg.h"
00024 
00025 class audioDriver
00026 {
00027         
00028  public:  // --------------------------------------------------------- public
00029   
00030         bool IsThere();
00031         
00032         bool Open(udword freq, int precision, int channels,
00033                           int fragments, int fragBase);
00034         
00035         void Close();
00036         
00037         void Play(ubyte* buffer, int bufferSize);
00038 
00039         bool Reset()
00040         {
00041                 return false;  // not available
00042         }
00043         
00044         int GetAudioHandle()
00045         {
00046                 return audioHd;
00047         }
00048         
00049         udword GetFrequency()
00050     { 
00051                 return frequency;
00052     }
00053         
00054         int GetChannels()
00055     {
00056                 return channels;
00057     }
00058         
00059         int GetSamplePrecision()
00060     {
00061                 return precision;
00062     }
00063         
00064         int GetSampleEncoding()
00065     {
00066                 return encoding;
00067     }
00068         
00069         int GetBlockSize()
00070         {
00071                 return frequency;  //blockSize;
00072         }
00073         
00074         int GetFragments()
00075     {
00076                 return 1;  //fragments;
00077     }
00078         
00079         int GetFragSizeBase()
00080     {
00081                 return 0;  //fragSizeBase;
00082     }
00083         
00084         const char* GetErrorString()
00085         {
00086                 return errorString;
00087         }
00088                         
00089  private:  // ------------------------------------------------------- private
00090 
00091         const char AUDIODEVICE[] = "/dev/audio";
00092         int audioHd;
00093         
00094         const char* errorString;
00095         
00096         int blockSize;
00097         
00098         udword frequency;
00099         
00100         // These are constants/enums from ``libsidplay/include/emucfg.h''.
00101         int encoding;
00102         int precision;
00103         int channels;
00104 };
00105 
00106 
00107 #endif  // AUDIODRV_H

Generated on Tue Feb 8 04:14:16 2005 for Esidplay by doxygen 1.3.3