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 "pbd/convert.h"
30 #include "ardour/audioengine.h"
31 #include "ardour/automation_watch.h"
32 #include "ardour/control_protocol_manager.h"
33 #include "ardour/profile.h"
34 #include "ardour/session.h"
36 #include "control_protocol/control_protocol.h"
38 #include "gtkmm2ext/keyboard.h"
39 #include "gtkmm2ext/utils.h"
42 #include "add_route_dialog.h"
43 #include "add_video_dialog.h"
44 #include "ardour_ui.h"
45 #include "big_clock_window.h"
46 #include "bundle_manager.h"
47 #include "global_port_matrix.h"
48 #include "gui_object.h"
49 #include "gui_thread.h"
50 #include "keyeditor.h"
51 #include "location_ui.h"
52 #include "lua_script_manager.h"
53 #include "luawindow.h"
54 #include "main_clock.h"
55 #include "meterbridge.h"
56 #include "meter_patterns.h"
57 #include "monitor_section.h"
58 #include "midi_tracer.h"
60 #include "public_editor.h"
61 #include "processor_box.h"
62 #include "rc_option_editor.h"
63 #include "route_params_ui.h"
64 #include "shuttle_control.h"
65 #include "session_option_editor.h"
66 #include "speaker_dialog.h"
69 #include "theme_manager.h"
70 #include "time_info_box.h"
75 using namespace ARDOUR;
79 using namespace Gtkmm2ext;
82 ARDOUR_UI::set_session (Session *s)
84 SessionHandlePtr::set_session (s);
87 WM::Manager::instance().set_session (s);
88 /* Session option editor cannot exist across change-of-session */
89 session_option_editor.drop_window ();
90 /* Ditto for AddVideoDialog */
91 add_video_dialog.drop_window ();
95 const XMLNode* node = _session->extra_xml (X_("UI"));
98 const XMLNodeList& children = node->children();
99 for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
100 if ((*i)->name() == GUIObjectState::xml_node_name) {
101 gui_object_state->load (**i);
107 WM::Manager::instance().set_session (s);
109 AutomationWatch::instance().set_session (s);
112 shuttle_box->set_session (s);
115 primary_clock->set_session (s);
116 secondary_clock->set_session (s);
117 big_clock->set_session (s);
118 time_info_box->set_session (s);
119 video_timeline->set_session (s);
121 /* sensitize menu bar options that are now valid */
123 ActionManager::set_sensitive (ActionManager::session_sensitive_actions, true);
124 ActionManager::set_sensitive (ActionManager::write_sensitive_actions, _session->writable());
126 if (_session->locations()->num_range_markers()) {
127 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, true);
129 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
132 if (!_session->monitor_out()) {
133 Glib::RefPtr<Action> act = ActionManager::get_action (X_("options"), X_("SoloViaBus"));
135 act->set_sensitive (false);
139 /* allow wastebasket flush again */
141 Glib::RefPtr<Action> act = ActionManager::get_action (X_("Main"), X_("FlushWastebasket"));
143 act->set_sensitive (true);
146 /* there are never any selections on startup */
148 ActionManager::set_sensitive (ActionManager::time_selection_sensitive_actions, false);
149 ActionManager::set_sensitive (ActionManager::track_selection_sensitive_actions, false);
150 ActionManager::set_sensitive (ActionManager::line_selection_sensitive_actions, false);
151 ActionManager::set_sensitive (ActionManager::point_selection_sensitive_actions, false);
152 ActionManager::set_sensitive (ActionManager::playlist_selection_sensitive_actions, false);
154 rec_button.set_sensitive (true);
156 solo_alert_button.set_active (_session->soloing());
158 setup_session_options ();
160 blink_connection = Timers::blink_connect (sigc::mem_fun(*this, &ARDOUR_UI::blink_handler));
162 _session->SaveSessionRequested.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::save_session_at_its_request, this, _1), gui_context());
163 _session->RecordStateChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::record_state_changed, this), gui_context());
164 _session->StepEditStatusChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::step_edit_status_change, this, _1), gui_context());
165 _session->TransportStateChange.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::map_transport_state, this), gui_context());
166 _session->DirtyChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_dirty_changed, this), gui_context());
168 _session->Xrun.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::xrun_handler, this, _1), gui_context());
169 _session->SoloActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::soloing_changed, this, _1), gui_context());
170 _session->AuditionActive.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::auditioning_changed, this, _1), gui_context());
171 _session->locations()->added.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
172 _session->locations()->removed.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::handle_locations_change, this, _1), gui_context());
173 _session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_parameter_changed, this, _1), gui_context ());
175 /* Clocks are on by default after we are connected to a session, so show that here.
178 connect_dependents_to_session (s);
180 /* listen to clock mode changes. don't do this earlier because otherwise as the clocks
181 restore their modes or are explicitly set, we will cause the "new" mode to be saved
182 back to the session XML ("Extra") state.
185 AudioClock::ModeChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::store_clock_modes));
187 Glib::signal_idle().connect (sigc::mem_fun (*this, &ARDOUR_UI::first_idle));
191 map_transport_state ();
193 second_connection = Timers::second_connect (sigc::mem_fun(*this, &ARDOUR_UI::every_second));
194 point_one_second_connection = Timers::rapid_connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_one_seconds));
195 point_zero_something_second_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_something_seconds));
196 set_fps_timeout_connection();
200 if (meter_box.get_parent()) {
201 transport_hbox.remove (meter_box);
202 transport_hbox.remove (editor_meter_peak_display);
206 meter_box.remove(*editor_meter);
209 editor_meter_peak_display.hide();
212 if (meter_box.get_parent()) {
213 transport_hbox.remove (meter_box);
214 transport_hbox.remove (editor_meter_peak_display);
218 _session->master_out() &&
219 _session->master_out()->n_outputs().n(DataType::AUDIO) > 0) {
221 if (!ARDOUR::Profile->get_trx()) {
222 editor_meter = new LevelMeterHBox(_session);
223 editor_meter->set_meter (_session->master_out()->shared_peak_meter().get());
224 editor_meter->clear_meters();
225 editor_meter->set_type (_session->master_out()->meter_type());
226 editor_meter->setup_meters (30, 12, 6);
227 editor_meter->show();
228 meter_box.pack_start(*editor_meter);
231 ArdourMeter::ResetAllPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_peak_display));
232 ArdourMeter::ResetRoutePeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_route_peak_display));
233 ArdourMeter::ResetGroupPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_group_peak_display));
235 editor_meter_peak_display.set_name ("meterbridge peakindicator");
236 editor_meter_peak_display.unset_flags (Gtk::CAN_FOCUS);
237 editor_meter_peak_display.set_size_request (std::max(9.f, rintf(8.f * UIConfiguration::instance().get_ui_scale())), -1);
238 editor_meter_peak_display.set_corner_radius (3.0);
240 editor_meter_max_peak = -INFINITY;
241 editor_meter_peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &ARDOUR_UI::editor_meter_peak_button_release), false);
243 if (UIConfiguration::instance().get_show_editor_meter() && !ARDOUR::Profile->get_trx()) {
244 transport_hbox.pack_start (meter_box, false, false);
245 transport_hbox.pack_start (editor_meter_peak_display, false, false);
247 editor_meter_peak_display.show();
255 ARDOUR_UI::unload_session (bool hide_stuff)
258 ARDOUR_UI::instance()->video_timeline->sync_session_state();
261 if (_session && _session->dirty()) {
262 std::vector<std::string> actions;
263 actions.push_back (_("Don't close"));
264 actions.push_back (_("Just close"));
265 actions.push_back (_("Save and close"));
266 switch (ask_about_saving_session (actions)) {
272 _session->save_state ("");
278 // tear down session specific CPI (owned by rc_config_editor which can remain)
279 ControlProtocolManager& m = ControlProtocolManager::instance ();
280 for (std::list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {
281 if (*i && (*i)->protocol && (*i)->protocol->has_editor ()) {
282 (*i)->protocol->tear_down_gui ();
290 meterbridge->hide ();
291 audio_port_matrix->hide();
292 midi_port_matrix->hide();
293 route_params->hide();
296 second_connection.disconnect ();
297 point_one_second_connection.disconnect ();
298 point_zero_something_second_connection.disconnect();
299 fps_connection.disconnect();
302 meter_box.remove(*editor_meter);
305 editor_meter_peak_display.hide();
308 ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false);
310 rec_button.set_sensitive (false);
312 WM::Manager::instance().set_session ((ARDOUR::Session*) 0);
314 if (ARDOUR_UI::instance()->video_timeline) {
315 ARDOUR_UI::instance()->video_timeline->close_session();
320 /* drop everything attached to the blink signal */
322 blink_connection.disconnect ();
327 session_loaded = false;
329 update_buffer_load ();
336 ARDOUR_UI::toggle_editor_and_mixer ()
338 if (editor->tabbed() && mixer->tabbed()) {
339 if (_tabs.get_current_page() == _tabs.page_num (editor->contents())) {
340 _tabs.set_current_page (_tabs.page_num (mixer->contents()));
341 } else if (_tabs.get_current_page() == _tabs.page_num (mixer->contents())) {
342 _tabs.set_current_page (_tabs.page_num (editor->contents()));
349 if (editor->tabbed() && !mixer->tabbed()) {
350 if (main_window_visibility && main_window_visibility->fully_visible()) {
351 if (_tabs.get_current_page() == _tabs.page_num (editor->contents())) {
352 mixer->make_visible ();
355 _main_window.present ();
360 if (mixer->tabbed () && !editor->tabbed()) {
361 if (main_window_visibility && main_window_visibility->fully_visible()) {
362 if (_tabs.get_current_page() == _tabs.page_num (mixer->contents())) {
363 editor->make_visible ();
366 _main_window.present ();
371 if (editor->fully_visible()) {
372 mixer->make_visible ();
374 editor->make_visible ();
379 ARDOUR_UI::step_up_through_tabs ()
381 std::vector<Tabbable*> candidates;
383 /* this list must match the order of visibility buttons */
385 if (!editor->window_visible()) {
386 candidates.push_back (editor);
389 if (!mixer->window_visible()) {
390 candidates.push_back (mixer);
393 if (!rc_option_editor->window_visible()) {
394 candidates.push_back (rc_option_editor);
397 if (candidates.size() < 2) {
398 /* nothing to be done with zero or one visible in tabs */
402 std::vector<Tabbable*>::iterator prev = candidates.end();
403 std::vector<Tabbable*>::iterator i;
404 Gtk::Widget* w = _tabs.get_nth_page (_tabs.get_current_page ());
406 for (i = candidates.begin(); i != candidates.end(); ++i) {
407 if (w == &(*i)->contents()) {
408 if (prev != candidates.end()) {
409 _tabs.set_current_page (_tabs.page_num ((*prev)->contents()));
411 _tabs.set_current_page (_tabs.page_num (candidates.back()->contents()));
420 ARDOUR_UI::step_down_through_tabs ()
422 std::vector<Tabbable*> candidates;
424 /* this list must match the order of visibility buttons */
426 if (!editor->window_visible()) {
427 candidates.push_back (editor);
430 if (!mixer->window_visible()) {
431 candidates.push_back (mixer);
434 if (!rc_option_editor->window_visible()) {
435 candidates.push_back (rc_option_editor);
438 if (candidates.size() < 2) {
439 /* nothing to be done with zero or one visible in tabs */
443 std::vector<Tabbable*>::reverse_iterator next = candidates.rend();
444 std::vector<Tabbable*>::reverse_iterator i;
445 Gtk::Widget* w = _tabs.get_nth_page (_tabs.get_current_page ());
447 for (i = candidates.rbegin(); i != candidates.rend(); ++i) {
448 if (w == &(*i)->contents()) {
449 if (next != candidates.rend()) {
450 _tabs.set_current_page (_tabs.page_num ((*next)->contents()));
452 _tabs.set_current_page (_tabs.page_num (candidates.front()->contents()));
461 ARDOUR_UI::key_change_tabbable_visibility (Tabbable* t)
468 _tabs.set_current_page (_tabs.page_num (t->contents()));
469 } else if (!t->fully_visible()) {
472 _main_window.present ();
477 ARDOUR_UI::button_change_tabbable_visibility (Tabbable* t)
479 /* For many/most users, clicking a button in the main window will make it
480 the main/front/key window, which will change any stacking relationship they
481 were trying to modify by clicking on the button in the first
482 place. This button-aware method knows that click on
483 a button designed to show/hide a Tabbable that has its own window
484 will have made that window be obscured (as the main window comes to
485 the front). We therefore *hide* the Tabbable's window if it is even
486 partially visible, believing that this is likely because the
487 Tabbable window used to be front, the user clicked to change that,
488 and before we even get here, the main window has become front.
496 _tabs.set_current_page (_tabs.page_num (t->contents()));
497 } else if (t->visible()) {
505 ARDOUR_UI::show_tabbable (Tabbable* t)
515 ARDOUR_UI::hide_tabbable (Tabbable* t)
520 t->make_invisible ();
524 ARDOUR_UI::attach_tabbable (Tabbable* t)
534 ARDOUR_UI::detach_tabbable (Tabbable* t)
543 ARDOUR_UI::tabs_page_added (Widget*,guint)
545 if (_tabs.get_n_pages() > 1) {
547 std::vector<TargetEntry> drag_target_entries;
548 drag_target_entries.push_back (TargetEntry ("tabbable"));
550 editor_visibility_button.drag_source_set (drag_target_entries);
551 mixer_visibility_button.drag_source_set (drag_target_entries);
552 prefs_visibility_button.drag_source_set (drag_target_entries);
554 editor_visibility_button.drag_source_set_icon (Gtkmm2ext::pixbuf_from_string (editor->name(),
555 Pango::FontDescription ("Sans 24"),
557 Gdk::Color ("red")));
558 mixer_visibility_button.drag_source_set_icon (Gtkmm2ext::pixbuf_from_string (mixer->name(),
559 Pango::FontDescription ("Sans 24"),
561 Gdk::Color ("red")));
562 prefs_visibility_button.drag_source_set_icon (Gtkmm2ext::pixbuf_from_string (rc_option_editor->name(),
563 Pango::FontDescription ("Sans 24"),
565 Gdk::Color ("red")));
570 ARDOUR_UI::tabs_page_removed (Widget*, guint)
572 if (_tabs.get_n_pages() < 2) {
573 editor_visibility_button.drag_source_unset ();
574 mixer_visibility_button.drag_source_unset ();
575 prefs_visibility_button.drag_source_unset ();
580 ARDOUR_UI::tabs_switch (GtkNotebookPage*, guint page)
582 if (editor && (page == (guint) _tabs.page_num (editor->contents()))) {
583 editor_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive);
585 if (mixer && (mixer->tabbed() || mixer->tabbed_by_default())) {
586 mixer_visibility_button.set_active_state (Gtkmm2ext::Off);
589 if (rc_option_editor && (rc_option_editor->tabbed() || rc_option_editor->tabbed_by_default())) {
590 prefs_visibility_button.set_active_state (Gtkmm2ext::Off);
592 } else if (mixer && (page == (guint) _tabs.page_num (mixer->contents()))) {
594 if (editor && (editor->tabbed() || editor->tabbed_by_default())) {
595 editor_visibility_button.set_active_state (Gtkmm2ext::Off);
598 mixer_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive);
600 if (rc_option_editor && (rc_option_editor->tabbed() || rc_option_editor->tabbed_by_default())) {
601 prefs_visibility_button.set_active_state (Gtkmm2ext::Off);
604 } else if (page == (guint) _tabs.page_num (rc_option_editor->contents())) {
606 if (editor && (editor->tabbed() || editor->tabbed_by_default())) {
607 editor_visibility_button.set_active_state (Gtkmm2ext::Off);
610 if (mixer && (mixer->tabbed() || mixer->tabbed_by_default())) {
611 mixer_visibility_button.set_active_state (Gtkmm2ext::Off);
614 prefs_visibility_button.set_active_state (Gtkmm2ext::ImplicitActive);
620 ARDOUR_UI::tabbable_state_change (Tabbable& t)
622 std::vector<std::string> insensitive_action_names;
623 std::vector<std::string> sensitive_action_names;
624 std::vector<std::string> active_action_names;
625 std::vector<std::string> inactive_action_names;
626 Glib::RefPtr<Action> action;
627 std::string downcased_name = downcase (t.name());
637 insensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
638 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
639 sensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
640 sensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
644 } else if (t.tabbed_by_default ()) {
646 insensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
647 insensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
648 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
649 sensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
653 } else if (t.window_visible()) {
655 insensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
656 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
657 sensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
658 sensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
660 active_action_names.push_back (string_compose ("show-%1", downcased_name));
661 inactive_action_names.push_back (string_compose ("hide-%1", downcased_name));
667 /* not currently visible. allow user to retab it or just make
671 insensitive_action_names.push_back (string_compose ("detach-%1", downcased_name));
672 insensitive_action_names.push_back (string_compose ("hide-%1", downcased_name));
673 sensitive_action_names.push_back (string_compose ("show-%1", downcased_name));
674 sensitive_action_names.push_back (string_compose ("attach-%1", downcased_name));
676 active_action_names.push_back (string_compose ("hide-%1", downcased_name));
677 inactive_action_names.push_back (string_compose ("show-%1", downcased_name));
682 for (std::vector<std::string>::iterator s = insensitive_action_names.begin(); s != insensitive_action_names.end(); ++s) {
683 action = ActionManager::get_action (X_("Common"), (*s).c_str());
685 action->set_sensitive (false);
689 for (std::vector<std::string>::iterator s = sensitive_action_names.begin(); s != sensitive_action_names.end(); ++s) {
690 action = ActionManager::get_action (X_("Common"), (*s).c_str());
692 action->set_sensitive (true);
696 ArdourButton* vis_button = 0;
697 std::vector<ArdourButton*> other_vis_buttons;
700 vis_button = &editor_visibility_button;
701 other_vis_buttons.push_back (&mixer_visibility_button);
702 other_vis_buttons.push_back (&prefs_visibility_button);
703 } else if (&t == mixer) {
704 vis_button = &mixer_visibility_button;
705 other_vis_buttons.push_back (&editor_visibility_button);
706 other_vis_buttons.push_back (&prefs_visibility_button);
707 } else if (&t == rc_option_editor) {
708 vis_button = &prefs_visibility_button;
709 other_vis_buttons.push_back (&editor_visibility_button);
710 other_vis_buttons.push_back (&mixer_visibility_button);
719 vis_button->set_active_state (Gtkmm2ext::ImplicitActive);
722 vis_button->set_active_state (Gtkmm2ext::ExplicitActive);
725 vis_button->set_active_state (Gtkmm2ext::Off);
729 for (std::vector<ArdourButton*>::iterator b = other_vis_buttons.begin(); b != other_vis_buttons.end(); ++b) {
730 (*b)->set_active_state (Gtkmm2ext::Off);
735 ARDOUR_UI::toggle_meterbridge ()
737 assert (editor && mixer && meterbridge);
740 bool obscuring = false;
742 if (meterbridge->not_visible ()) {
744 } else if ((editor->window_visible() && ARDOUR_UI_UTILS::windows_overlap (editor->own_window(), meterbridge)) ||
745 (mixer->window_visible () && ARDOUR_UI_UTILS::windows_overlap (mixer->own_window(), meterbridge))) {
749 if (obscuring && ((editor->own_window() && editor->own_window()->property_has_toplevel_focus()) ||
750 (mixer->own_window() && mixer->own_window()->property_has_toplevel_focus()))) {
755 meterbridge->show_window ();
756 meterbridge->present ();
757 meterbridge->raise ();
759 meterbridge->hide_window (NULL);
764 ARDOUR_UI::toggle_luawindow ()
766 assert (editor && luawindow);
770 if (luawindow->not_visible ()) {
773 // TODO check overlap
776 luawindow->show_window ();
777 luawindow->present ();
780 luawindow->hide_window (NULL);
786 ARDOUR_UI::new_midi_tracer_window ()
788 RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("NewMIDITracer"));
793 std::list<MidiTracer*>::iterator i = _midi_tracer_windows.begin ();
794 while (i != _midi_tracer_windows.end() && (*i)->get_visible() == true) {
798 if (i == _midi_tracer_windows.end()) {
799 /* all our MIDITracer windows are visible; make a new one */
800 MidiTracer* t = new MidiTracer ();
802 _midi_tracer_windows.push_back (t);
804 /* re-use the hidden one */
810 ARDOUR_UI::create_key_editor ()
812 KeyEditor* kedit = new KeyEditor;
814 for (std::list<Bindings*>::iterator b = Bindings::bindings.begin(); b != Bindings::bindings.end(); ++b) {
815 kedit->add_tab ((*b)->name(), **b);
822 ARDOUR_UI::create_bundle_manager ()
824 return new BundleManager (_session);
828 ARDOUR_UI::create_add_video_dialog ()
830 return new AddVideoDialog (_session);
834 ARDOUR_UI::create_session_option_editor ()
836 return new SessionOptionEditor (_session);
840 ARDOUR_UI::create_big_clock_window ()
842 return new BigClockWindow (*big_clock);
846 ARDOUR_UI::handle_locations_change (Location *)
849 if (_session->locations()->num_range_markers()) {
850 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, true);
852 ActionManager::set_sensitive (ActionManager::range_sensitive_actions, false);
858 ARDOUR_UI::tabbed_window_state_event_handler (GdkEventWindowState* ev, void* object)
860 if (object == editor) {
862 if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
863 (ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
864 if (big_clock_window) {
865 big_clock_window->set_transient_for (*editor->own_window());
869 } else if (object == mixer) {
871 if ((ev->changed_mask & GDK_WINDOW_STATE_FULLSCREEN) &&
872 (ev->new_window_state & GDK_WINDOW_STATE_FULLSCREEN)) {
873 if (big_clock_window) {
874 big_clock_window->set_transient_for (*mixer->own_window());
883 ARDOUR_UI::editor_meter_peak_button_release (GdkEventButton* ev)
885 if (ev->button == 1 && Gtkmm2ext::Keyboard::modifier_state_equals (ev->state, Gtkmm2ext::Keyboard::PrimaryModifier|Gtkmm2ext::Keyboard::TertiaryModifier)) {
886 ArdourMeter::ResetAllPeakDisplays ();
887 } else if (ev->button == 1 && Gtkmm2ext::Keyboard::modifier_state_equals (ev->state, Gtkmm2ext::Keyboard::PrimaryModifier)) {
888 if (_session->master_out()) {
889 ArdourMeter::ResetGroupPeakDisplays (_session->master_out()->route_group());
891 } else if (_session->master_out()) {
892 ArdourMeter::ResetRoutePeakDisplays (_session->master_out().get());
898 ARDOUR_UI::toggle_mixer_space()
900 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalMixer");
903 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
904 if (tact->get_active()) {
905 mixer->maximise_mixer_space ();
907 mixer->restore_mixer_space ();
913 ARDOUR_UI::toggle_mixer_list()
915 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMixerList");
918 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
919 mixer->show_mixer_list (tact->get_active());
924 ARDOUR_UI::toggle_monitor_section_visibility ()
926 Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMonitorSection");
929 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
930 mixer->show_monitor_section (tact->get_active());