xref: /haiku/src/bin/desklink/MixerControl.h (revision 1b80286772b529a3d6de3bbeb0720c62e6a32fed)
1 /*
2  * Copyright 2003-2009, Haiku, Inc.
3  * Distributed under the terms of the MIT license.
4  *
5  * Authors:
6  *		Jérôme Duval
7  *		François Revol
8  */
9 #ifndef MIXER_CONTROL_H
10 #define MIXER_CONTROL_H
11 
12 
13 #include <MediaRoster.h>
14 
15 class BParameterWeb;
16 class BContinuousParameter;
17 
18 
19 // The volume which choices
20 #define VOLUME_USE_MIXER		0 // default
21 #define VOLUME_USE_PHYS_OUTPUT	1
22 
23 
24 class MixerControl {
25 public:
26 							MixerControl(int32 volumeWhich,
27 								float* _value = NULL,
28 								const char** _error = NULL);
29 							~MixerControl();
30 
31 			int32			VolumeWhich() const;
32 			float			Volume() const;
33 
34 			void			SetVolume(float volume);
35 			void			ChangeVolumeBy(float value);
36 
37 			float			Minimum() const { return fMin; }
38 			float			Maximum() const { return fMax; }
39 
40 			media_node		GainNode() { return fGainMediaNode; }
41 
42 private:
43 			int32			fVolumeWhich;
44 			media_node		fGainMediaNode;
45 			BParameterWeb*	fParameterWeb;
46 			BContinuousParameter* fMixerParameter;
47 			float			fMin;
48 			float			fMax;
49 			float			fStep;
50 };
51 
52 #endif	// MIXER_CONTROL_H
53