#include <mmsaudioctrl.h>
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)? | |
Definition at line 55 of file mmsaudioctrl.h.
| 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.
| channel | [in] audio channel |
Definition at line 57 of file mmsaudioctrl.cpp.
| MMSAudioCtrl::~MMSAudioCtrl | ( | ) |
| void MMSAudioCtrl::setVolume | ( | int | count | ) |
Sets the volume of the audio device.
| count | [in] volume in percent |
Definition at line 144 of file mmsaudioctrl.cpp.
| int MMSAudioCtrl::getVolume | ( | bool | dfCard = false |
) |
Returns the currently set volume.
| dfCard | [in] get the volume directly from card? |
Definition at line 173 of file mmsaudioctrl.cpp.
| void MMSAudioCtrl::volumeUp | ( | int | count = 10 |
) |
Turns up the volume.
| 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.
| count | [in] value in percent to decrease |
Definition at line 203 of file mmsaudioctrl.cpp.
| bool MMSAudioCtrl::isMute | ( | ) |
Checks if sound is muted.
Definition at line 212 of file mmsaudioctrl.cpp.
| void MMSAudioCtrl::mute | ( | ) |
snd_mixer_t * MMSAudioCtrl::handle = NULL [static, private] |
snd_mixer_elem_t * MMSAudioCtrl::elem = NULL [static, private] |
string MMSAudioCtrl::card = "default" [static, private] |
int MMSAudioCtrl::volume = -1 [static, private] |
long MMSAudioCtrl::xval = -1 [static, private] |
bool MMSAudioCtrl::muteFlag = false [static, private] |
long MMSAudioCtrl::pmin [static, private] |
Definition at line 63 of file mmsaudioctrl.h.
long MMSAudioCtrl::pmax [static, private] |
string MMSAudioCtrl::channel = "" [static, private] |
bool MMSAudioCtrl::isSwitchable = false [static, private] |