Merge remote-tracking branch 'remotes/origin/cairocanvas' into windows
[ardour.git] / libs / surfaces / control_protocol / control_protocol / control_protocol.h
index a689d494314d97ae606bf50f113ac389d3e74413..37322530e46f6fc2598c3c9cc17bd40020f0a499 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
 #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>
+
+#include "pbd/stateful.h"
+#include "pbd/signals.h"
+
+#include "control_protocol/basic_ui.h"
+#include "control_protocol/types.h"
+
+#ifdef ARDOURSURFACE_DLL_EXPORTS // defined if we are building the ARDOUR surface DLLs (instead of using them)
+    #define ARDOURSURFACE_API LIBARDOUR_HELPER_DLL_EXPORT
+#else
+    #define ARDOURSURFACE_API LIBARDOUR_HELPER_DLL_IMPORT
+#endif 
+#define ARDOURSURFACE_LOCAL LIBARDOUR_HELPER_DLL_LOCAL
 
 namespace ARDOUR {
 
 class Route;
 class Session;
+class Bundle;
 
-class ControlProtocol : public sigc::trackable, public Stateful, public BasicUI {
+class ARDOURCP_API ControlProtocol : public PBD::Stateful, public PBD::ScopedConnectionList, public BasicUI
+{
   public:
        ControlProtocol (Session&, std::string name);
        virtual ~ControlProtocol();
@@ -45,20 +57,45 @@ class ControlProtocol : public sigc::trackable, public Stateful, public BasicUI
        virtual int set_active (bool yn) = 0;
        bool get_active() const { return _active; }
 
-       virtual int set_feedback (bool yn) { return 0; }
+       virtual int set_feedback (bool /*yn*/) { return 0; }
        virtual bool get_feedback () const { return false; }
 
-       sigc::signal<void> ActiveChanged;
+       virtual void midi_connectivity_established () {}
+
+       PBD::Signal0<void> ActiveChanged;
 
        /* signals that a control protocol can emit and other (presumably graphical)
           user interfaces can respond to
        */
 
-       static sigc::signal<void> ZoomToSession;
-       static sigc::signal<void> ZoomIn;
-       static sigc::signal<void> ZoomOut;
-       static sigc::signal<void> Enter;
-       static sigc::signal<void,float> ScrollTimeline;
+       static PBD::Signal0<void> ZoomToSession;
+       static PBD::Signal0<void> ZoomIn;
+       static PBD::Signal0<void> ZoomOut;
+       static PBD::Signal0<void> Enter;
+       static PBD::Signal0<void> Undo;
+       static PBD::Signal0<void> Redo;
+       static PBD::Signal1<void,float> ScrollTimeline;
+       static PBD::Signal1<void,uint32_t> GotoView;
+       static PBD::Signal0<void> CloseDialog;
+       static PBD::Signal0<void> VerticalZoomInAll;
+       static PBD::Signal0<void> VerticalZoomOutAll;
+       static PBD::Signal0<void> VerticalZoomInSelected;
+       static PBD::Signal0<void> VerticalZoomOutSelected;
+       static PBD::Signal0<void> StepTracksDown;
+       static PBD::Signal0<void> StepTracksUp;
+
+       static PBD::Signal1<void,uint32_t> AddRouteToSelection;
+       static PBD::Signal1<void,uint32_t> SetRouteSelection;
+       static PBD::Signal1<void,uint32_t> ToggleRouteSelection;
+       static PBD::Signal1<void,uint32_t> RemoveRouteFromSelection;
+       static PBD::Signal0<void>          ClearRouteSelection;
+
+       /* signals that one UI (e.g. the GUI) can emit to get all other UI's to 
+          respond. Typically this will always be GUI->"others" - the GUI pays
+          no attention to these signals.
+       */
+       
+       static PBD::Signal1<void,RouteNotificationListPtr> TrackSelectionChanged;
 
        /* the model here is as follows:
 
@@ -97,6 +134,12 @@ class ControlProtocol : public sigc::trackable, public Stateful, public BasicUI
 
        std::string route_get_name (uint32_t table_index);
 
+       virtual std::list<boost::shared_ptr<ARDOUR::Bundle> > bundles ();
+
+       virtual bool  has_editor () const { return false; }
+       virtual void* get_gui() const { return 0; }
+       virtual void  tear_down_gui() { }
+
   protected:
        std::vector<boost::shared_ptr<ARDOUR::Route> > route_table;
        std::string _name;
@@ -104,10 +147,14 @@ class ControlProtocol : public sigc::trackable, public Stateful, public BasicUI
 
        void next_track (uint32_t initial_id);
        void prev_track (uint32_t initial_id);
+
+  private:
+       ARDOURSURFACE_LOCAL ControlProtocol (const ControlProtocol&); /* noncopyable */
 };
 
 extern "C" {
-       struct ControlProtocolDescriptor {
+       class ControlProtocolDescriptor {
+       public:
            const char* name;      /* descriptive */
            const char* id;        /* unique and version-specific */
            void*       ptr;       /* protocol can store a value here */