re-add TLSF
[ardour.git] / gtk2_ardour / ardour_ui_ed.cc
index 7f60f03c7760d6a9d03c69e202a841fa8e0c2c64..d10e67339625287203914377f1b47dc6485a4fe5 100644 (file)
@@ -46,7 +46,6 @@
 #include "public_editor.h"
 #include "audio_clock.h"
 #include "keyboard.h"
-#include "master_faders.h"
 #include "monitor_section.h"
 #include "engine_dialog.h"
 #include "editor.h"
@@ -69,7 +68,7 @@
 
 #include "control_protocol/control_protocol.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -109,6 +108,12 @@ ARDOUR_UI::create_luawindow ()
        return 0;
 }
 
+void
+ARDOUR_UI::escape ()
+{
+       Escape (); /* EMIT SIGNAL */
+}
+
 void
 ARDOUR_UI::install_actions ()
 {
@@ -116,6 +121,8 @@ ARDOUR_UI::install_actions ()
        Glib::RefPtr<ActionGroup> main_menu_actions = global_actions.create_action_group (X_("Main_menu"));
        Glib::RefPtr<Action> act;
 
+       global_actions.register_action (main_actions, X_("Escape"), _("Escape"), sigc::mem_fun (*this, &ARDOUR_UI::escape));
+
        /* menus + submenus that need action items */
 
        global_actions.register_action (main_menu_actions, X_("Session"), _("Session"));
@@ -127,7 +134,6 @@ ARDOUR_UI::install_actions ()
        global_actions.register_action (main_menu_actions, X_("MixerMenu"), _("Mixer"));
        global_actions.register_action (main_menu_actions, X_("EditorMenu"), _("Editor"));
        global_actions.register_action (main_menu_actions, X_("PrefsMenu"), _("Preferences"));
-       global_actions.register_action (main_menu_actions, X_("MastersMenu"), _("Master Faders"));
        global_actions.register_action (main_menu_actions, X_("DetachMenu"), _("Detach"));
        global_actions.register_action (main_menu_actions, X_("Help"), _("Help"));
        global_actions.register_action (main_menu_actions, X_("KeyMouseActions"), _("Misc. Shortcuts"));
@@ -150,8 +156,7 @@ ARDOUR_UI::install_actions ()
        act = global_actions.register_action (main_actions, X_("Close"), _("Close"),  sigc::mem_fun(*this, &ARDOUR_UI::close_session));
        ActionManager::session_sensitive_actions.push_back (act);
 
-       act = global_actions.register_action (main_actions, X_("AddTrackBus"), _("Add Track or Bus..."),
-                       sigc::mem_fun(*this, &ARDOUR_UI::add_route));
+       act = global_actions.register_action (main_actions, X_("AddTrackBus"), _("Add Track or Bus..."), sigc::mem_fun(*this, &ARDOUR_UI::add_route));
        ActionManager::session_sensitive_actions.push_back (act);
        ActionManager::write_sensitive_actions.push_back (act);
 
@@ -250,22 +255,18 @@ ARDOUR_UI::install_actions ()
        global_actions.register_action (common_actions, X_("show-mixer"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), mixer));
        global_actions.register_action (common_actions, X_("show-preferences"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), rc_option_editor));
        global_actions.register_action (common_actions, X_("menu-show-preferences"), _("Preferences"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), rc_option_editor));
-       global_actions.register_action (common_actions, X_("show-masters"), _("Show"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::show_tabbable), masters));
 
        global_actions.register_action (common_actions, X_("hide-editor"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), editor));
        global_actions.register_action (common_actions, X_("hide-mixer"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), mixer));
        global_actions.register_action (common_actions, X_("hide-preferences"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), rc_option_editor));
-       global_actions.register_action (common_actions, X_("hide-masters"), _("Hide"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::hide_tabbable), masters));
 
        global_actions.register_action (common_actions, X_("attach-editor"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), editor));
        global_actions.register_action (common_actions, X_("attach-mixer"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), mixer));
        global_actions.register_action (common_actions, X_("attach-preferences"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), rc_option_editor));
-       global_actions.register_action (common_actions, X_("attach-masters"), _("Attach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::attach_tabbable), masters));
 
        global_actions.register_action (common_actions, X_("detach-editor"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), editor));
        global_actions.register_action (common_actions, X_("detach-mixer"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), mixer));
        global_actions.register_action (common_actions, X_("detach-preferences"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), rc_option_editor));
