diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-06-12 02:06:16 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-06-12 02:06:16 +0000 |
commit | 43b355734cf192129f2906789185301a61f4cd8a (patch) | |
tree | 35a3a56a085fc590b1864347d49660d421157305 /src/volume.c | |
parent | 43255a7f63af65d88bbead4c0d6429ef2008ada8 (diff) | |
download | mpd-43b355734cf192129f2906789185301a61f4cd8a.tar.gz mpd-43b355734cf192129f2906789185301a61f4cd8a.tar.xz mpd-43b355734cf192129f2906789185301a61f4cd8a.zip |
Add WARNING log method. it's the same as ERROR, except that when mpd starts,
warnings are buffered until the error log is opened, and then flushed to the
error log.
git-svn-id: https://svn.musicpd.org/mpd/trunk@1442 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/volume.c')
-rw-r--r-- | src/volume.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/volume.c b/src/volume.c index 42f72ba48..4a1370b2f 100644 --- a/src/volume.c +++ b/src/volume.c @@ -68,7 +68,7 @@ int prepOssMixer(char * device) { int devmask = 0; if((volume_ossFd = open(device,O_RDONLY))<0) { - ERROR("unable to open oss mixer \"%s\"\n",device); + WARNING("unable to open oss mixer \"%s\"\n",device); return -1; } @@ -78,7 +78,7 @@ int prepOssMixer(char * device) { int i,j; if(ioctl(volume_ossFd,SOUND_MIXER_READ_DEVMASK,&devmask)<0) { - ERROR("errors getting read_devmask for oss mixer\n"); + WARNING("errors getting read_devmask for oss mixer\n"); close(volume_ossFd); return -1; } @@ -96,13 +96,13 @@ int prepOssMixer(char * device) { } if(i>=SOUND_MIXER_NRDEVICES) { - ERROR("mixer control \"%s\" not found\n", + WARNING("mixer control \"%s\" not found\n", getConf()[CONF_MIXER_CONTROL]); close(volume_ossFd); return -1; } else if(!( ( 1 << i ) & devmask )) { - ERROR("mixer control \"%s\" not usable\n", + WARNING("mixer control \"%s\" not usable\n", getConf()[CONF_MIXER_CONTROL]); close(volume_ossFd); return -1; @@ -122,7 +122,7 @@ int getOssVolumeLevel() { int left, right, level; if(ioctl(volume_ossFd,MIXER_READ(volume_ossControl),&level) < 0) { - ERROR("unable to read volume\n"); + WARNING("unable to read volume\n"); return -1; } @@ -130,7 +130,7 @@ int getOssVolumeLevel() { right = (level & 0xff00) >> 8; if(left!=right) { - ERROR("volume for left and right is not the same, \"%i\" and " + WARNING("volume for left and right is not the same, \"%i\" and " "\"%i\"\n",left,right); } @@ -174,27 +174,27 @@ int prepAlsaMixer(char * card) { char * controlName = VOLUME_MIXER_ALSA_CONTROL_DEFAULT; if((err = snd_mixer_open(&volume_alsaMixerHandle,0))<0) { - ERROR("problems opening alsa mixer: %s\n",snd_strerror(err)); + WARNING("problems opening alsa mixer: %s\n",snd_strerror(err)); return -1; } if((err = snd_mixer_attach(volume_alsaMixerHandle,card))<0) { snd_mixer_close(volume_alsaMixerHandle); - ERROR("problems problems attaching alsa mixer: %s\n", + WARNING("problems problems attaching alsa mixer: %s\n", snd_strerror(err)); return -1; } if((err = snd_mixer_selem_register(volume_alsaMixerHandle,NULL,NULL))<0) { snd_mixer_close(volume_alsaMixerHandle); - ERROR("problems snd_mixer_selem_register'ing: %s\n", + WARNING("problems snd_mixer_selem_register'ing: %s\n", snd_strerror(err)); return -1; } if((err = snd_mixer_load(volume_alsaMixerHandle))<0) { snd_mixer_close(volume_alsaMixerHandle); - ERROR("problems snd_mixer_selem_register'ing: %s\n", + WARNING("problems snd_mixer_selem_register'ing: %s\n", snd_strerror(err)); return -1; } @@ -223,7 +223,7 @@ int prepAlsaMixer(char * card) { return 0; } - ERROR("can't find alsa mixer_control \"%s\"\n",controlName); + WARNING("can't find alsa mixer_control \"%s\"\n",controlName); snd_mixer_close(volume_alsaMixerHandle); return -1; @@ -244,7 +244,7 @@ int getAlsaVolumeLevel() { if((err = snd_mixer_selem_get_playback_volume(volume_alsaElem, SND_MIXER_SCHN_FRONT_LEFT,&level))<0) { - ERROR("problems getting alsa volume: %s\n",snd_strerror(err)); + WARNING("problems getting alsa volume: %s\n",snd_strerror(err)); return -1; } @@ -272,7 +272,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) { commandError(fp, ACK_ERROR_SYSTEM, "problems getting volume"); - ERROR("problems getting alsa volume: %s\n",snd_strerror(err)); + WARNING("problems getting alsa volume: %s\n",snd_strerror(err)); return -1; } @@ -298,7 +298,7 @@ int changeAlsaVolumeLevel(FILE * fp, int change, int rel) { if((err = snd_mixer_selem_set_playback_volume_all( volume_alsaElem,level))<0) { commandError(fp, ACK_ERROR_SYSTEM, "problems setting volume"); - ERROR("problems setting alsa volume: %s\n",snd_strerror(err)); + WARNING("problems setting alsa volume: %s\n",snd_strerror(err)); return -1; } @@ -365,7 +365,7 @@ void initVolume() { void openVolumeDevice() { if(prepMixer(volume_mixerDevice)<0) { - ERROR("using software volume\n"); + WARNING("using software volume\n"); volume_mixerType = VOLUME_MIXER_TYPE_SOFTWARE; } } |