]> git.alsa-project.org Git - alsa-tools.git/commitdiff
hdspmixer: Recall 1st preset on all cards, not just on the first
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>
Mon, 4 Apr 2011 12:34:29 +0000 (14:34 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 Apr 2011 06:22:33 +0000 (08:22 +0200)
With the new "store current settings to the virtual 9th preset" before
switching cards code, one needs to make sure the actual mixer state is
loaded with sane values, either from the preset file or a generic
builtin preset.

Calling preset_change(1) is sufficient, setting all the required data.
However, in case of more than one RME card in the system, one needs to
call this function for each card, otherwise, some of the cards store
uninitialized data to the 9th preset, resulting in a weird mixer state
afterwards.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
hdspmixer/src/HDSPMixerWindow.cxx

index 784819068267ba9c0b816f14cb461f75ebb5d24f..5a7dac09482174f565b47ea73ecd725b08264ada 100644 (file)
@@ -877,9 +877,10 @@ HDSPMixerWindow::HDSPMixerWindow(int x, int y, int w, int h, const char *label,
        printf("Initializing default presets\n");
        i = 0;
        while (i < MAX_CARDS && cards[i] != NULL) {
+           current_card = i;
            restoreDefaults(i++);
+           inputs->buttons->presets->preset_change(1);
        }
-       inputs->buttons->presets->preset_change(1);
     }
     Fl::atclose = atclose_cb;
     Fl::add_handler(handler_cb);