Make UEFI boot-platform build again
[haiku.git] / src / bin / desklink / MixerControl.h
blob159ee38188258ae3acc360f4d554efbcfc89fa46
1 /*
2 * Copyright 2003-2013, Haiku, Inc.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Jérôme Duval
7 * François Revol
8 * Puck Meerburg, puck@puckipedia.nl
9 */
10 #ifndef MIXER_CONTROL_H
11 #define MIXER_CONTROL_H
14 #include <MediaRoster.h>
16 class BContinuousParameter;
17 class BParameter;
18 class BParameterWeb;
20 // The volume which choices
21 #define VOLUME_USE_MIXER 0 // default
22 #define VOLUME_USE_PHYS_OUTPUT 1
25 class MixerControl {
26 public:
27 MixerControl(int32 volumeWhich = VOLUME_USE_MIXER);
28 ~MixerControl();
30 bool Connect(int32 volumeWhich, float* _value = NULL,
31 const char** _error = NULL);
32 bool Connected();
34 int32 VolumeWhich() const;
35 float Volume() const;
37 void SetVolume(float volume);
38 void ChangeVolumeBy(float value);
40 void SetMute(bool muted);
41 bool Mute();
43 float Minimum() const { return fMin; }
44 float Maximum() const { return fMax; }
46 media_node GainNode() { return fGainMediaNode; }
47 media_node MuteNode() { return fMuteMediaNode; }
49 private:
50 void _Disconnect();
52 int32 fVolumeWhich;
53 media_node fGainMediaNode;
54 media_node fMuteMediaNode;
55 BParameterWeb* fParameterWeb;
56 BContinuousParameter* fMixerParameter;
57 BParameter* fMuteParameter;
58 float fMin;
59 float fMax;
60 float fStep;
61 BMediaRoster* fRoster;
64 #endif // MIXER_CONTROL_H