Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

SolarisDspSource.h

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002 
00003    Copyright (c) 2000 Tyrell Corporation. All rights reserved.
00004 
00005    Tyrell DarkIce
00006 
00007    File     : SolarisDspSource.h
00008    Version  : $Revision: 1.5 $
00009    Author   : $Author: darkeye $
00010    Location : $Source: /cvsroot/darkice/darkice/src/SolarisDspSource.h,v $
00011    
00012    Copyright notice:
00013 
00014     This program is free software; you can redistribute it and/or
00015     modify it under the terms of the GNU General Public License  
00016     as published by the Free Software Foundation; either version 2
00017     of the License, or (at your option) any later version.
00018    
00019     This program is distributed in the hope that it will be useful,
00020     but WITHOUT ANY WARRANTY; without even the implied warranty of 
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
00022     GNU General Public License for more details.
00023    
00024     You should have received a copy of the GNU General Public License
00025     along with this program; if not, write to the Free Software
00026     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 
00028 ------------------------------------------------------------------------------*/
00029 #ifndef SOLARIS_DSP_SOURCE_H
00030 #define SOLARIS_DSP_SOURCE_H
00031 
00032 #ifndef __cplusplus
00033 #error This is a C++ include file
00034 #endif
00035 
00036 
00037 /* ============================================================ include files */
00038 
00039 #include "Reporter.h"
00040 #include "AudioSource.h"
00041 
00042 
00043 /* ================================================================ constants */
00044 
00045 
00046 /* =================================================================== macros */
00047 
00048 
00049 /* =============================================================== data types */
00050 
00057 class SolarisDspSource : public AudioSource, public virtual Reporter
00058 {
00059     private:
00060 
00064         char      * fileName;
00065 
00069         int         fileDescriptor;
00070 
00071 
00072     protected:
00073 
00079         inline
00080         SolarisDspSource ( void )                       throw ( Exception )
00081         {
00082             throw Exception( __FILE__, __LINE__);
00083         }
00084 
00091         void
00092         init (  const char    * name )              throw ( Exception );
00093 
00099         void
00100         strip ( void )                              throw ( Exception );
00101 
00102 
00103     public:
00104 
00116         inline
00117         SolarisDspSource (  const char    * name,
00118                             int             sampleRate    = 44100,
00119                             int             bitsPerSample = 16,
00120                             int             channel       = 2 )
00121                                                         throw ( Exception )
00122 
00123                     : AudioSource( sampleRate, bitsPerSample, channel)
00124         {
00125             init( name);
00126         }
00127 
00134         inline
00135         SolarisDspSource (  const SolarisDspSource &    sds )
00136                                                         throw ( Exception )
00137                     : AudioSource( sds )
00138         {
00139             init( sds.fileName);
00140         }
00141 
00147         inline virtual
00148         ~SolarisDspSource ( void )                          throw ( Exception )
00149         {
00150             strip();
00151         }
00152 
00160         inline virtual SolarisDspSource &
00161         operator= (     const SolarisDspSource &     ds )   throw ( Exception )
00162         {
00163             if ( this != &ds ) {
00164                 strip();
00165                 AudioSource::operator=( ds);
00166                 init( ds.fileName);
00167             }
00168             return *this;
00169         }
00170 
00176         virtual inline bool
00177         isBigEndian ( void ) const           throw ()
00178         {
00179 #ifdef WORDS_BIGENDIAN
00180             return true;
00181 #else
00182             return false;
00183 #endif
00184         }
00185 
00197         virtual bool
00198         open ( void )                                   throw ( Exception );
00199 
00205         inline virtual bool
00206         isOpen ( void ) const                           throw ()
00207         {
00208             return fileDescriptor != 0;
00209         }
00210 
00222         virtual bool
00223         canRead (               unsigned int    sec,
00224                                 unsigned int    usec )  throw ( Exception );
00225 
00235         virtual unsigned int
00236         read (                  void          * buf,
00237                                 unsigned int    len )   throw ( Exception );
00238 
00244         virtual void
00245         close ( void )                                  throw ( Exception );
00246 };
00247 
00248 
00249 /* ================================================= external data structures */
00250 
00251 
00252 /* ====================================================== function prototypes */
00253 
00254 
00255 
00256 #endif  /* SOLARIS_DSP_SOURCE_H */
00257 
00258 
00259 /*------------------------------------------------------------------------------
00260  
00261   $Source: /cvsroot/darkice/darkice/src/SolarisDspSource.h,v $
00262 
00263   $Log: SolarisDspSource.h,v $
00264   Revision 1.5  2005/04/14 11:53:17  darkeye
00265   fixed API documentation issues
00266 
00267   Revision 1.4  2004/02/19 06:47:06  darkeye
00268   finalized OpenBSD port
00269 
00270   Revision 1.3  2004/02/18 21:08:11  darkeye
00271   ported to OpenBSD (real-time scheduling not yet supported)
00272 
00273   Revision 1.2  2001/09/18 14:57:19  darkeye
00274   finalized Solaris port
00275 
00276   Revision 1.1  2001/09/11 15:05:21  darkeye
00277   added Solaris support
00278 
00279   
00280 ------------------------------------------------------------------------------*/
00281 

Generated on Sat Oct 22 13:17:05 2005 for DarkIce by  doxygen 1.4.4