* Reads the text entered in the spin button text field and converts * it to the correct format for the current mode. */
| 3369 | * it to the correct format for the current mode. |
| 3370 | */ |
| 3371 | G_MODULE_EXPORT gboolean |
| 3372 | ptop_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 |
no test coverage detected