summaryrefslogtreecommitdiff
path: root/gtk2_ardour/note_base.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-05-01 17:39:03 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2020-05-01 17:39:13 -0600
commit044be536168b0ae0dc44390ec3e58b60c4a9b613 (patch)
treef7748f0c6b331e390509a07fec7b2baa54ba9a9e /gtk2_ardour/note_base.h
parent13c0145890a6d86614482741bf8f486116002737 (diff)
attempt to properly manage MIDI note display of selected status
Whether to display the selected outline depends on BOTH whether the note is selected, and whether we are in an internal editing mode.
Diffstat (limited to 'gtk2_ardour/note_base.h')
-rw-r--r--gtk2_ardour/note_base.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/gtk2_ardour/note_base.h b/gtk2_ardour/note_base.h
index 74521f7258..c1fa77d256 100644
--- a/gtk2_ardour/note_base.h
+++ b/gtk2_ardour/note_base.h
@@ -55,7 +55,13 @@ namespace ArdourCanvas {
*/
class NoteBase : public sigc::trackable
{
-public:
+ private:
+ enum Flags {
+ Selected = 0x1,
+ HideSelection = 0x2,
+ };
+
+ public:
typedef Evoral::Note<Temporal::Beats> NoteType;
NoteBase (MidiRegionView& region, bool, const boost::shared_ptr<NoteType> note = boost::shared_ptr<NoteType>());
@@ -71,8 +77,9 @@ public:
void invalidate ();
void validate ();
- bool selected() const { return _selected; }
+ bool selected() const { return _flags & Selected; }
void set_selected(bool yn);
+ void set_hide_selection (bool yn);
virtual void move_event(double dx, double dy) = 0;
@@ -108,8 +115,8 @@ public:
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) {
+ inline static uint32_t calculate_outline(uint32_t color, bool showing_selection = false) {
+ if (showing_selection) {
return _selected_col;
} else {
return UINT_INTERPOLATE(color, 0x000000ff, 0.5);
@@ -132,7 +139,7 @@ protected:
const boost::shared_ptr<NoteType> _note;
bool _with_events;
bool _own_note;
- bool _selected;
+ Flags _flags;
bool _valid;
float _mouse_x_fraction;
float _mouse_y_fraction;