13
0

cease using BarTime for anything

This commit is contained in:
Paul Davis 2020-12-07 14:44:39 -07:00
parent b6f2e39ed4
commit 2a6b2dfa7c
3 changed files with 5 additions and 17 deletions

View File

@ -1169,28 +1169,17 @@ AutomationLine::set_state (const XMLNode &node, int version)
Temporal::timepos_t Temporal::timepos_t
AutomationLine::view_to_model_coord (double x, double& y) const AutomationLine::view_to_model_coord (double x, double& y) const
{ {
assert (alist->time_domain() != Temporal::BarTime);
view_to_model_coord_y (y); view_to_model_coord_y (y);
Temporal::timepos_t w; Temporal::timepos_t w;
#warning NUTEMPO FIX ME ... this accepts view coordinate as double and things it can infer beats etc #warning NUTEMPO FIX ME ... this accepts view coordinate as double and things it can infer beats etc
switch (alist->time_domain()) { if (alist->time_domain() == Temporal::AudioTime) {
case Temporal::AudioTime:
return timepos_t (samplepos_t (x)); return timepos_t (samplepos_t (x));
break;
case Temporal::BeatTime:
return timepos_t (Temporal::Beats::from_double (x));
break;
default:
/*NOTREACHED*/
break;
} }
/*NOTREACHED*/ return timepos_t (Temporal::Beats::from_double (x));
return timepos_t();
} }
void void

View File

@ -111,10 +111,10 @@ EditNoteDialog::EditNoteDialog (MidiRegionView* rv, set<NoteBase*> n)
_length_clock.set_session (_region_view->get_time_axis_view().session ()); _length_clock.set_session (_region_view->get_time_axis_view().session ());
_length_clock.set_mode (AudioClock::BBT); _length_clock.set_mode (AudioClock::BBT);
dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->end_time (), timepos_t()), BarTime); dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->end_time (), timepos_t()), BeatTime);
pos = _region_view->region()->position() + dur; pos = _region_view->region()->position() + dur;
timecnt_t offset; timecnt_t offset;
dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->time (), timepos_t()), BarTime); dur = _region_view->region_relative_distance (timecnt_t ((*_events.begin())->note()->time (), timepos_t()), BeatTime);
offset = timecnt_t (_region_view->region()->position(), timepos_t()) + dur; offset = timecnt_t (_region_view->region()->position(), timepos_t()) + dur;
_length_clock.set_is_duration (true, pos); _length_clock.set_is_duration (true, pos);

View File

@ -79,8 +79,7 @@ TempoDialog::TempoDialog (TempoMap::SharedPtr const & map, TempoPoint& point, co
, tap_tempo_button (_("Tap tempo")) , tap_tempo_button (_("Tap tempo"))
{ {
Temporal::BBT_Time when (map->bbt_at (point.time())); Temporal::BBT_Time when (map->bbt_at (point.time()));
init (when, _section->note_types_per_minute(), _section->end_note_types_per_minute(), _section->note_type(), _section->type(), init (when, _section->note_types_per_minute(), _section->end_note_types_per_minute(), _section->note_type(), _section->type(), map->is_initial (point), map->time_domain());
(map->is_initial (point) ||(map->time_domain() == Temporal::BarTime)), map->time_domain());
} }
void void