2 * Copyright 2000-2006 Ingo Weinhold <ingo_weinhold@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT licensce.
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
;
25 class AudioAdapter
: public AudioReader
{
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;
39 void _ConvertChannels(void* buffer
,
43 AudioReader
* fFinalConverter
;
44 AudioFormatConverter
* fFormatConverter
;
45 AudioChannelConverter
* fChannelConverter
;
46 AudioResampler
* fResampler
;
49 #endif // AUDIO_ADAPTER_H