Revert my last couple commits because they don't meet a robot's code formatting standards.

This commit is contained in:
arcum42 2018-08-24 19:34:48 -07:00
parent 33db759a77
commit 78282c7ed7
5 changed files with 42 additions and 91 deletions

View File

@ -81,8 +81,6 @@ static u32 SdlOutputAPI = 0;
int numSpeakers = 0;
int dplLevel = 0;
bool temp_debug_state;
/*****************************************************************************/
void ReadSettings()
@ -223,14 +221,6 @@ void debug_dialog()
#if defined(__unix__)
static void toggle_sensitivity(GtkWidget *widget, gpointer data)
{
GtkButton *btn = static_cast<GtkButton *>(data);
temp_debug_state = !temp_debug_state;
gtk_widget_set_sensitive(GTK_WIDGET(btn), temp_debug_state);
}
static void cb_adjust_latency(GtkComboBox *widget, gpointer data)
{
GtkRange *range = static_cast<GtkRange *>(data);
@ -244,13 +234,14 @@ void DisplayDialog()
int return_value;
GtkWidget *dialog;
GtkWidget *main_box;
GtkWidget *main_frame, *main_box;
GtkWidget *mixing_frame, *mixing_box;
GtkWidget *int_label, *int_box;
GtkWidget *effects_check;
GtkWidget *dealias_filter;
GtkWidget *debug_check, *debug_button, *debug_frame, *debug_box;
GtkWidget *debug_check;
GtkWidget *debug_button;
GtkWidget *output_frame, *output_box;
GtkWidget *mod_label, *mod_box;
@ -259,7 +250,6 @@ void DisplayDialog()
GtkWidget *sdl_api_label, *sdl_api_box;
#endif
GtkWidget *latency_label, *latency_slide;
GtkWidget *volume_label, *volume_slide;
GtkWidget *sync_label, *sync_box;
GtkWidget *advanced_button;
@ -268,8 +258,8 @@ void DisplayDialog()
"SPU2-X Config",
NULL, /* parent window*/
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
"Cancel", GTK_RESPONSE_REJECT,
"OK", GTK_RESPONSE_ACCEPT,
"Cancel", GTK_RESPONSE_REJECT,
NULL);
int_label = gtk_label_new("Interpolation:");
@ -326,14 +316,6 @@ void DisplayDialog()
#endif
gtk_range_set_value(GTK_RANGE(latency_slide), SndOutLatencyMS);
volume_label = gtk_label_new("Volume:");
#if GTK_MAJOR_VERSION < 3
volume_slide = gtk_hscale_new_with_range(0, 100, 5);
#else
volume_slide = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 100, 5);
#endif
gtk_range_set_value(GTK_RANGE(volume_slide), FinalVolume * 100);
sync_label = gtk_label_new("Synchronization Mode:");
sync_box = gtk_combo_box_text_new();
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(sync_box), "TimeStretch (Recommended)");
@ -348,6 +330,8 @@ void DisplayDialog()
#else
main_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
#endif
main_frame = gtk_frame_new("SPU2-X Config");
gtk_container_add(GTK_CONTAINER(main_frame), main_box);
#if GTK_MAJOR_VERSION < 3
mixing_box = gtk_vbox_new(false, 5);
@ -355,7 +339,6 @@ void DisplayDialog()
mixing_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
#endif
mixing_frame = gtk_frame_new("Mixing Settings:");
gtk_container_add(GTK_CONTAINER(mixing_frame), mixing_box);
#if GTK_MAJOR_VERSION < 3
@ -364,25 +347,14 @@ void DisplayDialog()
output_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
#endif
output_frame = gtk_frame_new("Output Settings:");
#if GTK_MAJOR_VERSION < 3
debug_box = gtk_vbox_new(false, 5);
#else
debug_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
#endif
debug_frame = gtk_frame_new("Debug Settings:");
gtk_container_add(GTK_CONTAINER(debug_box), debug_check);
gtk_container_add(GTK_CONTAINER(debug_box), debug_button);
gtk_container_add(GTK_CONTAINER(debug_frame), debug_box);
gtk_container_add(GTK_CONTAINER(output_frame), output_box);
gtk_container_add(GTK_CONTAINER(mixing_box), int_label);
gtk_container_add(GTK_CONTAINER(mixing_box), int_box);
gtk_container_add(GTK_CONTAINER(mixing_box), effects_check);
gtk_container_add(GTK_CONTAINER(mixing_box), dealias_filter);
gtk_container_add(GTK_CONTAINER(mixing_box), debug_frame);
gtk_container_add(GTK_CONTAINER(mixing_box), debug_check);
gtk_container_add(GTK_CONTAINER(mixing_box), debug_button);
gtk_container_add(GTK_CONTAINER(output_box), mod_label);
gtk_container_add(GTK_CONTAINER(output_box), mod_box);
@ -396,25 +368,21 @@ void DisplayDialog()
gtk_container_add(GTK_CONTAINER(output_box), sync_box);
gtk_container_add(GTK_CONTAINER(output_box), latency_label);
gtk_container_add(GTK_CONTAINER(output_box), latency_slide);
gtk_container_add(GTK_CONTAINER(output_box), volume_label);
gtk_container_add(GTK_CONTAINER(output_box), volume_slide);
gtk_container_add(GTK_CONTAINER(output_box), advanced_button);
gtk_box_pack_start(GTK_BOX(main_box), mixing_frame, TRUE, TRUE, 5);
gtk_box_pack_start(GTK_BOX(main_box), output_frame, TRUE, TRUE, 5);
gtk_container_add(GTK_CONTAINER(main_box), mixing_frame);
gtk_container_add(GTK_CONTAINER(main_box), output_frame);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(effects_check), EffectsDisabled);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dealias_filter), postprocess_filter_dealias);
//FinalVolume;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(debug_check), DebugEnabled);
gtk_widget_set_sensitive(GTK_WIDGET(debug_button), DebugEnabled);
temp_debug_state = DebugEnabled;
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_box);
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_frame);
gtk_widget_show_all(dialog);
g_signal_connect(sync_box, "changed", G_CALLBACK(cb_adjust_latency), latency_slide);
g_signal_connect_swapped(advanced_button, "clicked", G_CALLBACK(advanced_dialog), advanced_button);
g_signal_connect(debug_check, "clicked", G_CALLBACK(toggle_sensitivity), debug_button);
g_signal_connect_swapped(debug_button, "clicked", G_CALLBACK(debug_dialog), debug_button);
return_value = gtk_dialog_run(GTK_DIALOG(dialog));
@ -426,6 +394,7 @@ void DisplayDialog()
Interpolation = gtk_combo_box_get_active(GTK_COMBO_BOX(int_box));
EffectsDisabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(effects_check));
//FinalVolume;
if (gtk_combo_box_get_active(GTK_COMBO_BOX(mod_box)) != -1)
OutputModule = gtk_combo_box_get_active(GTK_COMBO_BOX(mod_box));
@ -464,7 +433,7 @@ void DisplayDialog()
SDLOut->SetApiSettings(wxString(SDL_GetAudioDriver(SdlOutputAPI), wxConvUTF8));
}
#endif
FinalVolume = gtk_range_get_value(GTK_RANGE(volume_slide)) / 100;
SndOutLatencyMS = gtk_range_get_value(GTK_RANGE(latency_slide));
if (gtk_combo_box_get_active(GTK_COMBO_BOX(sync_box)) != -1)

