diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-09 17:24:07 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-09 17:24:07 +0000 |
commit | 14004b75a6d18a74fa59ac06c203af693164b774 (patch) | |
tree | 1d0d3f416a7c1c1a8d8edd8ff630d87e2b276498 /libs/ardour/butler.cc | |
parent | 01829e63382ebab3d54b02fffbad11de7cf69ea6 (diff) |
dynamic playback & capture buffer resizing (though transport is stopped first)
git-svn-id: svn://localhost/ardour2/branches/3.0@7250 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/butler.cc')
-rw-r--r-- | libs/ardour/butler.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index 1eb96dea35..1efca35196 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -50,6 +50,8 @@ Butler::Butler(Session& s) { g_atomic_int_set(&should_do_transport_work, 0); SessionEvent::pool->set_trash (&pool_trash); + + Config->ParameterChanged.connect_same_thread (*this, boost::bind (&Butler::config_changed, this, _1)); } Butler::~Butler() @@ -57,6 +59,19 @@ Butler::~Butler() terminate_thread (); } +void +Butler::config_changed (std::string p) +{ + if (p == "playback-buffer-seconds") { + /* size is in Samples, not bytes */ + audio_dstream_playback_buffer_size = (uint32_t) floor (Config->get_audio_playback_buffer_seconds() * _session.frame_rate()); + _session.adjust_playback_buffering (); + } else if (p == "capture-buffer-seconds") { + audio_dstream_capture_buffer_size = (uint32_t) floor (Config->get_audio_capture_buffer_seconds() * _session.frame_rate()); + _session.adjust_capture_buffering (); + } +} + int Butler::start_thread() { |