- Merge from trunk up to r45543
[reactos.git] / base / applications / sndrec32 / audio_resampler_acm.hpp
1 /* PROJECT: ReactOS sndrec32
2 * LICENSE: GPL - See COPYING in the top level directory
3 * FILE: base/applications/sndrec32/audio_resampler_acm.hpp
4 * PURPOSE: Windows ACM wrapper
5 * PROGRAMMERS: Marco Pagliaricci (irc: rendar)
6 */
7
8
9 #ifndef _AUDIORESAMPLERACM__H_
10 #define _AUDIORESAMPLERACM__H_
11
12
13
14 #include "audio_def.hpp"
15 #include "audio_receiver.hpp"
16 #include "audio_format.hpp"
17
18
19
20
21 _AUDIO_NAMESPACE_START_
22
23
24
25 //TODO: inherit from a base resampler?
26 class audio_resampler_acm : public audio_receiver
27 {
28
29 private:
30 void init_( void );
31
32
33 protected:
34
35
36 HACMSTREAM acm_stream;
37 ACMSTREAMHEADER acm_header;
38 DWORD src_buflen;
39 DWORD dst_buflen;
40 bool stream_opened;
41
42 audio_format audfmt_in;
43 audio_format audfmt_out;
44
45 float buf_secs;
46
47 WAVEFORMATEX wformat_src;
48 WAVEFORMATEX wformat_dst;
49
50
51
52
53 public:
54
55
56 //
57 // Ctors
58 //
59
60 audio_resampler_acm( audio_format fmt_in, audio_format fmt_out )
61 : acm_stream( 0 ), src_buflen( 0 ), dst_buflen( 0 ),
62 stream_opened( false ), audfmt_in( fmt_in ), audfmt_out( fmt_out ),
63 buf_secs( _AUDIO_DEFAULT_BUFSECS )
64
65 {
66
67
68 init_();
69
70
71 }
72
73
74
75
76
77 //
78 // Dtor
79 //
80
81 ~audio_resampler_acm( void )
82 { }
83
84
85
86 //
87 // Public functions
88 //
89
90 void open( void );
91 void close( void );
92
93
94
95 void audio_receive( unsigned char *, unsigned int );
96
97
98
99 };
100
101
102 _AUDIO_NAMESPACE_END_
103
104
105
106
107 #endif //ifdef _AUDIORESAMPLERACM_H_