btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / mediaplayer / media_node_framework / audio / AudioAdapter.h
blob7afe62ec0d400b62dbae076f7a8dd330f3dd37e8
1 /*
2 * Copyright 2000-2006 Ingo Weinhold <ingo_weinhold@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT licensce.
4 */
5 #ifndef AUDIO_ADAPTER_H
6 #define AUDIO_ADAPTER_H
9 /*! This AudioReader slaves an AudioConverter and an AudioResampler
10 to convert the source data to a given format.
11 At this time the number of channels cannot be changed and the output
12 format byte order is set to the one of the host.
13 If input and output format are the same, the overhead is quit small.
17 #include "AudioReader.h"
20 class AudioChannelConverter;
21 class AudioFormatConverter;
22 class AudioResampler;
25 class AudioAdapter : public AudioReader {
26 public:
27 AudioAdapter(AudioReader* source,
28 const media_format& format);
29 virtual ~AudioAdapter();
31 virtual bigtime_t InitialLatency() const;
32 virtual status_t Read(void* buffer, int64 pos, int64 frames);
34 virtual status_t InitCheck() const;
36 AudioReader* Source() const;
38 protected:
39 void _ConvertChannels(void* buffer,
40 int64 frames) const;
42 AudioReader* fSource;
43 AudioReader* fFinalConverter;
44 AudioFormatConverter* fFormatConverter;
45 AudioChannelConverter* fChannelConverter;
46 AudioResampler* fResampler;
49 #endif // AUDIO_ADAPTER_H