btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / apps / mediaplayer / supplier / ProxyAudioSupplier.h
blob9db03cb84393f35b4d841fa9bfe427997234f800
1 /*
2 * Copyright 2008 Stephan Aßmus <superstippi@gmx.de>
3 * All Rights Reserved. Distributed under the terms of the MIT license.
4 */
5 #ifndef PROXY_AUDIO_SUPPLIER_H
6 #define PROXY_AUDIO_SUPPLIER_H
9 #include <Locker.h>
11 #include "AudioResampler.h"
12 #include "AudioSupplier.h"
15 class AudioTrackSupplier;
16 class AudioVolumeConverter;
17 class PlaybackManager;
20 class ProxyAudioSupplier : public AudioSupplier {
21 public:
22 ProxyAudioSupplier(
23 PlaybackManager* playbackManager);
24 virtual ~ProxyAudioSupplier();
26 // AudioSupplier interface
27 virtual status_t GetFrames(void* buffer, int64 frameCount,
28 bigtime_t startTime, bigtime_t endTime);
30 virtual bigtime_t InitialLatency() const;
31 virtual void SetFormat(const media_format& format);
32 virtual const media_format& Format() const;
34 virtual status_t InitCheck() const;
36 // ProxyAudioSupplier
37 void SetSupplier(AudioTrackSupplier* supplier,
38 float videoFrameRate);
39 void SetVolume(float volume);
40 float Volume();
42 private:
43 int64 _AudioFrameForVideoFrame(int64 frame) const;
44 int64 _VideoFrameForAudioFrame(int64 frame) const;
45 int64 _AudioFrameForTime(bigtime_t time) const;
46 int64 _VideoFrameForTime(bigtime_t time) const;
48 void _ReadSilence(void* buffer, int64 frames) const;
49 void _ReverseFrames(void* buffer,
50 int64 frames) const;
51 void* _SkipFrames(void* buffer, int64 frames) const;
53 private:
54 mutable BLocker fSupplierLock;
56 PlaybackManager* fPlaybackManager;
57 float fVideoFrameRate;
58 float fVolume;
60 AudioTrackSupplier* fSupplier;
61 AudioReader* fAdapter;
62 AudioVolumeConverter* fVolumeConverter;
63 AudioResampler fAudioResampler;
67 #endif // PROXY_AUDIO_SUPPLIER_H