Fix thinkos in cubasish theme
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index d44da988f6655e5a90bb1ba261846b5e429cd344..e6a6dc09c727b6b7523506d3fd23502920a6dec3 100644 (file)
@@ -1,21 +1,29 @@
 /*
-    Copyright (C) 20002-2004 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-2006 Taybin Rutkin <taybin@taybin.com>
+ * Copyright (C) 2005-2016 Tim Mayberry <mojofunk@gmail.com>
+ * Copyright (C) 2005-2019 Paul Davis <paul@linuxaudiosystems.com>
+ * Copyright (C) 2006-2007 Doug McLain <doug@nostar.net>
+ * Copyright (C) 2006-2012 David Robillard <d@drobilla.net>
+ * Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
+ * Copyright (C) 2008 Hans Baier <hansfbaier@googlemail.com>
+ * Copyright (C) 2013-2019 Robin Gareus <robin@gareus.org>
+ * 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.
+ */
 
 #ifdef WAF_BUILD
 #include "gtk2ardour-config.h"
 #include "meterbridge.h"
 #include "luawindow.h"
 #include "mixer_ui.h"
-#include "startup.h"
 #include "window_manager.h"
 #include "global_port_matrix.h"
 #include "location_ui.h"
 #include "main_clock.h"
 #include "rc_option_editor.h"
+#include "virtual_keyboard_window.h"
 
 #include <gtkmm2ext/application.h>
 
 #include "ardour/session.h"
 #include "ardour/profile.h"
 #include "ardour/audioengine.h"
+#include "ardour/lv2_plugin.h"
 
 #include "control_protocol/control_protocol.h"
 
@@ -162,7 +171,7 @@ ARDOUR_UI::install_actions ()
 
        /* the real actions */
 
-       act = ActionManager::register_action (main_actions, X_("New"), _("New..."),  hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::get_session_parameters), false, true, "")));
+       act = ActionManager::register_action (main_actions, X_("New"), _("New..."),  hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::start_session_load), true)));
 
        ActionManager::register_action (main_actions, X_("Open"), _("Open..."),  sigc::mem_fun(*this, &ARDOUR_UI::open_session));
        ActionManager::register_action (main_actions, X_("Recent"), _("Recent..."),  sigc::mem_fun(*this, &ARDOUR_UI::open_recent_session));
@@ -238,18 +247,6 @@ ARDOUR_UI::install_actions ()
        act = ActionManager::register_action (main_actions, X_("Export"), _("Export"));
        ActionManager::session_sensitive_actions.push_back (act);
 
-       act = global_actions.register_action (main_actions, X_("CleanupUnusedSources"), _("Clean-up Unused Sources..."),  sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::cleanup));
-       ActionManager::session_sensitive_actions.push_back (act);
-       ActionManager::write_sensitive_actions.push_back (act);
-
-       act = global_actions.register_action (main_actions, X_("CleanupUnusedRegions"), _("Clean-up Unused Regions..."),  sigc::mem_fun (*editor, &PublicEditor::cleanup_regions));
-       ActionManager::session_sensitive_actions.push_back (act);
-       ActionManager::write_sensitive_actions.push_back (act);
-
-       act = ActionManager::register_action (main_actions, X_("CleanupPeakFiles"), _("Reset Peak Files"),  sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::cleanup_peakfiles));
-       ActionManager::session_sensitive_actions.push_back (act);
-       ActionManager::write_sensitive_actions.push_back (act);
-
        act = ActionManager::register_action (main_actions, X_("FlushWastebasket"), _("Flush Wastebasket"),  sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::flush_trash));
 
        ActionManager::write_sensitive_actions.push_back (act);
@@ -486,6 +483,9 @@ ARDOUR_UI::install_actions ()
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::transport_sensitive_actions.push_back (act);
 
+       act = ActionManager::register_toggle_action (main_actions, X_("ToggleLatencyCompensation"), _("Disable Latency Compensation"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_latency_switch));
+       ActionManager::session_sensitive_actions.push_back (act);
+
        act = ActionManager::register_action (main_actions, X_("MonitorMenu"), _("Monitor Section")); /* just the submenu item */
        ActionManager::session_sensitive_actions.push_back (act);
 
@@ -572,6 +572,18 @@ ARDOUR_UI::install_dependent_actions ()
        act = ActionManager::register_action (main_actions, X_("ExportAudio"), _("Export to Audio File(s)..."),  sigc::mem_fun (*editor, &PublicEditor::export_audio));
        ActionManager::session_sensitive_actions.push_back (act);
 
+       act = ActionManager::register_action (main_actions, X_("CleanupUnusedSources"), _("Clean-up Unused Sources..."),  sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::cleanup));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::write_sensitive_actions.push_back (act);
+
+       act = ActionManager::register_action (main_actions, X_("CleanupUnusedRegions"), _("Clean-up Unused Regions..."),  sigc::mem_fun (*editor, &PublicEditor::cleanup_regions));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::write_sensitive_actions.push_back (act);
+
+       act = ActionManager::register_action (main_actions, X_("CleanupPeakFiles"), _("Reset Peak Files"),  sigc::mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::cleanup_peakfiles));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::write_sensitive_actions.push_back (act);
+
        /* these actions are all currently implemented by the Editor, but need
         * to be accessible from anywhere as actions.
         */
@@ -861,6 +873,11 @@ ARDOUR_UI::save_ardour_state ()
                if (location_ui) {
                        _session->add_instant_xml (location_ui->ui().get_state ());
                }
+               if (virtual_keyboard_window) {
+                       XMLNode& vkstate (virtual_keyboard_window->get_state());
+                       vkstate.add_child_nocopy (virtual_keyboard_window.get_state ());
+                       _session->add_instant_xml (vkstate);
+               }
        } else {
                Config->add_instant_xml (main_window_node);
                Config->add_instant_xml (enode);
@@ -870,6 +887,11 @@ ARDOUR_UI::save_ardour_state ()
                if (location_ui) {
                        Config->add_instant_xml (location_ui->ui().get_state ());
                }
+               if (virtual_keyboard_window) {
+                       XMLNode& vkstate (virtual_keyboard_window->get_state());
+                       vkstate.add_child_nocopy (virtual_keyboard_window.get_state ());
+                       _session->add_instant_xml (vkstate);
+               }
        }
 
        delete &enode;
@@ -881,8 +903,11 @@ ARDOUR_UI::save_ardour_state ()
 }
 
 void
-ARDOUR_UI::resize_text_widgets ()
+ARDOUR_UI::on_theme_changed ()
 {
+       LV2Plugin::set_global_ui_background_color (UIConfiguration::instance().color ("gtk_background"));
+       LV2Plugin::set_global_ui_foreground_color (UIConfiguration::instance().color ("gtk_foreground"));
+       LV2Plugin::set_global_ui_scale_factor (UIConfiguration::instance().get_ui_scale());
 }
 
 void