MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / set_widget_ranges

Function set_widget_ranges

gtk/src/callbacks.c:1268–1342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1266}
1267
1268static void
1269set_widget_ranges (signal_user_data_t *ud, GhbValue *settings)
1270{
1271 int title_id, titleindex;
1272 const hb_title_t * title;
1273 double val;
1274
1275 title_id = ghb_dict_get_int(settings, "title");
1276 title = ghb_lookup_title(title_id, &titleindex);
1277
1278 // Reconfigure the UI combo boxes
1279 ghb_update_ui_combo_box(ud, "AudioTrack", title, FALSE);
1280 ghb_update_ui_combo_box(ud, "SubtitleTrack", title, FALSE);
1281
1282 if (title != NULL)
1283 {
1284
1285 // Set the limits of cropping. hb_set_anamorphic_size crashes if
1286 // you pass it a cropped width or height == 0.
1287 gint vbound, hbound;
1288 vbound = title->geometry.height;
1289 hbound = title->geometry.width;
1290
1291 val = ghb_dict_get_int(ud->settings, "PictureTopCrop");
1292 spin_configure(ud, "PictureTopCrop", val, 0, vbound);
1293 val = ghb_dict_get_int(ud->settings, "PictureBottomCrop");
1294 spin_configure(ud, "PictureBottomCrop", val, 0, vbound);
1295 val = ghb_dict_get_int(ud->settings, "PictureLeftCrop");
1296 spin_configure(ud, "PictureLeftCrop", val, 0, hbound);
1297 val = ghb_dict_get_int(ud->settings, "PictureRightCrop");
1298 spin_configure(ud, "PictureRightCrop", val, 0, hbound);
1299
1300 gint duration = title->duration / 90000;
1301
1302 if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
1303 {
1304 GhbValue *chapter_list = ghb_get_job_chapter_list(settings);
1305 gint num_chapters = ghb_array_len(chapter_list);
1306
1307 val = ghb_dict_get_int(ud->settings, "start_point");
1308 spin_configure(ud, "start_point", val, 1, num_chapters);
1309 val = ghb_dict_get_int(ud->settings, "end_point");
1310 spin_configure(ud, "end_point", val, 1, num_chapters);
1311 }
1312 else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
1313 {
1314 val = ghb_dict_get_int(ud->settings, "start_point");
1315 spin_configure(ud, "start_point", val, 0, duration * 2 - 1);
1316 val = ghb_dict_get_int(ud->settings, "end_point");
1317 spin_configure(ud, "end_point", val, 0, duration * 2);
1318 }
1319 else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
1320 {
1321 gdouble max_frames;
1322 max_frames = (gdouble)duration *
1323 title->vrate.num / title->vrate.den;
1324
1325 val = ghb_dict_get_int(ud->settings, "start_point");

Callers 1

ghb_load_post_settingsFunction · 0.85

Calls 9

ghb_dict_get_intFunction · 0.85
ghb_lookup_titleFunction · 0.85
ghb_update_ui_combo_boxFunction · 0.85
spin_configureFunction · 0.85
ghb_settings_combo_intFunction · 0.85
ghb_get_job_chapter_listFunction · 0.85
ghb_vquality_rangeFunction · 0.85
ghb_dict_get_doubleFunction · 0.85
ghb_scale_configureFunction · 0.85

Tested by

no test coverage detected