eb700624c3f8dcb1c4cd083360a02f8fb4b91667
[ardour.git] / gtk2_ardour / ardour_ui_dependents.cc
1 /*
2     Copyright (C) 2000 Paul Davis 
3
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.
8
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.
13
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.
17
18     $Id$
19 */
20
21 /* this file exists solely to break compilation dependencies that
22    would connect changes to the mixer or editor objects.
23 */
24
25 #include <cstdio>
26
27 #include <gtkmm/accelmap.h>
28
29 #include <pbd/error.h>
30 #include "ardour_ui.h"
31 #include "public_editor.h"
32 #include "mixer_ui.h"
33 #include "keyboard.h"
34 #include "route_params_ui.h"
35 #include "i18n.h"
36
37 using namespace sigc;
38 using namespace Gtk;
39
40 namespace ARDOUR {
41         class Session;
42         class Route;
43 }
44
45 void
46 ARDOUR_UI::shutdown ()
47 {
48         if (session) {
49                 delete session;
50                 session = 0;
51         }
52
53 }
54
55 void
56 ARDOUR_UI::we_have_dependents ()
57 {
58         setup_keybindings ();
59 }
60
61 void
62 ARDOUR_UI::setup_keybindings ()
63 {
64         install_actions ();
65         RedirectBox::register_actions ();
66
67         try {
68                 AccelMap::load (ARDOUR::find_config_file ("ardour.bindings"));
69         } catch (...) {
70                 error << "ardour key bindings file not found" << endmsg;
71         }
72 }
73
74 void
75 ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
76 {
77         editor->connect_to_session (s);
78         mixer->connect_to_session (s);
79 }
80
81 void
82 ARDOUR_UI::goto_editor_window ()
83 {
84         editor->show_window ();
85         editor->present();
86 }
87 void
88 ARDOUR_UI::goto_mixer_window ()
89 {
90         mixer->show_window ();
91         mixer->present();
92 }
93
94 gint
95 ARDOUR_UI::exit_on_main_window_close (GdkEventAny *ev)
96 {
97         finish();
98         return TRUE;
99 }