use new libtemporal sample rate mechanism (libs edition)

This commit is contained in:
Paul Davis 2020-12-07 17:13:30 -07:00
parent 5bef968069
commit c64db47b37
7 changed files with 8 additions and 8 deletions

View File

@ -198,6 +198,10 @@ class LIBARDOUR_API AudioEngine : public PortManager, public SessionHandlePtr
static AudioEngine* instance() { return _instance; }
static void destroy();
/* this method is intended only to be used as a "fast" callback from libtemporal */
static int static_sample_rate () { return _instance->sample_rate(); }
void died ();
/* The backend will cause these at the appropriate time(s) */

View File

@ -288,8 +288,6 @@ AudioEngine::process_callback (pframes_t nframes)
thread_init_callback (NULL);
}
#warning NUTEMPO session sample rate or backend sample rate?
Temporal::set_thread_sample_rate (sample_rate());
Temporal::TempoMap::fetch ();
/* This is for JACK, where the latency callback arrives in sync with
@ -1433,7 +1431,6 @@ AudioEngine::thread_init_callback (void* arg)
PBD::notify_event_loops_about_thread_creation (pthread_self(), thread_name, 4096);
AsyncMIDIPort::set_process_thread (pthread_self());
Temporal::set_thread_sample_rate (44100); /* will change later as appropriate */
Temporal::TempoMap::fetch ();
if (arg) {

View File

@ -211,7 +211,6 @@ Butler::thread_work ()
}
}
Temporal::_thread_sample_rate = _session.sample_rate ();
Temporal::TempoMap::fetch ();
restart:

View File

@ -524,6 +524,8 @@ ARDOUR::init (bool try_optimization, const char* localedir, bool with_gui)
return true;
}
Temporal::set_sample_rate_callback (AudioEngine::static_sample_rate);
running_from_gui = with_gui;
#ifndef NDEBUG

View File

@ -538,7 +538,6 @@ again:
void
Graph::setup_thread_local_variables ()
{
Temporal::set_thread_sample_rate (AudioEngine::instance()->sample_rate());
Temporal::TempoMap::fetch ();
}

View File

@ -35,7 +35,7 @@
#include <glibmm/threads.h>
#include "temporal/superclock.h"
#include "temporal/tempo.h"
#include "ardour/audioengine.h"
#include "ardour/auditioner.h"
@ -72,7 +72,7 @@ using namespace std;
void
Session::setup_thread_local_variables ()
{
Temporal::set_thread_sample_rate (sample_rate());
Temporal::TempoMap::fetch ();
}
/** Called by the audio engine when there is work to be done with JACK.

View File

@ -383,7 +383,6 @@ ControlProtocol::notify_stripable_selection_changed (StripableNotificationListPt
void
ControlProtocol::event_loop_precall ()
{
Temporal::set_thread_sample_rate (session->sample_rate());
Temporal::TempoMap::fetch ();
}