use new method in MidiPatchManager to use MIDNAM data when setting a MidiTimeAxisView
[ardour.git] / gtk2_ardour / editor_actions.cc
index 81e2eb95968e974ddd8bdb57c541161dd1634882..adb783ca54ef0f47aecba565149fa694fd686b5d 100644 (file)
@@ -1,21 +1,30 @@
 /*
-    Copyright (C) 2000-2007 Paul Davis
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
+ * Copyright (C) 2005-2019 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2006-2007 Doug McLain <doug@nostar.net>
+ * Copyright (C) 2006-2007 Sampo Savolainen <v2@iki.fi>
+ * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2007-2014 David Robillard <d@drobilla.net>
+ * Copyright (C) 2012-2017 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2013-2015 Colin Fletcher <colin.m.fletcher@googlemail.com>
+ * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
+ * Copyright (C) 2014-2016 Nick Mainsbridge <mainsbridge@gmail.com>
+ * Copyright (C) 2014-2019 Ben Loftis <ben@harrisonconsoles.com>
+ * Copyright (C) 2015 AndrĂ© Nusser <andre.nusser@googlemail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
 
 #include <gio/gio.h>
 #include <gtk/gtkiconfactory.h>
@@ -473,10 +482,12 @@ Editor::register_actions ()
 
        ActionManager::register_action (editor_actions, X_("cycle-zoom-focus"), _("Next Zoom Focus"), sigc::mem_fun (*this, &Editor::cycle_zoom_focus));
 
+       Glib::RefPtr<ActionGroup> lua_script_actions = ActionManager::create_action_group (bindings, X_("LuaAction"));
+
        for (int i = 1; i <= MAX_LUA_ACTION_SCRIPTS; ++i) {
                string const a = string_compose (X_("script-action-%1"), i);
                string const n = string_compose (_("Unset #%1"), i);
-               act = ActionManager::register_action (editor_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::trigger_script), i - 1));
+               act = ActionManager::register_action (lua_script_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::trigger_script), i - 1));
                act->set_tooltip (_("no action bound"));
                act->set_sensitive (false);
        }
@@ -520,12 +531,10 @@ Editor::register_actions ()
        mouse_content_button.set_icon (ArdourWidgets::ArdourIcon::ToolContent);
        mouse_content_button.set_name ("mouse mode button");
 
-       if(!Profile->get_mixbus()) {
-               act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-cut", _("Cut Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseCut));
-               mouse_cut_button.set_related_action (act);
-               mouse_cut_button.set_icon (ArdourWidgets::ArdourIcon::ToolCut);
-               mouse_cut_button.set_name ("mouse mode button");
-       }
+       act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-cut", _("Cut Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseCut));
+       mouse_cut_button.set_related_action (act);
+       mouse_cut_button.set_icon (ArdourWidgets::ArdourIcon::ToolCut);
+       mouse_cut_button.set_name ("mouse mode button");
 
        ActionManager::register_action (editor_actions, "step-mouse-mode", _("Step Mouse Mode"), sigc::bind (sigc::mem_fun(*this, &Editor::step_mouse_mode), true));
 
@@ -619,29 +628,16 @@ Editor::register_actions ()
 
        no_ruler_shown_update = true;
 
-       if (Profile->get_trx()) {
-               ruler_marker_action->set_active (true);
-               ruler_meter_action->set_active (false);
-               ruler_tempo_action->set_active (false);
-               ruler_range_action->set_active (false);
-               ruler_loop_punch_action->set_active (false);
-               ruler_loop_punch_action->set_active (false);
-               ruler_bbt_action->set_active (true);
-               ruler_cd_marker_action->set_active (false);
-               ruler_timecode_action->set_active (false);
-               ruler_minsec_action->set_active (true);
-       } else {
-               ruler_marker_action->set_active (true);
-               ruler_meter_action->set_active (true);
-               ruler_tempo_action->set_active (true);
-               ruler_range_action->set_active (true);
-               ruler_loop_punch_action->set_active (true);
-               ruler_loop_punch_action->set_active (true);
-               ruler_bbt_action->set_active (true);
-               ruler_cd_marker_action->set_active (true);
-               ruler_timecode_action->set_active (true);
-               ruler_minsec_action->set_active (false);
-       }
+       ruler_marker_action->set_active (true);
+       ruler_meter_action->set_active (true);
+       ruler_tempo_action->set_active (true);
+       ruler_range_action->set_active (true);
+       ruler_loop_punch_action->set_active (true);
+       ruler_loop_punch_action->set_active (true);
+       ruler_bbt_action->set_active (true);
+       ruler_cd_marker_action->set_active (true);
+       ruler_timecode_action->set_active (true);
+       ruler_minsec_action->set_active (false);
 
        ruler_video_action->set_active (false);
        xjadeo_proc_action->set_active (false);
@@ -1559,7 +1555,7 @@ Editor::register_region_actions ()
 
        /* PART 2: actions that are not related to the selection, but for which the edit point type and location is important */
 
-//     register_region_action (_region_actions, RegionActionTarget (ListSelection), "insert-region-from-region-list", _("Insert Region from Region List"), sigc::bind (sigc::mem_fun (*this, &Editor::insert_region_list_selection), 1));
+       register_region_action (_region_actions, RegionActionTarget (ListSelection), "insert-region-from-source-list", _("Insert Region from Source List"), sigc::bind (sigc::mem_fun (*this, &Editor::insert_source_list_selection), 1));
 
        /* PART 3: actions that operate on the selection and also require the edit point location */