Remove unused button.
[ardour.git] / gtk2_ardour / editor.cc
index daeac13fba2c2447b4ea349378137abe955c243d..5be3f245c7520be92f736fbc67b2f1f3ef2d8776 100644 (file)
@@ -267,7 +267,6 @@ Editor::Editor ()
        , toolbar_selection_clock_table (2,3)
 
        , automation_mode_button (_("mode"))
-       , global_automation_button (_("automation"))
 
        , _toolbar_viewport (*manage (new Gtk::Adjustment (0, 0, 1e10)), *manage (new Gtk::Adjustment (0, 0, 1e10)))
        , midi_panic_button (_("Panic"))
@@ -704,6 +703,7 @@ Editor::Editor ()
        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::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());
 
        /* problematic: has to return a value and thus cannot be x-thread */
@@ -911,6 +911,32 @@ Editor::zoom_adjustment_changed ()
        temporal_zoom (fpu);
 }
 
+void
+Editor::control_select (uint32_t rid) 
+{
+       /* handles the (static) signal from the ControlProtocol class that
+        * requests setting the selected track to a given RID
+        */
+        
+       if (!_session) {
+               return;
+       }
+
+       boost::shared_ptr<Route> r = _session->route_by_remote_id (rid);
+
+       if (!r) {
+               return;
+       }
+
+       TimeAxisView* tav = axis_view_from_route (r);
+
+       if (tav) {
+               selection->set (tav);
+       } else {
+               selection->clear_tracks ();
+       }
+}
+
 void
 Editor::control_scroll (float fraction)
 {
@@ -5486,3 +5512,19 @@ Editor::notebook_tab_clicked (GdkEventButton* ev, Gtk::Widget* page)
        return true;
 }
 
+void
+Editor::popup_control_point_context_menu (ArdourCanvas::Item* item, GdkEvent* event)
+{
+       using namespace Menu_Helpers;
+       
+       MenuList& items = _control_point_context_menu.items ();
+       items.clear ();
+       
+       items.push_back (MenuElem (_("Edit..."), sigc::bind (sigc::mem_fun (*this, &Editor::edit_control_point), item)));
+       items.push_back (MenuElem (_("Delete"), sigc::bind (sigc::mem_fun (*this, &Editor::remove_control_point), item)));
+       if (!can_remove_control_point (item)) {
+               items.back().set_sensitive (false);
+       }
+
+       _control_point_context_menu.popup (event->button.button, event->button.time);
+}