mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
mo' better fixes for managing MIDI CC/automation lanes
git-svn-id: svn://localhost/ardour2/branches/3.0@6473 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
935eba7979
commit
dbff8105ab
3 changed files with 65 additions and 22 deletions
|
|
@ -1060,7 +1060,45 @@ MidiTimeAxisView::toggle_note_selection_region_view (RegionView* rv, uint8_t not
|
||||||
void
|
void
|
||||||
MidiTimeAxisView::set_channel_mode (ChannelMode, uint16_t)
|
MidiTimeAxisView::set_channel_mode (ChannelMode, uint16_t)
|
||||||
{
|
{
|
||||||
|
/* hide all automation tracks that use the wrong channel(s) and show all those that use
|
||||||
|
the right ones.
|
||||||
|
*/
|
||||||
|
|
||||||
|
uint16_t selected_channels = _channel_selector.get_selected_channels();
|
||||||
|
bool changed = false;
|
||||||
|
|
||||||
|
no_redraw = true;
|
||||||
|
|
||||||
|
for (uint32_t ctl = 0; ctl < 127; ++ctl) {
|
||||||
|
|
||||||
|
for (uint32_t chn = 0; chn < 16; ++chn) {
|
||||||
|
Evoral::Parameter fully_qualified_param (MidiCCAutomation, chn, ctl);
|
||||||
|
RouteAutomationNode* node = automation_track (fully_qualified_param);
|
||||||
|
|
||||||
|
if (!node) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((selected_channels & (0x0001 << chn)) == 0) {
|
||||||
|
/* channel not in use. hiding it will trigger RouteTimeAxisView::automation_track_hidden()
|
||||||
|
which will cause a redraw. We don't want one per channel, so block that with no_redraw.
|
||||||
|
*/
|
||||||
|
changed = node->track->set_visibility (false) || changed;
|
||||||
|
} else {
|
||||||
|
changed = node->track->set_visibility (true) || changed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
no_redraw = false;
|
||||||
|
|
||||||
|
/* TODO: Bender, PgmChange, Pressure */
|
||||||
|
|
||||||
/* invalidate the controller menu, so that we rebuilt it next time */
|
/* invalidate the controller menu, so that we rebuilt it next time */
|
||||||
delete controller_menu;
|
delete controller_menu;
|
||||||
controller_menu = 0;
|
controller_menu = 0;
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
_route->gui_changed ("track_height", this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -857,7 +857,7 @@ RouteTimeAxisView::set_height (uint32_t h)
|
||||||
name_label.set_text (_route->name());
|
name_label.set_text (_route->name());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (height_changed) {
|
if (height_changed && !no_redraw) {
|
||||||
/* only emit the signal if the height really changed */
|
/* only emit the signal if the height really changed */
|
||||||
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
@ -1625,13 +1625,15 @@ RouteTimeAxisView::toggle_automation_track (const Evoral::Parameter& param)
|
||||||
RouteAutomationNode* node = automation_track(param);
|
RouteAutomationNode* node = automation_track(param);
|
||||||
|
|
||||||
if (!node) {
|
if (!node) {
|
||||||
/* add it */
|
/* it doesn't exist yet, so we don't care about the button state: just add it */
|
||||||
create_automation_child (param, true);
|
create_automation_child (param, true);
|
||||||
} else {
|
} else {
|
||||||
|
bool yn = node->menu_item->get_active();
|
||||||
|
if (node->track->set_visibility (node->menu_item->get_active()) && yn) {
|
||||||
|
|
||||||
if (node->track->set_visibility (node->menu_item->get_active())) {
|
/* we made it visible, now trigger a redisplay. if it was hidden, then automation_track_hidden()
|
||||||
|
will have done that for us.
|
||||||
/* we changed the visibility, now trigger a redisplay */
|
*/
|
||||||
|
|
||||||
if (!no_redraw) {
|
if (!no_redraw) {
|
||||||
_route->gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
|
_route->gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
|
||||||
|
|
@ -1644,6 +1646,7 @@ void
|
||||||
RouteTimeAxisView::automation_track_hidden (Evoral::Parameter param)
|
RouteTimeAxisView::automation_track_hidden (Evoral::Parameter param)
|
||||||
{
|
{
|
||||||
RouteAutomationNode* ran = automation_track(param);
|
RouteAutomationNode* ran = automation_track(param);
|
||||||
|
|
||||||
if (!ran) {
|
if (!ran) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1653,11 +1656,13 @@ RouteTimeAxisView::automation_track_hidden (Evoral::Parameter param)
|
||||||
ran->track->get_state_node()->add_property (X_("shown"), X_("no"));
|
ran->track->get_state_node()->add_property (X_("shown"), X_("no"));
|
||||||
|
|
||||||
if (ran->menu_item && !_hidden) {
|
if (ran->menu_item && !_hidden) {
|
||||||
|
ignore_toggle = true;
|
||||||
ran->menu_item->set_active (false);
|
ran->menu_item->set_active (false);
|
||||||
|
ignore_toggle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_route) {
|
if (_route && !no_redraw) {
|
||||||
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1694,7 +1699,7 @@ RouteTimeAxisView::show_all_automation ()
|
||||||
|
|
||||||
/* Redraw */
|
/* Redraw */
|
||||||
|
|
||||||
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1727,7 +1732,7 @@ RouteTimeAxisView::show_existing_automation ()
|
||||||
|
|
||||||
no_redraw = false;
|
no_redraw = false;
|
||||||
|
|
||||||
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1755,7 +1760,7 @@ RouteTimeAxisView::hide_all_automation ()
|
||||||
_show_automation.clear();
|
_show_automation.clear();
|
||||||
|
|
||||||
no_redraw = false;
|
no_redraw = false;
|
||||||
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1897,7 +1902,9 @@ RouteTimeAxisView::processor_automation_track_hidden (RouteTimeAxisView::Process
|
||||||
|
|
||||||
i->mark_automation_visible (pan->what, false);
|
i->mark_automation_visible (pan->what, false);
|
||||||
|
|
||||||
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
|
if (!no_redraw) {
|
||||||
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -1953,7 +1960,9 @@ RouteTimeAxisView::add_automation_child (Evoral::Parameter param, boost::shared_
|
||||||
_show_automation.insert (param);
|
_show_automation.insert (param);
|
||||||
}
|
}
|
||||||
|
|
||||||
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
|
if (!no_redraw) {
|
||||||
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
|
}
|
||||||
|
|
||||||
if (!EventTypeMap::instance().is_midi_parameter(param)) {
|
if (!EventTypeMap::instance().is_midi_parameter(param)) {
|
||||||
/* MIDI-related parameters are always in the menu, there's no
|
/* MIDI-related parameters are always in the menu, there's no
|
||||||
|
|
@ -1966,7 +1975,6 @@ RouteTimeAxisView::add_automation_child (Evoral::Parameter param, boost::shared_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p)
|
RouteTimeAxisView::add_processor_to_subplugin_menu (boost::weak_ptr<Processor> p)
|
||||||
{
|
{
|
||||||
|
|
@ -2086,10 +2094,7 @@ RouteTimeAxisView::processor_menu_item_toggled (RouteTimeAxisView::ProcessorAuto
|
||||||
}
|
}
|
||||||
|
|
||||||
if (redraw && !no_redraw) {
|
if (redraw && !no_redraw) {
|
||||||
|
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
|
||||||
/* now trigger a redisplay */
|
|
||||||
|
|
||||||
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2133,8 +2138,8 @@ RouteTimeAxisView::processors_changed (RouteProcessorChange c)
|
||||||
i = tmp;
|
i = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deleted_processor_automation) {
|
if (deleted_processor_automation && !no_redraw) {
|
||||||
_route->gui_changed ("visible_tracks", this);
|
_route->gui_changed ("track_height", this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1367,7 +1367,7 @@ TimeAxisView::set_visibility (bool yn)
|
||||||
canvas_display()->show();
|
canvas_display()->show();
|
||||||
} else {
|
} else {
|
||||||
set_marked_for_display (false);
|
set_marked_for_display (false);
|
||||||
canvas_display()->hide ();
|
hide ();
|
||||||
}
|
}
|
||||||
return true; // things changed
|
return true; // things changed
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue