wmmixer: dynamic exception specifications were removed in C++17.
[dockapps.git] / AlsaMixer.app / AMixer / AChannel.cc
blobbc2aeefc80babc34adefaa832fdef60d523be7bd
1 // AChannel.cc
2 //
3 // Copyright (C) 2004, Petr Hlavka
4 //
5 // SPDX-License-Identifier: GPL-2.0+
7 #include "AMixer.h"
8 #include "AItem.h"
9 #include "AChannel.h"
11 #include <iostream>
14 AChannel::AChannel(AItem *item, SNDCHID_T cID) {
15 aItem = item;
16 id = cID;
20 AChannel::~AChannel() {
24 long AChannel::getVolume() {
25 long vol = 0;
27 snd_mixer_selem_get_playback_volume(aItem->aElem, (SNDCHID_T) id, &vol);
29 return (vol);
33 // it isn't necessery when using snd_mixer_selem_set_x_volume_all
34 void AChannel::setVolume(long value) {
35 std::cerr << "AChannel::setVolume not implemented!" << std::endl;
39 bool AChannel::isMuted() {
40 int val;
42 if (!snd_mixer_selem_has_playback_switch(aItem->aElem)) {
43 return (false); /* can't be muted? isn't muted. */
45 snd_mixer_selem_get_playback_switch(aItem->aElem, (SNDCHID_T) id, &val);
47 return (! (bool) val);