mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
show trigger/slot selection
This commit is contained in:
parent
a9949f20e6
commit
4f58a92c6d
2 changed files with 35 additions and 6 deletions
|
|
@ -106,7 +106,6 @@ TriggerEntry::TriggerEntry (Canvas* canvas, ARDOUR::Trigger& t)
|
||||||
prop_change (changed);
|
prop_change (changed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TriggerEntry::~TriggerEntry ()
|
TriggerEntry::~TriggerEntry ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -123,14 +122,28 @@ void
|
||||||
TriggerEntry::owner_color_changed ()
|
TriggerEntry::owner_color_changed ()
|
||||||
{
|
{
|
||||||
set_fill_color (dynamic_cast<Stripable*> (_trigger.box().owner())->presentation_info().color());
|
set_fill_color (dynamic_cast<Stripable*> (_trigger.box().owner())->presentation_info().color());
|
||||||
set_outline_color (HSV (fill_color()).opposite().color());
|
selection_change ();
|
||||||
active_bar->set_fill_color (HSV (fill_color()).darker(0.3).color ());
|
active_bar->set_fill_color (HSV (fill_color()).darker(0.3).color ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TriggerEntry::selection_change ()
|
||||||
|
{
|
||||||
|
if (PublicEditor::instance().get_selection().selected (this)) {
|
||||||
|
set_outline_color (UIConfiguration::instance().color ("selection"));
|
||||||
|
} else {
|
||||||
|
set_outline_color (HSV (fill_color()).opposite().color());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
TriggerEntry::event_handler (GdkEvent* ev)
|
TriggerEntry::event_handler (GdkEvent* ev)
|
||||||
{
|
{
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
|
case GDK_BUTTON_PRESS:
|
||||||
|
PublicEditor::instance().get_selection().set (this);
|
||||||
|
break;
|
||||||
case GDK_ENTER_NOTIFY:
|
case GDK_ENTER_NOTIFY:
|
||||||
if (ev->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
if (ev->crossing.detail != GDK_NOTIFY_INFERIOR) {
|
||||||
play_button->show ();
|
play_button->show ();
|
||||||
|
|
@ -269,11 +282,22 @@ TriggerBoxUI::TriggerBoxUI (ArdourCanvas::Item* parent, TriggerBox& tb)
|
||||||
set_fill (true);
|
set_fill (true);
|
||||||
|
|
||||||
build ();
|
build ();
|
||||||
|
|
||||||
|
selection_connection = PublicEditor::instance().get_selection().TriggersChanged.connect (sigc::mem_fun (*this, &TriggerBoxUI::selection_changed));
|
||||||
}
|
}
|
||||||
|
|
||||||
TriggerBoxUI::~TriggerBoxUI ()
|
TriggerBoxUI::~TriggerBoxUI ()
|
||||||
{
|
{
|
||||||
update_connection.disconnect ();
|
update_connection.disconnect ();
|
||||||
|
selection_connection.disconnect ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TriggerBoxUI::selection_changed ()
|
||||||
|
{
|
||||||
|
for (auto & slot : _slots) {
|
||||||
|
slot->selection_change ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -347,6 +371,8 @@ bool
|
||||||
TriggerBoxUI::event (GdkEvent* ev, uint64_t n)
|
TriggerBoxUI::event (GdkEvent* ev, uint64_t n)
|
||||||
{
|
{
|
||||||
switch (ev->type) {
|
switch (ev->type) {
|
||||||
|
case GDK_BUTTON_PRESS:
|
||||||
|
break;
|
||||||
case GDK_2BUTTON_PRESS:
|
case GDK_2BUTTON_PRESS:
|
||||||
edit_trigger (n);
|
edit_trigger (n);
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -662,8 +688,8 @@ TriggerBoxUI::stop_updating ()
|
||||||
void
|
void
|
||||||
TriggerBoxUI::rapid_update ()
|
TriggerBoxUI::rapid_update ()
|
||||||
{
|
{
|
||||||
for (Slots::iterator s = _slots.begin(); s != _slots.end(); ++s) {
|
for (auto & slot : _slots) {
|
||||||
(*s)->maybe_update ();
|
slot->maybe_update ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ class TriggerEntry : public ArdourCanvas::Rectangle
|
||||||
void _size_allocate (ArdourCanvas::Rect const &);
|
void _size_allocate (ArdourCanvas::Rect const &);
|
||||||
void maybe_update ();
|
void maybe_update ();
|
||||||
bool event_handler (GdkEvent*);
|
bool event_handler (GdkEvent*);
|
||||||
|
void selection_change ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ARDOUR::Trigger& _trigger;
|
ARDOUR::Trigger& _trigger;
|
||||||
|
|
@ -118,9 +119,11 @@ class TriggerBoxUI : public ArdourCanvas::Table
|
||||||
void build ();
|
void build ();
|
||||||
void rapid_update ();
|
void rapid_update ();
|
||||||
|
|
||||||
sigc::connection update_connection;
|
void selection_changed ();
|
||||||
};
|
|
||||||
|
|
||||||
|
sigc::connection update_connection;
|
||||||
|
sigc::connection selection_connection;
|
||||||
|
};
|
||||||
|
|
||||||
class TriggerBoxWidget : public ArdourCanvas::GtkCanvas
|
class TriggerBoxWidget : public ArdourCanvas::GtkCanvas
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue