Skip to content

Commit

Permalink
start using visible channel in MIDI cue editor
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldavisthefirst committed Dec 20, 2024
1 parent 8486c5b commit 5248e81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gtk2_ardour/editing_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
9 changes: 6 additions & 3 deletions gtk2_ardour/midi_cue_editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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));
}
}

Expand Down
1 change: 1 addition & 0 deletions gtk2_ardour/midi_cue_editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ class MidiCueEditor : public CueEditor
sigc::signal<void> NoteModeChanged;

void automation_state_changed ();

};


0 comments on commit 5248e81

Please sign in to comment.