13
0

merge and resolve conflict with master

This commit is contained in:
Paul Davis 2013-11-29 22:29:25 -05:00
commit 15cee60021
11 changed files with 63 additions and 62 deletions

View File

@ -87,7 +87,6 @@ EngineControl::EngineControl ()
, midi_refresh_button (_("Refresh list"))
, ignore_changes (0)
, _desired_sample_rate (0)
, no_push (true)
, started_at_least_once (false)
{
using namespace Notebook_Helpers;
@ -290,8 +289,6 @@ EngineControl::EngineControl ()
output_channels.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::parameter_changed));
notebook.signal_switch_page().connect (sigc::mem_fun (*this, &EngineControl::on_switch_page));
no_push = false;
}
void
@ -874,10 +871,6 @@ EngineControl::EngineControl ()
/* pick up any saved state for this device */
maybe_display_saved_state ();
/* and push it to the backend */
push_state_to_backend (false);
}
string
@ -1207,14 +1200,9 @@ EngineControl::EngineControl ()
}
}
int
EngineControl::push_state_to_backend (bool start)
{
if (no_push) {
return 0;
}
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
if (!backend) {

View File

@ -114,7 +114,6 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
uint32_t ignore_changes;
uint32_t _desired_sample_rate;
bool no_push;
bool started_at_least_once;
void driver_changed ();

View File

@ -379,12 +379,13 @@ def build(bld):
../libs/fst/vstwin.c
../vst/winmain.c
'''
obj.uselib = 'ALSA'
obj.use = [ 'libpbd',
'libmidipp',
'libtaglib',
'libardour',
'libardour_cp',
'libtimecode',
'libmidipp',
'libgtk2_ardour',
'libgtkmm2ext',
'libtaglib']
@ -407,21 +408,22 @@ def build(bld):
obj.source = gtk2_ardour_sources
obj.target = 'ardour-' + bld.env['VERSION']
obj.includes = ['.']
obj.use = [ 'libpbd',
'libardour',
'libardour_cp',
'libtimecode',
'libmidipp',
'libgtk2_ardour',
'libgtkmm2ext',
]
# continue with setup of obj, which could be a shared library
# or an executable.
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG ALSA CURL DL'
obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL'
obj.uselib += ' GTKMM GNOMECANVASMM GNOMECANVAS FFTW3F'
obj.uselib += ' AUDIOUNITS OSX GTKOSX LO '
obj.use = [ 'libpbd',
'libmidipp',
'ardour',
'libardour_cp',
'libgtkmm2ext',
]
if bld.env['build_target'] == 'mingw':
if bld.env['DEBUG'] == False:

View File

@ -207,7 +207,7 @@ public:
return _data + offset;
}
bool check_silence (pframes_t, pframes_t&) const;
bool check_silence (pframes_t, pframes_t&) const;
void prepare () { _written = false; _silent = false; }
bool written() const { return _written; }

View File

@ -80,8 +80,8 @@ public:
virtual void merge_from (const Buffer& src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) = 0;
protected:
Buffer(DataType type, size_t capacity)
: _type(type), _capacity(capacity), _size(0), _silent(true)
Buffer(DataType type)
: _type(type), _capacity(0), _size(0), _silent (true)
{}
DataType _type;

View File

@ -28,15 +28,15 @@ using namespace PBD;
using namespace ARDOUR;
AudioBuffer::AudioBuffer(size_t capacity)
: Buffer(DataType::AUDIO, capacity)
: Buffer (DataType::AUDIO)
, _owns_data (false)
, _data (0)
{
if (_capacity > 0) {
if (capacity) {
_owns_data = true; // prevent resize() from gagging
resize (_capacity);
resize (capacity);
_silent = false; // force silence on the intial buffer state
silence (_capacity);
clear ();
}
}
@ -50,21 +50,29 @@ void
AudioBuffer::resize (size_t size)
{
if (!_owns_data) {
/* XXX how the hell is this enforced? */
_capacity = size;
return;
}
if (size < _capacity) {
_size = size;
if (_data && size < _capacity) {
/* buffer is already large enough */
if (size < _size) {
/* truncate */
_size = size;
}
return;
}
free (_data);
_capacity = size;
_size = size;
_silent = false;
cache_aligned_malloc ((void**) &_data, sizeof (Sample) * size);
cache_aligned_malloc ((void**) &_data, sizeof (Sample) * _capacity);
_capacity = size;
_size = 0;
_silent = false;
}
bool

View File

@ -56,14 +56,11 @@ AudioPort::cycle_start (pframes_t nframes)
}
void
AudioPort::cycle_end (pframes_t)
AudioPort::cycle_end (pframes_t nframes)
{
if (sends_output() && !_buffer->written()) {
/* we can't use nframes here because the current buffer capacity may
be shorter than the full buffer size if we split the cycle.
*/
if (_buffer->capacity () > 0) {
_buffer->silence (_buffer->capacity());
if (_buffer->capacity() >= nframes) {
_buffer->silence (nframes);
}
}
}

View File

@ -167,7 +167,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
// If there's not enough or they're too small, just nuke the whole thing and
// rebuild it (so I'm lazy..)
if (bufs.size() < num_buffers
|| (bufs.size() > 0 && bufs[0]->capacity() < buffer_capacity)) {
|| (bufs.size() > 0 && bufs[0]->capacity() < buffer_capacity)) {
// Nuke it
for (BufferVec::iterator i = bufs.begin(); i != bufs.end(); ++i) {
@ -179,7 +179,7 @@ BufferSet::ensure_buffers(DataType type, size_t num_buffers, size_t buffer_capac
for (size_t i = 0; i < num_buffers; ++i) {
bufs.push_back(Buffer::create(type, buffer_capacity));
}
_available.set(type, num_buffers);
_count.set (type, num_buffers);
}

View File

@ -33,12 +33,12 @@ using namespace PBD;
// FIXME: mirroring for MIDI buffers?
MidiBuffer::MidiBuffer(size_t capacity)
: Buffer(DataType::MIDI, capacity)
, _data(0)
: Buffer (DataType::MIDI)
, _data (0)
{
if (capacity) {
resize(_capacity);
silence(_capacity);
resize (capacity);
silence (capacity);
}
}
@ -50,17 +50,22 @@ MidiBuffer::~MidiBuffer()
void
MidiBuffer::resize(size_t size)
{
assert(size > 0);
if (_data && size < _capacity) {
if (_size < size) {
/* truncate */
_size = size;
}
if (size < _capacity) {
return;
}
free(_data);
free (_data);
cache_aligned_malloc ((void**) &_data, size);
_size = 0;
_capacity = size;
cache_aligned_malloc ((void**) &_data, _capacity);
assert(_data);
}

View File

@ -60,7 +60,7 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
size_t count = std::max (scratch_buffers->available().get(*t), howmany.get(*t));
size_t size = _engine->raw_buffer_size (*t);
size_t size = _engine->raw_buffer_size (*t) / sizeof (Sample);
scratch_buffers->ensure_buffers (*t, count, size);
mix_buffers->ensure_buffers (*t, count, size);
@ -68,12 +68,14 @@ ThreadBuffers::ensure_buffers (ChanCount howmany)
route_buffers->ensure_buffers (*t, count, size);
}
delete [] gain_automation_buffer;
gain_automation_buffer = new gain_t[_engine->raw_buffer_size (DataType::AUDIO)];
delete [] send_gain_automation_buffer;
send_gain_automation_buffer = new gain_t[_engine->raw_buffer_size (DataType::AUDIO)];
size_t audio_buffer_size = _engine->raw_buffer_size (DataType::AUDIO) / sizeof (Sample);
allocate_pan_automation_buffers (_engine->raw_buffer_size (DataType::AUDIO), howmany.n_audio(), false);
delete [] gain_automation_buffer;
gain_automation_buffer = new gain_t[audio_buffer_size];
delete [] send_gain_automation_buffer;
send_gain_automation_buffer = new gain_t[audio_buffer_size];
allocate_pan_automation_buffers (audio_buffer_size, howmany.n_audio(), false);
}
void

View File

@ -155,11 +155,11 @@ JACKAudioBackend::enumerate_devices () const
}
vector<float>
JACKAudioBackend::available_sample_rates (const string& /*device*/) const
JACKAudioBackend::available_sample_rates (const string& device) const
{
vector<float> f;
if (available()) {
if (device == _target_device && available()) {
f.push_back (sample_rate());
return f;
}
@ -183,11 +183,11 @@ JACKAudioBackend::available_sample_rates (const string& /*device*/) const
}
vector<uint32_t>
JACKAudioBackend::available_buffer_sizes (const string& /*device*/) const
JACKAudioBackend::available_buffer_sizes (const string& device) const
{
vector<uint32_t> s;
if (available()) {
if (device == _target_device && available()) {
s.push_back (buffer_size());
return s;
}