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

Function ptop_read_value_cb

gtk/src/callbacks.c:3371–3398  ·  view source on GitHub ↗

* Reads the text entered in the spin button text field and converts * it to the correct format for the current mode. */

Source from the content-addressed store, hash-verified

3369 * it to the correct format for the current mode.
3370 */
3371G_MODULE_EXPORT gboolean
3372ptop_read_value_cb (GtkWidget *widget, gdouble *val, gpointer data)
3373{
3374 const gchar *text;
3375 int64_t result;
3376 gdouble ss = 0;
3377 int hh = 0, mm = 0;
3378 signal_user_data_t *ud = ghb_ud();
3379
3380 text = gtk_editable_get_text(GTK_EDITABLE(widget));
3381 if (ghb_settings_combo_int(ud->settings, "PtoPType") != 1)
3382 {
3383 result = strtol(text, NULL, 10);
3384 *val = (gdouble) result;
3385 return TRUE;
3386 }
3387
3388 result = sscanf(text, "%2d:%2d:%lf", &hh, &mm, &ss);
3389 if (result != 1 && result != 3)
3390 return FALSE;
3391 if (result == 1)
3392 {
3393 sscanf(text, "%lf", val);
3394 return TRUE;
3395 }
3396 *val = hh * 3600 + mm * 60 + ss;
3397 return TRUE;
3398}
3399
3400/*
3401 * Formats the current start or end point into a string which is then

Callers 2

start_point_changed_cbFunction · 0.85
end_point_changed_cbFunction · 0.85

Calls 2

ghb_udFunction · 0.85
ghb_settings_combo_intFunction · 0.85

Tested by

no test coverage detected