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
|
|
|
|
|
|
|
#include <gtkmm/accelmap.h>
|
|
|
|
|
2005-09-25 14:42:24 -04: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"
|
|
|
|
#include "route_params_ui.h"
|
|
|
|
#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;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::shutdown ()
|
|
|
|
{
|
|
|
|
if (session) {
|
|
|
|
delete session;
|
|
|
|
session = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::we_have_dependents ()
|
|
|
|
{
|
|
|
|
setup_keybindings ();
|
2006-11-30 11:43:11 -05:00
|
|
|
editor->UpdateAllTransportClocks.connect (mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2006-12-18 21:41:19 -05:00
|
|
|
static void
|
|
|
|
accel_map_changed (GtkAccelMap* map,
|
|
|
|
gchar* path,
|
|
|
|
guint key,
|
|
|
|
GdkModifierType mod,
|
|
|
|
gpointer arg)
|
|
|
|
{
|
|
|
|
static_cast<ARDOUR_UI*>(arg)->save_keybindings ();
|
|
|
|
}
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::setup_keybindings ()
|
|
|
|
{
|
2005-11-28 10:29:49 -05:00
|
|
|
install_actions ();
|
2007-06-27 16:23:48 -04:00
|
|
|
ProcessorBox::register_actions ();
|
2006-01-24 07:38:33 -05:00
|
|
|
|
2006-12-18 21:41:19 -05:00
|
|
|
cerr << "loading bindings from " << keybindings_path << endl;
|
2005-11-29 17:48:54 -05:00
|
|
|
|
|
|
|
try {
|
2006-12-18 21:41:19 -05:00
|
|
|
AccelMap::load (keybindings_path);
|
2005-11-29 17:48:54 -05:00
|
|
|
} catch (...) {
|
2006-12-18 21:41:19 -05:00
|
|
|
error << string_compose (_("Ardour key bindings file not found at \"%1\" or contains errors."), keybindings_path)
|
|
|
|
<< endmsg;
|
2005-11-29 17:48:54 -05:00
|
|
|
}
|
2006-12-18 21:41:19 -05:00
|
|
|
|
|
|
|
/* catch changes */
|
|
|
|
|
|
|
|
GtkAccelMap* accelmap = gtk_accel_map_get();
|
|
|
|
g_signal_connect (accelmap, "changed", (GCallback) accel_map_changed, this);
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
|
|
|
|
{
|
|
|
|
editor->connect_to_session (s);
|
|
|
|
mixer->connect_to_session (s);
|
2006-12-18 21:41:19 -05:00
|
|
|
|
|
|
|
/* its safe to do this now */
|
|
|
|
|
|
|
|
s->restore_history ("");
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::goto_editor_window ()
|
|
|
|
{
|
|
|
|
editor->show_window ();
|
2005-10-05 09:48:09 -04:00
|
|
|
editor->present();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
void
|
|
|
|
ARDOUR_UI::goto_mixer_window ()
|
|
|
|
{
|
|
|
|
mixer->show_window ();
|
2005-10-05 09:48:09 -04:00
|
|
|
mixer->present();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
ARDOUR_UI::exit_on_main_window_close (GdkEventAny *ev)
|
|
|
|
{
|
|
|
|
finish();
|
|
|
|
return TRUE;
|
|
|
|
}
|