diff options
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/audiohandler.c | 255 | ||||
-rw-r--r-- | gtk/src/audiohandler.h | 2 | ||||
-rw-r--r-- | gtk/src/callbacks.c | 12 | ||||
-rw-r--r-- | gtk/src/ghb.ui | 499 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 66 | ||||
-rw-r--r-- | gtk/src/hb-backend.h | 5 | ||||
-rw-r--r-- | gtk/src/internal_defaults.xml | 4 | ||||
-rw-r--r-- | gtk/src/makedeps.py | 16 | ||||
-rw-r--r-- | gtk/src/queuehandler.c | 86 |
9 files changed, 667 insertions, 278 deletions
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c index 90256d6cf..13c26e90d 100644 --- a/gtk/src/audiohandler.c +++ b/gtk/src/audiohandler.c @@ -175,7 +175,7 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud) bitrate = aconfig->in.bitrate / 1000; // Set the values for bitrate and samplerate to the input rates - ghb_set_passthru_bitrate_opts (ud->builder, bitrate); + ghb_set_bitrate_opts (ud->builder, bitrate, bitrate, bitrate); mix = 0; ghb_ui_update(ud, "AudioMixdown", ghb_int64_value(mix)); select_acodec &= aconfig->in.codec | HB_ACODEC_PASS_FLAG; @@ -203,7 +203,7 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud) int low, high; mix = ghb_get_best_mix( aconfig, select_acodec, mix); hb_get_audio_bitrate_limits(select_acodec, sr, mix, &low, &high); - ghb_set_default_bitrate_opts (ud->builder, low, high); + ghb_set_bitrate_opts (ud->builder, low, high, -1); } ghb_ui_update(ud, "AudioBitrate", ghb_int64_value(bitrate)); @@ -250,9 +250,9 @@ ghb_set_pref_audio(gint titleindex, signal_user_data_t *ud) gint mux; const GValue *pref_audio; - const GValue *audio, *drc, *gain; + const GValue *audio, *drc, *gain, *enable_qual; gint acodec, bitrate, mix; - gdouble rate; + gdouble rate, quality; gint count, ii, list_count; g_debug("set_pref_audio"); @@ -288,6 +288,8 @@ ghb_set_pref_audio(gint titleindex, signal_user_data_t *ud) mix = ghb_settings_combo_int(audio, "AudioMixdown"); drc = ghb_settings_get_value(audio, "AudioTrackDRCSlider"); gain = ghb_settings_get_value(audio, "AudioTrackGain"); + enable_qual = ghb_settings_get_value(audio, "AudioTrackQualityEnable"); + quality = ghb_settings_get_double(audio, "AudioTrackQuality"); // If there are multiple audios using the same codec, then // select sequential tracks for each. The hash keeps track // of the tracks used for each codec. @@ -324,6 +326,7 @@ ghb_set_pref_audio(gint titleindex, signal_user_data_t *ud) bitrate = aconfig->in.bitrate / 1000; bitrate = hb_get_best_audio_bitrate(select_acodec, bitrate, aconfig->in.samplerate, mix); + quality = hb_get_default_audio_quality( select_acodec ); rate = 0; } } @@ -342,6 +345,8 @@ ghb_set_pref_audio(gint titleindex, signal_user_data_t *ud) ghb_lookup_combo_string("AudioEncoder", ghb_int_value(acodec))); ghb_settings_set_value(settings, "AudioEncoderActual", ghb_lookup_acodec_value(select_acodec)); + ghb_settings_set_value(settings, "AudioTrackQualityEnable", enable_qual); + ghb_settings_set_double(settings, "AudioTrackQuality", quality); // This gets set autimatically if the codec is passthru ghb_settings_set_string(settings, "AudioBitrate", ghb_lookup_combo_string("AudioBitrate", ghb_int_value(bitrate))); @@ -412,7 +417,7 @@ ghb_audio_list_refresh_selected(signal_user_data_t *ud) if (gtk_tree_selection_get_selected(selection, &store, &iter)) { const gchar *track, *codec, *br, *sr, *mix; - gchar *s_drc, *s_gain; + gchar *s_drc, *s_gain, *s_quality = NULL; gint itrack; gdouble drc, gain; // Get the row number @@ -430,7 +435,17 @@ ghb_audio_list_refresh_selected(signal_user_data_t *ud) track = ghb_settings_combo_option(asettings, "AudioTrack"); itrack = ghb_settings_combo_int(asettings, "AudioTrack"); codec = ghb_settings_combo_option(asettings, "AudioEncoderActual"); - br = ghb_settings_combo_option(asettings, "AudioBitrate"); + double quality = ghb_settings_get_double(asettings, "AudioTrackQuality"); + if (ghb_settings_get_boolean(asettings, "AudioTrackQualityEnable") && + quality >= 0) + { + int codec = ghb_settings_combo_int(asettings, "AudioEncoderActual"); + s_quality = ghb_format_quality("Q/", codec, quality); + } + else + { + br = ghb_settings_combo_option(asettings, "AudioBitrate"); + } sr = ghb_settings_combo_option(asettings, "AudioSamplerate"); mix = ghb_settings_combo_option(asettings, "AudioMixdown"); gain = ghb_settings_get_double(asettings, "AudioTrackGain"); @@ -446,7 +461,7 @@ ghb_audio_list_refresh_selected(signal_user_data_t *ud) // These are displayed in list 0, track, 1, codec, - 2, br, + 2, s_quality ? s_quality : br, 3, sr, 4, mix, 5, s_gain, @@ -454,6 +469,78 @@ ghb_audio_list_refresh_selected(signal_user_data_t *ud) -1); g_free(s_drc); g_free(s_gain); + g_free(s_quality); + } +} + +void +ghb_audio_list_refresh(signal_user_data_t *ud) +{ + GtkTreeView *treeview; + GtkTreeIter iter; + GtkListStore *store; + gboolean done; + gint row = 0; + const GValue *audio_list; + + g_debug("ghb_audio_list_refresh ()"); + treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "audio_list")); + store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview)); + if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) + { + do + { + const gchar *track, *codec, *br, *sr, *mix; + gchar *s_drc, *s_gain, *s_quality = NULL; + gint itrack; + gdouble drc, gain; + GValue *asettings; + + audio_list = ghb_settings_get_value(ud->settings, "audio_list"); + if (row >= ghb_array_len(audio_list)) + return; + asettings = ghb_array_get_nth(audio_list, row); + + track = ghb_settings_combo_option(asettings, "AudioTrack"); + itrack = ghb_settings_combo_int(asettings, "AudioTrack"); + codec = ghb_settings_combo_option(asettings, "AudioEncoderActual"); + double quality = ghb_settings_get_double(asettings, "AudioTrackQuality"); + if (ghb_settings_get_boolean(asettings, "AudioTrackQualityEnable") && + quality >= 0) + { + int codec = ghb_settings_combo_int(asettings, "AudioEncoderActual"); + s_quality = ghb_format_quality("Q/", codec, quality); + } + else + { + br = ghb_settings_combo_option(asettings, "AudioBitrate"); + } + sr = ghb_settings_combo_option(asettings, "AudioSamplerate"); + mix = ghb_settings_combo_option(asettings, "AudioMixdown"); + gain = ghb_settings_get_double(asettings, "AudioTrackGain"); + s_gain = g_strdup_printf("%.fdB", gain); + + drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider"); + if (drc < 1.0) + s_drc = g_strdup("Off"); + else + s_drc = g_strdup_printf("%.1f", drc); + + gtk_list_store_set(GTK_LIST_STORE(store), &iter, + // These are displayed in list + 0, track, + 1, codec, + 2, s_quality ? s_quality : br, + 3, sr, + 4, mix, + 5, s_gain, + 6, s_drc, + -1); + g_free(s_drc); + g_free(s_gain); + done = !gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter); + row++; + } while (!done); } } @@ -467,17 +554,16 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) g_debug("audio_codec_changed_cb ()"); gval = ghb_widget_value(widget); acodec_code = ghb_lookup_combo_int("AudioEncoder", gval); + ghb_value_free(gval); + if (block_updates) { prev_acodec = acodec_code; ghb_grey_combo_options (ud); + ghb_check_dependency(ud, widget, NULL); return; } - gval = ghb_widget_value(widget); - acodec_code = ghb_lookup_combo_int("AudioEncoder", gval); - ghb_value_free(gval); - asettings = get_selected_asettings(ud); if (ghb_audio_is_passthru (prev_acodec) && !ghb_audio_is_passthru (acodec_code)) @@ -533,6 +619,21 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } ghb_update_destination_extension(ud); ghb_live_reset(ud); + + float low, high, gran, defval; + int dir; + hb_get_audio_quality_limits(acodec_code, &low, &high, &gran, &dir); + defval = hb_get_default_audio_quality(acodec_code); + GtkScaleButton *sb; + GtkAdjustment *adj; + sb = GTK_SCALE_BUTTON(GHB_WIDGET(ud->builder, "AudioTrackQuality")); + adj = gtk_scale_button_get_adjustment(sb); + if (dir) + { + // Quality values are inverted + defval = high - defval + low; + } + gtk_adjustment_configure (adj, defval, low, high, gran, gran * 10, 0); } G_MODULE_EXPORT void @@ -543,6 +644,7 @@ audio_track_changed_cb(GtkWidget *widget, signal_user_data_t *ud) g_debug("audio_track_changed_cb ()"); if (block_updates) { + ghb_check_dependency(ud, widget, NULL); ghb_grey_combo_options (ud); return; } @@ -569,7 +671,11 @@ audio_mix_changed_cb(GtkWidget *widget, signal_user_data_t *ud) GValue *asettings; g_debug("audio_mix_changed_cb ()"); - if (block_updates) return; + if (block_updates) + { + ghb_check_dependency(ud, widget, NULL); + return; + } ghb_adjust_audio_rate_combos(ud); ghb_check_dependency(ud, widget, NULL); @@ -588,10 +694,13 @@ audio_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) GValue *asettings; g_debug("audio_widget_changed_cb ()"); - if (block_updates) return; + if (block_updates) + { + ghb_check_dependency(ud, widget, NULL); + return; + } ghb_adjust_audio_rate_combos(ud); - ghb_check_dependency(ud, widget, NULL); asettings = get_selected_asettings(ud); if (asettings != NULL) { @@ -605,7 +714,11 @@ G_MODULE_EXPORT void global_audio_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { g_debug("global_audio_widget_changed_cb ()"); - if (block_updates) return; + if (block_updates) + { + ghb_check_dependency(ud, widget, NULL); + return; + } ghb_check_dependency(ud, widget, NULL); ghb_widget_to_setting(ud->settings, widget); @@ -623,6 +736,64 @@ format_drc_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud) return g_strdup_printf("%-7.1f", val); } +static inline int is_close(float a, float b, float metric) +{ + float diff = a - b; + diff = (diff > 0) ? diff : -diff; + return diff < metric; +} + +char * ghb_format_quality( const char *prefix, int codec, double quality ) +{ + float low, high, gran; + int dir; + hb_get_audio_quality_limits(codec, &low, &high, &gran, &dir); + + int digits; + float tmp = gran; + while (1) + { + if (is_close(tmp, (int)tmp, gran / 10)) + break; + digits++; + tmp *= 10; + } + return g_strdup_printf("%s%.*f", prefix, digits, quality); +} + +G_MODULE_EXPORT void +quality_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) +{ + GValue *asettings; + + g_debug("quality_widget_changed_cb ()"); + + ghb_check_dependency(ud, widget, NULL); + float low, high, gran; + int dir; + int codec = ghb_settings_combo_int(ud->settings, "AudioEncoderActual"); + hb_get_audio_quality_limits(codec, &low, &high, &gran, &dir); + double quality = ghb_widget_double(widget); + if (dir) + { + // Quality values are inverted + quality = high - quality + low; + } + char *s_quality = ghb_format_quality("", codec, quality); + ghb_ui_update( ud, "AudioTrackQualityValue", ghb_string_value(s_quality)); + g_free(s_quality); + + if (block_updates) return; + + asettings = get_selected_asettings(ud); + if (asettings != NULL) + { + ghb_settings_set_double(asettings, "AudioTrackQuality", quality); + ghb_audio_list_refresh_selected(ud); + } + ghb_live_reset(ud); +} + G_MODULE_EXPORT void drc_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { @@ -630,8 +801,18 @@ drc_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) g_debug("drc_widget_changed_cb ()"); - if (block_updates) return; ghb_check_dependency(ud, widget, NULL); + if (block_updates) return; + + double drc = ghb_widget_double(widget); + char *s_drc; + if (drc < 0.99) + s_drc = g_strdup("Off"); + else + s_drc = g_strdup_printf("%.1f", drc); + ghb_ui_update( ud, "AudioTrackDRCValue", ghb_string_value(s_drc)); + g_free(s_drc); + asettings = get_selected_asettings(ud); if (asettings != NULL) { @@ -656,9 +837,19 @@ gain_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) g_debug("gain_widget_changed_cb ()"); - if (block_updates) return; ghb_check_dependency(ud, widget, NULL); + if (block_updates) return; asettings = get_selected_asettings(ud); + + int gain = ghb_widget_int(widget); + char *s_gain; + if ( gain >= 21.0 ) + s_gain = g_strdup_printf("*11*"); + else + s_gain = g_strdup_printf("%ddB", gain); + ghb_ui_update( ud, "AudioTrackGainValue", ghb_string_value(s_gain)); + g_free(s_gain); + if (asettings != NULL) { ghb_widget_to_setting(asettings, widget); @@ -696,7 +887,7 @@ add_to_audio_list(signal_user_data_t *ud, GValue *settings) GtkListStore *store; GtkTreeSelection *selection; const gchar *track, *codec, *br, *sr, *mix; - gchar *s_drc, *s_gain; + gchar *s_drc, *s_gain, *s_quality = NULL; gint itrack; gdouble drc; gdouble gain; @@ -709,7 +900,17 @@ add_to_audio_list(signal_user_data_t *ud, GValue *settings) track = ghb_settings_combo_option(settings, "AudioTrack"); itrack = ghb_settings_combo_int(settings, "AudioTrack"); codec = ghb_settings_combo_option(settings, "AudioEncoderActual"); - br = ghb_settings_combo_option(settings, "AudioBitrate"); + double quality = ghb_settings_get_double(settings, "AudioTrackQuality"); + if (ghb_settings_get_boolean(settings, "AudioTrackQualityEnable") && + quality >= 0) + { + int codec = ghb_settings_combo_int(settings, "AudioEncoderActual"); + s_quality = ghb_format_quality("Q/", codec, quality); + } + else + { + br = ghb_settings_combo_option(settings, "AudioBitrate"); + } sr = ghb_settings_combo_option(settings, "AudioSamplerate"); mix = ghb_settings_combo_option(settings, "AudioMixdown"); gain = ghb_settings_get_double(settings, "AudioTrackGain"); @@ -726,7 +927,7 @@ add_to_audio_list(signal_user_data_t *ud, GValue *settings) // These are displayed in list 0, track, 1, codec, - 2, br, + 2, s_quality ? s_quality : br, 3, sr, 4, mix, 5, s_gain, @@ -735,6 +936,7 @@ add_to_audio_list(signal_user_data_t *ud, GValue *settings) gtk_tree_selection_select_iter(selection, &iter); g_free(s_drc); g_free(s_gain); + g_free(s_quality); } G_MODULE_EXPORT void @@ -779,6 +981,8 @@ audio_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t ghb_ui_update(ud, "AudioMixdown", ghb_settings_get_value(asettings, "AudioMixdown")); ghb_ui_update(ud, "AudioTrackDRCSlider", ghb_settings_get_value(asettings, "AudioTrackDRCSlider")); ghb_ui_update(ud, "AudioTrackGain", ghb_settings_get_value(asettings, "AudioTrackGain")); + ghb_ui_update(ud, "AudioTrackQuality", ghb_settings_get_value(asettings, "AudioTrackQuality")); + ghb_ui_update(ud, "AudioTrackQualityEnable", ghb_settings_get_value(asettings, "AudioTrackQualityEnable")); block_updates = FALSE; widget = GHB_WIDGET (ud->builder, "audio_remove"); gtk_widget_set_sensitive(widget, TRUE); @@ -838,6 +1042,10 @@ audio_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud) ghb_settings_take_value(asettings, "AudioEncoder", ghb_widget_value(widget)); ghb_settings_set_value(asettings, "AudioEncoderActual", ghb_settings_get_value(ud->settings, "AudioEncoderActual")); + widget = GHB_WIDGET(ud->builder, "AudioTrackQualityEnable"); + ghb_settings_take_value(asettings, "AudioTrackQualityEnable", ghb_widget_value(widget)); + widget = GHB_WIDGET(ud->builder, "AudioTrackQuality"); + ghb_settings_take_value(asettings, "AudioTrackQuality", ghb_widget_value(widget)); widget = GHB_WIDGET(ud->builder, "AudioBitrate"); ghb_settings_take_value(asettings, "AudioBitrate", ghb_widget_value(widget)); widget = GHB_WIDGET(ud->builder, "AudioSamplerate"); @@ -931,7 +1139,8 @@ ghb_set_audio(signal_user_data_t *ud, GValue *settings) gint acodec_code; GValue *alist; - GValue *track, *audio, *acodec, *acodec_actual, *bitrate, *rate, *mix, *drc, *gain; + GValue *track, *audio, *acodec, *acodec_actual, *bitrate, *rate, + *mix, *drc, *gain, *quality, *enable_quality; gint count, ii; g_debug("set_audio"); @@ -946,6 +1155,8 @@ ghb_set_audio(signal_user_data_t *ud, GValue *settings) track = ghb_settings_get_value(audio, "AudioTrack"); acodec = ghb_settings_get_value(audio, "AudioEncoder"); acodec_actual = ghb_settings_get_value(audio, "AudioEncoderActual"); + enable_quality = ghb_settings_get_value(audio, "AudioTrackQualityEnable"); + quality = ghb_settings_get_value(audio, "AudioTrackQuality"); bitrate = ghb_settings_get_value(audio, "AudioBitrate"); rate = ghb_settings_get_value(audio, "AudioSamplerate"); mix = ghb_settings_get_value(audio, "AudioMixdown"); @@ -959,6 +1170,8 @@ ghb_set_audio(signal_user_data_t *ud, GValue *settings) ghb_settings_set_value(settings, "AudioTrack", track); ghb_settings_set_value(settings, "AudioEncoder", acodec); ghb_settings_set_value(settings, "AudioEncoderActual", acodec_actual); + ghb_settings_set_value(settings, "AudioTrackQualityEnable", enable_quality); + ghb_settings_set_value(settings, "AudioTrackQuality", quality); // This gets set autimatically if the codec is passthru ghb_settings_set_value(settings, "AudioBitrate", bitrate); diff --git a/gtk/src/audiohandler.h b/gtk/src/audiohandler.h index 88ee306ae..6ecca9983 100644 --- a/gtk/src/audiohandler.h +++ b/gtk/src/audiohandler.h @@ -36,5 +36,7 @@ gchar* ghb_get_user_audio_lang( void ghb_audio_list_refresh_selected(signal_user_data_t *ud); gint ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec, gint fallback_acodec, gint copy_mask); int ghb_get_copy_mask(GValue *settings); +void ghb_audio_list_refresh(signal_user_data_t *ud); +char * ghb_format_quality( const char *prefix, int codec, double quality ); #endif // _AUDIOHANDLER_H_ diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 7b7b81f52..cce28befd 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -237,7 +237,6 @@ ghb_check_dependency( continue; } sensitive = dep_check(ud, dep_name, &hide); - g_free(dep_name); if (GTK_IS_ACTION(dep_object)) { gtk_action_set_sensitive(GTK_ACTION(dep_object), sensitive); @@ -248,13 +247,20 @@ ghb_check_dependency( gtk_widget_set_sensitive(GTK_WIDGET(dep_object), sensitive); if (!sensitive && hide) { - gtk_widget_hide(GTK_WIDGET(dep_object)); + if (gtk_widget_get_visible(GTK_WIDGET(dep_object))) + { + gtk_widget_hide(GTK_WIDGET(dep_object)); + } } else { - gtk_widget_show_now(GTK_WIDGET(dep_object)); + if (!gtk_widget_get_visible(GTK_WIDGET(dep_object))) + { + gtk_widget_show_now(GTK_WIDGET(dep_object)); + } } } + g_free(dep_name); } } diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 5ef2664e6..b25120594 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -288,6 +288,14 @@ <property name="page_size">0</property> <property name="value">10</property> </object> + <object class="GtkAdjustment" id="audio_quality_adj"> + <property name="upper">10</property> + <property name="lower">0</property> + <property name="page_increment">1</property> + <property name="step_increment">0.1</property> + <property name="page_size">0</property> + <property name="value">0.0</property> + </object> <object class="GtkImage" id="subtitle_add_image"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> @@ -2159,6 +2167,22 @@ FFMpeg's and Theora's scale is more linear. These encoders do not have a lossle </packing> </child> <child> + <object class="GtkLabel" id="labela6"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label" translatable="yes"></property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="left_attach">3</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_EXPAND</property> + <property name="y_options">GTK_FILL</property> + </packing> + </child> + <child> <object class="GtkExpander" id="expander1"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> @@ -2169,186 +2193,279 @@ FFMpeg's and Theora's scale is more linear. These encoders do not have a lossle <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="n_rows">4</property> - <property name="n_columns">5</property> + <property name="n_columns">8</property> <property name="row_spacing">5</property> <property name="column_spacing">5</property> <child> - <object class="GtkLabel" id="audio_name_label"> + <object class="GtkHBox" id="hbox40"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Track Name:</property> - <property name="use_markup">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">5</property> + <child> + <object class="GtkLabel" id="labela3"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">1</property> + <property name="label" translatable="yes">Auto Passthru:</property> + </object> + <packing> + <property name="position">0</property> + <property name="expand">False</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="AudioAllowMP3Pass"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip-text" translatable="yes">Enable this if your playback device supports AAC. This permits AAC passthru to be selected when automatic passthru selection is enabled.</property> + <property name="label" translatable="yes">MP3</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <signal handler="global_audio_widget_changed_cb" name="toggled"/> + </object> + <packing> + <property name="position">1</property> + <property name="expand">False</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="AudioAllowAACPass"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip-text" translatable="yes">Enable this if your playback device supports AAC. This permits AAC passthru to be selected when automatic passthru selection is enabled.</property> + <property name="label" translatable="yes">AAC</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <signal handler="global_audio_widget_changed_cb" name="toggled"/> + </object> + <packing> + <property name="position">2</property> + <property name="expand">False</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="AudioAllowAC3Pass"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip-text" translatable="yes">Enable this if your playback device supports AC-3. This permits AC-3 passthru to be selected when automatic passthru selection is enabled.</property> + <property name="label" translatable="yes">AC-3</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <signal handler="global_audio_widget_changed_cb" name="toggled"/> + </object> + <packing> + <property name="position">3</property> + <property name="expand">False</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="AudioAllowDTSPass"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip-text" translatable="yes">Enable this if your playback device supports DTS. This permits DTS passthru to be selected when automatic passthru selection is enabled.</property> + <property name="label" translatable="yes">DTS</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <signal handler="global_audio_widget_changed_cb" name="toggled"/> + </object> + <packing> + <property name="position">4</property> + <property name="expand">False</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="AudioAllowDTSHDPass"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip-text" translatable="yes">Enable this if your playback device supports DTS-HD. This permits DTS-HD passthru to be selected when automatic passthru selection is enabled.</property> + <property name="label" translatable="yes">DTS-HD</property> + <property name="active">True</property> + <property name="draw_indicator">True</property> + <signal handler="global_audio_widget_changed_cb" name="toggled"/> + </object> + <packing> + <property name="position">5</property> + <property name="expand">False</property> + </packing> + </child> </object> <packing> <property name="top_attach">0</property> <property name="bottom_attach">1</property> <property name="left_attach">0</property> - <property name="right_attach">1</property> + <property name="right_attach">4</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkAlignment" id="alignment25"> + <object class="GtkLabel" id="labela4"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="xalign">0</property> - <child> - <object class="GtkEntry" id="AudioTrackName"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="max_length">40</property> - <property name="activates_default">True</property> - <property name="width_chars">20</property> - <property name="truncate_multiline">True</property> - <property name="tooltip-text" translatable="yes">Set the audio track name. Players may use this in the audio selection list.</property> - <signal handler="audio_widget_changed_cb" name="changed"/> - </object> - </child> + <property name="xalign">1</property> + <property name="label" translatable="yes">Passthru Fallback:</property> </object> <packing> <property name="top_attach">0</property> <property name="bottom_attach">1</property> - <property name="left_attach">1</property> - <property name="right_attach">2</property> + <property name="left_attach">4</property> + <property name="right_attach">7</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkLabel" id="fill_label1"> + <object class="GtkComboBox" id="AudioEncoderFallback"> <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_markup">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip-text" translatable="yes">Set the audio codec to encode with when a suitable track can not be found for audio passthru.</property> + <signal handler="global_audio_widget_changed_cb" name="changed"/> </object> <packing> <property name="top_attach">0</property> <property name="bottom_attach">1</property> - <property name="left_attach">2</property> - <property name="right_attach">3</property> - <property name="x_options">GTK_FILL|GTK_EXPAND</property> + <property name="left_attach">7</property> + <property name="right_attach">8</property> + <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkLabel" id="sr_label"> + <object class="GtkHSeparator" id="separator1"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Sample Rate:</property> - <property name="use_markup">True</property> + <property name="orientation">horizontal</property> </object> <packing> <property name="top_attach">1</property> <property name="bottom_attach">2</property> <property name="left_attach">0</property> - <property name="right_attach">1</property> + <property name="right_attach">8</property> <property name="x_options">GTK_FILL</property> + <property name="y_options"></property> </packing> </child> <child> - <object class="GtkAlignment" id="alignment34"> + <object class="GtkAlignment" id="alignment59"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="xalign">0</property> - <property name="xscale">0</property> + <property name="top_padding">8</property> <child> - <object class="GtkComboBox" id="AudioSamplerate"> + <object class="GtkLabel" id="audio_name_label"> <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Set the sample rate of the output audio track.</property> - <signal handler="audio_widget_changed_cb" name="changed"/> + <property name="xalign">0.5</property> + <property name="label" translatable="yes">Track Name:</property> + <property name="use_markup">True</property> </object> </child> </object> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <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="left_attach">0</property> + <property name="right_attach">1</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkLabel" id="gain_label"> + <object class="GtkAlignment" id="alignment25"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Gain:</property> - <property name="use_markup">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">0</property> + <child> + <object class="GtkEntry" id="AudioTrackName"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="max_length">40</property> + <property name="activates_default">True</property> + <property name="width_chars">20</property> + <property name="truncate_multiline">True</property> + <property name="tooltip-text" translatable="yes">Set the audio track name. Players may use this in the audio selection list.</property> + <signal handler="audio_widget_changed_cb" name="changed"/> + </object> + </child> </object> <packing> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="left_attach">3</property> - <property name="right_attach">4</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkHScale" id="AudioTrackGain"> + <object class="GtkLabel" id="AudioSamplerateLabel"> <property name="visible">True</property> - <property name="width-request">150</property> - <property name="orientation">horizontal</property> - <property name="adjustment">adjustment35</property> - <property name="value_pos">right</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-markup" translatable="yes"><b>Audio Gain:</b> Adjust the amplification or attenuation of the output audio track.</property> - <signal handler="gain_widget_changed_cb" name="value_changed"/> - <signal name="format_value" handler="format_gain_cb"/> + <property name="xalign">0.5</property> + <property name="label" translatable="yes">Sample Rate:</property> + <property name="use_markup">True</property> </object> <packing> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="left_attach">4</property> - <property name="right_attach">5</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkLabel" id="drc_label"> + <object class="GtkAlignment" id="alignment34"> <property name="visible">True</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Dynamic Range Compression:</property> - <property name="use_markup">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="xalign">0.5</property> + <property name="xscale">0</property> + <child> + <object class="GtkComboBox" id="AudioSamplerate"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="tooltip-text" translatable="yes">Set the sample rate of the output audio track.</property> + <signal handler="audio_widget_changed_cb" name="changed"/> + </object> + </child> </object> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="left_attach">3</property> - <property name="right_attach">4</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkHScale" id="AudioTrackDRCSlider"> + <object class="GtkLabel" id="AudioTrackGainLabel"> <property name="visible">True</property> - <property name="width-request">100</property> - <property name="orientation">horizontal</property> - <property name="value_pos">right</property> - <property name="adjustment">adjustment28</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-markup" translatable="yes"><b>Dynamic Range Compression:</b> Adjust the dynamic range of the output audio track. - - For source audio that has a wide dynamic range (very loud and very soft sequences), DRC allows you to 'compress' the range by making loud sections softer and soft sections louder.</property> - <signal handler="drc_widget_changed_cb" name="value_changed"/> - <signal name="format_value" handler="format_drc_cb"/> + <property name="xalign">0.5</property> + <property name="label" translatable="yes">Gain:</property> + <property name="use_markup">True</property> </object> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="left_attach">4</property> - <property name="right_attach">5</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="left_attach">2</property> + <property name="right_attach">3</property> <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkHBox" id="hbox40"> + <object class="GtkHBox" id="hbox34"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="spacing">5</property> + <property name="spacing">0</property> <child> - <object class="GtkLabel" id="labela3"> + <object class="GtkScaleButton" id="AudioTrackGain"> <property name="visible">True</property> + <property name="orientation">vertical</property> + <property name="icons">audio-volume-muted +audio-volume-high +audio-volume-low +audio-volume-medium</property> + <property name="adjustment">adjustment35</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Auto Passthru:</property> + <property name="tooltip-markup" translatable="yes"><b>Audio Gain:</b> Adjust the amplification or attenuation of the output audio track.</property> + <signal handler="gain_widget_changed_cb" name="value_changed"/> </object> <packing> <property name="position">0</property> @@ -2356,130 +2473,194 @@ FFMpeg's and Theora's scale is more linear. These encoders do not have a lossle </packing> </child> <child> - <object class="GtkCheckButton" id="AudioAllowMP3Pass"> + <object class="GtkLabel" id="AudioTrackGainValue"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Enable this if your playback device supports AAC. This permits AAC passthru to be selected when automatic passthru selection is enabled.</property> - <property name="label" translatable="yes">MP3</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal handler="global_audio_widget_changed_cb" name="toggled"/> + <property name="width_chars">6</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">0dB</property> + <property name="use_markup">True</property> </object> <packing> <property name="position">1</property> <property name="expand">False</property> </packing> </child> + </object> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="left_attach">2</property> + <property name="right_attach">3</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="AudioTrackDRCSliderLabel"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="label" translatable="yes">DRC:</property> + <property name="tooltip-markup" translatable="yes"><b>Dynamic Range Compression:</b> Adjust the dynamic range of the output audio track. + + For source audio that has a wide dynamic range (very loud and very soft sequences), DRC allows you to 'compress' the range by making loud sections softer and soft sections louder.</property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox33"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">0</property> <child> - <object class="GtkCheckButton" id="AudioAllowAACPass"> + <object class="GtkScaleButton" id="AudioTrackDRCSlider"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="orientation">vertical</property> + <property name="icons">audio-input-microphone</property> + <property name="adjustment">adjustment28</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Enable this if your playback device supports AAC. This permits AAC passthru to be selected when automatic passthru selection is enabled.</property> - <property name="label" translatable="yes">AAC</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal handler="global_audio_widget_changed_cb" name="toggled"/> + <property name="tooltip-markup" translatable="yes"><b>Dynamic Range Compression:</b> Adjust the dynamic range of the output audio track. + + For source audio that has a wide dynamic range (very loud and very soft sequences), DRC allows you to 'compress' the range by making loud sections softer and soft sections louder.</property> + <signal handler="drc_widget_changed_cb" name="value_changed"/> </object> <packing> - <property name="position">2</property> + <property name="position">0</property> <property name="expand">False</property> </packing> </child> <child> - <object class="GtkCheckButton" id="AudioAllowAC3Pass"> + <object class="GtkLabel" id="AudioTrackDRCValue"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Enable this if your playback device supports AC-3. This permits AC-3 passthru to be selected when automatic passthru selection is enabled.</property> - <property name="label" translatable="yes">AC-3</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal handler="global_audio_widget_changed_cb" name="toggled"/> + <property name="width_chars">4</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Off</property> + <property name="use_markup">True</property> </object> <packing> - <property name="position">3</property> + <property name="position">1</property> <property name="expand">False</property> </packing> </child> + </object> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="left_attach">3</property> + <property name="right_attach">4</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="AudioTrackQualityEnable"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="label" translatable="yes">Quality:</property> + <property name="tooltip-markup" translatable="yes"><b>Quality:</b> For output codec's that support it, adjust the quality of the output.</property> + <property name="active">False</property> + <property name="draw_indicator">True</property> + <signal handler="audio_widget_changed_cb" name="toggled"/> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="left_attach">4</property> + <property name="right_attach">5</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox32"> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + <property name="spacing">0</property> <child> - <object class="GtkCheckButton" id="AudioAllowDTSPass"> + <object class="GtkScaleButton" id="AudioTrackQuality"> <property name="visible">True</property> - <property name="can_focus">True</property> + <property name="orientation">vertical</property> + <property name="icons">weather-storm +weather-clear +weather-storm +weather-showers-scattered +weather-showers +weather-overcast +weather-few-clouds +weather-clear</property> + <property name="adjustment">audio_quality_adj</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Enable this if your playback device supports DTS. This permits DTS passthru to be selected when automatic passthru selection is enabled.</property> - <property name="label" translatable="yes">DTS</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal handler="global_audio_widget_changed_cb" name="toggled"/> + <property name="tooltip-markup" translatable="yes"><b>Quality:</b> For output codec's that support it, adjust the quality of the output.</property> + <signal handler="quality_widget_changed_cb" name="value_changed"/> </object> <packing> - <property name="position">4</property> + <property name="position">0</property> <property name="expand">False</property> </packing> </child> <child> - <object class="GtkCheckButton" id="AudioAllowDTSHDPass"> + <object class="GtkLabel" id="AudioTrackQualityValue"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Enable this if your playback device supports DTS-HD. This permits DTS-HD passthru to be selected when automatic passthru selection is enabled.</property> - <property name="label" translatable="yes">DTS-HD</property> - <property name="active">True</property> - <property name="draw_indicator">True</property> - <signal handler="global_audio_widget_changed_cb" name="toggled"/> + <property name="width_chars">4</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">00.0</property> + <property name="use_markup">True</property> </object> <packing> - <property name="position">5</property> + <property name="position">1</property> <property name="expand">False</property> </packing> </child> </object> <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="left_attach">0</property> - <property name="right_attach">4</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="left_attach">4</property> + <property name="right_attach">5</property> + <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <object class="GtkLabel" id="labela4"> + <object class="GtkLabel" id="filler_label0"> <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="xalign">1</property> - <property name="label" translatable="yes">Passthru Fallback:</property> + <property name="label" translatable="yes"></property> + <property name="xalign">0</property> + <property name="use_markup">True</property> </object> <packing> <property name="top_attach">3</property> <property name="bottom_attach">4</property> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="x_options">GTK_FILL</property> + <property name="left_attach">5</property> + <property name="right_attach">8</property> + <property name="x_options">GTK_FILL|GTK_EXPAND</property> </packing> </child> <child> - <object class="GtkComboBox" id="AudioEncoderFallback"> + <object class="GtkLabel" id="filler_label1"> <property name="visible">True</property> - <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> - <property name="tooltip-text" translatable="yes">Set the audio codec to encode with when a suitable track can not be found for audio passthru.</property> - <signal handler="global_audio_widget_changed_cb" name="changed"/> + <property name="label" translatable="yes"></property> + <property name="xalign">0</property> + <property name="use_markup">True</property> </object> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="left_attach">5</property> + <property name="right_attach">8</property> + <property name="x_options">GTK_FILL|GTK_EXPAND</property> </packing> </child> </object> </child> </object> <packing> - <property name="top_attach">0</property> + <property name="top_attach">1</property> <property name="bottom_attach">2</property> - <property name="left_attach">2</property> + <property name="left_attach">0</property> <property name="right_attach">3</property> <property name="x_options">GTK_FILL|GTK_EXPAND</property> <property name="y_options"></property> @@ -2526,7 +2707,7 @@ FFMpeg's and Theora's scale is more linear. These encoders do not have a lossle </packing> </child> <child> - <object class="GtkLabel" id="label69"> + <object class="GtkLabel" id="AudioBitrateLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="label" translatable="yes">Bitrate</property> @@ -2542,7 +2723,7 @@ FFMpeg's and Theora's scale is more linear. These encoders do not have a lossle </packing> </child> <child> - <object class="GtkLabel" id="label24"> + <object class="GtkLabel" id="AudioMixdownLabel"> <property name="visible">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="label" translatable="yes">Mix</property> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 98a13079d..ea817b7ff 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3219,21 +3219,30 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate) g_debug("audio_bitrate_opts_add ()\n"); - if (rate < 8) return; + if (rate >= 0 && rate < 8) return; if (ghb_audio_bitrates[hb_audio_bitrates_count].string) { g_free(ghb_audio_bitrates[hb_audio_bitrates_count].string); } ghb_audio_bitrates[hb_audio_bitrates_count].rate = rate; - ghb_audio_bitrates[hb_audio_bitrates_count].string = - g_strdup_printf("%d", rate); + if (rate < 0) + { + ghb_audio_bitrates[hb_audio_bitrates_count].string = + g_strdup_printf("N/A"); + } + else + { + ghb_audio_bitrates[hb_audio_bitrates_count].string = + g_strdup_printf("%d", rate); + } ghb_audio_bitrates_count = hb_audio_bitrates_count + 1; store = get_combo_box_store(builder, name); if (!find_combo_item_by_int(GTK_TREE_MODEL(store), rate, &iter)) { - str = g_strdup_printf ("<small>%d</small>", rate); + str = g_strdup_printf ("<small>%s</small>", + ghb_audio_bitrates[hb_audio_bitrates_count].string); gtk_list_store_append(store, &iter); gtk_list_store_set(store, &iter, 0, str, @@ -3247,11 +3256,12 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate) } static void -audio_bitrate_opts_clean( +audio_bitrate_opts_update( GtkBuilder *builder, const gchar *name, gint first_rate, - gint last_rate) + gint last_rate, + gint extra_rate) { GtkTreeIter iter; GtkListStore *store; @@ -3270,12 +3280,14 @@ audio_bitrate_opts_clean( do { gtk_tree_model_get(GTK_TREE_MODEL(store), &iter, 3, &ivalue, -1); - if (search_rates( + if (ivalue != first_rate && ivalue != last_rate && + !(ivalue == extra_rate && extra_rate >= first_rate) && + search_rates( ghb_audio_bitrates, ivalue, ghb_audio_bitrates_count) < 0) { done = !gtk_list_store_remove(store, &iter); } - else if (ivalue < first || ivalue > last) + else if ((int)ivalue < first || (int)ivalue > last) { ii++; gtk_list_store_set(store, &iter, 1, FALSE, -1); @@ -3289,6 +3301,8 @@ audio_bitrate_opts_clean( } } while (!done); } + if (extra_rate >= first_rate) + audio_bitrate_opts_add(builder, name, extra_rate); } static void @@ -3327,18 +3341,13 @@ audio_bitrate_opts_set(GtkBuilder *builder, const gchar *name) } void -ghb_set_passthru_bitrate_opts(GtkBuilder *builder, gint bitrate) -{ - audio_bitrate_opts_add(builder, "AudioBitrate", bitrate); -} - -void -ghb_set_default_bitrate_opts( +ghb_set_bitrate_opts( GtkBuilder *builder, gint first_rate, - gint last_rate) + gint last_rate, + gint extra_rate) { - audio_bitrate_opts_clean(builder, "AudioBitrate", first_rate, last_rate); + audio_bitrate_opts_update(builder, "AudioBitrate", first_rate, last_rate, extra_rate); } static ghb_status_t hb_status; @@ -4906,17 +4915,28 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) // Make sure the mixdown is valid and pick a new one if not. audio.out.mixdown = ghb_get_best_mix(aconfig, audio.out.codec, audio.out.mixdown); - audio.out.bitrate = - ghb_settings_combo_int(asettings, "AudioBitrate"); + double quality = ghb_settings_get_double(asettings, "AudioTrackQuality"); + if (ghb_settings_get_boolean(asettings, "AudioTrackQualityEnable") && + quality >= 0) + { + audio.out.quality = quality; + audio.out.bitrate = -1; + } + else + { + audio.out.quality = -1; + audio.out.bitrate = + ghb_settings_combo_int(asettings, "AudioBitrate"); + + audio.out.bitrate = hb_get_best_audio_bitrate( + audio.out.codec, audio.out.bitrate, + audio.out.samplerate, audio.out.mixdown); + } gint srate = ghb_settings_combo_int(asettings, "AudioSamplerate"); if (srate == 0) // 0 is same as source audio.out.samplerate = aconfig->in.samplerate; else audio.out.samplerate = srate; - - audio.out.bitrate = hb_get_best_audio_bitrate( - audio.out.codec, audio.out.bitrate, - audio.out.samplerate, audio.out.mixdown); } // Add it to the jobs audio list diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index 683ead9c1..4d6f1efa3 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -135,9 +135,8 @@ gboolean ghb_audio_is_passthru(gint acodec); gboolean ghb_audio_can_passthru(gint acodec); gint ghb_get_default_acodec(void); hb_audio_config_t* ghb_get_scan_audio_info(gint titleindex, gint audioindex); -void ghb_set_passthru_bitrate_opts(GtkBuilder *builder, gint bitrate); -void ghb_set_default_bitrate_opts( - GtkBuilder *builder, gint first_rate, gint last_rate); +void ghb_set_bitrate_opts( + GtkBuilder *builder, gint first_rate, gint last_rate, gint extra_rate); void ghb_grey_combo_options(signal_user_data_t *ud); void ghb_update_ui_combo_box( signal_user_data_t *ud, const gchar *name, gint user_data, gboolean all); diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml index b4d06694d..0a6f65aba 100644 --- a/gtk/src/internal_defaults.xml +++ b/gtk/src/internal_defaults.xml @@ -318,6 +318,10 @@ <integer>1</integer> <key>AudioTrackDescription</key> <string></string> + <key>AudioTrackQualityEnable</key> + <false /> + <key>AudioTrackQuality</key> + <real>-1</real> <key>AudioTrackGain</key> <real>0</real> <key>AudioTrackDRCSlider</key> diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py index a3c3bdf62..d7c2fa762 100644 --- a/gtk/src/makedeps.py +++ b/gtk/src/makedeps.py @@ -49,13 +49,25 @@ dep_map = ( DepEntry("VideoEncoder", "x264_tab", "x264", False, True), DepEntry("VideoEncoder", "lavc_mpeg4_tab", "ffmpeg|ffmpeg2", False, True), DepEntry("VideoEncoder", "Mp4iPodCompatible", "x264", False, False), + DepEntry("AudioTrackQualityEnable", "AudioTrackQuality", "FALSE", True, False), + DepEntry("AudioTrackQualityEnable", "AudioTrackQualityValue", "FALSE", True, False), + DepEntry("AudioTrackQualityEnable", "AudioBitrateLabel", "TRUE", True, False), + DepEntry("AudioTrackQualityEnable", "AudioBitrate", "TRUE", True, False), + DepEntry("AudioEncoderActual", "AudioTrackQualityEnable", "lame|vorbis", False, True), + DepEntry("AudioEncoderActual", "AudioTrackQuality", "lame|vorbis", False, True), + DepEntry("AudioEncoderActual", "AudioTrackQualityValue", "lame|vorbis", False, True), + DepEntry("AudioEncoderActual", "AudioBitrateLabel", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), DepEntry("AudioEncoderActual", "AudioBitrate", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), + DepEntry("AudioEncoderActual", "AudioSamplerateLabel", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), DepEntry("AudioEncoderActual", "AudioSamplerate", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), + DepEntry("AudioEncoderActual", "AudioMixdownLabel", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), DepEntry("AudioEncoderActual", "AudioMixdown", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), + DepEntry("AudioEncoderActual", "AudioTrackDRCSliderLabel", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), DepEntry("AudioEncoderActual", "AudioTrackDRCSlider", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), - DepEntry("AudioEncoderActual", "drc_label", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), + DepEntry("AudioEncoderActual", "AudioTrackDRCValue", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), + DepEntry("AudioEncoderActual", "AudioTrackGainLabel", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), DepEntry("AudioEncoderActual", "AudioTrackGain", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), - DepEntry("AudioEncoderActual", "gain_label", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), + DepEntry("AudioEncoderActual", "AudioTrackGainValue", "copy:mp3|copy:aac|copy:ac3|copy:dts|copy:dtshd", True, False), DepEntry("AudioEncoder", "AudioAllowMP3Pass", "copy", False, False), DepEntry("AudioEncoder", "AudioAllowAACPass", "copy", False, False), DepEntry("AudioEncoder", "AudioAllowAC3Pass", "copy", False, False), diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c index 6b934c14e..8769ad5b3 100644 --- a/gtk/src/queuehandler.c +++ b/gtk/src/queuehandler.c @@ -20,6 +20,7 @@ #include "values.h" #include "callbacks.h" #include "presets.h" +#include "audiohandler.h" #include "ghb-dvd.h" G_MODULE_EXPORT void @@ -400,7 +401,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) count = ghb_array_len(audio_list); for (ii = 0; ii < count; ii++) { - gchar *bitrate, *samplerate, *track; + gchar *quality = NULL, *samplerate, *track; const gchar *acodec, *mix; GValue *asettings; gdouble sr; @@ -408,7 +409,19 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) asettings = ghb_array_get_nth(audio_list, ii); acodec = ghb_settings_combo_option(asettings, "AudioEncoderActual"); - bitrate = ghb_settings_get_string(asettings, "AudioBitrate"); + double q = ghb_settings_get_double(asettings, "AudioTrackQuality"); + if (ghb_settings_get_boolean(asettings, "AudioTrackQualityEnable") && + q >= 0) + { + int codec = ghb_settings_combo_int(asettings, "AudioEncoderActual"); + quality = ghb_format_quality("Quality: ", codec, q); + } + else + { + const char *br; + br = ghb_settings_combo_option(asettings, "AudioBitrate"); + quality = g_strdup_printf("Bitrate: %s", br); + } sr = ghb_settings_get_double(asettings, "AudioSamplerate"); samplerate = ghb_settings_get_string(asettings, "AudioSamplerate"); if ((int)sr == 0) @@ -429,10 +442,10 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) g_string_append_printf(str, "\t"); g_string_append_printf(str, - "<small> %s, Encoder: %s, Mixdown: %s, SampleRate: %s, Bitrate: %s</small>\n", - track, acodec, mix, samplerate, bitrate); + "<small> %s, Encoder: %s, Mixdown: %s, SampleRate: %s, %s</small>\n", + track, acodec, mix, samplerate, quality); g_free(track); - g_free(bitrate); + g_free(quality); g_free(samplerate); } @@ -505,67 +518,6 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter) g_free(preset); } -void -audio_list_refresh(signal_user_data_t *ud) -{ - GtkTreeView *treeview; - GtkTreeIter iter; - GtkListStore *store; - gboolean done; - gint row = 0; - const GValue *audio_list; - - g_debug("ghb_audio_list_refresh ()"); - treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "audio_list")); - store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview)); - if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) - { - do - { - const gchar *track, *codec, *br, *sr, *mix; - gchar *s_drc, *s_gain; - gint itrack; - gdouble drc, gain; - GValue *asettings; - - audio_list = ghb_settings_get_value(ud->settings, "audio_list"); - if (row >= ghb_array_len(audio_list)) - return; - asettings = ghb_array_get_nth(audio_list, row); - - track = ghb_settings_combo_option(asettings, "AudioTrack"); - itrack = ghb_settings_combo_int(asettings, "AudioTrack"); - codec = ghb_settings_combo_option(asettings, "AudioEncoderActual"); - br = ghb_settings_combo_option(asettings, "AudioBitrate"); - sr = ghb_settings_combo_option(asettings, "AudioSamplerate"); - mix = ghb_settings_combo_option(asettings, "AudioMixdown"); - gain = ghb_settings_get_double(asettings, "AudioTrackGain"); - s_gain = g_strdup_printf("%.fdB", gain); - - drc = ghb_settings_get_double(asettings, "AudioTrackDRCSlider"); - if (drc < 1.0) - s_drc = g_strdup("Off"); - else - s_drc = g_strdup_printf("%.1f", drc); - - gtk_list_store_set(GTK_LIST_STORE(store), &iter, - // These are displayed in list - 0, track, - 1, codec, - 2, br, - 3, sr, - 4, mix, - 5, s_gain, - 6, s_drc, - -1); - g_free(s_drc); - g_free(s_gain); - done = !gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter); - row++; - } while (!done); - } -} - static gboolean validate_settings(signal_user_data_t *ud) { @@ -711,7 +663,7 @@ validate_settings(signal_user_data_t *ud) { return FALSE; } - audio_list_refresh(ud); + ghb_audio_list_refresh(ud); return TRUE; } |