'libs/evoral' - cast the returned pointers from malloc() / g_ptr_array_index() etc...
[ardour.git] / libs / panners / vbap / vbap_speakers.h
index 8fe006ea1cefdb4602cb5c6cef2f7963e144dae6..b2f8b3c9dd13dd9f63770e8b296bedc71c5cb422 100644 (file)
@@ -35,28 +35,27 @@ class Speakers;
 
 class VBAPSpeakers : public boost::noncopyable {
 public:
-       typedef std::vector<double> dvector;
+       VBAPSpeakers (boost::shared_ptr<Speakers>);
 
+       typedef std::vector<double> dvector;
        const dvector matrix (int tuple) const  { return _matrices[tuple]; }
        int speaker_for_tuple (int tuple, int which) const { return _speaker_tuples[tuple][which]; }
 
        int           n_tuples () const  { return _matrices.size(); }
        int           dimension() const { return _dimension; }
 
-       static VBAPSpeakers& instance (Speakers&);
         uint32_t n_speakers() const { return _speakers.size(); }
+        boost::shared_ptr<Speakers> parent() const { return _parent; }
 
        ~VBAPSpeakers ();
 
 private:
-       static VBAPSpeakers* _instance;
-       static const double MIN_VOL_P_SIDE_LGTH = 0.01;
+       static const double MIN_VOL_P_SIDE_LGTH;
        int   _dimension;  
-       std::vector<Speaker>& _speakers;
+        boost::shared_ptr<Speakers> _parent;
+       std::vector<Speaker> _speakers;
        PBD::ScopedConnection speaker_connection;
 
-       VBAPSpeakers (Speakers&);
-
        struct azimuth_sorter {
                bool operator() (const Speaker& s1, const Speaker& s2) {
                        return s1.angles().azi < s2.angles().azi;