Add a label that shows relative video refresh rate for the selected

sound input rate.
This commit is contained in:
Brandon Wright 2011-02-23 15:38:55 -06:00
parent a013ae3306
commit fc3025bd05
2 changed files with 50 additions and 5 deletions

View File

@ -452,6 +452,20 @@ Snes9xPreferences::calibration_dialog (void)
#endif
static void
event_input_rate_changed (GtkRange *range, gpointer data)
{
char text[256];
GtkLabel *label = GTK_LABEL (data);
double value = gtk_range_get_value (range) / 32040.0 * 60.09881389744051;
snprintf (text, 256, "%.4f hz", value);
gtk_label_set_text (label, text);
return;
}
static void
event_about_clicked (GtkButton *widget, gpointer data)
{
@ -548,6 +562,13 @@ Snes9xPreferences::Snes9xPreferences (Snes9xConfig *config) :
signal_connect (callbacks);
g_signal_connect_data (get_widget ("sound_input_rate"),
"value-changed",
G_CALLBACK (event_input_rate_changed),
get_widget ("relative_video_rate"),
NULL,
(GConnectFlags) 0);
return;
}

View File

@ -2095,7 +2095,7 @@
<child>
<object class="GtkTable" id="table7">
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="column_spacing">10</property>
<property name="row_spacing">5</property>
@ -2141,8 +2141,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
@ -2154,8 +2154,8 @@
<property name="label" translatable="yes">Buffer size:</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options">GTK_FILL</property>
</packing>
@ -2216,6 +2216,30 @@
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label139">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Video rate:</property>
</object>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="relative_video_rate">
<property name="visible">True</property>
<property name="label" translatable="yes">label</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>