mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
refactor end-of-rb-selection for EditingContext
Whhat the main editor and the cue editor do with a click varies significantly
This commit is contained in:
parent
db30a7d040
commit
e6c0fcf98f
6 changed files with 39 additions and 20 deletions
|
|
@ -421,6 +421,8 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider
|
||||||
*/
|
*/
|
||||||
void redo (uint32_t n = 1) { do_redo (n); }
|
void redo (uint32_t n = 1) { do_redo (n); }
|
||||||
|
|
||||||
|
virtual bool rb_click (GdkEvent*, Temporal::timepos_t const &) = 0;
|
||||||
|
|
||||||
virtual void history_changed() = 0;
|
virtual void history_changed() = 0;
|
||||||
static void update_undo_redo_actions (PBD::UndoHistory const &);
|
static void update_undo_redo_actions (PBD::UndoHistory const &);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -508,6 +508,8 @@ public:
|
||||||
void remove_region_marker (ARDOUR::CueMarker&);
|
void remove_region_marker (ARDOUR::CueMarker&);
|
||||||
void make_region_markers_global (bool as_cd_markers);
|
void make_region_markers_global (bool as_cd_markers);
|
||||||
|
|
||||||
|
bool rb_click (GdkEvent*, Temporal::timepos_t const &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void map_transport_state ();
|
void map_transport_state ();
|
||||||
void map_position_change (samplepos_t);
|
void map_position_change (samplepos_t);
|
||||||
|
|
@ -2338,4 +2340,3 @@ private:
|
||||||
friend class EditorRoutes;
|
friend class EditorRoutes;
|
||||||
friend class RhythmFerret;
|
friend class RhythmFerret;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5306,27 +5306,9 @@ RubberbandSelectDrag::finished (GdkEvent* event, bool movement_occurred)
|
||||||
do_select_things (event, false);
|
do_select_things (event, false);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Editor* editor = dynamic_cast<Editor*> (&editing_context);
|
|
||||||
assert (editor);
|
|
||||||
|
|
||||||
/* just a click */
|
/* just a click */
|
||||||
|
|
||||||
bool do_deselect = true;
|
bool do_deselect = editing_context.rb_click (event, grab_time());
|
||||||
MidiTimeAxisView* mtv;
|
|
||||||
AutomationTimeAxisView* atv;
|
|
||||||
|
|
||||||
if ((mtv = dynamic_cast<MidiTimeAxisView*> (editor->clicked_axisview)) != 0) {
|
|
||||||
/* MIDI track */
|
|
||||||
if (editing_context.get_selection().empty () && editing_context.current_mouse_mode() == MouseDraw) {
|
|
||||||
/* nothing selected */
|
|
||||||
add_midi_region (mtv, true);
|
|
||||||
do_deselect = false;
|
|
||||||
}
|
|
||||||
} else if ((atv = dynamic_cast<AutomationTimeAxisView*> (editor->clicked_axisview)) != 0) {
|
|
||||||
timepos_t where = grab_time ();
|
|
||||||
atv->add_automation_event (event, where, event->button.y, false);
|
|
||||||
do_deselect = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do not deselect if Primary or Tertiary (toggle-select or
|
/* do not deselect if Primary or Tertiary (toggle-select or
|
||||||
* extend-select are pressed.
|
* extend-select are pressed.
|
||||||
|
|
|
||||||
|
|
@ -2591,3 +2591,29 @@ Editor::choose_mapping_drag (ArdourCanvas::Item* item, GdkEvent* event)
|
||||||
abort_tempo_mapping (); /* NOTREACHED */
|
abort_tempo_mapping (); /* NOTREACHED */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
Editor::rb_click (GdkEvent* event, timepos_t const & where)
|
||||||
|
{
|
||||||
|
bool do_deselect = true;
|
||||||
|
MidiTimeAxisView* mtv;
|
||||||
|
AutomationTimeAxisView* atv;
|
||||||
|
|
||||||
|
if ((mtv = dynamic_cast<MidiTimeAxisView*> (clicked_axisview)) != 0) {
|
||||||
|
/* MIDI track */
|
||||||
|
if (get_selection().empty () && current_mouse_mode() == MouseDraw) {
|
||||||
|
|
||||||
|
/* nothing selected */
|
||||||
|
|
||||||
|
const timepos_t pos (where.beats ());
|
||||||
|
const timecnt_t len = pos.distance (max (timepos_t::zero (Temporal::BeatTime), timepos_t (pos.beats () + Beats (1, 0))));
|
||||||
|
mtv->add_region (pos, len, true);
|
||||||
|
do_deselect = false;
|
||||||
|
}
|
||||||
|
} else if ((atv = dynamic_cast<AutomationTimeAxisView*> (clicked_axisview)) != 0) {
|
||||||
|
atv->add_automation_event (event, where, event->button.y, false);
|
||||||
|
do_deselect = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return do_deselect;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1652,3 +1652,9 @@ MidiCueEditor::selectable_owners()
|
||||||
|
|
||||||
return std::list<SelectableOwner*> ();
|
return std::list<SelectableOwner*> ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
MidiCueEditor::rb_click (GdkEvent*, timepos_t const &)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@ class MidiCueEditor : public CueEditor
|
||||||
|
|
||||||
std::list<SelectableOwner*> selectable_owners();
|
std::list<SelectableOwner*> selectable_owners();
|
||||||
|
|
||||||
|
bool rb_click (GdkEvent*, Temporal::timepos_t const &);
|
||||||
|
|
||||||
Gdk::Cursor* which_track_cursor () const;
|
Gdk::Cursor* which_track_cursor () const;
|
||||||
Gdk::Cursor* which_mode_cursor () const;
|
Gdk::Cursor* which_mode_cursor () const;
|
||||||
Gdk::Cursor* which_trim_cursor (bool left_side) const;
|
Gdk::Cursor* which_trim_cursor (bool left_side) const;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue