xref: /haiku/src/apps/mediaplayer/media_node_framework/audio/AudioSupplier.h (revision 21258e2674226d6aa732321b6f8494841895af5f)
1 /*	Copyright 2000-2008, Ingo Weinhold <ingo_weinhold@gmx.de>,
2  *	All Rights Reserved. Distributed under the terms of the MIT license.
3  */
4 #ifndef AUDIO_SUPPLIER_H
5 #define AUDIO_SUPPLIER_H
6 
7 
8 /*!	This class is an interface used by the AudioProducer to retreive the
9 	audio data to be played. */
10 
11 
12 #include <MediaDefs.h>
13 
14 
15 class AudioProducer;
16 
17 class AudioSupplier {
18 public:
19 								AudioSupplier();
20 	virtual						~AudioSupplier();
21 
22 	virtual	void				SetAudioProducer(AudioProducer* producer);
23 
24 	virtual	status_t			InitCheck() const;
25 
26 	virtual bigtime_t			InitialLatency() const = 0;
27 
28 	virtual	status_t			GetFrames(void* buffer, int64 frameCount,
29 									bigtime_t startTime,
30 									bigtime_t endTime) = 0;
31 
32 	virtual	void				SetFormat(const media_format& format) = 0;
33 
34 protected:
35 	AudioProducer*				fAudioProducer;
36 };
37 
38 
39 #endif	// AUDIO_SUPPLIER_H
40