mirror of https://github.com/PCSX2/pcsx2.git
zerospu2: Redo the dialog, and get rid of all the crufty Glade 2 files.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3198 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
b207218975
commit
54b89a4717
|
@ -258,7 +258,6 @@ void DisplayDialog()
|
|||
}
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
|
||||
}
|
||||
|
||||
void configure()
|
||||
|
|
|
@ -50,10 +50,7 @@ set(zerospu2Headers
|
|||
|
||||
# zerospu2 Linux sources
|
||||
set(zerospu2LinuxSources
|
||||
# Linux/callbacks.c
|
||||
Linux/interface.c
|
||||
Linux/Linux.cpp
|
||||
Linux/support.c
|
||||
Targets/Alsa.cpp
|
||||
Targets/OSS.cpp
|
||||
# Targets/PortAudio.cpp
|
||||
|
@ -61,10 +58,7 @@ set(zerospu2LinuxSources
|
|||
|
||||
# zerospu2 Linux headers
|
||||
set(zerospu2LinuxHeaders
|
||||
Linux/callbacks.h
|
||||
Linux/interface.h
|
||||
Linux/Linux.h
|
||||
Linux/support.h
|
||||
Targets/Alsa.h
|
||||
Targets/OSS.h
|
||||
# Targets/PortAudio.h
|
||||
|
|
|
@ -20,116 +20,32 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
#include "callbacks.h"
|
||||
}
|
||||
|
||||
#include "Linux.h"
|
||||
#include "zerospu2.h"
|
||||
|
||||
extern char *libraryName;
|
||||
|
||||
GtkWidget *MsgDlg, *ConfDlg;
|
||||
GtkWidget *ConfDlg;
|
||||
|
||||
void OnMsg_Ok()
|
||||
void __forceinline SysMessage(const char *fmt, ...)
|
||||
{
|
||||
gtk_widget_destroy(MsgDlg);
|
||||
gtk_main_quit();
|
||||
}
|
||||
va_list list;
|
||||
char msg[512];
|
||||
|
||||
void SysMessage(char *fmt, ...)
|
||||
{
|
||||
GtkWidget *Ok,*Txt;
|
||||
GtkWidget *Box,*Box1;
|
||||
va_list list;
|
||||
char msg[512];
|
||||
va_start(list, fmt);
|
||||
vsprintf(msg, fmt, list);
|
||||
va_end(list);
|
||||
|
||||
va_start(list, fmt);
|
||||
vsprintf(msg, fmt, list);
|
||||
va_end(list);
|
||||
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
|
||||
|
||||
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
|
||||
|
||||
MsgDlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_position(GTK_WINDOW(MsgDlg), GTK_WIN_POS_CENTER);
|
||||
gtk_window_set_title(GTK_WINDOW(MsgDlg), "SPU2null Msg");
|
||||
gtk_container_set_border_width(GTK_CONTAINER(MsgDlg), 5);
|
||||
|
||||
Box = gtk_vbox_new(5, 0);
|
||||
gtk_container_add(GTK_CONTAINER(MsgDlg), Box);
|
||||
gtk_widget_show(Box);
|
||||
|
||||
Txt = gtk_label_new(msg);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(Box), Txt, FALSE, FALSE, 5);
|
||||
gtk_widget_show(Txt);
|
||||
|
||||
Box1 = gtk_hbutton_box_new();
|
||||
gtk_box_pack_start(GTK_BOX(Box), Box1, FALSE, FALSE, 0);
|
||||
gtk_widget_show(Box1);
|
||||
|
||||
Ok = gtk_button_new_with_label("Ok");
|
||||
gtk_signal_connect (GTK_OBJECT(Ok), "clicked", GTK_SIGNAL_FUNC(OnMsg_Ok), NULL);
|
||||
gtk_container_add(GTK_CONTAINER(Box1), Ok);
|
||||
GTK_WIDGET_SET_FLAGS(Ok, GTK_CAN_DEFAULT);
|
||||
gtk_widget_show(Ok);
|
||||
|
||||
gtk_widget_show(MsgDlg);
|
||||
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
void CALLBACK SPU2configure()
|
||||
{
|
||||
LOG_CALLBACK("SPU2configure()\n");
|
||||
ConfDlg = create_Config();
|
||||
LoadConfig();
|
||||
set_checked(ConfDlg, "timescalingbutton", (conf.options & OPTION_TIMESTRETCH));
|
||||
set_checked(ConfDlg, "realtimebutton", (conf.options & OPTION_REALTIME));
|
||||
set_checked(ConfDlg, "recordingbutton", (conf.options & OPTION_RECORDING));
|
||||
set_checked(ConfDlg, "mutebutton", (conf.options & OPTION_MUTE));
|
||||
set_checked(ConfDlg, "loggingbutton", (conf.Log));
|
||||
|
||||
gtk_widget_show_all(ConfDlg);
|
||||
gtk_main();
|
||||
}
|
||||
|
||||
|
||||
void on_Conf_Ok (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
conf.options = 0;
|
||||
|
||||
if (is_checked(ConfDlg, "realtimebutton"))
|
||||
conf.options |= OPTION_REALTIME;
|
||||
if (is_checked(ConfDlg, "timescalingbutton"))
|
||||
conf.options |= OPTION_TIMESTRETCH;
|
||||
if (is_checked(ConfDlg, "recordingbutton"))
|
||||
conf.options |= OPTION_RECORDING;
|
||||
if (is_checked(ConfDlg, "mutebutton"))
|
||||
conf.options |= OPTION_MUTE;
|
||||
|
||||
conf.Log = is_checked(ConfDlg, "loggingbutton");
|
||||
|
||||
SaveConfig();
|
||||
gtk_widget_destroy(ConfDlg);
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
|
||||
void on_Conf_Cancel (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
gtk_widget_destroy(ConfDlg);
|
||||
gtk_main_quit();
|
||||
|
||||
}
|
||||
|
||||
void CALLBACK SPU2about()
|
||||
{
|
||||
LOG_CALLBACK("SPU2about()\n");
|
||||
SysMessage("%s %d.%d\ndeveloper: zerofrog", libraryName, SPU2_VERSION, SPU2_BUILD);
|
||||
GtkWidget *dialog;
|
||||
dialog = gtk_message_dialog_new (NULL,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
"%s", msg);
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
void SaveConfig()
|
||||
|
@ -146,10 +62,10 @@ void SaveConfig()
|
|||
fprintf(f, "log = %d\n", conf.Log);
|
||||
//fprintf(f, "options = %d\n", conf.options);
|
||||
|
||||
fprintf(f, "realtime = %d\n", is_checked(ConfDlg, "realtimebutton"));
|
||||
fprintf(f, "timestretch = %d\n", is_checked(ConfDlg, "timescalingbutton"));
|
||||
fprintf(f, "recording = %d\n", is_checked(ConfDlg, "recordingbutton"));
|
||||
fprintf(f, "mute = %d\n", is_checked(ConfDlg, "mutebutton"));
|
||||
fprintf(f, "realtime = %d\n", (conf.options & OPTION_REALTIME));
|
||||
fprintf(f, "timestretch = %d\n", (conf.options & OPTION_TIMESTRETCH));
|
||||
fprintf(f, "recording = %d\n", (conf.options & OPTION_RECORDING));
|
||||
fprintf(f, "mute = %d\n", (conf.options & OPTION_MUTE));
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
@ -190,3 +106,94 @@ void LoadConfig()
|
|||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
void DisplayDialog()
|
||||
{
|
||||
int return_value;
|
||||
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *main_box;
|
||||
GtkWidget *time_scaling_check, *real_time_check, *recording_check, *mute_check, *logging_check;
|
||||
|
||||
LoadConfig();
|
||||
|
||||
/* Create the widgets */
|
||||
dialog = gtk_dialog_new_with_buttons (
|
||||
"ZeroSPU2 Config",
|
||||
NULL, /* parent window*/
|
||||
(GtkDialogFlags)(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
|
||||
GTK_STOCK_OK,
|
||||
GTK_RESPONSE_ACCEPT,
|
||||
GTK_STOCK_CANCEL,
|
||||
GTK_RESPONSE_REJECT,
|
||||
NULL);
|
||||
|
||||
time_scaling_check = gtk_check_button_new_with_label("Time Scaling (recommended)");
|
||||
gtk_widget_set_tooltip_text(time_scaling_check, "Slows down or speeds up sound with respect to the game's real speed.\nEnabling this produces higher quality sound with less cracking, but can reduce speed.");
|
||||
|
||||
real_time_check = gtk_check_button_new_with_label("Real Time Mode");
|
||||
gtk_widget_set_tooltip_text(real_time_check, "Tries to reduce delays in music as much as possible.\nUse when a game is already fast, and needs sound tightly syncronized. (like in DDR, Guitar Hero, & Guitaroo Man)");
|
||||
|
||||
recording_check = gtk_check_button_new_with_label("Recording");
|
||||
gtk_widget_set_tooltip_text(recording_check, "Saves the raw 16 bit stereo wave data to zerospu2.wav. Timed to ps2 time.");
|
||||
|
||||
mute_check = gtk_check_button_new_with_label("Mute");
|
||||
gtk_widget_set_tooltip_text(mute_check, "ZeroSPU2 will not output sound (fast).");
|
||||
|
||||
logging_check = gtk_check_button_new_with_label("Enable logging");
|
||||
gtk_widget_set_tooltip_text(logging_check, "For development use only.");
|
||||
|
||||
main_box = gtk_vbox_new(false, 5);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(main_box), time_scaling_check);
|
||||
gtk_container_add(GTK_CONTAINER(main_box), real_time_check);
|
||||
gtk_container_add(GTK_CONTAINER(main_box), recording_check);
|
||||
gtk_container_add(GTK_CONTAINER(main_box), mute_check);
|
||||
gtk_container_add(GTK_CONTAINER(main_box), logging_check);
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(time_scaling_check), (conf.options & OPTION_TIMESTRETCH));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(real_time_check), (conf.options & OPTION_REALTIME));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(recording_check), (conf.options & OPTION_RECORDING));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mute_check), (conf.options & OPTION_MUTE));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(logging_check), (conf.Log));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), main_box);
|
||||
gtk_widget_show_all (dialog);
|
||||
|
||||
return_value = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
|
||||
if (return_value == GTK_RESPONSE_ACCEPT)
|
||||
{
|
||||
conf.options = 0;
|
||||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(time_scaling_check)))
|
||||
conf.options |= OPTION_TIMESTRETCH;
|
||||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(real_time_check)))
|
||||
conf.options |= OPTION_REALTIME;
|
||||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(recording_check)))
|
||||
conf.options |= OPTION_RECORDING;
|
||||
|
||||
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(mute_check)))
|
||||
conf.options |= OPTION_MUTE;
|
||||
|
||||
conf.Log = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(logging_check));
|
||||
SaveConfig();
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog);
|
||||
}
|
||||
|
||||
void CALLBACK SPU2configure()
|
||||
{
|
||||
LOG_CALLBACK("SPU2configure()\n");
|
||||
DisplayDialog();
|
||||
}
|
||||
|
||||
void CALLBACK SPU2about()
|
||||
{
|
||||
LOG_CALLBACK("SPU2about()\n");
|
||||
SysMessage("%s %d.%d\ndeveloper: zerofrog", libraryName, SPU2_VERSION, SPU2_BUILD);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,4 @@
|
|||
#include <zerospu2.h>
|
||||
#include "Targets/SoundTargets.h"
|
||||
|
||||
// Make it easier to check and set checkmarks in the gui
|
||||
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
||||
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
||||
|
||||
#endif // __LINUX_H__
|
||||
|
|
|
@ -126,15 +126,6 @@
|
|||
</Linker>
|
||||
<Unit filename="Linux.cpp" />
|
||||
<Unit filename="Linux.h" />
|
||||
<Unit filename="callbacks.h" />
|
||||
<Unit filename="interface.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="interface.h" />
|
||||
<Unit filename="support.c">
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="support.h" />
|
||||
<Unit filename="../Targets/Alsa.cpp" />
|
||||
<Unit filename="../Targets/Alsa.h" />
|
||||
<Unit filename="../Targets/OSS.cpp" />
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
|
||||
|
||||
void
|
||||
on_Conf_Ok (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
on_Conf_Cancel (GtkButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
#define VERSION "0.4.6"
|
||||
void
|
||||
on_Conf_Ok (GtkButton *button,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
on_Conf_Cancel (GtkButton *button,
|
||||
gpointer user_data);
|
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "callbacks.h"
|
||||
#include "interface.h"
|
||||
#include "support.h"
|
||||
|
||||
#define GLADE_HOOKUP_OBJECT(component,widget,name) \
|
||||
g_object_set_data_full (G_OBJECT (component), name, \
|
||||
gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)
|
||||
|
||||
#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
|
||||
g_object_set_data (G_OBJECT (component), name, widget)
|
||||
|
||||
GtkWidget*
|
||||
create_About (void)
|
||||
{
|
||||
GtkWidget *About;
|
||||
/* TRANSLATORS: Replace this string with your names, one name per line. */
|
||||
gchar *translators = _("translator-credits");
|
||||
|
||||
About = gtk_about_dialog_new ();
|
||||
gtk_container_set_border_width (GTK_CONTAINER (About), 5);
|
||||
gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (About), VERSION);
|
||||
gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (About), _("ZeroSPU2"));
|
||||
gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (About), translators);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (About, About, "About");
|
||||
|
||||
return About;
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
create_Config (void)
|
||||
{
|
||||
GtkWidget *Config;
|
||||
GtkWidget *dialog_vbox1;
|
||||
GtkWidget *vbox1;
|
||||
GtkWidget *timescalingbutton;
|
||||
GtkWidget *realtimebutton;
|
||||
GtkWidget *recordingbutton;
|
||||
GtkWidget *mutebutton;
|
||||
GtkWidget *loggingbutton;
|
||||
GtkWidget *dialog_action_area1;
|
||||
GtkWidget *Conf_Ok;
|
||||
GtkWidget *Conf_Cancel;
|
||||
|
||||
Config = gtk_dialog_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (Config), _("ZeroSPU2 Config"));
|
||||
gtk_window_set_type_hint (GTK_WINDOW (Config), GDK_WINDOW_TYPE_HINT_DIALOG);
|
||||
|
||||
dialog_vbox1 = GTK_DIALOG (Config)->vbox;
|
||||
gtk_widget_show (dialog_vbox1);
|
||||
|
||||
vbox1 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_widget_show (vbox1);
|
||||
gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox1, TRUE, TRUE, 0);
|
||||
|
||||
timescalingbutton = gtk_check_button_new_with_mnemonic (_("Time Scaling (recommended) \nSlows down or speeds up sound with respect to game's real speed. \nEnabling this produces higher quality sound with less cracking, but can reduce speed."));
|
||||
gtk_widget_show (timescalingbutton);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), timescalingbutton, FALSE, FALSE, 0);
|
||||
|
||||
realtimebutton = gtk_check_button_new_with_mnemonic (_("Real Time mode \nTries to reduce delays in music as much possible. \nUse when game is already fast and need sound tightly synchronized.\n(like in DDR, Guitar Hero, Guitaroo Man)"));
|
||||
gtk_widget_show (realtimebutton);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), realtimebutton, FALSE, FALSE, 0);
|
||||
|
||||
recordingbutton = gtk_check_button_new_with_mnemonic (_("Recording - Saves the raw 16bit stereo wav data to zerospu2.wav. Timed to ps2 time."));
|
||||
gtk_widget_show (recordingbutton);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), recordingbutton, FALSE, FALSE, 0);
|
||||
|
||||
mutebutton = gtk_check_button_new_with_mnemonic (_("Mute - ZeroSPU2 will not output any sound (fast)."));
|
||||
gtk_widget_show (mutebutton);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), mutebutton, FALSE, FALSE, 0);
|
||||
|
||||
loggingbutton = gtk_check_button_new_with_mnemonic (_("Enable logging(for development use only)"));
|
||||
gtk_widget_show (loggingbutton);
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), loggingbutton, FALSE, FALSE, 0);
|
||||
|
||||
dialog_action_area1 = GTK_DIALOG (Config)->action_area;
|
||||
gtk_widget_show (dialog_action_area1);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1), GTK_BUTTONBOX_END);
|
||||
|
||||
Conf_Ok = gtk_button_new_from_stock ("gtk-ok");
|
||||
gtk_widget_show (Conf_Ok);
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (Config), Conf_Ok, GTK_RESPONSE_OK);
|
||||
GTK_WIDGET_SET_FLAGS (Conf_Ok, GTK_CAN_DEFAULT);
|
||||
|
||||
Conf_Cancel = gtk_button_new_from_stock ("gtk-cancel");
|
||||
gtk_widget_show (Conf_Cancel);
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (Config), Conf_Cancel, GTK_RESPONSE_CANCEL);
|
||||
GTK_WIDGET_SET_FLAGS (Conf_Cancel, GTK_CAN_DEFAULT);
|
||||
|
||||
g_signal_connect ((gpointer) Conf_Ok, "clicked",
|
||||
G_CALLBACK (on_Conf_Ok),
|
||||
NULL);
|
||||
g_signal_connect ((gpointer) Conf_Cancel, "clicked",
|
||||
G_CALLBACK (on_Conf_Cancel),
|
||||
NULL);
|
||||
|
||||
/* Store pointers to all widgets, for use by lookup_widget(). */
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (Config, Config, "Config");
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (Config, dialog_vbox1, "dialog_vbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, vbox1, "vbox1");
|
||||
GLADE_HOOKUP_OBJECT (Config, timescalingbutton, "timescalingbutton");
|
||||
GLADE_HOOKUP_OBJECT (Config, realtimebutton, "realtimebutton");
|
||||
GLADE_HOOKUP_OBJECT (Config, recordingbutton, "recordingbutton");
|
||||
GLADE_HOOKUP_OBJECT (Config, mutebutton, "mutebutton");
|
||||
GLADE_HOOKUP_OBJECT (Config, loggingbutton, "loggingbutton");
|
||||
GLADE_HOOKUP_OBJECT_NO_REF (Config, dialog_action_area1, "dialog_action_area1");
|
||||
GLADE_HOOKUP_OBJECT (Config, Conf_Ok, "Conf_Ok");
|
||||
GLADE_HOOKUP_OBJECT (Config, Conf_Cancel, "Conf_Cancel");
|
||||
|
||||
return Config;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
GtkWidget* create_About (void);
|
||||
GtkWidget* create_Config (void);
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "support.h"
|
||||
|
||||
GtkWidget*
|
||||
lookup_widget (GtkWidget *widget,
|
||||
const gchar *widget_name)
|
||||
{
|
||||
GtkWidget *parent, *found_widget;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (GTK_IS_MENU (widget))
|
||||
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
|
||||
else
|
||||
parent = widget->parent;
|
||||
if (!parent)
|
||||
parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget), "GladeParentKey");
|
||||
if (parent == NULL)
|
||||
break;
|
||||
widget = parent;
|
||||
}
|
||||
|
||||
found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
|
||||
widget_name);
|
||||
if (!found_widget)
|
||||
g_warning ("Widget not found: %s", widget_name);
|
||||
return found_widget;
|
||||
}
|
||||
|
||||
static GList *pixmaps_directories = NULL;
|
||||
|
||||
/* Use this function to set the directory containing installed pixmaps. */
|
||||
void
|
||||
add_pixmap_directory (const gchar *directory)
|
||||
{
|
||||
pixmaps_directories = g_list_prepend (pixmaps_directories,
|
||||
g_strdup (directory));
|
||||
}
|
||||
|
||||
/* This is an internally used function to find pixmap files. */
|
||||
static gchar*
|
||||
find_pixmap_file (const gchar *filename)
|
||||
{
|
||||
GList *elem;
|
||||
|
||||
/* We step through each of the pixmaps directory to find it. */
|
||||
elem = pixmaps_directories;
|
||||
while (elem)
|
||||
{
|
||||
gchar *pathname = g_strdup_printf ("%s%s%s", (gchar*)elem->data,
|
||||
G_DIR_SEPARATOR_S, filename);
|
||||
if (g_file_test (pathname, G_FILE_TEST_EXISTS))
|
||||
return pathname;
|
||||
g_free (pathname);
|
||||
elem = elem->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
GtkWidget*
|
||||
create_pixmap (GtkWidget *widget,
|
||||
const gchar *filename)
|
||||
{
|
||||
gchar *pathname = NULL;
|
||||
GtkWidget *pixmap;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return gtk_image_new ();
|
||||
|
||||
pathname = find_pixmap_file (filename);
|
||||
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return gtk_image_new ();
|
||||
}
|
||||
|
||||
pixmap = gtk_image_new_from_file (pathname);
|
||||
g_free (pathname);
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
/* This is an internally used function to create pixmaps. */
|
||||
GdkPixbuf*
|
||||
create_pixbuf (const gchar *filename)
|
||||
{
|
||||
gchar *pathname = NULL;
|
||||
GdkPixbuf *pixbuf;
|
||||
GError *error = NULL;
|
||||
|
||||
if (!filename || !filename[0])
|
||||
return NULL;
|
||||
|
||||
pathname = find_pixmap_file (filename);
|
||||
|
||||
if (!pathname)
|
||||
{
|
||||
g_warning (_("Couldn't find pixmap file: %s"), filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pixbuf = gdk_pixbuf_new_from_file (pathname, &error);
|
||||
if (!pixbuf)
|
||||
{
|
||||
fprintf (stderr, "Failed to load pixbuf file: %s: %s\n",
|
||||
pathname, error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
g_free (pathname);
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/* This is used to set ATK action descriptions. */
|
||||
void
|
||||
glade_set_atk_action_description (AtkAction *action,
|
||||
const gchar *action_name,
|
||||
const gchar *description)
|
||||
{
|
||||
gint n_actions, i;
|
||||
|
||||
n_actions = atk_action_get_n_actions (action);
|
||||
for (i = 0; i < n_actions; i++)
|
||||
{
|
||||
if (!strcmp (atk_action_get_name (action, i), action_name))
|
||||
atk_action_set_description (action, i, description);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* DO NOT EDIT THIS FILE - it is generated by Glade.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/*
|
||||
* Standard gettext macros.
|
||||
*/
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# undef _
|
||||
# define _(String) dgettext (PACKAGE, String)
|
||||
# define Q_(String) g_strip_context ((String), gettext (String))
|
||||
# ifdef gettext_noop
|
||||
# define N_(String) gettext_noop (String)
|
||||
# else
|
||||
# define N_(String) (String)
|
||||
# endif
|
||||
#else
|
||||
# define textdomain(String) (String)
|
||||
# define gettext(String) (String)
|
||||
# define dgettext(Domain,Message) (Message)
|
||||
# define dcgettext(Domain,Message,Type) (Message)
|
||||
# define bindtextdomain(Domain,Directory) (Domain)
|
||||
# define _(String) (String)
|
||||
# define Q_(String) g_strip_context ((String), (String))
|
||||
# define N_(String) (String)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Public Functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This function returns a widget in a component created by Glade.
|
||||
* Call it with the toplevel widget in the component (i.e. a window/dialog),
|
||||
* or alternatively any widget in the component, and the name of the widget
|
||||
* you want returned.
|
||||
*/
|
||||
GtkWidget* lookup_widget (GtkWidget *widget,
|
||||
const gchar *widget_name);
|
||||
|
||||
|
||||
/* Use this function to set the directory containing installed pixmaps. */
|
||||
void add_pixmap_directory (const gchar *directory);
|
||||
|
||||
|
||||
/*
|
||||
* Private Functions.
|
||||
*/
|
||||
|
||||
/* This is used to create the pixmaps used in the interface. */
|
||||
GtkWidget* create_pixmap (GtkWidget *widget,
|
||||
const gchar *filename);
|
||||
|
||||
/* This is used to create the pixbufs used in the interface. */
|
||||
GdkPixbuf* create_pixbuf (const gchar *filename);
|
||||
|
||||
/* This is used to set ATK action descriptions. */
|
||||
void glade_set_atk_action_description (AtkAction *action,
|
||||
const gchar *action_name,
|
||||
const gchar *description);
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
|
||||
|
||||
<glade-interface>
|
||||
|
||||
<widget class="GtkAboutDialog" id="About">
|
||||
<property name="border_width">5</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="name" translatable="yes">ZeroSPU2</property>
|
||||
<property name="wrap_license">False</property>
|
||||
<property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property>
|
||||
</widget>
|
||||
|
||||
<widget class="GtkDialog" id="Config">
|
||||
<property name="visible">True</property>
|
||||
<property name="title" translatable="yes">ZeroSPU2 Config</property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="focus_on_map">True</property>
|
||||
<property name="urgency_hint">False</property>
|
||||
<property name="has_separator">True</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child internal-child="action_area">
|
||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
||||
<property name="visible">True</property>
|
||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="Conf_Ok">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-ok</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-5</property>
|
||||
<signal name="clicked" handler="on_Conf_Ok" last_modification_time="Sat, 18 Oct 2008 14:31:53 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkButton" id="Conf_Cancel">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-6</property>
|
||||
<signal name="clicked" handler="on_Conf_Cancel" last_modification_time="Sat, 18 Oct 2008 14:32:05 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">GTK_PACK_END</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="timescalingbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Time Scaling (recommended)
|
||||
Slows down or speeds up sound with respect to game's real speed.
|
||||
Enabling this produces higher quality sound with less cracking, but can reduce speed.</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="realtimebutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Real Time mode
|
||||
Tries to reduce delays in music as much possible.
|
||||
Use when game is already fast and need sound tightly synchronized.
|
||||
(like in DDR, Guitar Hero, Guitaroo Man)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="recordingbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Recording - Saves the raw 16bit stereo wav data to zerospu2.wav. Timed to ps2 time.</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="mutebutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Mute - ZeroSPU2 will not output any sound (fast).</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="loggingbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">Enable logging(for development use only)</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
</glade-interface>
|
|
@ -121,7 +121,7 @@ void __Log(char *fmt, ...);
|
|||
void __LogToConsole(const char *fmt, ...);
|
||||
void SaveConfig();
|
||||
void LoadConfig();
|
||||
void SysMessage(char *fmt, ...);
|
||||
void SysMessage(const char *fmt, ...);
|
||||
|
||||
extern void LogRawSound(void* pleft, int leftstride, void* pright, int rightstride, int numsamples);
|
||||
extern void LogPacketSound(void* packet, int memsize);
|
||||
|
|
Loading…
Reference in New Issue