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