change the use of "SMPTE" to "Timecode" to reflect the global economy and the end...
[ardour.git] / libs / surfaces / control_protocol / control_protocol / control_protocol.h
index 69135f2b4b010c3f1a60603582cebed802632494..9efb4b299c8a0314ab586c7c4c01ee91f24f98d1 100644 (file)
@@ -16,7 +16,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #ifndef ardour_control_protocols_h
@@ -25,8 +24,9 @@
 #include <string>
 #include <vector>
 #include <list>
+#include <boost/shared_ptr.hpp>
 #include <sigc++/sigc++.h>
-
+#include <pbd/stateful.h>
 #include <control_protocol/basic_ui.h>
 
 namespace ARDOUR {
@@ -34,7 +34,7 @@ namespace ARDOUR {
 class Route;
 class Session;
 
-class ControlProtocol : public sigc::trackable, public BasicUI {
+class ControlProtocol : public sigc::trackable, public PBD::Stateful, public BasicUI {
   public:
        ControlProtocol (Session&, std::string name);
        virtual ~ControlProtocol();
@@ -44,6 +44,11 @@ class ControlProtocol : public sigc::trackable, public BasicUI {
        virtual int set_active (bool yn) = 0;
        bool get_active() const { return _active; }
 
+       virtual int set_feedback (bool /*yn*/) { return 0; }
+       virtual bool get_feedback () const { return false; }
+
+       virtual void route_list_changed () {}
+
        sigc::signal<void> ActiveChanged;
 
        /* signals that a control protocol can emit and other (presumably graphical)
@@ -73,7 +78,7 @@ class ControlProtocol : public sigc::trackable, public BasicUI {
        */
 
        void set_route_table_size (uint32_t size);
-       void set_route_table (uint32_t table_index, ARDOUR::Route*);
+       void set_route_table (uint32_t table_index, boost::shared_ptr<ARDOUR::Route>);
        bool set_route_table (uint32_t table_index, uint32_t remote_control_id);
 
        void route_set_rec_enable (uint32_t table_index, bool yn);
@@ -94,10 +99,12 @@ class ControlProtocol : public sigc::trackable, public BasicUI {
        std::string route_get_name (uint32_t table_index);
 
   protected:
-       std::vector<ARDOUR::Route*> route_table;
+       std::vector<boost::shared_ptr<ARDOUR::Route> > route_table;
        std::string _name;
        bool _active;
 
+       void add_strip (std::list<boost::shared_ptr<ARDOUR::Route> >);
+
        void next_track (uint32_t initial_id);
        void prev_track (uint32_t initial_id);
 };
@@ -109,6 +116,7 @@ extern "C" {
            void*       ptr;       /* protocol can store a value here */
            void*       module;    /* not for public access */
            int         mandatory; /* if non-zero, always load and do not make optional */
+           bool        supports_feedback; /* if true, protocol has toggleable feedback mechanism */
            bool             (*probe)(ControlProtocolDescriptor*);
            ControlProtocol* (*initialize)(ControlProtocolDescriptor*,Session*);
            void             (*destroy)(ControlProtocolDescriptor*,ControlProtocol*);