fix crash with a new session
[ardour.git] / libs / panners / vbap / vbap.h
index af3c1c0df2263e4fe4919c1599befeb496fbac4b..61746002701ecfbe624ab82612bedbf564a0b0cf 100644 (file)
@@ -44,6 +44,9 @@ public:
         ChanCount in() const;
         ChanCount out() const;
 
+        void set_position (double);
+        void set_width (double);
+
         std::set<Evoral::Parameter> what_can_be_automated() const;
 
        static Panner* factory (boost::shared_ptr<Pannable>, boost::shared_ptr<Speakers>);
@@ -65,12 +68,14 @@ public:
 private:
         struct Signal {
             PBD::AngularVector direction;
-            double gains[3];
-            double desired_gains[3];
-            int    outputs[3];
-            int    desired_outputs[3];
+            std::vector<double> gains; /* most recently used gain for all speakers */
+
+            int outputs[3];  /* most recent set of outputs used (2 or 3, depending on dimension) */
+            int desired_outputs[3]; /* outputs to use the next time we distribute */
+            double desired_gains[3]; /* target gains for desired_outputs */
 
-            Signal (Session&, VBAPanner&, uint32_t which);
+            Signal (Session&, VBAPanner&, uint32_t which, uint32_t n_speakers);
+            void resize_gains (uint32_t n_speakers);
         };
 
         std::vector<Signal*> _signals;