13
0

Remove direct use of audio-engine rate (2/2)

This is in preparation for sample-rate independence.
This commit is contained in:
Robin Gareus 2023-01-22 20:07:40 +01:00
parent 5130a43d87
commit 86d9bcf525
5 changed files with 7 additions and 7 deletions

View File

@ -105,7 +105,7 @@ AudioClipEditor::ClipBBTMetric::get_marks (std::vector<ArdourCanvas::Ruler::Mark
std::cerr << "get marks between " << lower << " .. " << upper << " with tempo " << tempo << " upp = " << units_per_pixel << std::endl; std::cerr << "get marks between " << lower << " .. " << upper << " with tempo " << tempo << " upp = " << units_per_pixel << std::endl;
samplecnt_t samples_per_beat = tempo.samples_per_note_type (AudioEngine::instance()->sample_rate()); samplecnt_t samples_per_beat = tempo.samples_per_note_type (TEMPORAL_SAMPLE_RATE);
int64_t beat_number = (lower + (samples_per_beat/2)) / samples_per_beat; int64_t beat_number = (lower + (samples_per_beat/2)) / samples_per_beat;
int64_t last = INT64_MIN; int64_t last = INT64_MIN;
const double scale = UIConfiguration::instance ().get_ui_scale (); const double scale = UIConfiguration::instance ().get_ui_scale ();

View File

@ -4073,7 +4073,7 @@ Editor::set_zoom_preset (int64_t ms)
return; return;
} }
ARDOUR::samplecnt_t const sample_rate = ARDOUR::AudioEngine::instance()->sample_rate(); ARDOUR::samplecnt_t const sample_rate = TEMPORAL_SAMPLE_RATE;
temporal_zoom ((sample_rate * ms / 1000) / _visible_canvas_width); temporal_zoom ((sample_rate * ms / 1000) / _visible_canvas_width);
} }

View File

@ -3753,7 +3753,7 @@ TempoEndDrag::start_grab (GdkEvent* event, Gdk::Cursor* cursor)
TempoPoint const * prev = 0; TempoPoint const * prev = 0;
if ((prev = map->previous_tempo (*_tempo)) != 0) { if ((prev = map->previous_tempo (*_tempo)) != 0) {
_editor->tempo_curve_selected (prev, true); _editor->tempo_curve_selected (prev, true);
const samplecnt_t sr = AudioEngine::instance()->sample_rate(); const samplecnt_t sr = _editor->session()->sample_rate();
sstr << "end: " << fixed << setprecision(3) << map->tempo_at (samples_to_superclock (_tempo->sample (sr) - 1, sr)).end_note_types_per_minute() << "\n"; sstr << "end: " << fixed << setprecision(3) << map->tempo_at (samples_to_superclock (_tempo->sample (sr) - 1, sr)).end_note_types_per_minute() << "\n";
} }
@ -3795,7 +3795,7 @@ TempoEndDrag::motion (GdkEvent* event, bool first_move)
_editor->mid_tempo_change (Editor::TempoChanged); _editor->mid_tempo_change (Editor::TempoChanged);
ostringstream sstr; ostringstream sstr;
const samplecnt_t sr = AudioEngine::instance()->sample_rate(); const samplecnt_t sr = _editor->session()->sample_rate();
sstr << "end: " << fixed << setprecision(3) << map->tempo_at (samples_to_superclock (_tempo->sample (sr) - 1, sr)).end_note_types_per_minute() << "\n"; sstr << "end: " << fixed << setprecision(3) << map->tempo_at (samples_to_superclock (_tempo->sample (sr) - 1, sr)).end_note_types_per_minute() << "\n";
if (_tempo->continuing()) { if (_tempo->continuing()) {

View File

@ -1385,7 +1385,7 @@ Glib::RefPtr<Gtk::SizeGroup> RecorderUI::InputPort::_monitor_size_group;
RecorderUI::InputPort::InputPort (string const& name, DataType dt, RecorderUI* parent, bool vertical, bool ioplug) RecorderUI::InputPort::InputPort (string const& name, DataType dt, RecorderUI* parent, bool vertical, bool ioplug)
: _dt (dt) : _dt (dt)
, _monitor (dt, AudioEngine::instance()->sample_rate (), vertical ? InputPortMonitor::Vertical : InputPortMonitor::Horizontal) , _monitor (dt, TEMPORAL_SAMPLE_RATE, vertical ? InputPortMonitor::Vertical : InputPortMonitor::Horizontal) // XXX
, _alignment (0.5, 0.5, 0, 0) , _alignment (0.5, 0.5, 0, 0)
, _frame (vertical ? ArdourWidgets::Frame::Vertical : ArdourWidgets::Frame::Horizontal) , _frame (vertical ? ArdourWidgets::Frame::Vertical : ArdourWidgets::Frame::Horizontal)
, _spill_button ("", ArdourButton::default_elements, true) , _spill_button ("", ArdourButton::default_elements, true)

View File

@ -578,7 +578,7 @@ TransportMastersWidget::Row::update (Session* s, samplepos_t now)
sample_to_timecode (pos, t, false, false, sample_to_timecode (pos, t, false, false,
Timecode::timecode_to_frames_per_second (fmt), Timecode::timecode_to_frames_per_second (fmt),
Timecode::timecode_has_drop_frames (fmt), Timecode::timecode_has_drop_frames (fmt),
AudioEngine::instance()->sample_rate(), 0, false, 0); TEMPORAL_SAMPLE_RATE, 0, false, 0);
} else if ((mtm = boost::dynamic_pointer_cast<MIDIClock_TransportMaster> (tm))) { } else if ((mtm = boost::dynamic_pointer_cast<MIDIClock_TransportMaster> (tm))) {
char buf[16]; char buf[16];
@ -602,7 +602,7 @@ TransportMastersWidget::Row::update (Session* s, samplepos_t now)
if (save_when) { if (save_when) {
char gap[32]; char gap[32];
float seconds = (now - save_when) / (float) AudioEngine::instance()->sample_rate(); float seconds = (now - save_when) / (float) TEMPORAL_SAMPLE_RATE;
if (seconds < 0) { if (seconds < 0) {
seconds = 0; seconds = 0;
} }