aboutsummaryrefslogtreecommitdiffstats
path: root/src/volume.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/volume.c')
-rw-r--r--src/volume.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/volume.c b/src/volume.c
index 49d7483cd..bf367ab75 100644
--- a/src/volume.c
+++ b/src/volume.c
@@ -144,8 +144,7 @@ int changeOssVolumeLevel(FILE * fp, int change, int rel) {
if (rel) {
if((current = getOssVolumeLevel()) < 0) {
- myfprintf(fp,"%s problem getting current volume\n",
- COMMAND_RESPOND_ERROR);
+ commandError(fp, "problem getting current volume");
return -1;
}
@@ -159,7 +158,7 @@ int changeOssVolumeLevel(FILE * fp, int change, int rel) {
level = (new << 8) + new;
if(ioctl(volume_ossFd,MIXER_WRITE(volume_ossControl),&level) < 0) {
- myfprintf(fp,"%s problems setting volume\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "problems setting volume");
return -1;
}
@@ -271,8 +270,7 @@ int changeAlsaVolumeLevel(FILE * fp, int change, int rel) {
if((err = snd_mixer_selem_get_playback_volume(volume_alsaElem,
SND_MIXER_SCHN_FRONT_LEFT,&level))<0) {
- myfprintf(fp,"%s problems getting volume\n",
- COMMAND_RESPOND_ERROR);
+ commandError(fp, "problems getting volume");
ERROR("problems getting alsa volume: %s\n",snd_strerror(err));
return -1;
}
@@ -298,8 +296,7 @@ int changeAlsaVolumeLevel(FILE * fp, int change, int rel) {
if((err = snd_mixer_selem_set_playback_volume_all(
volume_alsaElem,level))<0) {
- myfprintf(fp,"%s problems setting volume\n",
- COMMAND_RESPOND_ERROR);
+ commandError(fp, "problems setting volume");
ERROR("problems setting alsa volume: %s\n",snd_strerror(err));
return -1;
}
@@ -426,7 +423,7 @@ int changeVolumeLevel(FILE * fp, int change, int rel) {
case VOLUME_MIXER_TYPE_SOFTWARE:
return changeSoftwareVolume(fp,change,rel);
default:
- myfprintf(fp,"%s no volume support!\n",COMMAND_RESPOND_ERROR);
+ commandError(fp, "no volume support");
return -1;
}
}