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

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

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