aboutsummaryrefslogtreecommitdiffstats
path: root/src/volume.c
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2005-03-15 23:18:23 +0000
committerWarren Dukes <warren.dukes@gmail.com>2005-03-15 23:18:23 +0000
commitd4352ac996743b9bab291bb76ae4dce8fc15f967 (patch)
tree7f84848799227f0169c30cddd7d65da787f2051e /src/volume.c
parentf72351705784aec1277d03c467cc57995c818b19 (diff)
downloadmpd-d4352ac996743b9bab291bb76ae4dce8fc15f967.tar.gz
mpd-d4352ac996743b9bab291bb76ae4dce8fc15f967.tar.xz
mpd-d4352ac996743b9bab291bb76ae4dce8fc15f967.zip
undo change 3081
git-svn-id: https://svn.musicpd.org/mpd/trunk@3085 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/volume.c')
-rw-r--r--src/volume.c114
1 files changed, 0 insertions, 114 deletions
diff --git a/src/volume.c b/src/volume.c
index 008aaac92..c16938042 100644
--- a/src/volume.c
+++ b/src/volume.c
@@ -63,9 +63,6 @@ char * volume_mixerDevice = VOLUME_MIXER_DEVICE_DEFAULT;
int volume_softwareSet = 100;
-int volume_fakeMuteStatus = 0;
-int volume_fakeLastUnmutedLevel = -1;
-
#ifdef HAVE_OSS
int volume_ossFd;
int volume_ossControl = SOUND_MIXER_PCM;
@@ -446,9 +443,6 @@ int changeSoftwareVolume(FILE * fp, int change, int rel) {
}
int changeVolumeLevel(FILE * fp, int change, int rel) {
- if(getVolumeMuteStatus())
- setVolumeMuteStatus(fp,0);
-
switch(volume_mixerType) {
#ifdef HAVE_ALSA
case VOLUME_MIXER_TYPE_ALSA:
@@ -465,111 +459,3 @@ int changeVolumeLevel(FILE * fp, int change, int rel) {
break;
}
}
-
-int getAlsaVolumeMuteStatus() {
- int err;
- int status;
-
- if((err = snd_mixer_selem_get_playback_switch(volume_alsaElem,
- SND_MIXER_SCHN_FRONT_LEFT,&status))<0) {
- WARNING("problems getting alsa mute status: %s\n",
- snd_strerror(err));
- return -1;
- }
-
- return !status;
-}
-
-int setAlsaVolumeMuteStatus(FILE * fp, int status) {
- int err;
-
- if(status == getVolumeMuteStatus())
- return 0;
-
- if((err = snd_mixer_selem_set_playback_switch_all(volume_alsaElem,
- !status))<0) {
- commandError(fp, ACK_ERROR_SYSTEM, "problems muting volume",
- NULL);
- WARNING("problems muting alsa volume: %s\n", snd_strerror(err));
- return -1;
- }
-
- return 0;
-}
-
-int getFakeVolumeMuteStatus() {
- return volume_fakeMuteStatus;
-}
-
-// Fake mute: just drop volume to 0
-int setFakeVolumeMuteStatus(FILE * fp, int status) {
- // Don't call changeVolumeLevel while volume_fakeMuteStatus is set!
- if(status && !getVolumeMuteStatus()) {
- // Mute
- int ret;
- volume_fakeLastUnmutedLevel = getVolumeLevel();
- ret = changeVolumeLevel(fp,0,0);
- volume_fakeMuteStatus = 1;
- return ret;
- }
- else if(!status && getVolumeMuteStatus()){
- // Unmute
- volume_fakeMuteStatus = 0;
- return changeVolumeLevel(fp,volume_fakeLastUnmutedLevel,0);
- }
- else {
- return 0;
- }
-}
-
-int getOssVolumeMuteStatus() {
- return getFakeVolumeMuteStatus();
-}
-
-int setOssVolumeMuteStatus(FILE * fp, int status) {
- return setFakeVolumeMuteStatus(fp,status);
-}
-
-int getSoftwareVolumeMuteStatus() {
- return getFakeVolumeMuteStatus();
-}
-
-int setSoftwareVolumeMuteStatus(FILE * fp, int status) {
- return setFakeVolumeMuteStatus(fp,status);
-}
-
-int getVolumeMuteStatus() {
- switch(volume_mixerType) {
-#ifdef HAVE_ALSA
- case VOLUME_MIXER_TYPE_ALSA:
- return getAlsaVolumeMuteStatus();
-#endif
-#ifdef HAVE_OSS
- case VOLUME_MIXER_TYPE_OSS:
- return getOssVolumeMuteStatus();
-#endif
- case VOLUME_MIXER_TYPE_SOFTWARE:
- return getSoftwareVolumeMuteStatus();
- default:
- return 0;
- break;
- }
-}
-
-int setVolumeMuteStatus(FILE * fp, int status) {
- switch(volume_mixerType) {
-#ifdef HAVE_ALSA
- case VOLUME_MIXER_TYPE_ALSA:
- return setAlsaVolumeMuteStatus(fp,status);
-#endif
-#ifdef HAVE_OSS
- case VOLUME_MIXER_TYPE_OSS:
- return setOssVolumeMuteStatus(fp,status);
-#endif
- case VOLUME_MIXER_TYPE_SOFTWARE:
- return setSoftwareVolumeMuteStatus(fp,status);
- default:
- return 0;
- break;
- }
-}