2005-09-25 14:42:24 -04:00
|
|
|
/*
|
|
|
|
Copyright (C) 2000 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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* this file exists solely to break compilation dependencies that
|
|
|
|
would connect changes to the mixer or editor objects.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <cstdio>
|
2005-11-29 17:48:54 -05:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/error.h"
|
2007-01-03 13:48:27 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "ardour_ui.h"
|
|
|
|
#include "public_editor.h"
|
|
|
|
#include "mixer_ui.h"
|
|
|
|
#include "keyboard.h"
|
2008-01-19 00:06:33 -05:00
|
|
|
#include "splash.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "route_params_ui.h"
|
2008-02-16 17:43:18 -05:00
|
|
|
#include "opts.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "i18n.h"
|
|
|
|
|
2005-09-25 16:33:00 -04:00
|
|
|
using namespace sigc;
|
2005-11-29 17:48:54 -05:00
|
|
|
using namespace Gtk;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
class Route;
|
|
|
|
}
|
|
|
|
|
2008-02-16 17:43:18 -05:00
|
|
|
using namespace ARDOUR;
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::shutdown ()
|
|
|
|
{
|
|
|
|
if (session) {
|
2007-10-11 18:07:47 -04:00
|
|
|
/* we're exiting cleanly, so remove any auto-save data */
|
|
|
|
session->remove_pending_capture_state ();
|
2005-09-25 14:42:24 -04:00
|
|
|
session = 0;
|
|
|
|
}
|
2008-02-02 12:22:04 -05:00
|
|
|
|
2008-01-10 16:20:59 -05:00
|
|
|
ui_config->save_state();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::we_have_dependents ()
|
|
|
|
{
|
2005-11-28 10:29:49 -05:00
|
|
|
install_actions ();
|
2007-06-27 16:23:48 -04:00
|
|
|
ProcessorBox::register_actions ();
|
2006-12-18 21:41:19 -05:00
|
|
|
|
2008-02-16 17:43:18 -05:00
|
|
|
Keyboard::setup_keybindings ();
|
2007-08-01 18:18:46 -04:00
|
|
|
|
2008-02-16 17:43:18 -05:00
|
|
|
editor->UpdateAllTransportClocks.connect (mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
|
|
|
|
{
|
2008-02-16 17:43:18 -05:00
|
|
|
BootMessage (_("Setup Editor"));
|
2005-09-25 14:42:24 -04:00
|
|
|
editor->connect_to_session (s);
|
2008-02-16 17:43:18 -05:00
|
|
|
BootMessage (_("Setup Mixer"));
|
2005-09-25 14:42:24 -04:00
|
|
|
mixer->connect_to_session (s);
|
2006-12-18 21:41:19 -05:00
|
|
|
|
|
|
|
/* its safe to do this now */
|
|
|
|
|
2008-02-16 17:43:18 -05:00
|
|
|
BootMessage (_("Reload Session History"));
|
2006-12-18 21:41:19 -05:00
|
|
|
s->restore_history ("");
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-01-19 00:06:33 -05:00
|
|
|
static bool
|
|
|
|
_hide_splash (gpointer arg)
|
|
|
|
{
|
|
|
|
((ARDOUR_UI*)arg)->hide_splash();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::goto_editor_window ()
|
|
|
|
{
|
2008-01-19 00:06:33 -05:00
|
|
|
if (splash && splash->is_visible()) {
|
|
|
|
// in 2 seconds, hide the splash screen
|
|
|
|
Glib::signal_timeout().connect (bind (sigc::ptr_fun (_hide_splash), this), 2000);
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
editor->show_window ();
|
2007-10-11 18:07:47 -04:00
|
|
|
editor->present ();
|
2008-12-12 09:43:24 -05:00
|
|
|
_mixer_on_top = false;
|
2008-01-18 22:49:52 -05:00
|
|
|
flush_pending ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2008-01-18 22:49:52 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::goto_mixer_window ()
|
|
|
|
{
|
|
|
|
mixer->show_window ();
|
2007-10-11 18:07:47 -04:00
|
|
|
mixer->present ();
|
2008-12-12 09:43:24 -05:00
|
|
|
_mixer_on_top = true;
|
2008-01-18 22:49:52 -05:00
|
|
|
flush_pending ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2008-12-12 09:43:24 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_editor_mixer_on_top ()
|
|
|
|
{
|
|
|
|
if (_mixer_on_top) {
|
|
|
|
goto_editor_window ();
|
|
|
|
} else {
|
|
|
|
goto_mixer_window ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
gint
|
2009-07-21 11:55:17 -04:00
|
|
|
ARDOUR_UI::exit_on_main_window_close (GdkEventAny * /*ev*/)
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2008-12-12 09:43:24 -05:00
|
|
|
#ifdef TOP_MENUBAR
|
|
|
|
/* just hide the window, and return - the top menu stays up */
|
|
|
|
editor->hide ();
|
|
|
|
return TRUE;
|
|
|
|
#else
|
|
|
|
/* time to get out of here */
|
2005-09-25 14:42:24 -04:00
|
|
|
finish();
|
|
|
|
return TRUE;
|
2008-12-12 09:43:24 -05:00
|
|
|
#endif
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|