MMSAudioCtrl Class Reference
[Media playback (mmsmedia)]

Controls the audio device. More...

#include <mmsaudioctrl.h>

List of all members.


Public Member Functions

 MMSAudioCtrl (string channel="")
 Constructor of MMSAudioCtrl class.
 ~MMSAudioCtrl ()
 Destructor of MMSAudioCtrl class.
void setVolume (int count)
 Sets the volume of the audio device.
int getVolume (bool dfCard=false)
 Returns the currently set volume.
void volumeUp (int count=10)
 Turns up the volume.
void volumeDown (int count=10)
 Turns down the volume.
bool isMute ()
 Checks if sound is muted.
void mute ()
 Mutes/unmutes the sound.

Static Private Attributes

static snd_mixer_t * handle = NULL
 alsa handle to mixer
static snd_mixer_elem_t * elem = NULL
 alsa mixer element handle
static string card = "default"
 card id
static int volume = -1
 volume (in percent)
static long xval = -1
 re-calculated volume for card
static bool muteFlag = false
 if true sound is muted
static long pmin
static long pmax
 range (not in percent)
static string channel = ""
 current audio channel
static bool isSwitchable = false
 has a switch (to mute)?

Detailed Description

Controls the audio device.

Author:
Stefan Schwarzer (stefan.schwarzer@diskohq.org)

Matthias Hardt (matthias.hardt@diskohq.org)

Jens Schneider (pupeider@gmx.de)

Guido Madaus (guido.madaus@diskohq.org)

Patrick Helterhoff (patrick.helterhoff@diskohq.org)

René Bählkow (rene.baehlkow@diskohq.org)

Definition at line 55 of file mmsaudioctrl.h.


Constructor & Destructor Documentation

MMSAudioCtrl::MMSAudioCtrl ( string  channel = ""  ) 

Constructor of MMSAudioCtrl class.

The first instance of this class assigns an audio channel, attaches to the mixer of the sound card and gets the current settings.

Parameters:
channel [in] audio channel

Definition at line 57 of file mmsaudioctrl.cpp.

MMSAudioCtrl::~MMSAudioCtrl (  ) 

Destructor of MMSAudioCtrl class.

Definition at line 132 of file mmsaudioctrl.cpp.


Member Function Documentation

void MMSAudioCtrl::setVolume ( int  count  ) 

Sets the volume of the audio device.

Parameters:
count [in] volume in percent
Note:
If count is less than 0 or more than 100 it will be set correctly to 0 or 100.

Definition at line 144 of file mmsaudioctrl.cpp.

int MMSAudioCtrl::getVolume ( bool  dfCard = false  ) 

Returns the currently set volume.

Parameters:
dfCard [in] get the volume directly from card?
Returns:
Volume in percent

Definition at line 173 of file mmsaudioctrl.cpp.

void MMSAudioCtrl::volumeUp ( int  count = 10  ) 

Turns up the volume.

Parameters:
count [in] value in percent to increase

Definition at line 194 of file mmsaudioctrl.cpp.

void MMSAudioCtrl::volumeDown ( int  count = 10  ) 

Turns down the volume.

Parameters:
count [in] value in percent to decrease

Definition at line 203 of file mmsaudioctrl.cpp.

bool MMSAudioCtrl::isMute (  ) 

Checks if sound is muted.

Returns:
true if sound is muted

Definition at line 212 of file mmsaudioctrl.cpp.

void MMSAudioCtrl::mute (  ) 

Mutes/unmutes the sound.

Definition at line 236 of file mmsaudioctrl.cpp.


Member Data Documentation

snd_mixer_t * MMSAudioCtrl::handle = NULL [static, private]

alsa handle to mixer

Definition at line 57 of file mmsaudioctrl.h.

snd_mixer_elem_t * MMSAudioCtrl::elem = NULL [static, private]

alsa mixer element handle

Definition at line 58 of file mmsaudioctrl.h.

string MMSAudioCtrl::card = "default" [static, private]

card id

Definition at line 59 of file mmsaudioctrl.h.

int MMSAudioCtrl::volume = -1 [static, private]

volume (in percent)

Definition at line 60 of file mmsaudioctrl.h.

long MMSAudioCtrl::xval = -1 [static, private]

re-calculated volume for card

Definition at line 61 of file mmsaudioctrl.h.

bool MMSAudioCtrl::muteFlag = false [static, private]

if true sound is muted

Definition at line 62 of file mmsaudioctrl.h.

long MMSAudioCtrl::pmin [static, private]

Definition at line 63 of file mmsaudioctrl.h.

long MMSAudioCtrl::pmax [static, private]

range (not in percent)

Definition at line 63 of file mmsaudioctrl.h.

string MMSAudioCtrl::channel = "" [static, private]

current audio channel

Definition at line 64 of file mmsaudioctrl.h.

bool MMSAudioCtrl::isSwitchable = false [static, private]

has a switch (to mute)?

Definition at line 65 of file mmsaudioctrl.h.


The documentation for this class was generated from the following files: