[totem/wip/hadess/precise-stepping: 1/7] backend: Add helper to reset time labels




commit 27b3971e21ebd599bd381bead795fdd9cc877f02
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 17 18:04:20 2022 +0100

    backend: Add helper to reset time labels

 src/backend/bacon-time-label.c | 8 ++++++++
 src/backend/bacon-time-label.h | 6 ++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/backend/bacon-time-label.c b/src/backend/bacon-time-label.c
index f9215dc46..8a0bdccbf 100644
--- a/src/backend/bacon-time-label.c
+++ b/src/backend/bacon-time-label.c
@@ -152,6 +152,14 @@ bacon_time_label_set_time (BaconTimeLabel *label,
        update_label_text (label);
 }
 
+void
+bacon_time_label_reset_time (BaconTimeLabel *label)
+{
+       g_return_if_fail (BACON_IS_TIME_LABEL (label));
+
+       bacon_time_label_set_time (label, 0, 0);
+}
+
 void
 bacon_time_label_set_remaining (BaconTimeLabel *label,
                                gboolean        remaining)
diff --git a/src/backend/bacon-time-label.h b/src/backend/bacon-time-label.h
index 101e7517d..cde8a92ec 100644
--- a/src/backend/bacon-time-label.h
+++ b/src/backend/bacon-time-label.h
@@ -29,8 +29,10 @@ G_DECLARE_FINAL_TYPE(BaconTimeLabel, bacon_time_label, BACON, TIME_LABEL, GtkLab
 G_MODULE_EXPORT GType bacon_time_label_get_type (void);
 GtkWidget *bacon_time_label_new                 (void);
 void       bacon_time_label_set_time            (BaconTimeLabel *label,
-                                                 gint64          time,
-                                                 gint64          length);
+                                                 gint64          time_msecs,
+                                                 gint64          length_msecs);
+void       bacon_time_label_reset_time          (BaconTimeLabel *label);
+
 void
 bacon_time_label_set_remaining                  (BaconTimeLabel *label,
                                                  gboolean        remaining);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]