From 6d477586710b56efe4fb6ec42dae167f805045e1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 31 Aug 2024 02:29:55 +0200 Subject: [PATCH] Add TailTime Icon --- libs/widgets/ardour_icon.cc | 42 ++++++++++++++++++++++++++++++ libs/widgets/widgets/ardour_icon.h | 1 + 2 files changed, 43 insertions(+) diff --git a/libs/widgets/ardour_icon.cc b/libs/widgets/ardour_icon.cc index e66b5697bb..0e5343c406 100644 --- a/libs/widgets/ardour_icon.cc +++ b/libs/widgets/ardour_icon.cc @@ -1344,6 +1344,45 @@ icon_latency_clock (cairo_t* cr, const int width, const int height, const uint32 cairo_fill (cr); } +static void +icon_tailtime_clock (cairo_t* cr, const int width, const int height, const uint32_t fg_color) +{ + const double x = width * .5; + const double y = height * .5; + const double d = std::min (x, y) * .4; + const double r = std::min (x, y) * .66; + + const double lw = DEFAULT_LINE_WIDTH; + const double lc = fmod (lw * .5, 1.0); + const double x0 = rint (x) - lc; + const double yl = rint (y) - lc; + + cairo_move_to (cr, x0, y - d); + cairo_line_to (cr, x0, y - r); + VECTORICONSTROKE (lw, fg_color); + + cairo_move_to (cr, x0, y + d); + cairo_line_to (cr, x0, y + r); + VECTORICONSTROKE (lw, fg_color); + + cairo_move_to (cr, x - d , yl); + cairo_line_to (cr, x - r, yl); + VECTORICONSTROKE (lw, fg_color); + + cairo_move_to (cr, x + d , yl); + cairo_line_to (cr, x + r, yl); + VECTORICONSTROKE (lw, fg_color); + + cairo_move_to (cr, x , y); + cairo_close_path (cr); + VECTORICONSTROKE (lw, fg_color); + + cairo_arc (cr, x, y, r, 0, 2 * M_PI); + VECTORICONSTROKE (lw, fg_color); + + //cairo_fill (cr); +} + static void icon_file_folder (cairo_t* cr, const int width, const int height, const uint32_t fg_color) { @@ -1689,6 +1728,9 @@ ArdourWidgets::ArdourIcon::render (cairo_t* cr case TrackWaveform: icon_waveform (cr, width, height, fg_color); break; + case TailTimeClock: + icon_tailtime_clock (cr, width, height, fg_color); + break; case NoIcon: rv = false; break; diff --git a/libs/widgets/widgets/ardour_icon.h b/libs/widgets/widgets/ardour_icon.h index 7a04c4593c..d58062f51f 100644 --- a/libs/widgets/widgets/ardour_icon.h +++ b/libs/widgets/widgets/ardour_icon.h @@ -77,6 +77,7 @@ namespace ArdourWidgets { namespace ArdourIcon { Mixer, Meters, TrackWaveform, + TailTimeClock, NoIcon //< Last };