set + store signal chain latency for all processors; DiskWriter sets its capture_offs...
[ardour.git] / libs / ardour / ardour / session_event.h
index 96145e7b295aee94ba80b73e7e72d9a56aa2daf3..2780924c276ad12138bc9ed713103047206ec5ff 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Paul Davis 
+    Copyright (C) 2012 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -40,13 +40,13 @@ class LIBARDOUR_API SessionEvent {
 public:
        enum Type {
                SetTransportSpeed,
-               SetTrackSpeed,
                Locate,
                LocateRoll,
                LocateRollLocate,
                SetLoop,
                PunchIn,
                PunchOut,
+               RecordStart,
                RangeStop,
                RangeLocate,
                Overwrite,
@@ -84,26 +84,28 @@ public:
        union {
                void*        ptr;
                bool         yes_or_no;
-               framepos_t  target2_frame;
+               framepos_t   target2_frame;
                Slave*       slave;
                Route*       route;
        };
 
        union {
                bool second_yes_or_no;
+               double control_value;
        };
 
        union {
                bool third_yes_or_no;
        };
 
-       /* 4 members to handle a multi-group event handled in RT context */
+       /* 5 members to handle a multi-group event handled in RT context */
 
        typedef boost::function<void (SessionEvent*)> RTeventCallback;
 
-       boost::shared_ptr<RouteList> routes;    /* apply to */
-       boost::function<void (void)> rt_slot;   /* what to call in RT context */
-       RTeventCallback              rt_return; /* called after rt_slot, with this event as an argument */
+       boost::shared_ptr<ControlList> controls; /* apply to */
+       boost::shared_ptr<RouteList> routes;     /* apply to */
+       boost::function<void (void)> rt_slot;    /* what to call in RT context */
+       RTeventCallback              rt_return;  /* called after rt_slot, with this event as an argument */
        PBD::EventLoop*              event_loop;
 
        std::list<AudioRange> audio_range;
@@ -134,11 +136,12 @@ public:
 
        static const framepos_t Immediate = -1;
 
+       static bool has_per_thread_pool ();
        static void create_per_thread_pool (const std::string& n, uint32_t nitems);
        static void init_event_pool ();
 
        CrossThreadPool* event_pool() const { return own_pool; }
-       
+
 private:
        static PerThreadPool* pool;
        CrossThreadPool* own_pool;
@@ -157,12 +160,14 @@ public:
        void clear_events (SessionEvent::Type type, boost::function<void (void)> after);
 
 protected:
-       RingBuffer<SessionEvent*> pending_events;
+       PBD::RingBuffer<SessionEvent*> pending_events;
        typedef std::list<SessionEvent *> Events;
        Events           events;
        Events           immediate_events;
        Events::iterator next_event;
 
+       Glib::Threads::Mutex rb_write_lock;
+
        /* there can only ever be one of each of these */
 
        SessionEvent *auto_loop_event;