mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 07:14:56 +01:00
some work on being able to swap channels and have different MIDI automation displayed in pianoroll
This commit is contained in:
parent
5248e81f9d
commit
084a23a80d
4 changed files with 46 additions and 2 deletions
|
|
@ -7476,8 +7476,10 @@ AutomationDrawDrag::finished (GdkEvent* event, bool motion_occured)
|
|||
FreehandLineDrag<Evoral::ControlList::OrderedPoints,Evoral::ControlList::OrderedPoint>::finished (event, motion_occured);
|
||||
|
||||
MergeableLine* ml = lm->make_merger();
|
||||
ml->merge_drawn_line (editing_context, *editing_context.session(), drawn_points, !did_snap);
|
||||
delete ml;
|
||||
if (ml) {
|
||||
ml->merge_drawn_line (editing_context, *editing_context.session(), drawn_points, !did_snap);
|
||||
delete ml;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************/
|
||||
|
|
|
|||
|
|
@ -256,6 +256,10 @@ MidiCueEditor::set_visible_channel (int n)
|
|||
{
|
||||
_visible_channel = n;
|
||||
visible_channel_label.set_text (string_compose (_("MIDI Channel %1"), _visible_channel + 1));
|
||||
|
||||
if (view) {
|
||||
view->swap_automation_channel (n);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -235,6 +235,43 @@ MidiCueView::update_hit (Hit* h)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiCueView::swap_automation_channel (int new_channel)
|
||||
{
|
||||
std::vector<Evoral::Parameter> new_params;
|
||||
Evoral::Parameter active (0, 0, 0);
|
||||
bool have_active = false;
|
||||
|
||||
/* Make a note of what was visible, but use the new channel */
|
||||
|
||||
for (CueAutomationMap::iterator i = automation_map.begin(); i != automation_map.end(); ++i) {
|
||||
if (i->second.visible) {
|
||||
Evoral::Parameter param (i->first.type(), new_channel, i->first.id());
|
||||
new_params.push_back (param);
|
||||
if (&i->second == active_automation) {
|
||||
active = param;
|
||||
have_active = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Drop the old */
|
||||
|
||||
automation_map.clear ();
|
||||
|
||||
/* Create the new */
|
||||
|
||||
for (auto const & p : new_params) {
|
||||
update_automation_display (p, SelectionAdd);
|
||||
}
|
||||
|
||||
if (have_active) {
|
||||
set_active_automation (active);
|
||||
} else {
|
||||
unset_active_automation ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiCueView::update_automation_display (Evoral::Parameter const & param, SelectionOperation op)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class MidiCueView : public MidiView
|
|||
void ghost_sync_selection (NoteBase*);
|
||||
|
||||
void update_automation_display (Evoral::Parameter const & param, ARDOUR::SelectionOperation);
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue