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();
194 if (meter_box.get_parent()) {
195 transport_hbox.remove (meter_box);
196 transport_hbox.remove (editor_meter_peak_display);
199 if (UIConfiguration::instance().get_show_editor_meter()) {
200 transport_hbox.pack_end (editor_meter_peak_display, false, false);
201 transport_hbox.pack_end (meter_box, false, false);
203 editor_meter_peak_display.show();
207 bool show_mon = UIConfiguration::instance().get_show_toolbar_monitoring ();
209 monitor_in_button.show ();
210 monitor_disk_button.show ();
211 auto_input_button.show ();
212 monitoring_spacer.show ();
214 monitor_in_button.hide ();
215 monitor_disk_button.hide ();
216 auto_input_button.hide ();
217 monitoring_spacer.hide ();
220 bool show_rec = UIConfiguration::instance().get_show_toolbar_recpunch ();
223 layered_label.show ();
224 punch_in_button.show ();
225 punch_out_button.show ();
226 layered_button.show ();
227 recpunch_spacer.show ();
230 layered_label.hide ();
231 punch_in_button.hide ();
232 punch_out_button.hide ();
233 layered_button.hide ();
234 recpunch_spacer.hide ();
240 ARDOUR_UI::update_clock_visibility ()
242 if (ARDOUR::Profile->get_small_screen()) {
245 if (UIConfiguration::instance().get_show_secondary_clock ()) {
246 secondary_clock->show();
247 secondary_clock->left_btn()->show();
248 secondary_clock->right_btn()->show();
249 if (secondary_clock_spacer) {
250 secondary_clock_spacer->show();
253 secondary_clock->hide();
254 secondary_clock->left_btn()->hide();
255 secondary_clock->right_btn()->hide();
256 if (secondary_clock_spacer) {
257 secondary_clock_spacer->hide();
263 ARDOUR_UI::setup_transport ()
268 act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
269 sync_button.set_related_action (act);
270 sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false);
272 sync_button.set_sizing_text (S_("LogestSync|M-Clk"));
274 /* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
275 act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
276 solo_alert_button.set_related_action (act);
277 auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
278 error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
279 act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
280 error_alert_button.set_related_action(act);
281 error_alert_button.set_fallthrough_to_parent(true);
283 layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
285 editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
286 mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
287 prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
289 act = ActionManager::get_action ("Transport", "ToggleAutoReturn");
290 auto_return_button.set_related_action (act);
291 act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
292 follow_edits_button.set_related_action (act);
293 act = ActionManager::get_action ("Transport", "ToggleAutoInput");
294 auto_input_button.set_related_action (act);
296 act = ActionManager::get_action ("Transport", "TogglePunchIn");
297 punch_in_button.set_related_action (act);
298 act = ActionManager::get_action ("Transport", "TogglePunchOut");
299 punch_out_button.set_related_action (act);
301 act = ActionManager::get_action ("Transport", "SessionMonitorIn");
302 monitor_in_button.set_related_action (act);
303 act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
304 monitor_disk_button.set_related_action (act);
306 /* connect signals */
307 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false, 0));
308 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false, 0));
310 primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
311 secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
312 big_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
314 editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor));
315 mixer_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), mixer));
316 prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor));
318 /* catch context clicks so that we can show a menu on these buttons */
320 editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
321 mixer_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("mixer")), false);
322 prefs_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("preferences")), false);
324 /* setup widget style/name */
326 auto_return_button.set_name ("transport option button");
327 follow_edits_button.set_name ("transport option button");
329 solo_alert_button.set_name ("rude solo");
330 auditioning_alert_button.set_name ("rude audition");
331 feedback_alert_button.set_name ("feedback alert");
332 error_alert_button.set_name ("error alert");
334 solo_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
335 auditioning_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
336 feedback_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
338 solo_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
339 auditioning_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
340 feedback_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
342 editor_visibility_button.set_name (X_("page switch button"));
343 mixer_visibility_button.set_name (X_("page switch button"));
344 prefs_visibility_button.set_name (X_("page switch button"));
346 punch_in_button.set_name ("punch button");
347 punch_out_button.set_name ("punch button");
348 layered_button.set_name (("layered button"));
350 monitor_in_button.set_name ("monitor button");
351 monitor_disk_button.set_name ("monitor button");
352 auto_input_button.set_name ("transport option button");
354 sync_button.set_name ("transport active option button");
356 /* and widget text */
357 auto_return_button.set_text(_("Auto Return"));
358 follow_edits_button.set_text(_("Follow Range"));
359 punch_in_button.set_text (_("In"));
360 punch_out_button.set_text (_("Out"));
361 layered_button.set_text (_("Non-Layered"));
363 monitor_in_button.set_text (_("All In"));
364 monitor_disk_button.set_text (_("All Disk"));
365 auto_input_button.set_text (_("Auto-Input"));
367 punch_label.set_text (_("Punch:"));
368 layered_label.set_text (_("Rec:"));
372 Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button,
373 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
374 "To re-attach the window, use the Window > %1 > Attach menu action"), editor->name()));
376 Gtkmm2ext::UI::instance()->set_tip (mixer_visibility_button,
377 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
378 "To re-attach the window, use the Window > %1 > Attach menu action"), mixer->name()));
380 Gtkmm2ext::UI::instance()->set_tip (prefs_visibility_button,
381 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
382 "To re-attach the window, use the Window > %1 > Attach menu action"), rc_option_editor->name()));
384 Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
385 Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
387 Gtkmm2ext::UI::instance()->set_tip (monitor_in_button, _("Force all tracks to monitor Input, unless they are explicitly set to monitor Disk"));
388 Gtkmm2ext::UI::instance()->set_tip (monitor_disk_button, _("Force all tracks to monitor Disk playback, unless they are explicitly set to Input"));
390 /* transport control size-group */
392 Glib::RefPtr<SizeGroup> punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
393 punch_button_size_group->add_widget (punch_in_button);
394 punch_button_size_group->add_widget (punch_out_button);
396 Glib::RefPtr<SizeGroup> monitor_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
397 monitor_button_size_group->add_widget (monitor_in_button);
398 monitor_button_size_group->add_widget (monitor_disk_button);
400 /* and now the layout... */
402 /* top level packing */
403 transport_table.set_spacings (0);
404 transport_table.set_row_spacings (4);
405 transport_table.set_border_width (2);
407 transport_frame.set_name ("TransportFrame");
408 transport_frame.set_shadow_type (Gtk::SHADOW_NONE);
410 /* An event box to hold the table. We use this because we want specific
411 control over the background color, and without this event box,
412 nothing inside the transport_sample actually draws a background. We
413 would therefore end up seeing the background of the parent widget,
414 which is probably some default color. Adding the EventBox adds a
415 widget that will draw the background, using a style based on
416 the parent, "TransportFrame".
418 Gtk::EventBox* ebox = manage (new Gtk::EventBox);
419 transport_frame.add (*ebox);
420 ebox->add (transport_table);
422 /* alert box sub-group */
423 VBox* alert_box = manage (new VBox);
424 alert_box->set_homogeneous (true);
425 alert_box->set_spacing (1);
426 alert_box->set_border_width (0);
427 alert_box->pack_start (solo_alert_button, true, true);
428 alert_box->pack_start (auditioning_alert_button, true, true);
429 alert_box->pack_start (feedback_alert_button, true, true);
431 /* clock button size groups */
432 Glib::RefPtr<SizeGroup> button_height_size_group = SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL);
433 button_height_size_group->add_widget (follow_edits_button);
434 button_height_size_group->add_widget (*primary_clock->left_btn());
435 button_height_size_group->add_widget (*primary_clock->right_btn());
436 button_height_size_group->add_widget (*secondary_clock->left_btn());
437 button_height_size_group->add_widget (*secondary_clock->right_btn());
439 button_height_size_group->add_widget (transport_ctrl.size_button ());
440 // button_height_size_group->add_widget (sync_button);
441 button_height_size_group->add_widget (auto_return_button);
444 button_height_size_group->add_widget (editor_visibility_button);
445 button_height_size_group->add_widget (mixer_visibility_button);
448 button_height_size_group->add_widget (punch_in_button);
449 button_height_size_group->add_widget (punch_out_button);
450 button_height_size_group->add_widget (layered_button);
452 //input monitoring section
453 button_height_size_group->add_widget (monitor_in_button);
454 button_height_size_group->add_widget (monitor_disk_button);
455 button_height_size_group->add_widget (auto_input_button);
457 Glib::RefPtr<SizeGroup> clock1_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
458 clock1_size_group->add_widget (*primary_clock->left_btn());
459 clock1_size_group->add_widget (*primary_clock->right_btn());
461 Glib::RefPtr<SizeGroup> clock2_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
462 clock2_size_group->add_widget (*secondary_clock->left_btn());
463 clock2_size_group->add_widget (*secondary_clock->right_btn());
465 /* sub-layout for Sync | Shuttle (grow) */
466 HBox* ssbox = manage (new HBox);
467 ssbox->set_spacing (PX_SCALE(2));
468 ssbox->pack_start (sync_button, false, false, 0);
469 ssbox->pack_start (shuttle_box, true, true, 0);
470 ssbox->pack_start (*shuttle_box.info_button(), false, false, 0);
473 /* and the main table layout */
477 #define TCOL col, col + 1
479 transport_table.attach (transport_ctrl, TCOL, 0, 1 , SHRINK, SHRINK, 0, 0);
480 transport_table.attach (*ssbox, TCOL, 1, 2 , FILL, SHRINK, 0, 0);
483 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
486 transport_table.attach (punch_label, TCOL, 0, 1 , FILL, SHRINK, 3, 0);
487 transport_table.attach (layered_label, TCOL, 1, 2 , FILL, SHRINK, 3, 0);
490 transport_table.attach (punch_in_button, col, col + 1, 0, 1 , FILL, SHRINK, hpadding, vpadding);
491 transport_table.attach (punch_space, col + 1, col + 2, 0, 1 , FILL, SHRINK, 0, vpadding);
492 transport_table.attach (punch_out_button, col + 2, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
493 transport_table.attach (layered_button, col, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
496 transport_table.attach (recpunch_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
499 transport_table.attach (auto_input_button, col, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
500 transport_table.attach (monitor_in_button, col, col + 1, 1, 2 , FILL, SHRINK, hpadding, vpadding);
501 transport_table.attach (mon_space, col + 1, col + 2, 1, 2 , FILL, SHRINK, 2, vpadding);
502 transport_table.attach (monitor_disk_button, col + 2, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
505 transport_table.attach (monitoring_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
508 transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
509 transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
512 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
515 transport_table.attach (*primary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
516 transport_table.attach (*primary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
517 transport_table.attach (*primary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
520 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
523 if (!ARDOUR::Profile->get_small_screen()) {
524 transport_table.attach (*secondary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
525 transport_table.attach (*secondary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
526 transport_table.attach (*secondary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
527 secondary_clock->set_no_show_all (true);
528 secondary_clock->left_btn()->set_no_show_all (true);
529 secondary_clock->right_btn()->set_no_show_all (true);
532 secondary_clock_spacer = manage (new ArdourVSpacer ());
533 transport_table.attach (*secondary_clock_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
537 transport_table.attach (*alert_box, TCOL, 0, 2, SHRINK, EXPAND|FILL, hpadding, 0);
540 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
543 /* editor-meter, mini-timeline and selection clock are options in the transport_hbox */
544 transport_hbox.set_spacing (3);
545 transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, hpadding, 0);
548 /* lua script action buttons */
549 transport_table.attach (action_script_table, TCOL, 0, 2, SHRINK, EXPAND|FILL, 1, 0);
552 transport_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
553 transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
556 repack_transport_hbox ();
557 update_clock_visibility ();
560 feedback_alert_button.set_sensitive (false);
561 feedback_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
562 auditioning_alert_button.set_sensitive (false);
563 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
565 set_transport_sensitivity (false);
571 ARDOUR_UI::soloing_changed (bool onoff)
573 if (solo_alert_button.get_active() != onoff) {
574 solo_alert_button.set_active (onoff);
579 ARDOUR_UI::_auditioning_changed (bool onoff)
581 auditioning_alert_button.set_active (onoff);
582 auditioning_alert_button.set_sensitive (onoff);
584 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
586 set_transport_sensitivity (!onoff);
590 ARDOUR_UI::auditioning_changed (bool onoff)
592 UI::instance()->call_slot (MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::_auditioning_changed, this, onoff));
596 ARDOUR_UI::audition_alert_clicked ()
599 _session->cancel_audition();
604 ARDOUR_UI::error_alert_press (GdkEventButton* ev)
606 bool do_toggle = true;
607 if (ev->button == 1) {
608 if (_log_not_acknowledged == LogLevelError) {
609 // just acknowledge the error, don't hide the log if it's already visible
610 RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
611 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
612 if (tact && tact->get_active()) {
616 _log_not_acknowledged = LogLevelNone;
617 error_blink (false); // immediate acknowledge
619 // maybe fall through to to button toggle
624 ARDOUR_UI::layered_button_clicked ()
627 _session->config.set_layered_record_mode (!_session->config.get_layered_record_mode ());
632 ARDOUR_UI::solo_blink (bool onoff)
638 if (_session->soloing() || _session->listening()) {
640 solo_alert_button.set_active (true);
642 solo_alert_button.set_active (false);
645 solo_alert_button.set_active (false);
650 ARDOUR_UI::sync_blink (bool onoff)
652 if (_session == 0 || !_session->config.get_external_sync()) {
654 sync_button.set_active (false);
658 if (!_session->transport_locked()) {
659 /* not locked, so blink on and off according to the onoff argument */
662 sync_button.set_active (true);
664 sync_button.set_active (false);
668 sync_button.set_active (true);
673 ARDOUR_UI::audition_blink (bool onoff)
679 if (_session->is_auditioning()) {
681 auditioning_alert_button.set_active (true);
683 auditioning_alert_button.set_active (false);
686 auditioning_alert_button.set_active (false);
691 ARDOUR_UI::feedback_blink (bool onoff)
693 if (_feedback_exists) {
695 feedback_alert_button.set_active (true);
697 feedback_alert_button.set_active (false);
700 feedback_alert_button.set_active (false);
705 ARDOUR_UI::error_blink (bool onoff)
707 switch (_log_not_acknowledged) {
711 error_alert_button.set_custom_led_color(0xff0000ff); // bright red
713 error_alert_button.set_custom_led_color(0x880000ff); // dark red
716 case LogLevelWarning:
717 error_alert_button.set_custom_led_color(0xccaa00ff); // yellow
720 error_alert_button.set_custom_led_color(0x88cc00ff); // lime green
723 error_alert_button.set_custom_led_color(0x333333ff); // gray
728 ARDOUR_UI::set_transport_sensitivity (bool yn)
730 ActionManager::set_sensitive (ActionManager::transport_sensitive_actions, yn);
731 shuttle_box.set_sensitive (yn);
735 ARDOUR_UI::editor_realized ()
737 boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
738 Config->map_parameters (pc);
740 UIConfiguration::instance().reset_dpi ();
744 ARDOUR_UI::maximise_editing_space ()
747 editor->maximise_editing_space ();
752 ARDOUR_UI::restore_editing_space ()
755 editor->restore_editing_space ();
760 ARDOUR_UI::show_ui_prefs ()
762 if (rc_option_editor) {
763 show_tabbable (rc_option_editor);
764 rc_option_editor->set_current_page (_("Appearance"));
769 ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
771 if (ev->button != 3) {
772 /* this handler is just for button-3 clicks */
776 show_tabbable (rc_option_editor);
777 rc_option_editor->set_current_page (_("Metronome"));
782 ARDOUR_UI::sync_button_clicked (GdkEventButton* ev)
784 if (ev->button != 3) {
785 /* this handler is just for button-3 clicks */
789 show_tabbable (rc_option_editor);
790 rc_option_editor->set_current_page (_("Sync"));
795 ARDOUR_UI::toggle_follow_edits ()
797 RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
800 RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
803 UIConfiguration::instance().set_follow_edits (tact->get_active ());
807 ARDOUR_UI::update_title ()
810 bool dirty = _session->dirty();
814 if (_session->snap_name() != _session->name()) {
815 session_name = _session->snap_name();
817 session_name = _session->name();
821 session_name = "*" + session_name;
824 WindowTitle title (session_name);
825 title += Glib::get_application_name();
826 _main_window.set_title (title.get_string());
828 WindowTitle title (Glib::get_application_name());
829 _main_window.set_title (title.get_string());