pianoroll: further improvements to layered/non-layered automation display + editing
This commit is contained in:
@@ -245,8 +245,14 @@ Pianoroll::layered_automation_button_clicked ()
|
||||
{
|
||||
if ((layered_automation = !layered_automation)) {
|
||||
layered_automation_button->set_active_state (Gtkmm2ext::ExplicitActive);
|
||||
if (view && view->n_visible_automation() > 1) {
|
||||
view->hide_all_automation ();
|
||||
}
|
||||
} else {
|
||||
layered_automation_button->set_active_state (Gtkmm2ext::Off);
|
||||
if (view && view->n_visible_automation() > 1) {
|
||||
view->hide_all_automation ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1555,10 +1561,13 @@ Pianoroll::automation_active_button_click (Evoral::ParameterType type, int id)
|
||||
EC_LOCAL_TEMPO_SCOPE;
|
||||
|
||||
if (view) {
|
||||
Evoral::Parameter p (type, id);
|
||||
std::string str (ARDOUR::EventTypeMap::instance().to_symbol (p));
|
||||
std::cerr << "set active for " << str << std::endl;
|
||||
view->set_active_automation (Evoral::Parameter (type, _visible_channel, id));
|
||||
Evoral::Parameter p (type, _visible_channel, id);
|
||||
|
||||
if (!layered_automation && !view->is_visible_automation (p)) {
|
||||
view->hide_all_automation ();
|
||||
}
|
||||
|
||||
view->set_active_automation (p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1569,6 +1578,10 @@ Pianoroll::automation_show_button_click (Evoral::ParameterType type, int id)
|
||||
|
||||
if (view) {
|
||||
Evoral::Parameter param (type, _visible_channel, id);
|
||||
if (!layered_automation && !view->is_visible_automation (param)) {
|
||||
/* Param is about to become visible, hide everything else */
|
||||
view->hide_all_automation ();
|
||||
}
|
||||
view->toggle_visibility (param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,7 +466,7 @@ PianorollMidiView::have_visible_automation () const
|
||||
}
|
||||
|
||||
void
|
||||
PianorollMidiView::hide_all_automation ()
|
||||
PianorollMidiView::remove_all_automation ()
|
||||
{
|
||||
unset_active_automation ();
|
||||
|
||||
@@ -479,6 +479,28 @@ PianorollMidiView::hide_all_automation ()
|
||||
velocity_display = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
PianorollMidiView::hide_all_automation ()
|
||||
{
|
||||
unset_active_automation ();
|
||||
|
||||
for (auto & [parameter,ads] : automation_map) {
|
||||
ads.hide ();
|
||||
}
|
||||
|
||||
AutomationStateChange (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
size_t
|
||||
PianorollMidiView::n_visible_automation() const
|
||||
{
|
||||
size_t n = 0;
|
||||
for (auto const & [parameter,ads] : automation_map) {
|
||||
n += ads.visible;
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
void
|
||||
PianorollMidiView::toggle_visibility (Evoral::Parameter const & param)
|
||||
{
|
||||
@@ -955,5 +977,5 @@ void
|
||||
PianorollMidiView::set_region (std::shared_ptr<MidiRegion> mr)
|
||||
{
|
||||
MidiView::set_region (mr);
|
||||
hide_all_automation ();
|
||||
remove_all_automation ();
|
||||
}
|
||||
|
||||
@@ -62,11 +62,13 @@ class PianorollMidiView : public MidiView
|
||||
void ghost_sync_selection (NoteBase*);
|
||||
|
||||
void toggle_visibility (Evoral::Parameter const & param);
|
||||
void remove_all_automation ();
|
||||
void hide_all_automation ();
|
||||
void swap_automation_channel (int);
|
||||
void set_active_automation (Evoral::Parameter const &);
|
||||
bool is_active_automation (Evoral::Parameter const &) const;
|
||||
bool is_visible_automation (Evoral::Parameter const &) const;
|
||||
size_t n_visible_automation () const;
|
||||
|
||||
AutomationLine* active_automation_line() const;
|
||||
ArdourCanvas::Duple automation_group_position() const;
|
||||
|
||||
Reference in New Issue
Block a user