ReactOS  0.4.12-dev-57-g7050ac4
audio_producer.hpp
Go to the documentation of this file.
1 /* PROJECT: ReactOS sndrec32
2  * LICENSE: GPL - See COPYING in the top level directory
3  * FILE: base/applications/sndrec32/audio_producer.hpp
4  * PURPOSE: Audio producer
5  * PROGRAMMERS: Marco Pagliaricci (irc: rendar)
6  */
7 
8 #ifndef _AUDIOAUDBUF__H_
9 #define _AUDIOAUDBUF__H_
10 
11 #include "audio_def.hpp"
12 
14 
16 {
17  protected:
18  unsigned int bytes_played_;
19 
20  public:
21  /* Ctors */
22  audio_producer() : bytes_played_(0), play_finished(0)
23  {
24  }
25 
26  /* Dtor */
27  virtual ~audio_producer(void)
28  {
29  }
30 
31  /* Public Functions */
32 
33  /* reads N bytes from the buffer */
34  virtual unsigned int read(BYTE *, unsigned int) = 0;
35 
36  virtual bool finished(void) = 0;
37 
38  unsigned int bytes_played(void) const
39  {
40  return bytes_played_;
41  }
42 
43  void set_position(unsigned int pos)
44  {
45  bytes_played_ = pos;
46  }
47 
48  void set_position_start(void)
49  {
50  bytes_played_ = 0;
51  }
52 
53  void forward(unsigned int bytes)
54  {
55  bytes_played_ += bytes;
56  }
57 
58  void backward(unsigned int bytes)
59  {
60  bytes_played_ += bytes;
61  }
62 
64 };
65 
67 
68 #endif /* _AUDIOAUDBUF__H_ */
void set_position_start(void)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
virtual bool finished(void)=0
void backward(unsigned int bytes)
virtual ~audio_producer(void)
#define _AUDIO_NAMESPACE_START_
Definition: audio_def.hpp:24
unsigned int bytes_played(void) const
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
virtual unsigned int read(BYTE *, unsigned int)=0
void forward(unsigned int bytes)
unsigned char BYTE
Definition: ntddk_ex.h:96
void set_position(unsigned int pos)
#define _AUDIO_NAMESPACE_END_
Definition: audio_def.hpp:25
unsigned int bytes_played_
void(* play_finished)(void)