Add a scratch buffer for automation.

Useful as temporary buffer: This allows a controllable to
get a master's automation-curve and combine it with its own
(gain, trim, send) automation buffer.
This commit is contained in:
Robin Gareus
2017-06-03 12:26:33 +02:00
parent 5f7d50a690
commit 0c57199a6c
6 changed files with 23 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ public:
static gain_t* gain_automation_buffer ();
static gain_t* trim_automation_buffer ();
static gain_t* send_gain_automation_buffer ();
static gain_t* scratch_automation_buffer ();
static pan_t** pan_automation_buffer ();
protected:

View File

@@ -1034,6 +1034,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
gain_t* gain_automation_buffer () const;
gain_t* trim_automation_buffer () const;
gain_t* send_gain_automation_buffer () const;
gain_t* scratch_automation_buffer () const;
pan_t** pan_automation_buffer () const;
void ensure_buffer_set (BufferSet& buffers, const ChanCount& howmany);

View File

@@ -45,6 +45,7 @@ public:
gain_t* gain_automation_buffer;
gain_t* trim_automation_buffer;
gain_t* send_gain_automation_buffer;
gain_t* scratch_automation_buffer;
pan_t** pan_automation_buffer;
uint32_t npan_buffers;

View File

@@ -208,6 +208,17 @@ ProcessThread::send_gain_automation_buffer()
return g;
}
gain_t*
ProcessThread::scratch_automation_buffer()
{
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
gain_t* g = tb->scratch_automation_buffer;
assert (g);
return g;
}
pan_t**
ProcessThread::pan_automation_buffer()
{

View File

@@ -6301,6 +6301,12 @@ Session::send_gain_automation_buffer() const
return ProcessThread::send_gain_automation_buffer ();
}
gain_t*
Session::scratch_automation_buffer() const
{
return ProcessThread::scratch_automation_buffer ();
}
pan_t**
Session::pan_automation_buffer() const
{

View File

@@ -36,6 +36,7 @@ ThreadBuffers::ThreadBuffers ()
, gain_automation_buffer (0)
, trim_automation_buffer (0)
, send_gain_automation_buffer (0)
, scratch_automation_buffer (0)
, pan_automation_buffer (0)
, npan_buffers (0)
{
@@ -86,6 +87,8 @@ ThreadBuffers::ensure_buffers (ChanCount howmany, size_t custom)
trim_automation_buffer = new gain_t[audio_buffer_size];
delete [] send_gain_automation_buffer;
send_gain_automation_buffer = new gain_t[audio_buffer_size];
delete [] scratch_automation_buffer;
scratch_automation_buffer = new gain_t[audio_buffer_size];
allocate_pan_automation_buffers (audio_buffer_size, howmany.n_audio(), false);
}