diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-07-10 23:39:02 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-09-17 17:14:39 -0600 |
commit | ea30642ae3eac3706dbef1f70f8d13e8ebfec51d (patch) | |
tree | 124af6d9ed74b77e29892412fbc9eaf4cf4dc8b2 /libs/ardour/port_manager.cc | |
parent | 455039255ba43f88a3e158b44c2c7f40605e6255 (diff) |
resize audio port _data buffer based on current buffer size
Diffstat (limited to 'libs/ardour/port_manager.cc')
-rw-r--r-- | libs/ardour/port_manager.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/ardour/port_manager.cc b/libs/ardour/port_manager.cc index 8d9f47cf84..75d93af320 100644 --- a/libs/ardour/port_manager.cc +++ b/libs/ardour/port_manager.cc @@ -420,12 +420,13 @@ PortManager::register_port (DataType dtype, const string& portname, bool input, throw PortRegistrationFailure (string_compose ("unable to create port '%1': %2", portname, _("(unknown type)"))); } + newport->set_buffer_size (AudioEngine::instance()->samples_per_cycle()); + RCUWriter<Ports> writer (ports); boost::shared_ptr<Ports> ps = writer.get_copy (); ps->insert (make_pair (make_port_name_relative (portname), newport)); /* writer goes out of scope, forces update */ - } catch (PortRegistrationFailure& err) { @@ -1353,3 +1354,14 @@ PortManager::fill_midi_port_info_locked () midi_info_dirty = false; } + +void +PortManager::set_port_buffer_sizes (pframes_t n) +{ + + boost::shared_ptr<Ports> all = ports.reader(); + + for (Ports::iterator p = all->begin(); p != all->end(); ++p) { + p->second->set_buffer_size (n); + } +} |