provide rudimentary button control over percussive/sustained drawing in clip editor
Note that the note length selector can always be used to change the length of a note added via a click
This commit is contained in:
@@ -195,11 +195,13 @@ EditingContext::EditingContext (std::string const & name)
|
||||
set_tooltip (snap_mode_button, _("Snap Mode\n\nRight-click to visit Snap preferences."));
|
||||
|
||||
set_tooltip (play_note_selection_button, _("Play notes when selected"));
|
||||
set_tooltip (note_mode_button, _("Switch between sustained and percussive mode"));
|
||||
set_tooltip (follow_playhead_button, _("Scroll automatically to keep playhead visible"));
|
||||
/* Leave tip for full zoom button to derived class */
|
||||
set_tooltip (visible_channel_selector, _("Select visible MIDI channel"));
|
||||
|
||||
play_note_selection_button.signal_clicked.connect (sigc::mem_fun (*this, &EditingContext::play_note_selection_clicked));
|
||||
note_mode_button.signal_clicked.connect (sigc::mem_fun (*this, &EditingContext::note_mode_clicked));
|
||||
follow_playhead_button.signal_clicked.connect (sigc::mem_fun (*this, &EditingContext::follow_playhead_clicked));
|
||||
full_zoom_button.signal_clicked.connect (sigc::mem_fun (*this, &EditingContext::full_zoom_clicked));
|
||||
|
||||
|
||||
@@ -516,12 +516,14 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
|
||||
void grid_type_chosen (Editing::GridType);
|
||||
|
||||
ArdourWidgets::ArdourButton play_note_selection_button;
|
||||
ArdourWidgets::ArdourButton note_mode_button;
|
||||
ArdourWidgets::ArdourButton follow_playhead_button;
|
||||
ArdourWidgets::ArdourButton full_zoom_button;
|
||||
Gtk::Label visible_channel_label;
|
||||
ArdourWidgets::ArdourDropdown visible_channel_selector;
|
||||
|
||||
virtual void play_note_selection_clicked();
|
||||
virtual void note_mode_clicked() {}
|
||||
virtual void follow_playhead_clicked ();
|
||||
virtual void full_zoom_clicked() {};
|
||||
virtual void set_visible_channel (int) {}
|
||||
|
||||
@@ -65,6 +65,7 @@ MidiCueEditor::MidiCueEditor()
|
||||
, bg (nullptr)
|
||||
, view (nullptr)
|
||||
, bbt_metric (*this)
|
||||
, _note_mode (Sustained)
|
||||
{
|
||||
mouse_mode = Editing::MouseContent;
|
||||
autoscroll_vertical_allowed = false;
|
||||
@@ -205,6 +206,7 @@ MidiCueEditor::build_upper_toolbar ()
|
||||
_toolbar_outer->pack_start (visible_channel_label, false, false);
|
||||
_toolbar_outer->pack_start (visible_channel_selector, false, false);
|
||||
_toolbar_outer->pack_start (play_note_selection_button, false, false);
|
||||
_toolbar_outer->pack_start (note_mode_button, false, false);
|
||||
_toolbar_outer->pack_start (follow_playhead_button, false, false);
|
||||
_toolbar_outer->pack_start (full_zoom_button, false, false);
|
||||
_toolbar_outer->pack_start (*_toolbar_inner, true, false);
|
||||
@@ -1890,3 +1892,30 @@ MidiCueEditor::automation_button_click (Evoral::ParameterType type, int id, Sele
|
||||
view->update_automation_display (Evoral::Parameter (type, 0, id), op);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiCueEditor::note_mode_clicked ()
|
||||
{
|
||||
assert (bg);
|
||||
|
||||
if (bg->note_mode() == Sustained) {
|
||||
set_note_mode (Percussive);
|
||||
} else {
|
||||
set_note_mode (Sustained);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MidiCueEditor::set_note_mode (NoteMode nm)
|
||||
{
|
||||
assert (bg);
|
||||
|
||||
if (nm != bg->note_mode()) {
|
||||
bg->set_note_mode (nm);
|
||||
if (bg->note_mode() == Percussive) {
|
||||
note_mode_button.set_active (true);
|
||||
} else {
|
||||
note_mode_button.set_active (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@ class MidiCueEditor : public CueEditor
|
||||
Gdk::Cursor* which_canvas_cursor (ItemType type) const;
|
||||
|
||||
void set_visible_channel (int chan);
|
||||
void note_mode_clicked();
|
||||
ARDOUR::NoteMode note_mode() const { return _note_mode; }
|
||||
void set_note_mode (ARDOUR::NoteMode);
|
||||
|
||||
void set_trigger_start (Temporal::timepos_t const &);
|
||||
void set_trigger_end (Temporal::timepos_t const &);
|
||||
@@ -244,6 +247,9 @@ class MidiCueEditor : public CueEditor
|
||||
void automation_button_click (Evoral::ParameterType type, int id, ARDOUR::SelectionOperation);
|
||||
|
||||
int _visible_channel;
|
||||
|
||||
ARDOUR::NoteMode _note_mode;
|
||||
sigc::signal<void> NoteModeChanged;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -306,3 +306,9 @@ MidiViewBackground::update_data_note_range (uint8_t min, uint8_t max)
|
||||
}
|
||||
return dirty;
|
||||
}
|
||||
|
||||
void
|
||||
MidiViewBackground::set_note_mode (ARDOUR::NoteMode nm)
|
||||
{
|
||||
_note_mode = nm;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user