Update "separate_by_channel" API & add Lua bindings
authorRobin Gareus <robin@gareus.org>
Wed, 23 Aug 2017 17:37:45 +0000 (19:37 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 23 Aug 2017 19:33:29 +0000 (21:33 +0200)
This breaks compilation (GUI)

libs/ardour/ardour/audioregion.h
libs/ardour/ardour/midi_region.h
libs/ardour/ardour/region.h
libs/ardour/audioregion.cc
libs/ardour/luabindings.cc
libs/ardour/midi_region.cc

index a2c43460ed5a4f729c931388b37ae74d0ec3afc6..205998e4a840999a2e098a660fdacca93a5b5ef7 100644 (file)
@@ -153,7 +153,7 @@ class LIBARDOUR_API AudioRegion : public Region
        void set_envelope_active (bool yn);
        void set_default_envelope ();
 
-       int separate_by_channel (ARDOUR::Session&, std::vector<boost::shared_ptr<Region> >&) const;
+       int separate_by_channel (std::vector<boost::shared_ptr<Region> >&) const;
 
        /* automation */
 
index 9039db63d5ba6d1240ef28f6ea1fcde73bc6b025..36c9125a84341b4b1fc46e9347c469bf6a2f80f9 100644 (file)
@@ -97,7 +97,7 @@ class LIBARDOUR_API MidiRegion : public Region
        XMLNode& state ();
        int      set_state (const XMLNode&, int version);
 
-       int separate_by_channel (ARDOUR::Session&, std::vector< boost::shared_ptr<Region> >&) const;
+       int separate_by_channel (std::vector< boost::shared_ptr<Region> >&) const;
 
        /* automation */
 
index 33c381df5886f25fbefafe00735b5fda9f96f39c..c49d8c86cb96d7bb70e0d1a39778d35e8cdf4b7d 100644 (file)
@@ -336,9 +336,8 @@ class LIBARDOUR_API Region
 
        bool has_transients () const;
 
-       virtual int separate_by_channel (ARDOUR::Session&,
-                       std::vector< boost::shared_ptr<Region> >&) const {
-               return 0;
+       virtual int separate_by_channel (std::vector< boost::shared_ptr<Region> >&) const {
+               return -1;
        }
 
        void maybe_invalidate_transients ();
index 689b220b81d303c113f1173cd6ca497e08dec9d0..def7e9dbfb2c37dd14bccae572788a821c712670 100644 (file)
@@ -1321,7 +1321,7 @@ AudioRegion::recompute_at_start ()
 }
 
 int
-AudioRegion::separate_by_channel (Session& /*session*/, vector<boost::shared_ptr<Region> >& v) const
+AudioRegion::separate_by_channel (vector<boost::shared_ptr<Region> >& v) const
 {
        SourceList srcs;
        string new_name;
index 01aca8901556b49f93866d5eed2e44bae46d1cce..4575e9fbecf98b36d508497bec37d04d95133164 100644 (file)
@@ -1210,6 +1210,7 @@ LuaBindings::common (lua_State* L)
                .addFunction ("scale_amplitude", &AudioRegion::scale_amplitude)
                .addFunction ("maximum_amplitude", &AudioRegion::maximum_amplitude)
                .addFunction ("rms", &AudioRegion::rms)
+               .addRefFunction ("separate_by_channel", &AudioRegion::separate_by_channel)
                .endClass ()
 
                .deriveWSPtrClass <Source, SessionObject> ("Source")
@@ -1538,6 +1539,10 @@ LuaBindings::common (lua_State* L)
                .beginConstStdList <boost::weak_ptr<AudioSource> > ("WeakAudioSourceList")
                .endClass ()
 
+               // typedef std::vector<boost::shared_ptr<Region> > RegionVector
+               .beginStdVector <boost::shared_ptr<Region> > ("RegionVector")
+               .endClass ()
+
                // typedef std::list<boost::shared_ptr<Region> > RegionList
                .beginConstStdList <boost::shared_ptr<Region> > ("RegionList")
                .endClass ()
index dc7293f7b5c1c3cca72e1b2a8070f9f105655a44..51b87bdceddb22aeee8c10fdece618665bc5786b 100644 (file)
@@ -510,7 +510,7 @@ MidiRegion::recompute_at_start ()
 }
 
 int
-MidiRegion::separate_by_channel (ARDOUR::Session&, vector< boost::shared_ptr<Region> >&) const
+MidiRegion::separate_by_channel (vector< boost::shared_ptr<Region> >&) const
 {
        // TODO
        return -1;