change Audio backend sample time methods to use a 64 bit timeline

This commit is contained in:
Paul Davis 2015-02-19 17:43:16 -05:00
parent e148ee52ab
commit 582138f280
14 changed files with 30 additions and 30 deletions

View File

@ -477,12 +477,12 @@ class LIBARDOUR_API AudioBackend : public PortEngine {
*
* Can be called from any thread.
*/
virtual pframes_t sample_time () = 0;
virtual framepos_t sample_time () = 0;
/** Return the time according to the sample clock in use when the most
* recent buffer process cycle began. Can be called from any thread.
*/
virtual pframes_t sample_time_at_cycle_start () = 0;
virtual framepos_t sample_time_at_cycle_start () = 0;
/** Return the time since the current buffer process cycle started,
* in samples, according to the sample clock in use.

View File

@ -94,8 +94,8 @@ class LIBARDOUR_API AudioEngine : public SessionHandlePtr, public PortManager
pframes_t samples_per_cycle () const;
int usecs_per_cycle () const;
size_t raw_buffer_size (DataType t);
pframes_t sample_time ();
pframes_t sample_time_at_cycle_start ();
framepos_t sample_time ();
framepos_t sample_time_at_cycle_start ();
pframes_t samples_since_cycle_start ();
bool get_sync_offset (pframes_t& offset) const;

View File

@ -336,7 +336,7 @@ class LIBARDOUR_API PortEngine {
*
* XXX to be removed after some more design cleanup.
*/
virtual pframes_t sample_time_at_cycle_start () = 0;
virtual framepos_t sample_time_at_cycle_start () = 0;
protected:
PortManager& manager;

View File

@ -189,7 +189,7 @@ class LIBARDOUR_API ISlaveSessionProxy {
virtual framepos_t audible_frame () const { return 0; }
virtual framepos_t transport_frame () const { return 0; }
virtual pframes_t frames_since_cycle_start () const { return 0; }
virtual pframes_t sample_time_at_cycle_start() const { return 0; }
virtual framepos_t sample_time_at_cycle_start() const { return 0; }
virtual framepos_t frame_time () const { return 0; }
virtual void request_locate (framepos_t /*frame*/, bool with_roll = false) {
@ -212,7 +212,7 @@ class LIBARDOUR_API SlaveSessionProxy : public ISlaveSessionProxy {
framepos_t audible_frame () const;
framepos_t transport_frame () const;
pframes_t frames_since_cycle_start () const;
pframes_t sample_time_at_cycle_start() const;
framepos_t sample_time_at_cycle_start() const;
framepos_t frame_time () const;
void request_locate (framepos_t frame, bool with_roll = false);

View File

@ -979,7 +979,7 @@ AudioEngine::raw_buffer_size (DataType t)
return _backend->raw_buffer_size (t);
}
pframes_t
framepos_t
AudioEngine::sample_time ()
{
if (!_backend) {
@ -988,7 +988,7 @@ AudioEngine::sample_time ()
return _backend->sample_time ();
}
pframes_t
framepos_t
AudioEngine::sample_time_at_cycle_start ()
{
if (!_backend) {

View File

@ -59,7 +59,7 @@ SlaveSessionProxy::frames_since_cycle_start() const
return session.engine().samples_since_cycle_start();
}
pframes_t
framepos_t
SlaveSessionProxy::sample_time_at_cycle_start() const
{
return session.engine().sample_time_at_cycle_start();

View File

@ -681,13 +681,13 @@ AlsaAudioBackend::raw_buffer_size (DataType t)
}
/* Process time */
pframes_t
framepos_t
AlsaAudioBackend::sample_time ()
{
return _processed_samples;
}
pframes_t
framepos_t
AlsaAudioBackend::sample_time_at_cycle_start ()
{
return _processed_samples;

View File

@ -223,8 +223,8 @@ class AlsaAudioBackend : public AudioBackend {
size_t raw_buffer_size (DataType t);
/* Process time */
pframes_t sample_time ();
pframes_t sample_time_at_cycle_start ();
framepos_t sample_time ();
framepos_t sample_time_at_cycle_start ();
pframes_t samples_since_cycle_start ();
int create_process_thread (boost::function<void()> func);
@ -349,7 +349,7 @@ class AlsaAudioBackend : public AudioBackend {
/* processing */
float _dsp_load;
uint64_t _processed_samples;
framecnt_t _processed_samples;
pthread_t _main_thread;
/* process threads */

View File

@ -470,13 +470,13 @@ DummyAudioBackend::raw_buffer_size (DataType t)
}
/* Process time */
pframes_t
framepos_t
DummyAudioBackend::sample_time ()
{
return _processed_samples;
}
pframes_t
framepos_t
DummyAudioBackend::sample_time_at_cycle_start ()
{
return _processed_samples;

View File

@ -290,8 +290,8 @@ class DummyAudioBackend : public AudioBackend {
size_t raw_buffer_size (DataType t);
/* Process time */
pframes_t sample_time ();
pframes_t sample_time_at_cycle_start ();
framepos_t sample_time ();
framepos_t sample_time_at_cycle_start ();
pframes_t samples_since_cycle_start ();
int create_process_thread (boost::function<void()> func);
@ -397,7 +397,7 @@ class DummyAudioBackend : public AudioBackend {
uint32_t _systemic_input_latency;
uint32_t _systemic_output_latency;
uint64_t _processed_samples;
framecnt_t _processed_samples;
pthread_t _main_thread;

View File

@ -660,14 +660,14 @@ JACKAudioBackend::get_sync_offset (pframes_t& offset) const
return false;
}
pframes_t
framepos_t
JACKAudioBackend::sample_time ()
{
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);
return jack_frame_time (_priv_jack);
}
pframes_t
framepos_t
JACKAudioBackend::sample_time_at_cycle_start ()
{
GET_PRIVATE_JACK_POINTER_RET (_priv_jack, 0);

View File

@ -97,8 +97,8 @@ class JACKAudioBackend : public AudioBackend {
float dsp_load() const;
pframes_t sample_time ();
pframes_t sample_time_at_cycle_start ();
framepos_t sample_time ();
framepos_t sample_time_at_cycle_start ();
pframes_t samples_since_cycle_start ();
size_t raw_buffer_size (DataType t);

View File

@ -731,7 +731,7 @@ void
WavesAudioBackend::_audio_device_callback (const float* input_buffer,
float* output_buffer,
unsigned long nframes,
pframes_t sample_time,
framepos_t sample_time,
uint64_t cycle_start_time_nanos)
{
uint64_t dsp_start_time_nanos = __get_time_nanos();
@ -988,7 +988,7 @@ WavesAudioBackend::raw_buffer_size (DataType data_type)
}
pframes_t
framepos_t
WavesAudioBackend::sample_time ()
{
// WARNING: This is approximate calculation. Implementation of accurate calculation is pending.
@ -1015,7 +1015,7 @@ WavesAudioBackend::__get_time_nanos ()
}
pframes_t
framepos_t
WavesAudioBackend::sample_time_at_cycle_start ()
{
// COMMENTED FREQUENT DBG LOGS */ std::cout << "WavesAudioBackend::sample_time_at_cycle_start (): " << _sample_time_at_cycle_start << std::endl;

View File

@ -197,9 +197,9 @@ class WavesMidiPort;
virtual size_t raw_buffer_size (DataType data_type);
virtual pframes_t sample_time ();
virtual framepos_t sample_time ();
virtual pframes_t sample_time_at_cycle_start ();
virtual framepos_t sample_time_at_cycle_start ();
virtual pframes_t samples_since_cycle_start ();
@ -347,7 +347,7 @@ class WavesMidiPort;
void _audio_device_callback (const float* input_audio_buffer,
float* output_buffer,
unsigned long nframes,
pframes_t sample_time,
framepos_t sample_time,
uint64_t cycle_start_time_nanos);
void _changed_midi_devices ();