#ifndef MIXER_CONTROL_H
#define MIXER_CONTROL_H
#include <MediaRoster.h>
class BContinuousParameter;
class BParameter;
class BParameterWeb;
#define VOLUME_USE_MIXER 0
#define VOLUME_USE_PHYS_OUTPUT 1
class MixerControl {
public:
MixerControl(int32 volumeWhich = VOLUME_USE_MIXER);
~MixerControl();
bool Connect(int32 volumeWhich, float* _value = NULL,
const char** _error = NULL);
bool Connected();
int32 VolumeWhich() const;
float Volume() const;
void SetVolume(float volume);
void ChangeVolumeBy(float value);
void SetMute(bool muted);
bool Mute();
float Minimum() const { return fMin; }
float Maximum() const { return fMax; }
media_node GainNode() { return fGainMediaNode; }
media_node MuteNode() { return fMuteMediaNode; }
private:
void _Disconnect();
int32 fVolumeWhich;
media_node fGainMediaNode;
media_node fMuteMediaNode;
BParameterWeb* fParameterWeb;
BContinuousParameter* fMixerParameter;
BParameter* fMuteParameter;
float fMin;
float fMax;
float fStep;
BMediaRoster* fRoster;
};
#endif