From bf93910b400b4fd122599796eb30253531c05b2a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 18 Jan 2020 22:53:54 +0100 Subject: Factorise the frozen string --- glitchyclock.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/glitchyclock.c b/glitchyclock.c index 2a960fc..9c3327c 100644 --- a/glitchyclock.c +++ b/glitchyclock.c @@ -128,6 +128,7 @@ static gboolean draw_sig(GtkWidget *widget, cairo_t *cr, struct glitchyclock *gc int clock_hours, clock_minutes, clock_seconds; int glitch = 0; double duty; + const char *frozenstr = "vl:68"; w = gtk_widget_get_allocated_width(widget); h = gtk_widget_get_allocated_height(widget); @@ -165,7 +166,7 @@ static gboolean draw_sig(GtkWidget *widget, cairo_t *cr, struct glitchyclock *gc if ( cues[gc->cue].type == FADE_IN_FROZEN ) { gc->brightness = seconds_elapsed / cues[gc->cue].parameter; if ( gc->brightness > 1.0 ) gc->brightness = 1.0; - strcpy(timestr, "88:68"); + strcpy(timestr, frozenstr); } if ( cues[gc->cue].type == BLACKOUT ) { @@ -176,7 +177,7 @@ static gboolean draw_sig(GtkWidget *widget, cairo_t *cr, struct glitchyclock *gc if ( cues[gc->cue].type == BLACKOUT_FROZEN ) { gc->brightness = 1.0 - (seconds_elapsed / cues[gc->cue].parameter); if ( gc->brightness < 0.0 ) gc->brightness = 0.0; - strcpy(timestr, "88:68"); + strcpy(timestr, frozenstr); } if ( (cues[gc->cue].type == GLITCH) @@ -215,9 +216,9 @@ static gboolean draw_sig(GtkWidget *widget, cairo_t *cr, struct glitchyclock *gc if ( glitch ) { if ( fmod(seconds_elapsed, 0.05) > duty*0.05 ) { - strcpy(timestr, "00:c1"); + strcpy(timestr, "00:00"); } else { - strcpy(timestr, "vL:68"); + strcpy(timestr, frozenstr); } } -- cgit v1.2.3