summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-01-18 22:53:54 +0100
committerThomas White <taw@physics.org>2020-01-18 22:53:54 +0100
commitbf93910b400b4fd122599796eb30253531c05b2a (patch)
treec43f0494c84bff6b29de1706b2f9ac1c10c1880f
parentc078ba9c9f63f623665b69bce99f7c633c201a1a (diff)
Factorise the frozen string
-rw-r--r--glitchyclock.c9
1 files 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);
}
}