cleanup after timecnt_t API changed (GUI edition)

This commit is contained in:
Paul Davis 2020-12-06 12:57:48 -07:00
parent eee0fdf2d5
commit 0093ae07b0
3 changed files with 15 additions and 9 deletions

View File

@ -1949,7 +1949,7 @@ AudioClock::current_duration (timepos_t pos) const
switch (_mode) {
case BBT:
ret = sample_duration_from_bbt_string (pos, _layout->get_text());
ret = timecnt_t (sample_duration_from_bbt_string (pos, _layout->get_text()));
break;
case Timecode:

View File

@ -2369,7 +2369,8 @@ RegionRippleDrag::RegionRippleDrag (Editor* e, ArdourCanvas::Item* i, RegionView
// Rippling accross tracks disabled. Rippling on all tracks is the way to go in the future.
allow_moves_across_tracks = false; // (selected_regions.playlists().size() == 1);
prev_tav = NULL;
prev_amount = 0;
#warning NUTEMPO need to pick time domain here
prev_amount = timecnt_t ();
exclude = new RegionList;
for (RegionSelection::iterator i =selected_regions.begin(); i != selected_regions.end(); ++i) {
exclude->push_back((*i)->region());
@ -2452,7 +2453,8 @@ RegionRippleDrag::motion (GdkEvent* event, bool first_move)
remove_unselected_from_views (prev_amount, false);
// ripple previous playlist according to the regions that have been removed onto the new playlist
prev_tav->playlist()->ripple(prev_position, -selection_length, exclude);
prev_amount = 0;
#warning NUTEMPO need to pick time domain here
prev_amount = timecnt_t ();
// move just the selected regions
RegionMoveDrag::motion(event, first_move);
@ -4714,7 +4716,7 @@ MarkerDrag::setup_pointer_offset ()
void
MarkerDrag::setup_video_offset ()
{
_video_offset = 0;
_video_offset = timecnt_t (Temporal::AudioTime);
_preview_video = true;
}
@ -5691,7 +5693,8 @@ SelectionDrag::setup_pointer_offset ()
{
switch (_operation) {
case CreateSelection:
_pointer_offset = 0;
#warning NUTEMPO need to pick time domain here
_pointer_offset = timecnt_t ();
break;
case SelectionStartTrim:
@ -7162,7 +7165,7 @@ CrossfadeEdgeDrag::motion (GdkEvent*, bool)
/* now check with the region that this is legal */
new_length = ar->verify_xfade_bounds (new_length.samples(), start);
new_length = timecnt_t (ar->verify_xfade_bounds (new_length.samples(), start));
if (start) {
arv->reset_fade_in_shape_width (ar, new_length.samples());
@ -7188,7 +7191,10 @@ CrossfadeEdgeDrag::finished (GdkEvent*, bool)
len = timecnt_t (ar->fade_out()->back()->when);
}
new_length = ar->verify_xfade_bounds ((len + timecnt_t (_editor->pixel_to_sample (distance))).samples(), start);
samplecnt_t samples = _editor->pixel_to_sample (distance);
timecnt_t tdist = timecnt_t (samples);
timecnt_t newlen = len + tdist;
new_length = timecnt_t (ar->verify_xfade_bounds (newlen.samples(), start));
_editor->begin_reversible_command ("xfade trim");
ar->playlist()->clear_owned_changes ();

View File

@ -135,11 +135,11 @@ StepEditor::reset_step_edit_beat_pos ()
const timepos_t ep = _editor.get_preferred_edit_position();
timecnt_t distance_from_start (step_edit_region->position().distance (ep));
if (distance_from_start < 0) {
if (distance_from_start.negative()) {
/* this can happen with snap enabled, and the edit point == Playhead. we snap the
position of the new region, and it can end up after the edit point.
*/
distance_from_start = 0;
distance_from_start = timecnt_t (ep.time_domain());
}
step_edit_beat_pos = distance_from_start.beats();