X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fnote_base.h;h=574ca54e6d75e37436fab7fbff4e3f461496778b;hb=69194df4d9a2f985423eca7d44c3d3292cc8baad;hp=b7be36ada864b756b9f74eede7931c9bad715234;hpb=b976bf8986290e8f4812a50e7fdd98b9cbeb4249;p=ardour.git diff --git a/gtk2_ardour/note_base.h b/gtk2_ardour/note_base.h index b7be36ada8..574ca54e6d 100644 --- a/gtk2_ardour/note_base.h +++ b/gtk2_ardour/note_base.h @@ -22,7 +22,9 @@ #include +#include "temporal/beats.h" #include "canvas/types.h" +#include "gtkmm2ext/colors.h" #include "rgb_macros.h" #include "ui_config.h" @@ -53,7 +55,7 @@ namespace ArdourCanvas { class NoteBase : public sigc::trackable { public: - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; NoteBase (MidiRegionView& region, bool, const boost::shared_ptr note = boost::shared_ptr()); virtual ~NoteBase (); @@ -102,20 +104,12 @@ public: static void set_colors (); - inline static uint32_t meter_style_fill_color(uint8_t vel, bool selected) { - if (selected) { - return _selected_mod_col; - } else if (vel < 64) { - return UINT_INTERPOLATE(_min_col, _mid_col, (vel / (double)63.0)); - } else { - return UINT_INTERPOLATE(_mid_col, _max_col, ((vel - 64) / (double)63.0)); - } - } + static Gtkmm2ext::Color meter_style_fill_color(uint8_t vel, bool selected); /// calculate outline colors from fill colors of notes inline static uint32_t calculate_outline(uint32_t color, bool selected=false) { if (selected) { - return _selected_outline_col; + return _selected_col; } else { return UINT_INTERPOLATE(color, 0x000000ff, 0.5); } @@ -147,12 +141,9 @@ protected: private: bool event_handler (GdkEvent *); - static uint32_t _selected_mod_col; - static uint32_t _selected_outline_col; - static uint32_t _selected_col; - static uint32_t _min_col; - static uint32_t _mid_col; - static uint32_t _max_col; + static Gtkmm2ext::Color _selected_col; + static Gtkmm2ext::SVAModifier color_modifier; + static Gtkmm2ext::Color velocity_color_table[128]; static bool _color_init; };