MIDI region forking, plus Playlist::regions_to_read() fix forward ported from 2.X...
[ardour.git] / libs / ardour / ardour / process_thread.h
1 #ifndef __libardour_process_thread__
2 #define __libardour_process_thread__
3
4 #include <glibmm/thread.h>
5
6 #include "ardour/chan_count.h"
7 #include "ardour/types.h"
8
9 namespace ARDOUR {
10
11 class ThreadBuffers;
12
13 class ProcessThread
14 {
15   public:
16     ProcessThread ();
17     ~ProcessThread ();
18
19     static void init();
20
21     void get_buffers ();
22     void drop_buffers ();
23
24     /* these MUST be called by a process thread's thread, nothing else
25      */
26
27     static BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
28     static BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
29     static BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
30     static gain_t* gain_automation_buffer ();
31     static pan_t** pan_automation_buffer ();
32
33   protected:
34     void session_going_away ();
35
36   private:
37     Glib::Thread* _thread;
38
39     static Glib::Private<ThreadBuffers>* _private_thread_buffers;
40 };
41
42 } // namespace
43
44 #endif /* __libardour_process_thread__ */