From 76732a03ed7c6c8b1ff38e95807dc0eddca5874f Mon Sep 17 00:00:00 2001 From: alvinwong Date: Thu, 20 Feb 2014 13:58:00 +0000 Subject: [PATCH] Linux (gtk): Add sound interpolation option. --- desmume/src/gtk/main.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 06c51660a..4b8322f7b 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -284,6 +284,11 @@ static const char *ui_description = " " #endif " " +" " +" " +" " +" " +" " " " " " " " @@ -380,6 +385,7 @@ static const GtkActionEntry action_entries[] = { { "ConfigMenu", NULL, "_Config" }, { "SPUModeMenu", NULL, "_SPU Mode" }, + { "SPUInterpolationMenu", NULL, "Sound _Interpolation" }, { "FrameskipMenu", NULL, "_Frameskip" }, { "CheatMenu", NULL, "_Cheat" }, { "cheatsearch", NULL, "_Search", NULL, NULL, CheatSearch }, @@ -491,6 +497,12 @@ static const GtkRadioActionEntry spumode_entries[] = { { "SPUModeDualASync", NULL, "Dual Asynchronous", NULL, NULL, SPUMODE_DUALASYNC} }; +static const GtkRadioActionEntry spuinterpolation_entries[] = { + { "SPUInterpolationNone", NULL, "_None", NULL, NULL, SPUInterpolation_None }, + { "SPUInterpolationLinear", NULL, "_Linear", NULL, NULL, SPUInterpolation_Linear }, + { "SPUInterpolationCosine", NULL, "_Cosine", NULL, NULL, SPUInterpolation_Cosine } +}; + enum frameskip_enum { FRAMESKIP_0 = 0, FRAMESKIP_1 = 1, @@ -2133,6 +2145,11 @@ static void Modify_SPUMode(GtkAction *action, GtkRadioAction *current) } } +static void Modify_SPUInterpolation(GtkAction *action, GtkRadioAction *current) +{ + CommonSettings.spuInterpolationMode = (SPUInterpolationMode)gtk_radio_action_get_current_value(current); +} + static void Modify_Frameskip(GtkAction *action, GtkRadioAction *current) { autoFrameskipMax = gtk_radio_action_get_current_value(current) ; @@ -2780,6 +2797,8 @@ common_gtk_main( class configured_features *my_config) VideoFilterTypeID_None, G_CALLBACK(Modify_PriInterpolation), NULL); gtk_action_group_add_radio_actions(action_group, spumode_entries, G_N_ELEMENTS(spumode_entries), 0, G_CALLBACK(Modify_SPUMode), NULL); + gtk_action_group_add_radio_actions(action_group, spuinterpolation_entries, G_N_ELEMENTS(spuinterpolation_entries), + CommonSettings.spuInterpolationMode, G_CALLBACK(Modify_SPUInterpolation), NULL); gtk_action_group_add_radio_actions(action_group, frameskip_entries, G_N_ELEMENTS(frameskip_entries), 0, G_CALLBACK(Modify_Frameskip), NULL); gtk_action_group_add_radio_actions(action_group, rotation_entries, G_N_ELEMENTS(rotation_entries),