X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fsession_butler.cc;h=259a3a1d3d6d55c42aa3a5d0bc189624d35f3b52;hb=499e7907337da36d6d0440c22a2f63e3ada7c439;hp=7cbbd194aebd04c0a30cfc56aeb3ddb02c3a8f9c;hpb=5670e2c3a4732ed7325620713f006c5b93f44a72;p=ardour.git diff --git a/libs/ardour/session_butler.cc b/libs/ardour/session_butler.cc index 7cbbd194ae..259a3a1d3d 100644 --- a/libs/ardour/session_butler.cc +++ b/libs/ardour/session_butler.cc @@ -17,54 +17,56 @@ */ -#include -#include -#include -#include -#include -#include -#include - -#include - #include "pbd/error.h" #include "pbd/pthread_utils.h" #include "pbd/stacktrace.h" -#include "ardour/audio_diskstream.h" -#include "ardour/audioengine.h" #include "ardour/butler.h" -#include "ardour/configuration.h" -#include "ardour/crossfade.h" -#include "ardour/io.h" -#include "ardour/midi_diskstream.h" +#include "ardour/route.h" #include "ardour/session.h" -#include "ardour/timestamps.h" +#include "ardour/session_event.h" #include "ardour/track.h" +#include "ardour/types.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace ARDOUR; using namespace PBD; -/* XXX put this in the right place */ +/*--------------------------------------------------------------------------- + BUTLER THREAD + ---------------------------------------------------------------------------*/ -static inline uint32_t next_power_of_two (uint32_t n) +void +Session::adjust_playback_buffering () { - --n; - n |= n >> 16; - n |= n >> 8; - n |= n >> 4; - n |= n >> 2; - n |= n >> 1; - ++n; - return n; + request_stop (false, false); + SessionEvent *ev = new SessionEvent (SessionEvent::AdjustPlaybackBuffering, SessionEvent::Add, SessionEvent::Immediate, 0, 0, 0.0); + queue_event (ev); } -/*--------------------------------------------------------------------------- - BUTLER THREAD - ---------------------------------------------------------------------------*/ +void +Session::adjust_capture_buffering () +{ + request_stop (false, false); + SessionEvent *ev = new SessionEvent (SessionEvent::AdjustCaptureBuffering, SessionEvent::Add, SessionEvent::Immediate, 0, 0, 0.0); + queue_event (ev); +} + +void +Session::schedule_playback_buffering_adjustment () +{ + add_post_transport_work (PostTransportAdjustPlaybackBuffering); + _butler->schedule_transport_work (); +} + +void +Session::schedule_capture_buffering_adjustment () +{ + add_post_transport_work (PostTransportAdjustCaptureBuffering); + _butler->schedule_transport_work (); +} void Session::schedule_curve_reallocation ()