xref: /haiku/src/apps/mediaplayer/media_node_framework/audio/AudioChannelConverter.h (revision 02354704729d38c3b078c696adc1bbbd33cbcf72)
1 /*
2  * Copyright 2008 Stephan Aßmus <superstippi@gmx.de>
3  * All rights reserved. Distributed under the terms of the MIT licensce.
4  */
5 #ifndef AUDIO_CHANNEL_CONVERTER_H
6 #define AUDIO_CHANNEL_CONVERTER_H
7 
8 
9 /*! This AudioReader just converts the source channel count
10 	into another one, e.g. 1 -> 2. Frame rate and sample format
11 	remain unchanged.
12 */
13 
14 
15 #include "AudioReader.h"
16 
17 
18 class AudioChannelConverter : public AudioReader {
19 public:
20 								AudioChannelConverter(AudioReader* source,
21 									const media_format& format);
22 	virtual						~AudioChannelConverter();
23 
24 	virtual bigtime_t			InitialLatency() const;
25 	virtual	status_t			Read(void* buffer, int64 pos, int64 frames);
26 
27 	virtual	status_t			InitCheck() const;
28 
29 			AudioReader*		Source() const;
30 
31 protected:
32 			AudioReader*		fSource;
33 };
34 
35 #endif	// AUDIO_CHANNEL_CONVERTER_H
36