summaryrefslogtreecommitdiffstats
path: root/gtk/src/audiohandler.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-07-24 15:03:22 -0700
committerJohn Stebbins <[email protected]>2019-07-26 12:57:20 -0700
commita1d064d2f01d963213b1336c0aeda9e7a1a6817f (patch)
tree3857d6faaa5c61a71d1106403f1cbf74ba93d992 /gtk/src/audiohandler.c
parent30b59112b75ef6572615db032fb461d9e9c51fa2 (diff)
LinGui: WIP gtk4 support
Known issues and todo: notebooks, use GtkNotebookPage semantics in ui file fix keypress delete in queue_list fix dest_file grab-focus? (highlight of filename for editing) focus-in/out with GtkEventControllerKey preview_state_cb how to handle icon-ified preview? preview_configure_cb, saving preview window size? accelerator alt-d grab-focus destination key-press-event in chapter list, ghbcellrenderertext -> GtkEventControllerKey Why doesn't summary preview image scale correctly? "System" in about dialog? why is the tab there when "system" prop not set? GtkSeparatorToolitem seems to ignore "draw" prop?
Diffstat (limited to 'gtk/src/audiohandler.c')
-rw-r--r--gtk/src/audiohandler.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index c4dbac716..cab1ff0ca 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -1743,7 +1743,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(button), "add_button");
gtk_widget_hide(GTK_WIDGET(button));
g_signal_connect(button, "clicked", (GCallback)audio_def_setting_add_cb, ud);
- ghb_box_pack_start(box, GTK_WIDGET(button));
+ ghb_box_append_child(box, GTK_WIDGET(button));
// Hidden widgets box
box2 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
@@ -1764,7 +1764,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(combo), "AudioEncoder");
gtk_widget_show(GTK_WIDGET(combo));
g_signal_connect(combo, "changed", (GCallback)audio_def_encoder_changed_cb, ud);
- ghb_box_pack_start(box2, GTK_WIDGET(combo));
+ ghb_box_append_child(box2, GTK_WIDGET(combo));
box3 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
gtk_widget_set_name(GTK_WIDGET(box3), "br_q_box");
@@ -1776,15 +1776,15 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
radio = GTK_RADIO_BUTTON(gtk_radio_button_new_with_label(NULL, _("Bitrate")));
gtk_widget_set_name(GTK_WIDGET(radio), "AudioTrackBitrateEnable");
gtk_widget_show(GTK_WIDGET(radio));
- ghb_box_pack_start(vbox, GTK_WIDGET(radio));
+ ghb_box_append_child(vbox, GTK_WIDGET(radio));
radio = GTK_RADIO_BUTTON(
gtk_radio_button_new_with_label_from_widget(radio, _("Quality")));
gtk_widget_set_name(GTK_WIDGET(radio), "AudioTrackQualityEnable");
g_signal_connect(radio, "toggled", (GCallback)audio_def_quality_enable_changed_cb, ud);
gtk_widget_show(GTK_WIDGET(radio));
- ghb_box_pack_start(vbox, GTK_WIDGET(radio));
+ ghb_box_append_child(vbox, GTK_WIDGET(radio));
gtk_widget_show(GTK_WIDGET(vbox));
- ghb_box_pack_start(box3, GTK_WIDGET(vbox));
+ ghb_box_append_child(box3, GTK_WIDGET(vbox));
// Audio Bitrate ComboBox
combo = GTK_COMBO_BOX(gtk_combo_box_new());
@@ -1797,7 +1797,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(combo), "AudioBitrate");
gtk_widget_show(GTK_WIDGET(combo));
g_signal_connect(combo, "changed", (GCallback)audio_def_encode_setting_changed_cb, ud);
- ghb_box_pack_start(box3, GTK_WIDGET(combo));
+ ghb_box_append_child(box3, GTK_WIDGET(combo));
GtkBox *qbox;
qbox = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
@@ -1815,8 +1815,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
"weather-clear",
NULL
};
- scale = GTK_SCALE_BUTTON(gtk_scale_button_new(GTK_ICON_SIZE_BUTTON,
- 0, 10, 0.1, quality_icons));
+ scale = GTK_SCALE_BUTTON(ghb_scale_button_new(0, 10, 0.1, quality_icons));
gtk_widget_set_tooltip_markup(GTK_WIDGET(scale),
_("<b>Audio Quality:</b>\n"
"For encoders that support it, adjust the quality of the output."));
@@ -1825,7 +1824,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(scale), "AudioTrackQualityX");
gtk_widget_show(GTK_WIDGET(scale));
g_signal_connect(scale, "value-changed", (GCallback)audio_def_quality_changed_cb, ud);
- ghb_box_pack_start(qbox, GTK_WIDGET(scale));
+ ghb_box_append_child(qbox, GTK_WIDGET(scale));
// Audio Quality Label
label = GTK_LABEL(gtk_label_new("0.00"));
@@ -1834,10 +1833,10 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER);
gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackQualityValue");
gtk_widget_show(GTK_WIDGET(label));
- ghb_box_pack_start(qbox, GTK_WIDGET(label));
+ ghb_box_append_child(qbox, GTK_WIDGET(label));
gtk_widget_hide(GTK_WIDGET(qbox));
- ghb_box_pack_start(box3, GTK_WIDGET(qbox));
- ghb_box_pack_start(box2, GTK_WIDGET(box3));
+ ghb_box_append_child(box3, GTK_WIDGET(qbox));
+ ghb_box_append_child(box2, GTK_WIDGET(box3));
// Audio Mix ComboBox
combo = GTK_COMBO_BOX(gtk_combo_box_new());
@@ -1850,7 +1849,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(combo), "AudioMixdown");
gtk_widget_show(GTK_WIDGET(combo));
g_signal_connect(combo, "changed", (GCallback)audio_def_encode_setting_changed_cb, ud);
- ghb_box_pack_start(box2, GTK_WIDGET(combo));
+ ghb_box_append_child(box2, GTK_WIDGET(combo));
// Audio Sample Rate ComboBox
combo = GTK_COMBO_BOX(gtk_combo_box_new());
@@ -1863,7 +1862,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(combo), "AudioSamplerate");
gtk_widget_show(GTK_WIDGET(combo));
g_signal_connect(combo, "changed", (GCallback)audio_def_encode_setting_changed_cb, ud);
- ghb_box_pack_start(box2, GTK_WIDGET(combo));
+ ghb_box_append_child(box2, GTK_WIDGET(combo));
box3 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
gtk_widget_set_name(GTK_WIDGET(box3), "gain_box");
@@ -1877,8 +1876,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
"audio-volume-medium",
NULL
};
- scale = GTK_SCALE_BUTTON(gtk_scale_button_new(GTK_ICON_SIZE_BUTTON,
- -20, 21, 1, gain_icons));
+ scale = GTK_SCALE_BUTTON(ghb_scale_button_new(-20, 21, 1, gain_icons));
gtk_widget_set_tooltip_markup(GTK_WIDGET(scale),
_("<b>Audio Gain:</b> "
"Adjust the amplification or attenuation of the output audio track."));
@@ -1887,7 +1885,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(scale), "AudioTrackGainSlider");
gtk_widget_show(GTK_WIDGET(scale));
g_signal_connect(scale, "value-changed", (GCallback)audio_def_gain_changed_cb, ud);
- ghb_box_pack_start(box3, GTK_WIDGET(scale));
+ ghb_box_append_child(box3, GTK_WIDGET(scale));
// Audio Gain Label
label = GTK_LABEL(gtk_label_new(_("0dB")));
@@ -1896,8 +1894,8 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER);
gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackGainValue");
gtk_widget_show(GTK_WIDGET(label));
- ghb_box_pack_start(box3, GTK_WIDGET(label));
- ghb_box_pack_start(box2, GTK_WIDGET(box3));
+ ghb_box_append_child(box3, GTK_WIDGET(label));
+ ghb_box_append_child(box2, GTK_WIDGET(box3));
box3 = GTK_BOX(gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0));
gtk_widget_set_name(GTK_WIDGET(box3), "drc_box");
@@ -1908,8 +1906,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
"audio-input-microphone",
NULL
};
- scale = GTK_SCALE_BUTTON(gtk_scale_button_new(GTK_ICON_SIZE_BUTTON,
- 0.9, 4, 0.1, drc_icons));
+ scale = GTK_SCALE_BUTTON(ghb_scale_button_new(0.9, 4, 0.1, drc_icons));
gtk_widget_set_tooltip_markup(GTK_WIDGET(scale),
_("<b>Dynamic Range Compression:</b> "
"Adjust the dynamic range of the output audio track.\n\n"
@@ -1922,7 +1919,7 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(scale), "AudioTrackDRCSlider");
gtk_widget_show(GTK_WIDGET(scale));
g_signal_connect(scale, "value-changed", (GCallback)audio_def_drc_changed_cb, ud);
- ghb_box_pack_start(box3, GTK_WIDGET(scale));
+ ghb_box_append_child(box3, GTK_WIDGET(scale));
// Audio DRC Label
label = GTK_LABEL(gtk_label_new(_("Off")));
@@ -1931,8 +1928,8 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_CENTER);
gtk_widget_set_name(GTK_WIDGET(label), "AudioTrackDRCValue");
gtk_widget_show(GTK_WIDGET(label));
- ghb_box_pack_start(box3, GTK_WIDGET(label));
- ghb_box_pack_start(box2, GTK_WIDGET(box3));
+ ghb_box_append_child(box3, GTK_WIDGET(label));
+ ghb_box_append_child(box2, GTK_WIDGET(box3));
// Remove button
button = GTK_BUTTON(gtk_button_new());
@@ -1947,10 +1944,10 @@ GtkWidget * ghb_create_audio_settings_row(signal_user_data_t *ud)
gtk_widget_set_name(GTK_WIDGET(button), "remove_button");
gtk_widget_show(GTK_WIDGET(button));
g_signal_connect(button, "clicked", (GCallback)audio_def_setting_remove_cb, ud);
- ghb_box_pack_start(box2, GTK_WIDGET(button));
+ ghb_box_append_child(box2, GTK_WIDGET(button));
gtk_widget_show(GTK_WIDGET(box2));
- ghb_box_pack_start(box, GTK_WIDGET(box2));
+ ghb_box_append_child(box, GTK_WIDGET(box2));
gtk_widget_show(GTK_WIDGET(box));