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.
20 /* This file contains any ARDOUR_UI methods that require knowledge of
21 the various dialog boxes, and exists so that no compilation dependency
22 exists between the main ARDOUR_UI modules and their respective classes.
23 This is to cut down on the compile times. It also helps with my sanity.
28 #include <gtkmm/treemodelfilter.h>
30 #include "pbd/convert.h"
32 #include "ardour/audioengine.h"
33 #include "ardour/automation_watch.h"
34 #include "ardour/control_protocol_manager.h"
35 #include "ardour/profile.h"
36 #include "ardour/session.h"
38 #include "control_protocol/control_protocol.h"
40 #include "gtkmm2ext/keyboard.h"
41 #include "gtkmm2ext/utils.h"
44 #include "add_route_dialog.h"
45 #include "add_video_dialog.h"
46 #include "ardour_ui.h"
47 #include "big_clock_window.h"
48 #include "big_transport_window.h"
49 #include "bundle_manager.h"
50 #include "global_port_matrix.h"
51 #include "gui_object.h"
52 #include "gui_thread.h"
53 #include "keyeditor.h"
54 #include "location_ui.h"
55 #include "lua_script_manager.h"
56 #include "luawindow.h"
57 #include "main_clock.h"
58 #include "meterbridge.h"
59 #include "meter_patterns.h"
60 #include "monitor_section.h"
61 #include "midi_tracer.h"
62 #include "mini_timeline.h"
64 #include "public_editor.h"
65 #include "processor_box.h"
66 #include "rc_option_editor.h"
67 #include "route_params_ui.h"
68 #include "shuttle_control.h"
69 #include "session_option_editor.h"
70 #include "speaker_dialog.h"
73 #include "time_info_box.h"
78 using namespace ARDOUR;
82 using namespace Gtkmm2ext;
83 using namespace ArdourWidgets;
86 ARDOUR_UI::set_session (Session *s)
88 SessionHandlePtr::set_session (s);
90 transport_ctrl.set_session (s);
92 if (big_transport_window) {
93 big_transport_window->set_session (s);
97 WM::Manager::instance().set_session (s);
98 /* Session option editor cannot exist across change-of-session */
99 session_option_editor.drop_window ();
100 /* Ditto for AddVideoDialog */
101 add_video_dialog.drop_window ();
105 const XMLNode* node = _session->extra_xml (X_("UI"));
108 const XMLNodeList& children = node->children();
109 for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
110 if ((*i)->name() == GUIObjectState::xml_node_name) {
111 gui_object_state->load (**i);
117 WM::Manager::instance().set_session (s);
119 AutomationWatch::instance().set_session (s);
121 shuttle_box.set_session (s);
122 mini_timeline.set_session (s);
123 time_info_box->set_session (s);
125 primary_clock->set_session (s);
126 secondary_clock->set_session (s);
127 big_clock->set_session (s);
128 video_timeline->set_session (s);
129 lua_script_window->set_session (s);
131 /* sensitize menu bar options that are now valid */
133 ActionManager::set_sensitive (ActionManager::session_sensitive_actions, true);
134 ActionManager::set_sensitive (ActionManager::write_sensitive_actions, _session->writable());
136 if (_session->locations()->num_range_markers()) {
137 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, true);
139 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
142 if (!_session->monitor_out()) {
143 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), X_("SoloViaBus"));
145 act->set_sensitive (false);
149 /* allow wastebasket flush again */
151 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("FlushWastebasket"));
153 act->set_sensitive (true);
156 /* there are never any selections on startup */
158 ActionManager::set_sensitive (ActionManager::time_selection_sensitive_actions, false);
159 ActionManager::set_sensitive (ActionManager::track_selection_sensitive_actions, false);
160 ActionManager::set_sensitive (ActionManager::route_selection_sensitive_actions, false);
161 ActionManager::set_sensitive (ActionManager::bus_selection_sensitive_actions, false);
162 ActionManager::set_sensitive (ActionManager::vca_selection_sensitive_actions, false);
163 ActionManager::set_sensitive (ActionManager::stripable_selection_sensitive_actions, false);
164 ActionManager::set_sensitive (ActionManager::line_selection_sensitive_actions, false);
165 ActionManager::set_sensitive (ActionManager::point_selection_sensitive_actions, false);
166 ActionManager::set_sensitive (ActionManager::playlist_selection_sensitive_actions, false);
168 solo_alert_button.set_active (_session->soloing());
170 setup_session_options ();
172 blink_connection = Timers::blink_connect (sigc::mem_fun(*this, &ARDOUR_UI::blink_handler));
174 _session->SaveSessionRequested.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::save_session_at_its_request, this, _1), gui_context());
175 _session->StateSaved.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_title, this), gui_context());
176 _session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context());
177 _session->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::map_transport_state, this), gui_context());
178 _session->DirtyChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_dirty_changed, this), gui_context());
180 _session->Xrun.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context());
181 _session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
182 _session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context());
183 _session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
184 _session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
185 _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());
187 /* Clocks are on by default after we are connected to a session, so show that here.
190 connect_dependents_to_session (s);
192 /* listen to clock mode changes. don't do this earlier because otherwise as the clocks
193 restore their modes or are explicitly set, we will cause the "new" mode to be saved
194 back to the session XML ("Extra") state.
197 AudioClock::ModeChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::store_clock_modes));
199 Glib::signal_idle().connect (sigc::mem_fun (*this, &ARDOUR_UI::first_idle));
203 map_transport_state ();
205 second_connection = Timers::second_connect (sigc::mem_fun(*this, &ARDOUR_UI::every_second));
206 point_one_second_connection = Timers::rapid_connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_one_seconds));
207 point_zero_something_second_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_something_seconds));
208 set_fps_timeout_connection();
212 if (editor_meter_table.get_parent()) {
213 transport_hbox.remove (editor_meter_table);
217 editor_meter_table.remove(*editor_meter);
220 editor_meter_peak_display.hide();
223 if (editor_meter_table.get_parent()) {
224 transport_hbox.remove (editor_meter_table);
228 _session->master_out() &&
229 _session->master_out()->n_outputs().n(DataType::AUDIO) > 0) {
231 if (!ARDOUR::Profile->get_trx()) {
232 editor_meter = new LevelMeterHBox(_session);
233 editor_meter->set_meter (_session->master_out()->shared_peak_meter().get());
234 editor_meter->clear_meters();
235 editor_meter->set_meter_type (_session->master_out()->meter_type());
236 editor_meter->setup_meters (30, 10, 6);
237 editor_meter->show();
238 editor_meter->ButtonPress.connect_same_thread (editor_meter_connection, boost::bind (&ARDOUR_UI::editor_meter_button_press, this, _1));
240 editor_meter_table.set_homogeneous(true);
241 editor_meter_table.attach(*editor_meter, 0,1, 0,2, SHRINK, EXPAND);
242 editor_meter_table.attach(editor_meter_peak_display, 0,1, 2,3, EXPAND|FILL, EXPAND|FILL);
244 editor_meter->show();
245 editor_meter_peak_display.show();
248 ArdourMeter::ResetAllPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_peak_display));
249 ArdourMeter::ResetRoutePeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_route_peak_display));
250 ArdourMeter::ResetGroupPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_group_peak_display));
252 editor_meter_peak_display.set_name ("meterbridge peakindicator");
253 editor_meter_peak_display.unset_flags (Gtk::CAN_FOCUS);
254 editor_meter_peak_display.set_size_request (std::max(9.f, rintf(8.f * UIConfiguration::instance().get_ui_scale())), -1);
255 editor_meter_peak_display.set_corner_radius (3.0);
257 editor_meter_max_peak = -INFINITY;
258 editor_meter_peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &ARDOUR_UI::editor_meter_peak_button_release), false);
260 repack_transport_hbox ();
267 ARDOUR_UI::unload_session (bool hide_stuff)
270 ARDOUR_UI::instance()->video_timeline->sync_session_state();
273 if (_session && _session->dirty()) {
274 std::vector<std::string> actions;
275 actions.push_back (_("Don't close"));
276 actions.push_back (_("Just close"));
277 actions.push_back (_("Save and close"));
278 switch (ask_about_saving_session (actions)) {
284 _session->save_state ("");
290 // tear down session specific CPI (owned by rc_config_editor which can remain)
291 ControlProtocolManager& m = ControlProtocolManager::instance ();
292 for (std::list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
293 if (*i && (*i)->protocol && (*i)->protocol->has_editor ()) {
294 (*i)->protocol->tear_down_gui ();
300 close_all_dialogs ();
303 meterbridge->hide ();
304 audio_port_matrix->hide();
305 midi_port_matrix->hide();
306 route_params->hide();
309 second_connection.disconnect ();
310 point_one_second_connection.disconnect ();
311 point_zero_something_second_connection.disconnect();
312 fps_connection.disconnect();
315 editor_meter_table.remove(*editor_meter);
318 editor_meter_peak_display.hide();
321 ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false);
323 WM::Manager::instance().set_session ((ARDOUR::Session*) 0);
325 if (ARDOUR_UI::instance()->video_timeline) {
326 ARDOUR_UI::instance()->video_timeline->close_session();
331 /* drop everything attached to the blink signal */
333 blink_connection.disconnect ();
338 session_loaded = false;
340 update_buffer_load ();
347 ARDOUR_UI::toggle_editor_and_mixer ()
349 if (editor->tabbed() && mixer->tabbed()) {
350 /* both in the same window */
351 if (_tabs.get_current_page() == _tabs.page_num (editor->contents())) {
352 _tabs.set_current_page (_tabs.page_num (mixer->contents()));
353 } else if (_tabs.get_current_page() == _tabs.page_num (mixer->contents())) {
354 _tabs.set_current_page (_tabs.page_num (editor->contents()));
357 _tabs.set_current_page (_tabs.page_num (mixer->contents()));
363 if (editor->tabbed() && !mixer->tabbed()) {
364 /* editor is tabbed, mixer is not */
366 Gtk::Window* mwin = mixer->current_toplevel ();
369 /* mixer's own window doesn't exist */
370 mixer->make_visible ();
371 } else if (!mwin->is_mapped ()) {
372 /* mixer's own window exists but isn't mapped */
373 mixer->make_visible ();
375 /* mixer window is mapped, editor is visible as tab */
376 Gtk::Widget* f = mwin->get_focus();
377 if (f && f->has_focus()) {
378 /* mixer has focus, switch to editor */
379 editor->make_visible ();
381 mixer->make_visible ();
387 if (!editor->tabbed() && mixer->tabbed()) {
388 /* mixer is tabbed, editor is not */
390 Gtk::Window* ewin = editor->current_toplevel ();
393 /* mixer's own window doesn't exist */
394 editor->make_visible ();
395 } else if (!ewin->is_mapped ()) {
396 /* editor's own window exists but isn't mapped */
397 editor->make_visible ();
399 /* editor window is mapped, mixer is visible as tab */
400 Gtk::Widget* f = ewin->get_focus();
401 if (f && f->has_focus()) {
402 /* editor has focus, switch to mixer */
403 mixer->make_visible ();
405 editor->make_visible ();
413 ARDOUR_UI::step_up_through_tabs ()
415 std::vector<Tabbable*> candidates;
417 /* this list must match the order of visibility buttons */
419 if (!editor->window_visible()) {
420 candidates.push_back (editor);
423 if (!mixer->window_visible()) {
424 candidates.push_back (mixer);
427 if (!rc_option_editor->window_visible()) {
428 candidates.push_back (rc_option_editor);
431 if (candidates.size() < 2) {
432 /* nothing to be done with zero or one visible in tabs */
436 std::vector<Tabbable*>::iterator prev = candidates.end();
437 std::vector<Tabbable*>::iterator i;
438 Gtk::Widget* w = _tabs.get_nth_page (_tabs.get_current_page ());
440 for (i = candidates.begin(); i != candidates.end(); ++i) {
441 if (w == &(*i)->contents()) {
442 if (prev != candidates.end()) {
443 _tabs.set_current_page (_tabs.page_num ((*prev)->contents()));
445 _tabs.set_current_page (_tabs.page_num (candidates.back()->contents()));
454 ARDOUR_UI::step_down_through_tabs ()
456 std::vector<Tabbable*> candidates;
458 /* this list must match the order of visibility buttons */
460 if (!editor->window_visible()) {
461 candidates.push_back (editor);
464 if (!mixer->window_visible()) {
465 candidates.push_back (mixer);
468 if (!rc_option_editor->window_visible()) {
469 candidates.push_back (rc_option_editor);
472 if (candidates.size() < 2) {
473 /* nothing to be done with zero or one visible in tabs */
477 std::vector<Tabbable*>::reverse_iterator next = candidates.rend();
478 std::vector<Tabbable*>::reverse_iterator i;
479 Gtk::Widget* w = _tabs.get_nth_page (_tabs.get_current_page ());
481 for (i = candidates.rbegin(); i != candidates.rend(); ++i) {
482 if (w == &(*i)->contents()) {
483 if (next != candidates.rend()) {
484 _tabs.set_current_page (_tabs.page_num ((*next)->contents()));
486 _tabs.set_current_page (_tabs.page_num (candidates.front()->contents()));
495 ARDOUR_UI::key_change_tabbable_visibility (Tabbable* t)
502 _tabs.set_current_page (_tabs.page_num (t->contents()));
503 } else if (!t->fully_visible()) {
506 _main_window.present ();
511 ARDOUR_UI::button_change_tabbable_visibility (Tabbable* t)
513 /* For many/most users, clicking a button in the main window will make it
514 the main/front/key window, which will change any stacking relationship they
515 were trying to modify by clicking on the button in the first
516 place. This button-aware method knows that click on
517 a button designed to show/hide a Tabbable that has its own window
518 will have made that window be obscured (as the main window comes to
519 the front). We therefore *hide* the Tabbable's window if it is even
520 partially visible, believing that this is likely because the
521 Tabbable window used to be front, the user clicked to change that,
522 and before we even get here, the main window has become front.
530 _tabs.set_current_page (_tabs.page_num (t->contents()));
531 } else if (t->visible()) {
539 ARDOUR_UI::show_tabbable (Tabbable* t)
549 ARDOUR_UI::hide_tabbable (Tabbable* t)
554 t->make_invisible ();
558 ARDOUR_UI::attach_tabbable (Tabbable* t)
568 ARDOUR_UI::detach_tabbable (Tabbable* t)
577 ARDOUR_UI::tabs_page_added (Widget*,guint)
579 if (_tabs.get_n_pages() > 1) {
581 std::vector<TargetEntry> drag_target_entries;
582 drag_target_entries.push_back (TargetEntry ("tabbable"));
584 editor_visibility_button.drag_source_set (drag_target_entries);
585 mixer_visibility_button.drag_source_set (drag_target_entries);
586 prefs_visibility_button.drag_source_set (drag_target_entries);
588 editor_visibility_button.drag_source_set_icon (Gtkmm2ext::pixbuf_from_string (editor->name(),
589 Pango::FontDescription ("Sans 24"),
591 Gdk::Color ("red")));
592 mixer_visibility_button.drag_source_set_icon (Gtkmm2ext::pixbuf_from_string (mixer->name(),
593 Pango::FontDescription ("Sans 24"),
595 Gdk::Color ("red")));
596 prefs_visibility_button.drag_source_set_icon (Gtkmm2ext::pixbuf_from_string (rc_option_editor->name(),
597 Pango::FontDescription ("Sans 24"),
599 Gdk::Color ("red")));
604 ARDOUR_UI::tabs_page_removed (Widget*, guint)
606 if (_tabs.get_n_pages() < 2) {
607 editor_visibility_button.drag_source_unset ();
608 mixer_visibility_button.drag_source_unset ();
609 prefs_visibility_button.drag_source_unset ();
614 ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page)
616 if (editor && (page == (guint) _tabs.page_num (editor->contents()))) {
617 editor_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive);
619 if (mixer && (mixer->tabbed() || mixer->tabbed_by_default())) {
620 mixer_visibility_button.set_active_state (Gtkmm2ext::Off);
623 if (rc_option_editor && (rc_option_editor->tabbed() || rc_option_editor->tabbed_by_default())) {
624 prefs_visibility_button.set_active_state (Gtkmm2ext::Off);
626 } else if (mixer && (page == (guint) _tabs.page_num (mixer->contents()))) {
628 if (editor && (editor->tabbed() || editor->tabbed_by_default())) {
629 editor_visibility_button.set_active_state (Gtkmm2ext::Off);
632 mixer_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive);
634 if (rc_option_editor && (rc_option_editor->tabbed() || rc_option_editor->tabbed_by_default())) {
635 prefs_visibility_button.set_active_state (Gtkmm2ext::Off);
638 } else if (page == (guint) _tabs.page_num (rc_option_editor->contents())) {
640 if (editor && (editor->tabbed() || editor->tabbed_by_default())) {
641 editor_visibility_button.set_active_state (Gtkmm2ext::Off);
644 if (mixer && (mixer->tabbed() || mixer->tabbed_by_default())) {
645 mixer_visibility_button.set_active_state (Gtkmm2ext::Off);
648 prefs_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive);
654 ARDOUR_UI::tabbable_state_change (Tabbable& t)
656 std::vector<std::string> insensitive_action_names;
657 std::vector<std::string> sensitive_action_names;
658 std::vector<std::string> active_action_names;
659 std::vector<std::string> inactive_action_names;
660 Glib::RefPtr<Action> action;
661 std::string downcased_name = downcase (t.name());
671 insensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
672 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
673 sensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
674 sensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
678 } else if (t.tabbed_by_default ()) {
680 insensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
681 insensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
682 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
683 sensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
687 } else if (t.window_visible()) {
689 insensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
690 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
691 sensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
692 sensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
694 active_action_names.push_back (string_compose ("show-%1", downcased_name));
695 inactive_action_names.push_back (string_compose ("hide-%1", downcased_name));
701 /* not currently visible. allow user to retab it or just make
705 insensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
706 insensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
707 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
708 sensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
710 active_action_names.push_back (string_compose ("hide-%1", downcased_name));
711 inactive_action_names.push_back (string_compose ("show-%1", downcased_name));
716 for (std::vector<std::string>::iterator s = insensitive_action_names.begin(); s != insensitive_action_names.end(); ++s) {
717 action = ActionManager::get_action (X_("Common"), (*s).c_str());
719 action->set_sensitive (false);
723 for (std::vector<std::string>::iterator s = sensitive_action_names.begin(); s != sensitive_action_names.end(); ++s) {
724 action = ActionManager::get_action (X_("Common"), (*s).c_str());
726 action->set_sensitive (true);
730 ArdourButton* vis_button = 0;
731 std::vector<ArdourButton*> other_vis_buttons;
734 vis_button = &editor_visibility_button;
735 other_vis_buttons.push_back (&mixer_visibility_button);
736 other_vis_buttons.push_back (&prefs_visibility_button);
737 } else if (&t == mixer) {
738 vis_button = &mixer_visibility_button;
739 other_vis_buttons.push_back (&editor_visibility_button);
740 other_vis_buttons.push_back (&prefs_visibility_button);
741 } else if (&t == rc_option_editor) {
742 vis_button = &prefs_visibility_button;
743 other_vis_buttons.push_back (&editor_visibility_button);
744 other_vis_buttons.push_back (&mixer_visibility_button);
753 vis_button->set_active_state (Gtkmm2ext::ImplicitActive);
756 vis_button->set_active_state (Gtkmm2ext::ExplicitActive);
759 vis_button->set_active_state (Gtkmm2ext::Off);
763 for (std::vector<ArdourButton*>::iterator b = other_vis_buttons.begin(); b != other_vis_buttons.end(); ++b) {
764 (*b)->set_active_state (Gtkmm2ext::Off);
769 ARDOUR_UI::toggle_meterbridge ()
771 assert (editor && mixer && meterbridge);
774 bool obscuring = false;
776 if (meterbridge->not_visible ()) {
778 } else if ((editor->window_visible() && ARDOUR_UI_UTILS::windows_overlap (editor->own_window(), meterbridge)) ||
779 (mixer->window_visible () && ARDOUR_UI_UTILS::windows_overlap (mixer->own_window(), meterbridge))) {
783 if (obscuring && ((editor->own_window() && editor->own_window()->property_has_toplevel_focus()) ||
784 (mixer->own_window() && mixer->own_window()->property_has_toplevel_focus()))) {
789 meterbridge->show_window ();
790 meterbridge->present ();
791 meterbridge->raise ();
793 meterbridge->hide_window (NULL);
798 ARDOUR_UI::toggle_luawindow ()
800 assert (editor && luawindow);
804 if (luawindow->not_visible ()) {
807 // TODO check overlap
810 luawindow->show_window ();
811 luawindow->present ();
814 luawindow->hide_window (NULL);
820 ARDOUR_UI::new_midi_tracer_window ()
822 RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("NewMIDITracer"));
827 std::list<MidiTracer*>::iterator i = _midi_tracer_windows.begin ();
828 while (i != _midi_tracer_windows.end() && (*i)->get_visible() == true) {
832 if (i == _midi_tracer_windows.end()) {
833 /* all our MIDITracer windows are visible; make a new one */
834 MidiTracer* t = new MidiTracer ();
836 _midi_tracer_windows.push_back (t);
838 /* re-use the hidden one */
844 ARDOUR_UI::create_key_editor ()
846 KeyEditor* kedit = new KeyEditor;
848 for (std::list<Bindings*>::iterator b = Bindings::bindings.begin(); b != Bindings::bindings.end(); ++b) {
849 kedit->add_tab ((*b)->name(), **b);
856 ARDOUR_UI::create_bundle_manager ()
858 return new BundleManager (_session);
862 ARDOUR_UI::create_add_video_dialog ()
864 return new AddVideoDialog (_session);
868 ARDOUR_UI::create_session_option_editor ()
870 return new SessionOptionEditor (_session);
874 ARDOUR_UI::create_big_clock_window ()
876 return new BigClockWindow (*big_clock);
880 ARDOUR_UI::create_big_transport_window ()
882 BigTransportWindow* btw = new BigTransportWindow ();
883 btw->set_session (_session);
888 ARDOUR_UI::handle_locations_change (Location *)
891 if (_session->locations()->num_range_markers()) {
892 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, true);
894 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
900 ARDOUR_UI::tabbed_window_state_event_handler (GdkEventWindowState* ev, void* object)
902 if (object == editor) {
904 if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
905 (ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
906 if (big_clock_window) {
907 big_clock_window->set_transient_for (*editor->own_window());
909 if (big_transport_window) {
910 big_transport_window->set_transient_for (*editor->own_window());
914 } else if (object == mixer) {
916 if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
917 (ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
918 if (big_clock_window) {
919 big_clock_window->set_transient_for (*mixer->own_window());
921 if (big_transport_window) {
922 big_transport_window->set_transient_for (*mixer->own_window());
931 ARDOUR_UI::editor_meter_peak_button_release (GdkEventButton* ev)
933 if (ev->button == 1 && Gtkmm2ext::Keyboard::modifier_state_equals (ev->state, Gtkmm2ext::Keyboard::PrimaryModifier|Gtkmm2ext::Keyboard::TertiaryModifier)) {
934 ArdourMeter::ResetAllPeakDisplays ();
935 } else if (ev->button == 1 && Gtkmm2ext::Keyboard::modifier_state_equals (ev->state, Gtkmm2ext::Keyboard::PrimaryModifier)) {
936 if (_session->master_out()) {
937 ArdourMeter::ResetGroupPeakDisplays (_session->master_out()->route_group());
939 } else if (_session->master_out()) {
940 ArdourMeter::ResetRoutePeakDisplays (_session->master_out().get());
946 ARDOUR_UI::toggle_mixer_space()
948 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalMixer");
951 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
952 if (tact->get_active()) {
953 mixer->maximise_mixer_space ();
955 mixer->restore_mixer_space ();
961 ARDOUR_UI::toggle_mixer_list()
963 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMixerList");
966 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
967 mixer->show_mixer_list (tact->get_active());
972 ARDOUR_UI::toggle_monitor_section_visibility ()
974 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
977 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
978 mixer->show_monitor_section (tact->get_active());