merge with master, fixing conflicts in 3 wscript files
[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 */
19
20 #ifdef WAF_BUILD
21 #include "gtk2ardour-config.h"
22 #endif
23
24 /* this file exists solely to break compilation dependencies that
25    would connect changes to the mixer or editor objects.
26 */
27
28 #include <cstdio>
29
30 #include "pbd/error.h"
31
32 #include "ardour/session.h"
33
34 #include "ardour_ui.h"
35 #include "public_editor.h"
36 #include "mixer_ui.h"
37 #include "keyboard.h"
38 #include "splash.h"
39 #include "route_params_ui.h"
40 #include "opts.h"
41 #include "i18n.h"
42
43 using namespace Gtk;
44 using namespace PBD;
45
46 namespace ARDOUR {
47         class Session;
48         class Route;
49 }
50
51 using namespace ARDOUR;
52
53 void
54 ARDOUR_UI::we_have_dependents ()
55 {
56         install_actions ();
57         ProcessorBox::register_actions ();
58         keyboard->setup_keybindings ();
59         editor->setup_tooltips ();
60         editor->UpdateAllTransportClocks.connect (sigc::mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
61
62         editor->track_mixer_selection ();
63         mixer->track_editor_selection ();
64 }
65
66 void
67 ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
68 {
69         BootMessage (_("Setup Editor"));
70         editor->set_session (s);
71         BootMessage (_("Setup Mixer"));
72         mixer->set_session (s);
73         meterbridge->set_session (s);
74
75         /* its safe to do this now */
76
77         BootMessage (_("Reload Session History"));
78         s->restore_history ("");
79 }
80
81 /** The main editor window has been closed */
82 gint
83 ARDOUR_UI::exit_on_main_window_close (GdkEventAny * /*ev*/)
84 {
85 #ifdef TOP_MENUBAR
86         /* just hide the window, and return - the top menu stays up */
87         editor->hide ();
88         return TRUE;
89 #else
90         /* time to get out of here */
91         finish();
92         return TRUE;
93 #endif
94 }
95