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