| 80 | } |
| 81 | |
| 82 | G_MODULE_EXPORT void |
| 83 | vcodec_changed_cb (GtkWidget *widget, gpointer data) |
| 84 | { |
| 85 | float val, vqmin, vqmax, step, page; |
| 86 | int inverted, digits; |
| 87 | signal_user_data_t *ud = ghb_ud(); |
| 88 | |
| 89 | ghb_widget_to_setting(ud->settings, widget); |
| 90 | ghb_show_container_options(ud); |
| 91 | ghb_update_summary_info(ud); |
| 92 | ghb_clear_presets_selection(ud); |
| 93 | ghb_live_reset(ud); |
| 94 | ghb_update_multipass(ud); |
| 95 | |
| 96 | // Set the range of the video quality slider |
| 97 | val = ghb_vquality_default(ud); |
| 98 | ghb_vquality_range(ud, &vqmin, &vqmax, &step, &page, &digits, &inverted); |
| 99 | ghb_scale_configure(ud, "VideoQualitySlider", val, vqmin, vqmax, |
| 100 | step, page, digits, inverted); |
| 101 | |
| 102 | ghb_update_ui_combo_box(ud, "VideoTune", NULL, FALSE); |
| 103 | ghb_update_ui_combo_box(ud, "VideoProfile", NULL, FALSE); |
| 104 | ghb_update_ui_combo_box(ud, "VideoLevel", NULL, FALSE); |
| 105 | ghb_ui_update("VideoTune", ghb_int_value(0)); |
| 106 | ghb_ui_update("VideoProfile", ghb_int_value(0)); |
| 107 | ghb_ui_update("VideoLevel", ghb_int_value(0)); |
| 108 | ghb_ui_update("VideoOptionExtra", ghb_string_value("")); |
| 109 | |
| 110 | // Set the range of the preset slider |
| 111 | int encoder = ghb_get_video_encoder(ud->settings); |
| 112 | GtkWidget *presetSlider = ghb_builder_widget("VideoPresetSlider"); |
| 113 | const char * const *video_presets; |
| 114 | int count = 0; |
| 115 | video_presets = hb_video_encoder_get_presets(encoder); |
| 116 | while (video_presets && video_presets[count]) count++; |
| 117 | gtk_widget_set_visible(presetSlider, count > 0); |
| 118 | if (count) |
| 119 | { |
| 120 | gtk_range_set_range(GTK_RANGE(presetSlider), 0, count-1); |
| 121 | gtk_scale_clear_marks(GTK_SCALE(presetSlider)); |
| 122 | for (double i = 0; i < count; i += 1) |
| 123 | { |
| 124 | gtk_scale_add_mark(GTK_SCALE(presetSlider), i, GTK_POS_BOTTOM, NULL); |
| 125 | } |
| 126 | } |
| 127 | ghb_set_video_preset(ud->settings, encoder, NULL); |
| 128 | GhbValue *gval = ghb_dict_get_value(ud->settings, "VideoPresetSlider"); |
| 129 | ghb_ui_settings_update(ud, ud->settings, "VideoPresetSlider", gval); |
| 130 | |
| 131 | // update quality type |
| 132 | GtkWidget *cqRadioButton = ghb_builder_widget("vquality_type_constant"); |
| 133 | GtkWidget *abrRadioButton = ghb_builder_widget("vquality_type_bitrate"); |
| 134 | gtk_widget_set_sensitive(cqRadioButton, hb_video_quality_is_supported(encoder)); |
| 135 | gtk_widget_set_sensitive(abrRadioButton, hb_video_bitrate_is_supported(encoder)); |
| 136 | if (ghb_widget_boolean(cqRadioButton) && ! hb_video_quality_is_supported(encoder)) |
| 137 | { |
| 138 | ghb_update_widget(abrRadioButton, ghb_boolean_value(true)); |
| 139 | } |
nothing calls this directly
no test coverage detected