2 Copyright (C) 2000 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "gtk2ardour-config.h"
24 /* this file exists solely to break compilation dependencies that
25 would connect changes to the mixer or editor objects.
30 #include "pbd/error.h"
32 #include "ardour/session.h"
34 #include "ardour_ui.h"
35 #include "public_editor.h"
39 #include "route_params_ui.h"
51 using namespace ARDOUR;
54 ARDOUR_UI::shutdown ()
56 if (ui_config->dirty()) {
57 ui_config->save_state();
62 ARDOUR_UI::we_have_dependents ()
65 ProcessorBox::register_actions ();
66 keyboard->setup_keybindings ();
67 editor->setup_tooltips ();
68 editor->UpdateAllTransportClocks.connect (sigc::mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
70 editor->track_mixer_selection ();
71 mixer->track_editor_selection ();
75 ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
77 BootMessage (_("Setup Editor"));
78 editor->set_session (s);
79 BootMessage (_("Setup Mixer"));
80 mixer->set_session (s);
82 /* its safe to do this now */
84 BootMessage (_("Reload Session History"));
85 s->restore_history ("");
89 _hide_splash (gpointer arg)
91 ((ARDOUR_UI*)arg)->hide_splash();
96 ARDOUR_UI::goto_editor_window ()
98 if (splash && splash->is_visible()) {
99 // in 2 seconds, hide the splash screen
100 Glib::signal_timeout().connect (sigc::bind (sigc::ptr_fun (_hide_splash), this), 2000);
103 editor->show_window ();
109 ARDOUR_UI::goto_mixer_window ()
111 mixer->show_window ();
117 ARDOUR_UI::toggle_mixer_window ()
119 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer"));
124 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
126 if (tact->get_active()) {
127 goto_mixer_window ();
134 ARDOUR_UI::toggle_mixer_on_top ()
137 if (gtk_window_is_active(Mixer_UI::instance()->gobj())) {
138 goto_editor_window ();
140 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("toggle-mixer"));
142 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
144 /* Toggle the mixer to `visible' if required */
145 if (!tact->get_active ()) {
146 tact->set_active (true);
149 goto_mixer_window ();
153 /** The main editor window has been closed */
155 ARDOUR_UI::exit_on_main_window_close (GdkEventAny * /*ev*/)
158 /* just hide the window, and return - the top menu stays up */
162 /* time to get out of here */