diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index e2178153b6..7e4f85b2c1 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -4250,7 +4250,7 @@ Editor::get_paste_offset (Temporal::timepos_t const & pos, unsigned paste_count, } /* calculate basic unsnapped multi-paste offset */ - Temporal::timecnt_t offset = duration * paste_count; + Temporal::timecnt_t offset = duration.scale (paste_count); /* snap offset so pos + offset is aligned to the grid */ Temporal::timepos_t snap_pos (pos + offset); diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index 5442e4d682..f0b2a247b3 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -932,7 +932,7 @@ Editor::add_sources (vector paths, cerr << "for " << (*x)->name() << " source length appears to be " << len << endl; if (len.is_zero()) { if ((*x)->type() == DataType::AUDIO) { - len = timepos_t (_session->sample_rate ()) / 2; + len = timepos_t (_session->sample_rate () / 2); } else { len = timepos_t (Beats (1, 0)); } diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 3e2e35eee6..4656565ac9 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -876,7 +876,12 @@ RegionMotionDrag::compute_x_delta (GdkEvent const * event, Temporal::timepos_t & if (sync_dir >= 0 || (sync_dir < 0 && pending_region_position >= sync_offset)) { timecnt_t const sd = snap_delta (event->button.state); - timepos_t sync_snap (pending_region_position + (sync_offset * sync_dir) + sd); + timepos_t sync_snap; + if (sync_dir > 0) { + sync_snap = pending_region_position + sync_offset + sd; + } else { + sync_snap = pending_region_position.earlier (sync_offset) + sd; + } _editor->snap_to_with_modifier (sync_snap, event); if (sync_offset.is_zero () && sd.is_zero ()) { pending_region_position = sync_snap; @@ -3053,7 +3058,7 @@ TrimDrag::start_grab (GdkEvent* event, Gdk::Cursor*) setup_snap_delta (region_start); /* These will get overridden for a point trim.*/ - if (pf < (region_start + region_length/2)) { + if (pf < (region_start + region_length.scale (ratio_t (1, 2)))) { /* closer to front */ _operation = StartTrim; if (Keyboard::modifier_state_equals (event->button.state, ArdourKeyboard::trim_anchored_modifier ())) { @@ -6529,7 +6534,7 @@ AutomationRangeDrag::motion (GdkEvent*, bool first_move) /* add guard points */ for (list::const_iterator i = _ranges.begin(); i != _ranges.end(); ++i) { - timepos_t const half = (i->start() + i->end()) / 2; + timepos_t const half = (i->start() + i->end()).scale (ratio_t (1, 2)); for (list::iterator j = _lines.begin(); j != _lines.end(); ++j) { if (j->range.first > i->start() || j->range.second < i->start()) { diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc index 66c934a9a4..d51b806314 100644 --- a/gtk2_ardour/editor_markers.cc +++ b/gtk2_ardour/editor_markers.cc @@ -1542,7 +1542,7 @@ Editor::marker_menu_zoom_to_range () return; } - timepos_t const extra = timepos_t (l->length() * Temporal::ratio_t (5, 100)); + timepos_t const extra = timepos_t (l->length().scale (Temporal::ratio_t (5, 100))); timepos_t a = l->start (); if (a >= extra) { a.shift_earlier (extra); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 4f922a99cf..dc5f9f80f8 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -2643,7 +2643,7 @@ Editor::insert_source_list_selection (float times) playlist->add_region ((RegionFactory::create (region, true)), get_preferred_edit_position(), times, _session->config.get_layered_record_mode()); //ToDo: insert_mode ? if (should_ripple()) { - do_ripple (playlist, get_preferred_edit_position(), region->length() * times, boost::shared_ptr(), true); + do_ripple (playlist, get_preferred_edit_position(), region->length().scale (times), boost::shared_ptr(), true); } else { playlist->rdiff_and_add_command (_session); } @@ -5241,7 +5241,7 @@ Editor::duplicate_some_regions (RegionSelection& regions, float times) } for (set >::iterator p = playlists.begin(); p != playlists.end(); ++p) { - do_ripple ((*p), start_sample, span * times, &exclude, false); + do_ripple ((*p), start_sample, span.scale (times), &exclude, false); } } diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc index 37678343cf..dfe1022c4f 100644 --- a/gtk2_ardour/editor_timefx.cc +++ b/gtk2_ardour/editor_timefx.cc @@ -169,7 +169,7 @@ Editor::time_fx (RegionList& regions, Temporal::ratio_t ratio, bool pitching) } const timecnt_t oldlen = regions.front()->length(); - const timecnt_t newlen = regions.front()->length() * ratio; + const timecnt_t newlen = regions.front()->length().scale (ratio); const timepos_t pos = regions.front()->position (); current_timefx = new TimeFXDialog (*this, pitching, oldlen, newlen, pos); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index f7716841a8..d6ac9fa516 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -1363,7 +1363,7 @@ RouteTimeAxisView::paste (timepos_t const & pos, const Selection& selection, Pas if (_editor.should_ripple()) { std::pair extent = (*p)->get_extent_with_endspace(); timecnt_t amount = extent.first.distance (extent.second); - pl->ripple (ppos, amount * ctx.times, boost::shared_ptr()); + pl->ripple (ppos, amount.scale (ctx.times), boost::shared_ptr()); } pl->paste (*p, ppos, ctx.times); diff --git a/gtk2_ardour/time_fx_dialog.cc b/gtk2_ardour/time_fx_dialog.cc index c313cbe729..1e27f2f85f 100644 --- a/gtk2_ardour/time_fx_dialog.cc +++ b/gtk2_ardour/time_fx_dialog.cc @@ -301,7 +301,7 @@ TimeFXDialog::duration_adjustment_changed () PBD::Unwinder uw (ignore_clock_change, true); - duration_clock->set_duration (original_length * Temporal::ratio_t (1.0, (duration_adjustment.get_value() / 100.0))); + duration_clock->set_duration (original_length.scale (Temporal::ratio_t (1.0, (duration_adjustment.get_value() / 100.0)))); } void