xref: /haiku/src/apps/cortex/addons/AudioAdapter/AudioAdapterNode.h (revision 893988af824e65e49e55f517b157db8386e8002b)
1 // AudioAdapterNode.h
2 #ifndef AUDIO_ADAPTER_NODE_H
3 #define AUDIO_ADAPTER_NODE_H
4 
5 
6 #include "AudioFilterNode.h"
7 #include "AudioAdapterParams.h"
8 
9 
10 class _AudioAdapterNode : public AudioFilterNode {
11 	typedef	AudioFilterNode _inherited;
12 
13 	public:	// ctor/dtor
14 		virtual ~_AudioAdapterNode();
15 		_AudioAdapterNode(const char* name, IAudioOpFactory* opFactory,
16 			BMediaAddOn* addOn = 0);
17 
18 	public:	// AudioFilterNode
19 		status_t getRequiredInputFormat(media_format& ioFormat);
20 		status_t getPreferredInputFormat(media_format& ioFormat);
21 		status_t getRequiredOutputFormat(media_format& ioFormat);
22 
23 		status_t getPreferredOutputFormat(media_format& ioFormat);
24 
25 		status_t validateProposedInputFormat(
26 			const media_format& preferredFormat,
27 			media_format& ioProposedFormat);
28 
29 		status_t validateProposedOutputFormat(
30 			const media_format&	preferredFormat,
31 			media_format& ioProposedFormat);
32 
33 		virtual void SetParameterValue(int32 id, bigtime_t changeTime,
34 			const void* value, size_t size); //nyi
35 
36 	public:	// BBufferProducer/Consumer
37 		virtual status_t Connected(const media_source&	source,
38 			const media_destination& destination,
39 			const media_format& format,
40 			media_input* outInput);
41 
42 		virtual void Connect(status_t status, const media_source& source,
43 			const media_destination& destination,
44 			const media_format& format,
45 			char* ioName);
46 
47 	private:
48 		void _attemptInputFormatChange(
49 		const media_multi_audio_format& format); //nyi
50 
51 		void _attemptOutputFormatChange(
52 			const media_multi_audio_format& format); //nyi
53 
54 		void _broadcastInputFormatParams();
55 		void _broadcastOutputFormatParams();
56 };
57 
58 #endif	// AUDIO_ADAPTER_NODE_H
59