2 Copyright (C) 1999 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.
21 #include "gtk2ardour-config.h"
31 #include <sigc++/bind.h>
32 #include <gtkmm/settings.h>
34 #include "canvas/canvas.h"
36 #include "pbd/error.h"
37 #include "pbd/basename.h"
38 #include "pbd/fastlog.h"
40 #include "gtkmm2ext/utils.h"
41 #include "gtkmm2ext/window_title.h"
43 #include "ardour/profile.h"
44 #include "ardour/session.h"
45 #include "ardour/types.h"
47 #include "ardour_ui.h"
49 #include "public_editor.h"
50 #include "audio_clock.h"
52 #include "main_clock.h"
55 #include "time_info_box.h"
56 #include "midi_tracer.h"
57 #include "global_port_matrix.h"
58 #include "location_ui.h"
59 #include "rc_option_editor.h"
64 using namespace ARDOUR;
66 using namespace Gtkmm2ext;
67 using namespace ArdourWidgets;
70 using namespace ARDOUR_UI_UTILS;
73 ARDOUR_UI::setup_tooltips ()
75 ArdourCanvas::Canvas::set_tooltip_timeout (Gtk::Settings::get_default()->property_gtk_tooltip_timeout ());
77 set_tip (auto_return_button, _("Return to last playback start when stopped"));
78 set_tip (follow_edits_button, _("Playhead follows Range tool clicks, and Range selections"));
79 set_tip (auto_input_button, _("Track Input Monitoring automatically follows transport state"));
80 parameter_changed("click-gain");
81 set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
82 set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition"));
83 set_tip (feedback_alert_button, _("When active, there is a feedback loop."));
84 set_tip (primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
85 set_tip (secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
86 set_tip (editor_meter_peak_display, _("Reset All Peak Indicators"));
87 set_tip (error_alert_button, _("Show Error Log and acknowledge warnings"));
89 synchronize_sync_source_and_video_pullup ();
91 editor->setup_tooltips ();
95 ARDOUR_UI::status_bar_button_press (GdkEventButton* ev)
101 status_bar_label.set_text ("");
112 ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuffer::Tag> ptag, RefPtr<TextBuffer::Tag> mtag, const char *msg)
116 UI::display_message (prefix, prefix_len, ptag, mtag, msg);
118 ArdourLogLevel ll = LogLevelNone;
120 if (strcmp (prefix, _("[ERROR]: ")) == 0) {
121 text = "<span color=\"red\" weight=\"bold\">";
123 } else if (strcmp (prefix, _("[WARNING]: ")) == 0) {
124 text = "<span color=\"yellow\" weight=\"bold\">";
125 ll = LogLevelWarning;
126 } else if (strcmp (prefix, _("[INFO]: ")) == 0) {
127 text = "<span color=\"green\" weight=\"bold\">";
130 text = "<span color=\"white\" weight=\"bold\">???";
133 _log_not_acknowledged = std::max(_log_not_acknowledged, ll);
140 status_bar_label.set_markup (text);
145 ARDOUR_UI::tearoff_settings (const char* name) const
147 XMLNode* ui_node = Config->extra_xml(X_("UI"));
150 XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
152 XMLNode* mnode = tearoff_node->child (name);
160 #define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
163 bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult result, Tabbable* tab)
165 if (result == Gtk::DRAG_RESULT_NO_TARGET) {
173 ARDOUR_UI::repack_transport_hbox ()
176 if (time_info_box->get_parent()) {
177 transport_hbox.remove (*time_info_box);
179 if (UIConfiguration::instance().get_show_toolbar_selclock ()) {
180 transport_hbox.pack_start (*time_info_box, false, false);
181 time_info_box->show();
185 if (mini_timeline.get_parent()) {
186 transport_hbox.remove (mini_timeline);
188 if (UIConfiguration::instance().get_show_mini_timeline ()) {
189 transport_hbox.pack_start (mini_timeline, true, true);
190 mini_timeline.show();
193 if (dsp_load_indicator.get_parent()) {
194 transport_hbox.remove (dsp_load_indicator);
196 if (UIConfiguration::instance().get_show_dsp_load_info ()) {
197 transport_hbox.pack_start (dsp_load_indicator, false, false);
198 dsp_load_indicator.show();
201 if (disk_space_indicator.get_parent()) {
202 transport_hbox.remove (disk_space_indicator);
204 if (UIConfiguration::instance().get_show_disk_space_info ()) {
205 transport_hbox.pack_start (disk_space_indicator, false, false);
206 disk_space_indicator.show();
210 if (meter_box.get_parent()) {
211 transport_hbox.remove (meter_box);
212 transport_hbox.remove (editor_meter_peak_display);
215 if (UIConfiguration::instance().get_show_editor_meter()) {
216 transport_hbox.pack_end (editor_meter_peak_display, false, false);
217 transport_hbox.pack_end (meter_box, false, false);
219 editor_meter_peak_display.show();
223 bool show_mon = UIConfiguration::instance().get_show_toolbar_monitoring ();
225 monitor_in_button.show ();
226 monitor_disk_button.show ();
227 auto_input_button.show ();
228 monitoring_spacer.show ();
230 monitor_in_button.hide ();
231 monitor_disk_button.hide ();
232 auto_input_button.hide ();
233 monitoring_spacer.hide ();
236 bool show_rec = UIConfiguration::instance().get_show_toolbar_recpunch ();
239 layered_label.show ();
240 punch_in_button.show ();
241 punch_out_button.show ();
242 layered_button.show ();
243 recpunch_spacer.show ();
246 layered_label.hide ();
247 punch_in_button.hide ();
248 punch_out_button.hide ();
249 layered_button.hide ();
250 recpunch_spacer.hide ();
256 ARDOUR_UI::update_clock_visibility ()
258 if (ARDOUR::Profile->get_small_screen()) {
261 if (UIConfiguration::instance().get_show_secondary_clock ()) {
262 secondary_clock->show();
263 secondary_clock->left_btn()->show();
264 secondary_clock->right_btn()->show();
265 if (secondary_clock_spacer) {
266 secondary_clock_spacer->show();
269 secondary_clock->hide();
270 secondary_clock->left_btn()->hide();
271 secondary_clock->right_btn()->hide();
272 if (secondary_clock_spacer) {
273 secondary_clock_spacer->hide();
279 ARDOUR_UI::setup_transport ()
284 act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
285 sync_button.set_related_action (act);
286 sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false);
288 sync_button.set_sizing_text (S_("LogestSync|M-Clk"));
290 /* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
291 act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
292 solo_alert_button.set_related_action (act);
293 auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
294 error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
295 act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
296 error_alert_button.set_related_action(act);
297 error_alert_button.set_fallthrough_to_parent(true);
299 layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
301 editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
302 mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
303 prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
305 act = ActionManager::get_action ("Transport", "ToggleAutoReturn");
306 auto_return_button.set_related_action (act);
307 act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
308 follow_edits_button.set_related_action (act);
309 act = ActionManager::get_action ("Transport", "ToggleAutoInput");
310 auto_input_button.set_related_action (act);
312 act = ActionManager::get_action ("Transport", "TogglePunchIn");
313 punch_in_button.set_related_action (act);
314 act = ActionManager::get_action ("Transport", "TogglePunchOut");
315 punch_out_button.set_related_action (act);
317 act = ActionManager::get_action ("Transport", "SessionMonitorIn");
318 monitor_in_button.set_related_action (act);
319 act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
320 monitor_disk_button.set_related_action (act);
322 /* connect signals */
323 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false, 0));
324 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false, 0));
326 primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
327 secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
328 big_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
330 editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor));
331 mixer_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), mixer));
332 prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor));
334 /* catch context clicks so that we can show a menu on these buttons */
336 editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
337 mixer_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("mixer")), false);
338 prefs_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("preferences")), false);
340 /* setup widget style/name */
342 auto_return_button.set_name ("transport option button");
343 follow_edits_button.set_name ("transport option button");
345 solo_alert_button.set_name ("rude solo");
346 auditioning_alert_button.set_name ("rude audition");
347 feedback_alert_button.set_name ("feedback alert");
348 error_alert_button.set_name ("error alert");
350 solo_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
351 auditioning_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
352 feedback_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
354 solo_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
355 auditioning_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
356 feedback_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
358 editor_visibility_button.set_name (X_("page switch button"));
359 mixer_visibility_button.set_name (X_("page switch button"));
360 prefs_visibility_button.set_name (X_("page switch button"));
362 punch_in_button.set_name ("punch button");
363 punch_out_button.set_name ("punch button");
364 layered_button.set_name (("layered button"));
366 monitor_in_button.set_name ("monitor button");
367 monitor_disk_button.set_name ("monitor button");
368 auto_input_button.set_name ("transport option button");
370 sync_button.set_name ("transport active option button");
372 /* and widget text */
373 auto_return_button.set_text(_("Auto Return"));
374 follow_edits_button.set_text(_("Follow Range"));
375 punch_in_button.set_text (_("In"));
376 punch_out_button.set_text (_("Out"));
377 layered_button.set_text (_("Non-Layered"));
379 monitor_in_button.set_text (_("All In"));
380 monitor_disk_button.set_text (_("All Disk"));
381 auto_input_button.set_text (_("Auto-Input"));
383 punch_label.set_text (_("Punch:"));
384 layered_label.set_text (_("Rec:"));
388 Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button,
389 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
390 "To re-attach the window, use the Window > %1 > Attach menu action"), editor->name()));
392 Gtkmm2ext::UI::instance()->set_tip (mixer_visibility_button,
393 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
394 "To re-attach the window, use the Window > %1 > Attach menu action"), mixer->name()));
396 Gtkmm2ext::UI::instance()->set_tip (prefs_visibility_button,
397 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
398 "To re-attach the window, use the Window > %1 > Attach menu action"), rc_option_editor->name()));
400 Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
401 Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
403 Gtkmm2ext::UI::instance()->set_tip (monitor_in_button, _("Force all tracks to monitor Input, unless they are explicitly set to monitor Disk"));
404 Gtkmm2ext::UI::instance()->set_tip (monitor_disk_button, _("Force all tracks to monitor Disk playback, unless they are explicitly set to Input"));
406 /* transport control size-group */
408 Glib::RefPtr<SizeGroup> punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
409 punch_button_size_group->add_widget (punch_in_button);
410 punch_button_size_group->add_widget (punch_out_button);
412 Glib::RefPtr<SizeGroup> monitor_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
413 monitor_button_size_group->add_widget (monitor_in_button);
414 monitor_button_size_group->add_widget (monitor_disk_button);
416 /* and now the layout... */
418 /* top level packing */
419 transport_table.set_spacings (0);
420 transport_table.set_row_spacings (4);
421 transport_table.set_border_width (2);
423 transport_frame.set_name ("TransportFrame");
424 transport_frame.set_shadow_type (Gtk::SHADOW_NONE);
426 /* An event box to hold the table. We use this because we want specific
427 control over the background color, and without this event box,
428 nothing inside the transport_sample actually draws a background. We
429 would therefore end up seeing the background of the parent widget,
430 which is probably some default color. Adding the EventBox adds a
431 widget that will draw the background, using a style based on
432 the parent, "TransportFrame".
434 Gtk::EventBox* ebox = manage (new Gtk::EventBox);
435 transport_frame.add (*ebox);
436 ebox->add (transport_table);
438 /* alert box sub-group */
439 VBox* alert_box = manage (new VBox);
440 alert_box->set_homogeneous (true);
441 alert_box->set_spacing (1);
442 alert_box->set_border_width (0);
443 alert_box->pack_start (solo_alert_button, true, true);
444 alert_box->pack_start (auditioning_alert_button, true, true);
445 alert_box->pack_start (feedback_alert_button, true, true);
447 /* clock button size groups */
448 Glib::RefPtr<SizeGroup> button_height_size_group = SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL);
449 button_height_size_group->add_widget (follow_edits_button);
450 button_height_size_group->add_widget (*primary_clock->left_btn());
451 button_height_size_group->add_widget (*primary_clock->right_btn());
452 button_height_size_group->add_widget (*secondary_clock->left_btn());
453 button_height_size_group->add_widget (*secondary_clock->right_btn());
455 button_height_size_group->add_widget (transport_ctrl.size_button ());
456 // button_height_size_group->add_widget (sync_button);
457 button_height_size_group->add_widget (auto_return_button);
460 button_height_size_group->add_widget (editor_visibility_button);
461 button_height_size_group->add_widget (mixer_visibility_button);
464 button_height_size_group->add_widget (punch_in_button);
465 button_height_size_group->add_widget (punch_out_button);
466 button_height_size_group->add_widget (layered_button);
468 //input monitoring section
469 button_height_size_group->add_widget (monitor_in_button);
470 button_height_size_group->add_widget (monitor_disk_button);
471 button_height_size_group->add_widget (auto_input_button);
473 Glib::RefPtr<SizeGroup> clock1_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
474 clock1_size_group->add_widget (*primary_clock->left_btn());
475 clock1_size_group->add_widget (*primary_clock->right_btn());
477 Glib::RefPtr<SizeGroup> clock2_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
478 clock2_size_group->add_widget (*secondary_clock->left_btn());
479 clock2_size_group->add_widget (*secondary_clock->right_btn());
481 /* sub-layout for Sync | Shuttle (grow) */
482 HBox* ssbox = manage (new HBox);
483 ssbox->set_spacing (PX_SCALE(2));
484 ssbox->pack_start (sync_button, false, false, 0);
485 ssbox->pack_start (shuttle_box, true, true, 0);
486 ssbox->pack_start (*shuttle_box.info_button(), false, false, 0);
489 /* and the main table layout */
493 #define TCOL col, col + 1
495 transport_table.attach (transport_ctrl, TCOL, 0, 1 , SHRINK, SHRINK, 0, 0);
496 transport_table.attach (*ssbox, TCOL, 1, 2 , FILL, SHRINK, 0, 0);
499 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
502 transport_table.attach (punch_label, TCOL, 0, 1 , FILL, SHRINK, 3, 0);
503 transport_table.attach (layered_label, TCOL, 1, 2 , FILL, SHRINK, 3, 0);
506 transport_table.attach (punch_in_button, col, col + 1, 0, 1 , FILL, SHRINK, hpadding, vpadding);
507 transport_table.attach (punch_space, col + 1, col + 2, 0, 1 , FILL, SHRINK, 0, vpadding);
508 transport_table.attach (punch_out_button, col + 2, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
509 transport_table.attach (layered_button, col, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
512 transport_table.attach (recpunch_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
515 transport_table.attach (auto_input_button, col, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
516 transport_table.attach (monitor_in_button, col, col + 1, 1, 2 , FILL, SHRINK, hpadding, vpadding);
517 transport_table.attach (mon_space, col + 1, col + 2, 1, 2 , FILL, SHRINK, 2, vpadding);
518 transport_table.attach (monitor_disk_button, col + 2, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
521 transport_table.attach (monitoring_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
524 transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
525 transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
528 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
531 transport_table.attach (*primary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
532 transport_table.attach (*primary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
533 transport_table.attach (*primary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
536 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
539 if (!ARDOUR::Profile->get_small_screen()) {
540 transport_table.attach (*secondary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
541 transport_table.attach (*secondary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
542 transport_table.attach (*secondary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
543 secondary_clock->set_no_show_all (true);
544 secondary_clock->left_btn()->set_no_show_all (true);
545 secondary_clock->right_btn()->set_no_show_all (true);
548 secondary_clock_spacer = manage (new ArdourVSpacer ());
549 transport_table.attach (*secondary_clock_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
553 transport_table.attach (*alert_box, TCOL, 0, 2, SHRINK, EXPAND|FILL, hpadding, 0);
556 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
559 /* editor-meter, mini-timeline and selection clock are options in the transport_hbox */
560 transport_hbox.set_spacing (3);
561 transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, hpadding, 0);
564 /* lua script action buttons */
565 transport_table.attach (action_script_table, TCOL, 0, 2, SHRINK, EXPAND|FILL, 1, 0);
568 transport_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
569 transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
572 repack_transport_hbox ();
573 update_clock_visibility ();
576 feedback_alert_button.set_sensitive (false);
577 feedback_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
578 auditioning_alert_button.set_sensitive (false);
579 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
581 set_transport_sensitivity (false);
587 ARDOUR_UI::soloing_changed (bool onoff)
589 if (solo_alert_button.get_active() != onoff) {
590 solo_alert_button.set_active (onoff);
595 ARDOUR_UI::_auditioning_changed (bool onoff)
597 auditioning_alert_button.set_active (onoff);
598 auditioning_alert_button.set_sensitive (onoff);
600 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
602 set_transport_sensitivity (!onoff);
606 ARDOUR_UI::auditioning_changed (bool onoff)
608 UI::instance()->call_slot (MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::_auditioning_changed, this, onoff));
612 ARDOUR_UI::audition_alert_clicked ()
615 _session->cancel_audition();
620 ARDOUR_UI::error_alert_press (GdkEventButton* ev)
622 bool do_toggle = true;
623 if (ev->button == 1) {
624 if (_log_not_acknowledged == LogLevelError) {
625 // just acknowledge the error, don't hide the log if it's already visible
626 RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
627 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
628 if (tact && tact->get_active()) {
632 _log_not_acknowledged = LogLevelNone;
633 error_blink (false); // immediate acknowledge
635 // maybe fall through to to button toggle
640 ARDOUR_UI::layered_button_clicked ()
643 _session->config.set_layered_record_mode (!_session->config.get_layered_record_mode ());
648 ARDOUR_UI::solo_blink (bool onoff)
654 if (_session->soloing() || _session->listening()) {
656 solo_alert_button.set_active (true);
658 solo_alert_button.set_active (false);
661 solo_alert_button.set_active (false);
666 ARDOUR_UI::sync_blink (bool onoff)
668 if (_session == 0 || !_session->config.get_external_sync()) {
670 sync_button.set_active (false);
674 if (!_session->transport_locked()) {
675 /* not locked, so blink on and off according to the onoff argument */
678 sync_button.set_active (true);
680 sync_button.set_active (false);
684 sync_button.set_active (true);
689 ARDOUR_UI::audition_blink (bool onoff)
695 if (_session->is_auditioning()) {
697 auditioning_alert_button.set_active (true);
699 auditioning_alert_button.set_active (false);
702 auditioning_alert_button.set_active (false);
707 ARDOUR_UI::feedback_blink (bool onoff)
709 if (_feedback_exists) {
711 feedback_alert_button.set_active (true);
713 feedback_alert_button.set_active (false);
716 feedback_alert_button.set_active (false);
721 ARDOUR_UI::error_blink (bool onoff)
723 switch (_log_not_acknowledged) {
727 error_alert_button.set_custom_led_color(0xff0000ff); // bright red
729 error_alert_button.set_custom_led_color(0x880000ff); // dark red
732 case LogLevelWarning:
733 error_alert_button.set_custom_led_color(0xccaa00ff); // yellow
736 error_alert_button.set_custom_led_color(0x88cc00ff); // lime green
739 error_alert_button.set_custom_led_color(0x333333ff); // gray
744 ARDOUR_UI::set_transport_sensitivity (bool yn)
746 ActionManager::set_sensitive (ActionManager::transport_sensitive_actions, yn);
747 shuttle_box.set_sensitive (yn);
751 ARDOUR_UI::editor_realized ()
753 boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
754 Config->map_parameters (pc);
756 UIConfiguration::instance().reset_dpi ();
760 ARDOUR_UI::maximise_editing_space ()
763 editor->maximise_editing_space ();
768 ARDOUR_UI::restore_editing_space ()
771 editor->restore_editing_space ();
776 ARDOUR_UI::show_ui_prefs ()
778 if (rc_option_editor) {
779 show_tabbable (rc_option_editor);
780 rc_option_editor->set_current_page (_("Appearance"));
785 ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
787 if (ev->button != 3) {
788 /* this handler is just for button-3 clicks */
792 show_tabbable (rc_option_editor);
793 rc_option_editor->set_current_page (_("Metronome"));
798 ARDOUR_UI::sync_button_clicked (GdkEventButton* ev)
800 if (ev->button != 3) {
801 /* this handler is just for button-3 clicks */
805 show_tabbable (rc_option_editor);
806 rc_option_editor->set_current_page (_("Sync"));
811 ARDOUR_UI::toggle_follow_edits ()
813 RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
816 RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
819 UIConfiguration::instance().set_follow_edits (tact->get_active ());
823 ARDOUR_UI::update_title ()
826 bool dirty = _session->dirty();
830 if (_session->snap_name() != _session->name()) {
831 session_name = _session->snap_name();
833 session_name = _session->name();
837 session_name = "*" + session_name;
840 WindowTitle title (session_name);
841 title += Glib::get_application_name();
842 _main_window.set_title (title.get_string());
844 WindowTitle title (Glib::get_application_name());
845 _main_window.set_title (title.get_string());