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