View File

@ -92,7 +92,7 @@ namespace SoundtouchCfg
void ReadSettings();
void WriteSettings();
void DisplayDialog();
}; // namespace SoundtouchCfg
};
void ReadSettings();
void WriteSettings();

View File

@ -161,7 +161,7 @@ void DisplayDialog()
int return_value;
GtkWidget *msg_box, *log_box, *dump_box, *main_box;
GtkWidget *msg_frame, *log_frame, *dump_frame;
GtkWidget *msg_frame, *log_frame, *dump_frame, *main_frame;
GtkWidget *msg_console_check, *msg_key_check, *msg_voice_check, *msg_dma_check;
GtkWidget *msg_autodma_check, *msg_overrun_check, *msg_cache_check;
@ -176,23 +176,17 @@ void DisplayDialog()
"Spu2-X Config",
NULL, // parent window
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
"Cancel", GTK_RESPONSE_REJECT,
"OK", GTK_RESPONSE_ACCEPT,
"Cancel", GTK_RESPONSE_REJECT,
NULL);
#if GTK_MAJOR_VERSION < 3
main_box = gtk_hbox_new(false, 5);
#else
main_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
#endif
main_frame = gtk_frame_new("Spu2-X Config");
gtk_container_add(GTK_CONTAINER(main_frame), main_box);
// Message Section
#if GTK_MAJOR_VERSION < 3
msg_box = gtk_vbox_new(false, 5);
#else
msg_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
#endif
msg_console_check = gtk_check_button_new_with_label("Show In Console");
msg_key_check = gtk_check_button_new_with_label("KeyOn/Off Events");
@ -221,12 +215,8 @@ void DisplayDialog()
msg_frame = gtk_frame_new("Message/Log Options");
gtk_container_add(GTK_CONTAINER(msg_frame), msg_box);
// Log Section
#if GTK_MAJOR_VERSION < 3
// Log Section
log_box = gtk_vbox_new(false, 5);
#else
log_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
#endif
log_access_check = gtk_check_button_new_with_label("Log Register/DMA Actions");
log_dma_check = gtk_check_button_new_with_label("Log DMA Writes");
@ -243,12 +233,8 @@ void DisplayDialog()
log_frame = gtk_frame_new("Log Options");
gtk_container_add(GTK_CONTAINER(log_frame), log_box);
// Dump Section
#if GTK_MAJOR_VERSION < 3
// Dump Section
dump_box = gtk_vbox_new(false, 5);
#else
dump_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
#endif
dump_core_check = gtk_check_button_new_with_label("Dump Core and Voice State");
dump_mem_check = gtk_check_button_new_with_label("Dump Memory Contents");
@ -272,7 +258,7 @@ void DisplayDialog()
gtk_container_add(GTK_CONTAINER(main_box), dump_frame);
// Add all our widgets, and show everything we've added to the dialog.
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_box);
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_frame);
gtk_widget_show_all(dialog);
return_value = gtk_dialog_run(GTK_DIALOG(dialog));
@ -304,4 +290,4 @@ void DisplayDialog()
{
}
#endif
} // namespace DebugConfig
}

