hdspmixer: Save preset before switching cards

When running with more than one card, switching cards would lose any
changes made to the current card. To avoid this inconvenience, save the
current settings to the virtual 9th preset and restore them when
switching back.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Adrian Knoth 2011-04-04 14:34:28 +02:00 committed by Takashi Iwai
parent 0b018d9a23
commit 7a865ce040
5 changed files with 47 additions and 1 deletions

View file

@ -48,9 +48,11 @@ void HDSPMixerCardSelector::draw()
void HDSPMixerCardSelector::ActivateCard (int i)
{
card = i + 1;
basew->stashPreset(); /* save current mixer state */
basew->current_card = i;
basew->cards[i]->setMode (basew->cards[i]->getSpeed ());
basew->setTitleWithFilename();
basew->unstashPreset(); /* restore previous mixer state */
redraw ();
}