summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-01-07 20:46:21 -0500
committerDavid Robillard <d@drobilla.net>2015-01-07 20:46:21 -0500
commit2eef0612b9bd4217bf9c137688955d68966dae16 (patch)
tree0200b9d4899ad858bbec2c55bc4be8f0e393fd29 /gtk2_ardour
parent4fd3adda019ef349ce70fd8dc2f6dea8d00a9216 (diff)
Start step entry at playhead.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.cc8
-rw-r--r--gtk2_ardour/editor.h4
-rw-r--r--gtk2_ardour/public_editor.h2
-rw-r--r--gtk2_ardour/step_editor.cc2
4 files changed, 10 insertions, 6 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index b7ec7d43b2..53ad481eb3 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -4611,7 +4611,7 @@ Editor::sort_track_selection (TrackViewList& sel)
}
framepos_t
-Editor::get_preferred_edit_position (bool ignore_playhead, bool from_context_menu)
+Editor::get_preferred_edit_position (bool ignore_playhead, bool from_context_menu, bool from_outside_canvas)
{
bool ignored;
framepos_t where = 0;
@@ -4620,8 +4620,10 @@ Editor::get_preferred_edit_position (bool ignore_playhead, bool from_context_men
if(Profile->get_mixbus())
if (ep == EditAtSelectedMarker)
ep=EditAtPlayhead;
-
- if (from_context_menu && (ep == EditAtMouse)) {
+
+ if (from_outside_canvas && (ep == EditAtMouse)) {
+ ep = EditAtPlayhead;
+ } else if (from_context_menu && (ep == EditAtMouse)) {
return canvas_event_sample (&context_click_event, 0, 0);
}
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 9261b01a7e..77d28f4e12 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -382,7 +382,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void reset_zoom (framecnt_t);
void reposition_and_zoom (framepos_t, double);
- framepos_t get_preferred_edit_position (bool ignore_playhead = false, bool use_context_click = false);
+ framepos_t get_preferred_edit_position (bool ignore_playhead = false,
+ bool use_context_click = false,
+ bool from_outside_canvas = false);
bool update_mouse_speed ();
bool decelerate_mouse_speed ();
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index c484537ee1..69a3b13fcd 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -280,7 +280,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
virtual void restore_editing_space () = 0;
virtual void update_tearoff_visibility () = 0;
virtual void reattach_all_tearoffs () = 0;
- virtual framepos_t get_preferred_edit_position (bool ignore_playhead = false, bool from_context_menu = false) = 0;
+ virtual framepos_t get_preferred_edit_position (bool ignore_playhead = false, bool from_context_menu = false, bool from_outside_canvas = false) = 0;
virtual void toggle_meter_updating() = 0;
virtual void split_regions_at (framepos_t, RegionSelection&) = 0;
virtual void split_region_at_points (boost::shared_ptr<ARDOUR::Region>, ARDOUR::AnalysisFeatureList&, bool can_ferret, bool select_new = false) = 0;
diff --git a/gtk2_ardour/step_editor.cc b/gtk2_ardour/step_editor.cc
index 4648299188..7bd82cfa7d 100644
--- a/gtk2_ardour/step_editor.cc
+++ b/gtk2_ardour/step_editor.cc
@@ -88,7 +88,7 @@ StepEditor::start_step_editing ()
void
StepEditor::resync_step_edit_position ()
{
- step_edit_insert_position = _editor.get_preferred_edit_position ();
+ step_edit_insert_position = _editor.get_preferred_edit_position (false, false, true);
}
void