ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

audio_producer.hpp
Go to the documentation of this file.
00001 /* PROJECT:         ReactOS sndrec32
00002  * LICENSE:         GPL - See COPYING in the top level directory
00003  * FILE:            base/applications/sndrec32/audio_producer.hpp
00004  * PURPOSE:         Audio producer
00005  * PROGRAMMERS:     Marco Pagliaricci (irc: rendar)
00006  */
00007 
00008 #ifndef _AUDIOAUDBUF__H_
00009 #define _AUDIOAUDBUF__H_
00010 
00011 
00012 
00013 #include "audio_def.hpp"
00014 #include "audio_producer.hpp"
00015 
00016 
00017 
00018 
00019 
00020 
00021 _AUDIO_NAMESPACE_START_
00022 
00023 
00024 
00025 
00026 
00027 class audio_producer
00028 {
00029 
00030 
00031     protected:
00032         
00033         
00034         unsigned int bytes_played_;
00035 
00036 
00037 
00038 
00039 
00040     public:
00041 
00042 
00043         //
00044         // Ctors
00045         //
00046 
00047         audio_producer ( ) : bytes_played_( 0 ), play_finished ( 0 )
00048         {  }
00049 
00050 
00051         
00052 
00053 
00054 
00055 
00056 
00057         
00058         //
00059         // Dtor
00060         //
00061 
00062         virtual ~audio_producer( void )
00063         {  }
00064 
00065 
00066 
00067 
00068         //
00069         // Public Functions
00070         //
00071 
00072 
00073         //reads N bytes from the buffer
00074         virtual unsigned int read( BYTE *, unsigned int ) = 0;
00075 
00076         virtual bool finished ( void ) = 0;
00077 
00078 
00079 
00080 
00081         unsigned int bytes_played( void ) const
00082         {
00083             return bytes_played_;
00084         }
00085 
00086 
00087         void set_position( unsigned int pos )
00088         {
00089             bytes_played_ = pos;
00090         }
00091 
00092         void set_position_start( void )
00093         {
00094             bytes_played_ = 0 ;
00095         }
00096 
00097 
00098 
00099         void forward( unsigned int bytes )
00100         {
00101             bytes_played_ += bytes ;
00102         }
00103 
00104 
00105         void backward( unsigned int bytes )
00106         {
00107             bytes_played_ += bytes ;
00108         }
00109 
00110         void ( * play_finished )( void );
00111 
00112 
00113 
00114 
00115 };
00116 
00117 
00118 
00119 
00120 _AUDIO_NAMESPACE_END_
00121 
00122 
00123 
00124 
00125 
00126 
00127 #endif //ifdef _AUDIOAUDBUF__H_

Generated on Fri May 25 2012 04:15:49 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.