View File

@ -87,7 +87,7 @@ void restore_defaults()
void DisplayDialog()
{
int return_value;
GtkWidget *dialog, *main_label, *adv_box;
GtkWidget *dialog, *main_label, *main_frame, *main_box;
GtkWidget *default_button;
ReadSettings();
@ -97,11 +97,11 @@ void DisplayDialog()
"Advanced Settings",
NULL, /* parent window*/
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
"Cancel", GTK_RESPONSE_REJECT,
"OK", GTK_RESPONSE_ACCEPT,
"Cancel", GTK_RESPONSE_REJECT,
NULL);
main_label = gtk_label_new("These are advanced configuration options for fine tuning time stretching behavior. \nLarger values are better for slowdown, while smaller values are better for speedup (more then 60 fps.). \nAll options are in microseconds.");
main_label = gtk_label_new("These are advanced configuration options fine tuning time stretching behavior. Larger values are better for slowdown, while smaller values are better for speedup (more then 60 fps.). All options are in microseconds.");
gtk_label_set_line_wrap(GTK_LABEL(main_label), true);
default_button = gtk_button_new_with_label("Reset to Defaults");
@ -130,28 +130,24 @@ void DisplayDialog()
#endif
gtk_range_set_value(GTK_RANGE(over_slide), OverlapMS);
#if GTK_MAJOR_VERSION < 3
adv_box = gtk_vbox_new(false, 5);
#else
adv_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
#endif
main_box = gtk_vbox_new(false, 5);
main_frame = gtk_frame_new("Spu2-X Config");
gtk_box_pack_start(GTK_BOX(adv_box), main_label, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(adv_box), default_button, TRUE, TRUE, 5);
gtk_container_add(GTK_CONTAINER(main_box), default_button);
gtk_container_add(GTK_CONTAINER(main_box), seq_label);
gtk_container_add(GTK_CONTAINER(main_box), seq_slide);
gtk_container_add(GTK_CONTAINER(main_box), seek_label);
gtk_container_add(GTK_CONTAINER(main_box), seek_slide);
gtk_container_add(GTK_CONTAINER(main_box), over_label);
gtk_container_add(GTK_CONTAINER(main_box), over_slide);
gtk_container_add(GTK_CONTAINER(main_frame), main_box);
gtk_box_pack_start(GTK_BOX(adv_box), seq_label, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(adv_box), seq_slide, TRUE, TRUE, 5);
gtk_box_pack_start(GTK_BOX(adv_box), seek_label, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(adv_box), seek_slide, TRUE, TRUE, 5);
gtk_box_pack_start(GTK_BOX(adv_box), over_label, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(adv_box), over_slide, TRUE, TRUE, 5);
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), adv_box);
g_signal_connect_swapped(default_button, "clicked", G_CALLBACK(restore_defaults), default_button);
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_label);
gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), main_frame);
gtk_widget_show_all(dialog);
g_signal_connect_swapped(default_button, "clicked", G_CALLBACK(restore_defaults), default_button);
return_value = gtk_dialog_run(GTK_DIALOG(dialog));
if (return_value == GTK_RESPONSE_ACCEPT) {
@ -173,4 +169,4 @@ void restore_defaults()
{
}
#endif
} // namespace SoundtouchCfg
}

View File

@ -26,7 +26,7 @@ namespace DebugConfig
extern void ReadSettings();
extern void WriteSettings();
extern void DisplayDialog();
} // namespace DebugConfig
}
extern void CfgSetSettingsDir(const char *dir);
extern void CfgSetLogDir(const char *dir);