#include "ardour/audio_track.h"
#include "ardour/audioengine.h"
#include "ardour/audioregion.h"
+#include "ardour/lmath.h"
#include "ardour/location.h"
#include "ardour/profile.h"
#include "ardour/route_group.h"
_popup_region_menu_item->set_label (menu_item_name);
}
- const framepos_t position = get_preferred_edit_position (false, true);
+ const framepos_t position = get_preferred_edit_position (EDIT_IGNORE_NONE, true);
edit_items.push_back (*_popup_region_menu_item);
if (track->playlist()->count_regions_at (position) > 1 && (layering_order_editor == 0 || !layering_order_editor->is_visible ())) {
}
framepos_t
-Editor::get_preferred_edit_position (bool ignore_playhead, bool from_context_menu, bool from_outside_canvas)
+Editor::get_preferred_edit_position (EditIgnoreOption ignore, bool from_context_menu, bool from_outside_canvas)
{
bool ignored;
framepos_t where = 0;
EditPoint ep = _edit_point;
- if(Profile->get_mixbus())
+ if (Profile->get_mixbus())
if (ep == EditAtSelectedMarker)
- ep=EditAtPlayhead;
+ ep = EditAtPlayhead;
if (from_outside_canvas && (ep == EditAtMouse)) {
ep = EditAtPlayhead;
return entered_marker->position();
}
- if (ignore_playhead && ep == EditAtPlayhead) {
+ if ( (ignore==EDIT_IGNORE_PHEAD) && ep == EditAtPlayhead) {
ep = EditAtSelectedMarker;
}
+ if ( (ignore==EDIT_IGNORE_MOUSE) && ep == EditAtMouse) {
+ ep = EditAtPlayhead;
+ }
+
switch (ep) {
case EditAtPlayhead:
if (_dragging_playhead) {
/* XXX not right but what can we do ? */
return 0;
}
- } else
+ } else {
where = _session->audible_frame();
+ }
DEBUG_TRACE (DEBUG::CutNPaste, string_compose ("GPEP: use playhead @ %1\n", where));
break;
void
Editor::change_region_layering_order (bool from_context_menu)
{
- const framepos_t position = get_preferred_edit_position (false, from_context_menu);
+ const framepos_t position = get_preferred_edit_position (EDIT_IGNORE_NONE, from_context_menu);
if (!clicked_routeview) {
if (layering_order_editor) {