allow ControlProtocols to call for undo/redo in GUI; make MCP use this
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 9 Apr 2012 15:50:38 +0000 (15:50 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 9 Apr 2012 15:50:38 +0000 (15:50 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11851 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
libs/surfaces/control_protocol/control_protocol.cc
libs/surfaces/control_protocol/control_protocol/control_protocol.h
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/mackie_control_protocol.h

index b058001c5eb42894cbb40656a538b81558b9cc34..5295337c5d68150494a83a1ba1003b7eaedcdbb9 100644 (file)
@@ -709,6 +709,8 @@ Editor::Editor ()
        ControlProtocol::ZoomToSession.connect (*this, invalidator (*this), boost::bind (&Editor::temporal_zoom_session, this), gui_context());
        ControlProtocol::ZoomIn.connect (*this, invalidator (*this), boost::bind (&Editor::temporal_zoom_step, this, false), gui_context());
        ControlProtocol::ZoomOut.connect (*this, invalidator (*this), boost::bind (&Editor::temporal_zoom_step, this, true), gui_context());
+       ControlProtocol::Undo.connect (*this, invalidator (*this), boost::bind (&Editor::undo, this, true), gui_context());
+       ControlProtocol::Redo.connect (*this, invalidator (*this), boost::bind (&Editor::redo, this, true), gui_context());
        ControlProtocol::ScrollTimeline.connect (*this, invalidator (*this), ui_bind (&Editor::control_scroll, this, _1), gui_context());
        ControlProtocol::SelectByRID.connect (*this, invalidator (*this), ui_bind (&Editor::control_select, this, _1), gui_context());
        BasicUI::AccessAction.connect (*this, invalidator (*this), ui_bind (&Editor::access_action, this, _1, _2), gui_context());
index 983208343a90309708a1c8e60f840e5863d35ec6..bbe4cea35017a915b0abd52eab389dd1b75b5378 100644 (file)
@@ -35,6 +35,8 @@ Signal0<void>       ControlProtocol::ZoomToSession;
 Signal0<void>       ControlProtocol::ZoomOut;
 Signal0<void>       ControlProtocol::ZoomIn;
 Signal0<void>       ControlProtocol::Enter;
+Signal0<void>       ControlProtocol::Undo;
+Signal0<void>       ControlProtocol::Redo;
 Signal1<void,float> ControlProtocol::ScrollTimeline;
 Signal1<void,uint32_t> ControlProtocol::SelectByRID;
 
index c05e7e291a14d99034bcf0dab174f9dbe9b9d32b..c6547b09740a3ad6b97c17eb489ce6e175537f1c 100644 (file)
@@ -60,6 +60,8 @@ class ControlProtocol : virtual public sigc::trackable, public PBD::Stateful, pu
        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> SelectByRID;
 
index dedd3332a85d815ec773c999a7f835758b6712fb..3410eeb29fd6e2ecb9ce2b26a0ac7f4d2fc56e11 100644 (file)
@@ -1720,6 +1720,32 @@ MackieControlProtocol::scrub_release (Mackie::Button &)
                );
 }
 
+LedState
+MackieControlProtocol::undo_press (Button&)
+{
+       Undo(); /* EMIT SIGNAL */
+       return off;
+}
+
+LedState
+MackieControlProtocol::undo_release (Button&)
+{
+       return off;
+}
+
+LedState
+MackieControlProtocol::redo_press (Button&)
+{
+       Redo(); /* EMIT SIGNAL */
+       return off;
+}
+
+LedState
+MackieControlProtocol::redo_release (Button&)
+{
+       return off;
+}
+
 LedState 
 MackieControlProtocol::drop_press (Button &)
 {
index 3825262dede99b9c232c862a3cfdb47b61f04071..70e1dfd3643526921929639bd883cd9cd3b09ff1 100644 (file)
@@ -196,6 +196,10 @@ class MackieControlProtocol
        Mackie::LedState zoom_release(Mackie::Button &);
        Mackie::LedState scrub_press(Mackie::Button &);
        Mackie::LedState scrub_release(Mackie::Button &);
+       Mackie::LedState undo_press (Mackie::Button &);
+       Mackie::LedState undo_release (Mackie::Button &);
+       Mackie::LedState redo_press (Mackie::Button &);
+       Mackie::LedState redo_release (Mackie::Button &);
 
        /* unimplemented button handlers */
 
@@ -261,14 +265,10 @@ class MackieControlProtocol
        Mackie::LedState on_release (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState rec_ready_press (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState rec_ready_release (Mackie::Button &) { return Mackie::off; }
-       Mackie::LedState undo_press (Mackie::Button &) { return Mackie::off; }
-       Mackie::LedState undo_release (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState snapshot_press (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState snapshot_release (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState touch_press (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState touch_release (Mackie::Button &) { return Mackie::off; }
-       Mackie::LedState redo_press (Mackie::Button &) { return Mackie::off; }
-       Mackie::LedState redo_release (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState enter_press (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState enter_release (Mackie::Button &) { return Mackie::off; }
        Mackie::LedState cancel_press (Mackie::Button &) { return Mackie::off; }