start using visible channel in MIDI cue editor

This commit is contained in:
Paul Davis 2024-12-20 10:44:35 -07:00
parent 8486c5ba98
commit 5248e81f9d
3 changed files with 8 additions and 4 deletions

View file

@ -208,7 +208,7 @@ EditingContext::EditingContext (std::string const & name)
for (int i = 0; i < 16; i++) {
char buf[4];
sprintf(buf, "%d", i+1);
visible_channel_selector.AddMenuElem (MenuElem (buf, [this,i]() { EditingContext::set_visible_channel (i); }));
visible_channel_selector.AddMenuElem (MenuElem (buf, [this,i]() { set_visible_channel (i); }));
}
/* handle escape */

View file

@ -254,6 +254,8 @@ MidiCueEditor::build_upper_toolbar ()
void
MidiCueEditor::set_visible_channel (int n)
{
_visible_channel = n;
visible_channel_label.set_text (string_compose (_("MIDI Channel %1"), _visible_channel + 1));
}
void
@ -1901,6 +1903,8 @@ MidiCueEditor::set_region (std::shared_ptr<ARDOUR::MidiRegion> r)
samplecnt_t spp = floor (samples / width);
reset_zoom (spp);
}
set_visible_channel (0);
}
bool
@ -1915,7 +1919,7 @@ MidiCueEditor::automation_button_event (GdkEventButton* ev, Evoral::ParameterTyp
switch (ev->type) {
case GDK_BUTTON_RELEASE:
if (view) {
Evoral::Parameter param (type, 0, id);
Evoral::Parameter param (type, _visible_channel, id);
if (view->is_visible_automation (param) && (op == SelectionSet)) {
op = SelectionToggle;
@ -1934,13 +1938,12 @@ MidiCueEditor::automation_button_event (GdkEventButton* ev, Evoral::ParameterTyp
void
MidiCueEditor::automation_led_click (GdkEventButton* ev, Evoral::ParameterType type, int id)
{
#warning paul allow channel selection (2nd param)
if (ev->button != 1) {
return;
}
if (view) {
view->set_active_automation (Evoral::Parameter (type, 0, id));
view->set_active_automation (Evoral::Parameter (type, _visible_channel, id));
}
}

View file

@ -261,6 +261,7 @@ class MidiCueEditor : public CueEditor
sigc::signal<void> NoteModeChanged;
void automation_state_changed ();
};