Fix --template commandline option
[ardour.git] / gtk2_ardour / editor.cc
index 82ea4f027de1e403be413ac12a3abe6a9083e079..ff587b2fc14683886a363d346e6e0ffeaa3fe3a0 100644 (file)
@@ -370,7 +370,6 @@ Editor::Editor ()
        , meter_marker_menu (0)
        , marker_menu (0)
        , range_marker_menu (0)
-       , transport_marker_menu (0)
        , new_transport_marker_menu (0)
        , marker_menu_item (0)
        , bbt_beat_subdivision (4)
@@ -830,7 +829,6 @@ Editor::Editor ()
 
        _ignore_region_action = false;
        _last_region_menu_was_main = false;
-       _popup_region_menu_item = 0;
 
        _show_marker_lines = false;
 
@@ -858,6 +856,14 @@ Editor::Editor ()
 
 Editor::~Editor()
 {
+       delete tempo_marker_menu;
+       delete meter_marker_menu;
+       delete marker_menu;
+       delete range_marker_menu;
+       delete new_transport_marker_menu;
+       delete editor_ruler_menu;
+       delete _popup_region_menu_item;
+
        delete button_bindings;
        delete _routes;
        delete _route_groups;
@@ -1136,10 +1142,13 @@ Editor::access_action (const std::string& action_group, const std::string& actio
        ENSURE_GUI_THREAD (*this, &Editor::access_action, action_group, action_item)
 
        RefPtr<Action> act;
-       act = ActionManager::get_action (action_group.c_str(), action_item.c_str());
-
-       if (act) {
-               act->activate();
+       try {
+               act = ActionManager::get_action (action_group.c_str(), action_item.c_str());
+               if (act) {
+                       act->activate();
+               }
+       } catch ( ActionManager::MissingActionException const& e) {
+               cerr << "MissingActionException:" << e.what () << endl;
        }
 }
 
@@ -2080,7 +2089,7 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items)
        edit_items.push_back (MenuElem (_("Select"), *select_menu));
 
        /* Cut-n-Paste */
-
+#if 0 // unused, why?
        Menu *cutnpaste_menu = manage (new Menu);
        MenuList& cutnpaste_items = cutnpaste_menu->items();
        cutnpaste_menu->set_name ("ArdourContextMenu");
@@ -2088,6 +2097,7 @@ Editor::add_bus_context_items (Menu_Helpers::MenuList& edit_items)
        cutnpaste_items.push_back (MenuElem (_("Cut"), sigc::mem_fun(*this, &Editor::cut)));
        cutnpaste_items.push_back (MenuElem (_("Copy"), sigc::mem_fun(*this, &Editor::copy)));
        cutnpaste_items.push_back (MenuElem (_("Paste"), sigc::bind (sigc::mem_fun(*this, &Editor::paste), 1.0f, true)));
+#endif
 
        Menu *nudge_menu = manage (new Menu());
        MenuList& nudge_items = nudge_menu->items();
@@ -2292,12 +2302,15 @@ Editor::set_snap_mode (SnapMode mode)
 void
 Editor::set_edit_point_preference (EditPoint ep, bool force)
 {
+       if (Profile->get_mixbus()) {
+               if (ep == EditAtSelectedMarker) {
+                       ep = EditAtPlayhead;
+               }
+       }
+
        bool changed = (_edit_point != ep);
 
        _edit_point = ep;
-       if (Profile->get_mixbus())
-               if (ep == EditAtSelectedMarker)
-                       ep = EditAtPlayhead;
 
        string str = edit_point_strings[(int)ep];
        if (str != edit_point_selector.get_text ()) {
@@ -2317,7 +2330,7 @@ Editor::set_edit_point_preference (EditPoint ep, bool force)
                action = "edit-at-playhead";
                break;
        case EditAtSelectedMarker:
-               action = "edit-at-marker";
+               action = "edit-at-selected-marker";
                break;
        case EditAtMouse:
                action = "edit-at-mouse";
@@ -3042,10 +3055,14 @@ Editor::setup_toolbar ()
        Glib::RefPtr<SizeGroup> mouse_mode_size_group = SizeGroup::create (SIZE_GROUP_VERTICAL);
        mouse_mode_size_group->add_widget (smart_mode_button);
        mouse_mode_size_group->add_widget (mouse_move_button);
-       mouse_mode_size_group->add_widget (mouse_cut_button);
+       if (!Profile->get_mixbus()) {
+               mouse_mode_size_group->add_widget (mouse_cut_button);
+       }
        mouse_mode_size_group->add_widget (mouse_select_button);
        mouse_mode_size_group->add_widget (mouse_timefx_button);
-       mouse_mode_size_group->add_widget (mouse_audition_button);
+       if (!Profile->get_mixbus()) {
+               mouse_mode_size_group->add_widget (mouse_audition_button);
+       }
        mouse_mode_size_group->add_widget (mouse_draw_button);
        mouse_mode_size_group->add_widget (mouse_content_button);
 
@@ -4362,7 +4379,7 @@ Editor::new_playlists (TimeAxisView* v)
 {
        begin_reversible_command (_("new playlists"));
        vector<boost::shared_ptr<ARDOUR::Playlist> > playlists;
-       _session->playlists->get (playlists);
+       _session->playlists()->get (playlists);
        mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_use_new_playlist), playlists), v, ARDOUR::Properties::group_select.property_id);
        commit_reversible_command ();
 }
@@ -4378,7 +4395,7 @@ Editor::copy_playlists (TimeAxisView* v)
 {
        begin_reversible_command (_("copy playlists"));
        vector<boost::shared_ptr<ARDOUR::Playlist> > playlists;
-       _session->playlists->get (playlists);
+       _session->playlists()->get (playlists);
        mapover_tracks (sigc::bind (sigc::mem_fun (*this, &Editor::mapped_use_copy_playlist), playlists), v, ARDOUR::Properties::group_select.property_id);
        commit_reversible_command ();
 }
@@ -4393,7 +4410,7 @@ Editor::clear_playlists (TimeAxisView* v)
 {
        begin_reversible_command (_("clear playlists"));
        vector<boost::shared_ptr<ARDOUR::Playlist> > playlists;
-       _session->playlists->get (playlists);
+       _session->playlists()->get (playlists);
        mapover_tracks (sigc::mem_fun (*this, &Editor::mapped_clear_playlist), v, ARDOUR::Properties::group_select.property_id);
        commit_reversible_command ();
 }
@@ -5567,7 +5584,7 @@ Editor::timeaxisview_deleted (TimeAxisView *tv)
                         * button to inactive (which also unticks the menu option)
                         */
 
-                       ActionManager::uncheck_toggleaction ("<Actions>/Editor/show-editor-mixer");
+                       ActionManager::uncheck_toggleaction ("Editor/show-editor-mixer");
                }
        }
 }