summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/buffer_manager.h
blob: e3ac981e63b6cce4ff2683c542355b79e2f57f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef __libardour_buffer_manager__
#define __libardour_buffer_manager__

#include <stdint.h>

#include "pbd/ringbufferNPT.h"

#include "ardour/chan_count.h"
#include <list>
#include <glibmm/thread.h>

namespace ARDOUR {

class ThreadBuffers;

class BufferManager
{
public:
	static void init (uint32_t);

	static ThreadBuffers* get_thread_buffers ();
	static void           put_thread_buffers (ThreadBuffers*);

	static void ensure_buffers (ChanCount howmany = ChanCount::ZERO);

private:
	static Glib::StaticMutex rb_mutex;

	typedef PBD::RingBufferNPT<ThreadBuffers*> ThreadBufferFIFO;
	typedef std::list<ThreadBuffers*> ThreadBufferList;

	static ThreadBufferFIFO* thread_buffers;
	static ThreadBufferList* thread_buffers_list;
};

}

#endif /* __libardour_buffer_manager__ */