open_and_update_audio_file(): Always print file name on errors.
[paraslash.git] / fade.c
diff --git a/fade.c b/fade.c
index 38fcdfe..5fbd0dd 100644 (file)
--- a/fade.c
+++ b/fade.c
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (C) 1998-2010 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1998-2011 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -46,6 +46,7 @@ __printf_2_3 void para_log(__a_unused int ll, const char *fmt, ...)
  */
 static int open_mixer(void)
 {
  */
 static int open_mixer(void)
 {
+       PARA_INFO_LOG("opening %s\n", conf.mixer_device_arg);
        return para_open(conf.mixer_device_arg, O_RDWR, 42);
 }
 
        return para_open(conf.mixer_device_arg, O_RDWR, 42);
 }
 
@@ -124,6 +125,7 @@ static void fixup_mixer_channel_arg(void)
                case mixer_channel_arg_reclev: val = SOUND_MIXER_RECLEV; break;
                case mixer_channel_arg_igain: val = SOUND_MIXER_IGAIN; break;
                case mixer_channel_arg_ogain: val = SOUND_MIXER_OGAIN; break;
                case mixer_channel_arg_reclev: val = SOUND_MIXER_RECLEV; break;
                case mixer_channel_arg_igain: val = SOUND_MIXER_IGAIN; break;
                case mixer_channel_arg_ogain: val = SOUND_MIXER_OGAIN; break;
+               default: break;
        }
        conf.mixer_channel_arg = val;
 }
        }
        conf.mixer_channel_arg = val;
 }
@@ -343,15 +345,15 @@ int main(int argc, char *argv[])
        }
        fixup_mixer_channel_arg();
        switch (conf.mode_arg) {
        }
        fixup_mixer_channel_arg();
        switch (conf.mode_arg) {
-       case mode_arg_sleep:
-               ret = sweet_dreams();
-               break;
        case mode_arg_fade:
                ret = fade(conf.fade_vol_arg, conf.fade_time_arg);
                break;
        case mode_arg_snooze:
                ret = snooze();
                break;
        case mode_arg_fade:
                ret = fade(conf.fade_vol_arg, conf.fade_time_arg);
                break;
        case mode_arg_snooze:
                ret = snooze();
                break;
+       default: /* sleep mode */
+               ret = sweet_dreams();
+               break;
        }
        if (ret < 0)
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));
        }
        if (ret < 0)
                PARA_EMERG_LOG("%s\n", para_strerror(-ret));