xref: /haiku/src/apps/cortex/addons/common/IParameterSet.h (revision c90684742e7361651849be4116d0e5de3a817194)
1 // IParameterSet.h
2 // * PURPOSE
3 //   An abstract parameter-collection object.  Can be shared
4 //   between a media node and one or more operations to simplify
5 //   realtime parameter automation.
6 //
7 // * HISTORY
8 //   e.moon		26aug99		Begun
9 
10 #ifndef __IParameterSet_H__
11 #define __IParameterSet_H__
12 
13 #include <ParameterWeb.h>
14 #include <SupportDefs.h>
15 
16 class IParameterSet {
17 
18 public:											// *** EXTERNAL INTERFACE
19 	virtual ~IParameterSet(); //nyi
20 	IParameterSet(); //nyi
21 
22 	// set parameter if the operation is stopped, or queue
23 	// parameter-change if it's running.
24 	// B_BAD_INDEX: invalid parameter ID
25 	// B_NO_MEMORY: too little data
26 	status_t setValue(
27 		int32										parameterID,
28 		bigtime_t								performanceTime,
29 		const void*							data,
30 		size_t									size); //nyi
31 
32 	// fetch last-changed value for the given parameter
33 	// B_BAD_INDEX: invalid parameter ID
34 	// B_NO_MEMORY: data buffer too small
35 	status_t getValue(
36 		int32										parameterID,
37 		bigtime_t*							lastChangeTime,
38 		void*										data,
39 		size_t*									ioSize); //nyi
40 
41 public:											// *** INTERNAL INTERFACE (HOOKS)
42 
43 	// write to and from this object (translating parameter ID to
44 	// member variable(s))
45 
46 	virtual status_t store(
47 		int32										parameterID,
48 		const void*							data,
49 		size_t									size) =0;
50 
51 	virtual status_t retrieve(
52 		int32										parameterID,
53 		void*										data,
54 		size_t*									ioSize) =0;
55 
56 	// implement this hook to return a BParameterGroup representing
57 	// the parameters represented by this set
58 
59 	virtual void populateGroup(
60 		BParameterGroup* 				group) =0;
61 
62 private:										// *** IMPLEMENTATION
63 
64 	// map of parameter ID -> change time +++++
65 };
66 
67 #endif /*__IParameterSet_H__*/
68