-       global_actions.register_action (common_actions, X_("detach-masters"), _("Detach"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::detach_tabbable), masters));
 
        /* These "change" actions are not intended to be used inside menus, but
           are for the tab/window control buttons, which have somewhat odd
@@ -274,7 +275,6 @@ ARDOUR_UI::install_actions ()
        global_actions.register_action (common_actions, X_("change-editor-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::button_change_tabbable_visibility), editor));
        global_actions.register_action (common_actions, X_("change-mixer-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::button_change_tabbable_visibility), mixer));
        global_actions.register_action (common_actions, X_("change-preferences-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::button_change_tabbable_visibility), rc_option_editor));
-       global_actions.register_action (common_actions, X_("change-masters-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::button_change_tabbable_visibility), masters));
 
        /* These "change" actions are not intended to be used inside menus, but
           are for the tab/window control key bindings, which have somewhat odd
@@ -283,7 +283,6 @@ ARDOUR_UI::install_actions ()
        global_actions.register_action (common_actions, X_("key-change-editor-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::key_change_tabbable_visibility), editor));
        global_actions.register_action (common_actions, X_("key-change-mixer-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::key_change_tabbable_visibility), mixer));
        global_actions.register_action (common_actions, X_("key-change-preferences-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::key_change_tabbable_visibility), rc_option_editor));
-       global_actions.register_action (common_actions, X_("key-change-masters-visibility"), _("Change"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::key_change_tabbable_visibility), masters));
 
        global_actions.register_action (common_actions, X_("previous-tab"), _("Previous Tab"), sigc::mem_fun (*this, &ARDOUR_UI::step_up_through_tabs));
        global_actions.register_action (common_actions, X_("next-tab"), _("Next Tab"), sigc::mem_fun (*this, &ARDOUR_UI::step_down_through_tabs));
@@ -597,18 +596,6 @@ ARDOUR_UI::build_menu_bar ()
        use_menubar_as_top_menubar ();
 #endif
 
-       bool wall_clock = false;
-       bool disk_space = false;
-
-       if (!Profile->get_small_screen()) {
-#ifndef __APPLE__
-               // OSX provides its own wallclock, thank you very much
-               wall_clock = true;
-#endif
-               disk_space = true;
-       }
-
-
        hbox->pack_end (error_alert_button, false, false, 2);
 
        hbox->pack_end (wall_clock_label, false, false, 2);
@@ -627,9 +614,10 @@ ARDOUR_UI::build_menu_bar ()
        menu_bar_base.add (menu_hbox);
 
 #ifndef __APPLE__
-       _status_bar_visibility.add (&wall_clock_label,      X_("WallClock"), _("Wall Clock"), wall_clock);
+       // OSX provides its own wallclock, thank you very much
+       _status_bar_visibility.add (&wall_clock_label,      X_("WallClock"), _("Wall Clock"), true);
 #endif
-       _status_bar_visibility.add (&disk_space_label,      X_("Disk"),      _("Disk Space"), disk_space);
+       _status_bar_visibility.add (&disk_space_label,      X_("Disk"),      _("Disk Space"), !Profile->get_small_screen());
        _status_bar_visibility.add (&cpu_load_label,        X_("DSP"),       _("DSP"), true);
        _status_bar_visibility.add (&xrun_label,            X_("XRun"),      _("X-run"), false);
        _status_bar_visibility.add (&peak_thread_work_label,X_("Peakfile"),  _("Active Peak-file Work"), false);
@@ -713,8 +701,6 @@ ARDOUR_UI::save_ardour_state ()
                current_tab = "mixer";
        } else if (current_page_number == _tabs.page_num (rc_option_editor->contents())) {
                current_tab = "preferences";
-       } else if (masters && (current_page_number == _tabs.page_num (masters->contents()))) {
-               current_tab == "masters";
        }
 
        main_window_node.add_property (X_("current-tab"), current_tab);
@@ -736,6 +722,7 @@ ARDOUR_UI::save_ardour_state ()
        XMLNode& enode (editor->get_state());
        XMLNode& mnode (mixer->get_state());
        XMLNode& bnode (meterbridge->get_state());
+       XMLNode& pnode (rc_option_editor->get_state());
 
        Config->add_extra_xml (*window_node);
        Config->add_extra_xml (audio_midi_setup->get_state());
@@ -748,6 +735,7 @@ ARDOUR_UI::save_ardour_state ()
                _session->add_instant_xml (main_window_node);
                _session->add_instant_xml (enode);
                _session->add_instant_xml (mnode);
+               _session->add_instant_xml (pnode);
                _session->add_instant_xml (bnode);
                if (location_ui) {
                        _session->add_instant_xml (location_ui->ui().get_state ());
@@ -756,12 +744,17 @@ ARDOUR_UI::save_ardour_state ()
                Config->add_instant_xml (main_window_node);
                Config->add_instant_xml (enode);
                Config->add_instant_xml (mnode);
+               Config->add_instant_xml (pnode);
                Config->add_instant_xml (bnode);
                if (location_ui) {
                        Config->add_instant_xml (location_ui->ui().get_state ());
                }
        }
+
        delete &enode;
+       delete &mnode;
+       delete &bnode;
+       delete &pnode;
 
        Keyboard::save_keybindings ();
 }