if (eff_mouse_mode != MouseRange) {
AutomationLine* al = reinterpret_cast<AutomationLine*> (item->get_data ("line"));
std::list<Selectable*> selectables;
+ double mx = event->button.x;
+ double my = event->button.y;
+
+ al->grab_item().canvas_to_item (mx, my);
+
uint32_t before, after;
- framecnt_t const where = (framecnt_t) floor (event->button.x * samples_per_pixel);
+ framecnt_t const where = (framecnt_t) floor (mx * samples_per_pixel);
if (!al || !al->control_points_adjacent (where, before, after)) {
break;
case TempoMarkerItem:
{
- _drags->set (
- new TempoMarkerDrag (
- this,
- item,
- ArdourKeyboard::indicates_copy (event->button.state)
- ),
- event
- );
+ if (ArdourKeyboard::indicates_constraint (event->button.state)) {
+ _drags->set (
+ new TempoEndDrag (
+ this,
+ item
+ ),
+ event
+ );
+ } else {
+ _drags->set (
+ new TempoMarkerDrag (
+ this,
+ item,
+ ArdourKeyboard::indicates_copy (event->button.state)
+ ),
+ event
+ );
+ }
+
return true;
}
if (!Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier)
&& !ArdourKeyboard::indicates_constraint (event->button.state)) {
_drags->set (new CursorDrag (this, *playhead_cursor, false), event);
+ } else if (ArdourKeyboard::indicates_constraint (event->button.state)
+ && Keyboard::modifier_state_contains (event->button.state, Keyboard::PrimaryModifier)) {
+ _drags->set (new TempoTwistDrag (this, item), event);
} else if (ArdourKeyboard::indicates_constraint (event->button.state)) {
_drags->set (new BBTRulerDrag (this, item), event);
}
return true;
}
- //not rolling, range mode click + join_play_range : locate the PH here
- if ( !_drags->active () && _session && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && UIConfiguration::instance().get_follow_edits() && !_session->config.get_external_sync() ) {
- framepos_t where = canvas_event_sample (event);
- snap_to(where);
- _session->request_locate (where, false);
+ /* not rolling, effectively in range mode, follow edits enabled (likely
+ * to start range drag), not in a fade handle (since that means we are
+ * not starting a range drag): locate the PH here
+ */
+
+ if ((item_type != FadeInHandleItem) &&
+ (item_type != FadeOutHandleItem) &&
+ !_drags->active () &&
+ _session &&
+ !_session->transport_rolling() &&
+ (effective_mouse_mode() == MouseRange) &&
+ UIConfiguration::instance().get_follow_edits() &&
+ !_session->config.get_external_sync()) {
+
+ MusicFrame where (canvas_event_sample (event), 0);
+ snap_to (where);
+ _session->request_locate (where.frame, false);
}
switch (event->button.button) {
bool
Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{
- framepos_t where = canvas_event_sample (event);
+ MusicFrame where (canvas_event_sample (event), 0);
AutomationTimeAxisView* atv = 0;
_press_cursor_ctx.reset();
case SamplesRulerItem:
case MinsecRulerItem:
case BBTRulerItem:
- popup_ruler_menu (where, item_type);
+ popup_ruler_menu (where.frame, item_type);
break;
case MarkerItem:
case MarkerBarItem:
if (!_dragging_playhead) {
snap_to_with_modifier (where, event, RoundNearest, true);
- mouse_add_new_marker (where);
+ mouse_add_new_marker (where.frame);
}
return true;
if (!_dragging_playhead) {
// if we get here then a dragged range wasn't done
snap_to_with_modifier (where, event, RoundNearest, true);
- mouse_add_new_marker (where, true);
+ mouse_add_new_marker (where.frame, true);
}
return true;
case TempoBarItem:
case TempoCurveItem:
if (!_dragging_playhead) {
snap_to_with_modifier (where, event);
- mouse_add_new_tempo_event (where);
+ mouse_add_new_tempo_event (where.frame);
}
return true;
bool with_guard_points = Keyboard::modifier_state_equals (event->button.state, Keyboard::PrimaryModifier);
atv = dynamic_cast<AutomationTimeAxisView*>(clicked_axisview);
if (atv) {
- atv->add_automation_event (event, where, event->button.y, with_guard_points);
+ atv->add_automation_event (event, where.frame, event->button.y, with_guard_points);
}
return true;
break;
commit_reversible_command();
}
+void
+Editor::edit_region (RegionView* rv)
+{
+ if (UIConfiguration::instance().get_use_double_click_to_zoom_to_selection()) {
+ temporal_zoom_selection (Both);
+ } else {
+ rv->show_region_editor ();
+ }
+}
+
void
Editor::visible_order_range (int* low, int* high) const
{
if (entered_regionview) {
+ //ToDo: there is currently a bug here(?)
+ //when we are inside a region fade handle, it acts as though we are in range mode because it is in the top half of the region
+ //can it be fixed here?
+
ArdourCanvas::Duple const item_space = entered_regionview->get_canvas_group()->canvas_to_item (ArdourCanvas::Duple (0, y));
double const c = item_space.y / entered_regionview->height();