projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
copy plugin state to all instances when instantiating.
[ardour.git]
/
libs
/
ardour
/
buffer_manager.cc
diff --git
a/libs/ardour/buffer_manager.cc
b/libs/ardour/buffer_manager.cc
index e035e4519a30d120c5aaf502fe3ebae008c2434e..c221837af88ddef013ca597ecf1ec8a272f348e0 100644
(file)
--- a/
libs/ardour/buffer_manager.cc
+++ b/
libs/ardour/buffer_manager.cc
@@
-22,7
+22,6
@@
#include "pbd/compose.h"
#include "ardour/buffer_manager.h"
#include "pbd/compose.h"
#include "ardour/buffer_manager.h"
-#include "ardour/debug.h"
#include "ardour/thread_buffers.h"
using namespace ARDOUR;
#include "ardour/thread_buffers.h"
using namespace ARDOUR;
@@
-30,7
+29,10
@@
using namespace PBD;
RingBufferNPT<ThreadBuffers*>* BufferManager::thread_buffers = 0;
std::list<ThreadBuffers*>* BufferManager::thread_buffers_list = 0;
RingBufferNPT<ThreadBuffers*>* BufferManager::thread_buffers = 0;
std::list<ThreadBuffers*>* BufferManager::thread_buffers_list = 0;
-Glib::StaticMutex BufferManager::rb_mutex = GLIBMM_STATIC_MUTEX_INIT;
+Glib::Threads::Mutex BufferManager::rb_mutex;
+
+using std::cerr;
+using std::endl;
void
BufferManager::init (uint32_t size)
void
BufferManager::init (uint32_t size)
@@
-46,15
+48,18
@@
BufferManager::init (uint32_t size)
thread_buffers->write (&ts, 1);
thread_buffers_list->push_back (ts);
}
thread_buffers->write (&ts, 1);
thread_buffers_list->push_back (ts);
}
+ // cerr << "Initialized thread buffers, readable count now " << thread_buffers->read_space() << endl;
+
}
ThreadBuffers*
BufferManager::get_thread_buffers ()
{
}
ThreadBuffers*
BufferManager::get_thread_buffers ()
{
- Glib::Mutex::Lock em (rb_mutex);
+ Glib::
Threads::
Mutex::Lock em (rb_mutex);
ThreadBuffers* tbp;
if (thread_buffers->read (&tbp, 1) == 1) {
ThreadBuffers* tbp;
if (thread_buffers->read (&tbp, 1) == 1) {
+ // cerr << "Got thread buffers, readable count now " << thread_buffers->read_space() << endl;
return tbp;
}
return tbp;
}
@@
-64,19
+69,17
@@
BufferManager::get_thread_buffers ()
void
BufferManager::put_thread_buffers (ThreadBuffers* tbp)
{
void
BufferManager::put_thread_buffers (ThreadBuffers* tbp)
{
- Glib::Mutex::Lock em (rb_mutex);
+ Glib::
Threads::
Mutex::Lock em (rb_mutex);
thread_buffers->write (&tbp, 1);
thread_buffers->write (&tbp, 1);
+ // cerr << "Put back thread buffers, readable count now " << thread_buffers->read_space() << endl;
}
void
}
void
-BufferManager::ensure_buffers (ChanCount howmany)
+BufferManager::ensure_buffers (ChanCount howmany
, size_t custom
)
{
/* this is protected by the audioengine's process lock: we do not */
{
/* this is protected by the audioengine's process lock: we do not */
- DEBUG_TRACE (DEBUG::Processors, string_compose ("BufferManager::ensure_buffers (%1)\n", howmany));
-
for (ThreadBufferList::iterator i = thread_buffers_list->begin(); i != thread_buffers_list->end(); ++i) {
for (ThreadBufferList::iterator i = thread_buffers_list->begin(); i != thread_buffers_list->end(); ++i) {
- DEBUG_TRACE (DEBUG::Processors, string_compose ("BufferManager::ensure_buffers, thread buffers @ %1\n", (*i)));
- (*i)->ensure_buffers (howmany);
+ (*i)->ensure_buffers (howmany, custom);
}
}
}
}