GTK: set individual mixers on slider change instead of restarting sound

* runs much nicer off of a live cd
This commit is contained in:
punkrockguy318 2010-03-03 06:10:40 +00:00
parent 6fd48a5e1b
commit 3e98bed606
1 changed files with 19 additions and 4 deletions

View File

@ -695,21 +695,36 @@ int mixerChanged(GtkWidget* w, gpointer p)
GtkWidget* parent = gtk_widget_get_parent(w);
char* lbl = (char*)gtk_frame_get_label(GTK_FRAME(parent));
if(strcmp(lbl, "Volume") == 0)
{
g_config->setOption("SDL.SoundVolume", v);
FCEUI_SetSoundVolume(v);
}
if(strcmp(lbl, "Triangle") == 0)
{
g_config->setOption("SDL.TriangleVolume", v);
FCEUI_SetTriangleVolume(v);
}
if(strcmp(lbl, "Square1") == 0)
{
g_config->setOption("SDL.Square1Volume", v);
FCEUI_SetSquare1Volume(v);
}
if(strcmp(lbl, "Square2") == 0)
{
g_config->setOption("SDL.Square2Volume", v);
FCEUI_SetSquare2Volume(v);
}
if(strcmp(lbl, "Noise") == 0)
{
g_config->setOption("SDL.NoiseVolume", v);
FCEUI_SetNoiseVolume(v);
}
if(strcmp(lbl, "PCM") == 0)
{
g_config->setOption("SDL.PCMVolume", v);
FCEUI_SetPCMVolume(v);
}
g_config->save();
KillSound();
InitSound();
return 0;
}