add per-thread sample rate variable and libardour method to update it
This commit is contained in:
parent
1f0d9159a7
commit
f42bd3fe47
28
libs/ardour/superclock.cc
Normal file
28
libs/ardour/superclock.cc
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Paul Davis <paul@linuxaudiosystems.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "temporal/superclock.h"
|
||||
|
||||
#include "ardour/audioengine.h"
|
||||
|
||||
void
|
||||
update_sample_rate ()
|
||||
{
|
||||
Temporal::_thread_sample_rate = ARDOUR::AudioEngine::instance()->sample_rate();
|
||||
}
|
||||
|
@ -251,6 +251,7 @@ libardour_sources = [
|
||||
'stripable.cc',
|
||||
'step_sequencer.cc',
|
||||
'strip_silence.cc',
|
||||
'superclock.cc',
|
||||
'system_exec.cc',
|
||||
'revision.cc',
|
||||
'rt_midibuffer.cc',
|
||||
|
24
libs/temporal/superclock.cc
Normal file
24
libs/temporal/superclock.cc
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Paul Davis <paul@linuxaudiosystems.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include "temporal/superclock.h"
|
||||
|
||||
namespace Temporal {
|
||||
thread_local uint32_t _thread_sample_rate = 0;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ APPNAME = 'temporal'
|
||||
VERSION = TEMPORAL_VERSION
|
||||
I18N_PACKAGE = 'libtemporal'
|
||||
|
||||
temporal_sources = [ 'time.cc', 'bbt_time.cc', 'tempo.cc', 'timeline.cc' ]
|
||||
temporal_sources = [ 'time.cc', 'bbt_time.cc', 'tempo.cc', 'timeline.cc', 'superclock.cc' ]
|
||||
|
||||
def options(opt):
|
||||
autowaf.set_options(opt)
|
||||
|
Loading…
Reference in New Issue
Block a user