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)
114 UI::display_message (prefix, prefix_len, ptag, mtag, msg);
116 ArdourLogLevel ll = LogLevelNone;
118 if (strcmp (prefix, _("[ERROR]: ")) == 0) {
120 } else if (strcmp (prefix, _("[WARNING]: ")) == 0) {
121 ll = LogLevelWarning;
122 } else if (strcmp (prefix, _("[INFO]: ")) == 0) {
126 _log_not_acknowledged = std::max(_log_not_acknowledged, ll);
130 ARDOUR_UI::tearoff_settings (const char* name) const
132 XMLNode* ui_node = Config->extra_xml(X_("UI"));
135 XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
137 XMLNode* mnode = tearoff_node->child (name);
145 #define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
148 bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult result, Tabbable* tab)
150 if (result == Gtk::DRAG_RESULT_NO_TARGET) {
158 ARDOUR_UI::repack_transport_hbox ()
161 if (time_info_box->get_parent()) {
162 transport_hbox.remove (*time_info_box);
164 if (UIConfiguration::instance().get_show_toolbar_selclock ()) {
165 transport_hbox.pack_start (*time_info_box, false, false);
166 time_info_box->show();
170 if (mini_timeline.get_parent()) {
171 transport_hbox.remove (mini_timeline);
173 if (UIConfiguration::instance().get_show_mini_timeline ()) {
174 transport_hbox.pack_start (mini_timeline, true, true);
175 mini_timeline.show();
179 if (editor_meter_table.get_parent()) {
180 transport_hbox.remove (editor_meter_table);
182 if (meterbox_spacer.get_parent()) {
183 transport_hbox.remove (meterbox_spacer);
184 transport_hbox.remove (meterbox_spacer2);
187 if (UIConfiguration::instance().get_show_editor_meter()) {
188 transport_hbox.pack_end (meterbox_spacer, false, false, 3);
189 transport_hbox.pack_end (editor_meter_table, false, false);
190 transport_hbox.pack_end (meterbox_spacer2, false, false, 3);
191 editor_meter_table.show();
192 meterbox_spacer.show();
193 meterbox_spacer2.show();
197 bool show_mon = UIConfiguration::instance().get_show_toolbar_monitoring ();
199 monitor_in_button.show ();
200 monitor_disk_button.show ();
201 auto_input_button.show ();
202 monitoring_spacer.show ();
204 monitor_in_button.hide ();
205 monitor_disk_button.hide ();
206 auto_input_button.hide ();
207 monitoring_spacer.hide ();
210 bool show_rec = UIConfiguration::instance().get_show_toolbar_recpunch ();
213 layered_label.show ();
214 punch_in_button.show ();
215 punch_out_button.show ();
216 layered_button.show ();
217 recpunch_spacer.show ();
220 layered_label.hide ();
221 punch_in_button.hide ();
222 punch_out_button.hide ();
223 layered_button.hide ();
224 recpunch_spacer.hide ();
230 ARDOUR_UI::update_clock_visibility ()
232 if (ARDOUR::Profile->get_small_screen()) {
235 if (UIConfiguration::instance().get_show_secondary_clock ()) {
236 secondary_clock->show();
237 secondary_clock->left_btn()->show();
238 secondary_clock->right_btn()->show();
239 if (secondary_clock_spacer) {
240 secondary_clock_spacer->show();
243 secondary_clock->hide();
244 secondary_clock->left_btn()->hide();
245 secondary_clock->right_btn()->hide();
246 if (secondary_clock_spacer) {
247 secondary_clock_spacer->hide();
253 ARDOUR_UI::setup_transport ()
258 act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
259 sync_button.set_related_action (act);
260 sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false);
262 sync_button.set_sizing_text (S_("LogestSync|M-Clk"));
264 /* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
265 act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
266 solo_alert_button.set_related_action (act);
267 auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
268 error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
269 act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
270 error_alert_button.set_related_action(act);
271 error_alert_button.set_fallthrough_to_parent(true);
273 layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
275 editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
276 mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
277 prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
279 act = ActionManager::get_action ("Transport", "ToggleAutoReturn");
280 auto_return_button.set_related_action (act);
281 act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
282 follow_edits_button.set_related_action (act);
283 act = ActionManager::get_action ("Transport", "ToggleAutoInput");
284 auto_input_button.set_related_action (act);
286 act = ActionManager::get_action ("Transport", "TogglePunchIn");
287 punch_in_button.set_related_action (act);
288 act = ActionManager::get_action ("Transport", "TogglePunchOut");
289 punch_out_button.set_related_action (act);
291 act = ActionManager::get_action ("Transport", "SessionMonitorIn");
292 monitor_in_button.set_related_action (act);
293 act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
294 monitor_disk_button.set_related_action (act);
296 /* connect signals */
297 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false, 0));
298 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false, 0));
300 primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
301 secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
302 big_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
304 editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor));
305 mixer_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), mixer));
306 prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor));
308 /* catch context clicks so that we can show a menu on these buttons */
310 editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
311 mixer_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("mixer")), false);
312 prefs_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("preferences")), false);
314 /* setup widget style/name */
316 auto_return_button.set_name ("transport option button");
317 follow_edits_button.set_name ("transport option button");
319 solo_alert_button.set_name ("rude solo");
320 auditioning_alert_button.set_name ("rude audition");
321 feedback_alert_button.set_name ("feedback alert");
322 error_alert_button.set_name ("error alert");
324 solo_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
325 auditioning_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
326 feedback_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
328 solo_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
329 auditioning_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
330 feedback_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
332 editor_visibility_button.set_name (X_("page switch button"));
333 mixer_visibility_button.set_name (X_("page switch button"));
334 prefs_visibility_button.set_name (X_("page switch button"));
336 punch_in_button.set_name ("punch button");
337 punch_out_button.set_name ("punch button");
338 layered_button.set_name (("layered button"));
340 monitor_in_button.set_name ("monitor button");
341 monitor_disk_button.set_name ("monitor button");
342 auto_input_button.set_name ("transport option button");
344 sync_button.set_name ("transport active option button");
346 /* and widget text */
347 auto_return_button.set_text(_("Auto Return"));
348 follow_edits_button.set_text(_("Follow Range"));
349 punch_in_button.set_text (_("In"));
350 punch_out_button.set_text (_("Out"));
351 layered_button.set_text (_("Non-Layered"));
353 monitor_in_button.set_text (_("All In"));
354 monitor_disk_button.set_text (_("All Disk"));
355 auto_input_button.set_text (_("Auto-Input"));
357 punch_label.set_text (_("Punch:"));
358 layered_label.set_text (_("Rec:"));
362 Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button,
363 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
364 "To re-attach the window, use the Window > %1 > Attach menu action"), editor->name()));
366 Gtkmm2ext::UI::instance()->set_tip (mixer_visibility_button,
367 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
368 "To re-attach the window, use the Window > %1 > Attach menu action"), mixer->name()));
370 Gtkmm2ext::UI::instance()->set_tip (prefs_visibility_button,
371 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
372 "To re-attach the window, use the Window > %1 > Attach menu action"), rc_option_editor->name()));
374 Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
375 Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
377 Gtkmm2ext::UI::instance()->set_tip (monitor_in_button, _("Force all tracks to monitor Input, unless they are explicitly set to monitor Disk"));
378 Gtkmm2ext::UI::instance()->set_tip (monitor_disk_button, _("Force all tracks to monitor Disk playback, unless they are explicitly set to Input"));
380 /* transport control size-group */
382 Glib::RefPtr<SizeGroup> punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
383 punch_button_size_group->add_widget (punch_in_button);
384 punch_button_size_group->add_widget (punch_out_button);
386 Glib::RefPtr<SizeGroup> monitor_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
387 monitor_button_size_group->add_widget (monitor_in_button);
388 monitor_button_size_group->add_widget (monitor_disk_button);
390 /* and now the layout... */
392 /* top level packing */
393 transport_table.set_spacings (0);
394 transport_table.set_row_spacings (4);
395 transport_table.set_border_width (0);
397 transport_frame.set_name ("TransportFrame");
398 transport_frame.set_shadow_type (Gtk::SHADOW_NONE);
400 /* An event box to hold the table. We use this because we want specific
401 control over the background color, and without this event box,
402 nothing inside the transport_sample actually draws a background. We
403 would therefore end up seeing the background of the parent widget,
404 which is probably some default color. Adding the EventBox adds a
405 widget that will draw the background, using a style based on
406 the parent, "TransportFrame".
408 Gtk::EventBox* ebox = manage (new Gtk::EventBox);
409 transport_frame.add (*ebox);
410 ebox->add (transport_table);
412 /* alert box sub-group */
413 VBox* alert_box = manage (new VBox);
414 alert_box->set_homogeneous (true);
415 alert_box->set_spacing (1);
416 alert_box->set_border_width (0);
417 alert_box->pack_start (solo_alert_button, true, true);
418 alert_box->pack_start (auditioning_alert_button, true, true);
419 alert_box->pack_start (feedback_alert_button, true, true);
421 /* clock button size groups */
422 Glib::RefPtr<SizeGroup> button_height_size_group = SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL);
423 button_height_size_group->add_widget (follow_edits_button);
424 button_height_size_group->add_widget (*primary_clock->left_btn());
425 button_height_size_group->add_widget (*primary_clock->right_btn());
426 button_height_size_group->add_widget (*secondary_clock->left_btn());
427 button_height_size_group->add_widget (*secondary_clock->right_btn());
429 button_height_size_group->add_widget (transport_ctrl.size_button ());
430 // button_height_size_group->add_widget (sync_button);
431 button_height_size_group->add_widget (auto_return_button);
434 button_height_size_group->add_widget (editor_visibility_button);
435 button_height_size_group->add_widget (mixer_visibility_button);
438 button_height_size_group->add_widget (punch_in_button);
439 button_height_size_group->add_widget (punch_out_button);
440 button_height_size_group->add_widget (layered_button);
442 //input monitoring section
443 button_height_size_group->add_widget (monitor_in_button);
444 button_height_size_group->add_widget (monitor_disk_button);
445 button_height_size_group->add_widget (auto_input_button);
447 Glib::RefPtr<SizeGroup> clock1_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
448 clock1_size_group->add_widget (*primary_clock->left_btn());
449 clock1_size_group->add_widget (*primary_clock->right_btn());
451 Glib::RefPtr<SizeGroup> clock2_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
452 clock2_size_group->add_widget (*secondary_clock->left_btn());
453 clock2_size_group->add_widget (*secondary_clock->right_btn());
455 /* sub-layout for Sync | Shuttle (grow) */
456 HBox* ssbox = manage (new HBox);
457 ssbox->set_spacing (PX_SCALE(2));
458 ssbox->pack_start (sync_button, false, false, 0);
459 ssbox->pack_start (shuttle_box, true, true, 0);
460 ssbox->pack_start (*shuttle_box.info_button(), false, false, 0);
463 /* and the main table layout */
467 #define TCOL col, col + 1
469 transport_table.attach (transport_ctrl, TCOL, 0, 1 , SHRINK, SHRINK, 0, 0);
470 transport_table.attach (*ssbox, TCOL, 1, 2 , FILL, SHRINK, 0, 0);
473 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
476 transport_table.attach (punch_label, TCOL, 0, 1 , FILL, SHRINK, 3, 0);
477 transport_table.attach (layered_label, TCOL, 1, 2 , FILL, SHRINK, 3, 0);
480 transport_table.attach (punch_in_button, col, col + 1, 0, 1 , FILL, SHRINK, hpadding, vpadding);
481 transport_table.attach (punch_space, col + 1, col + 2, 0, 1 , FILL, SHRINK, 0, vpadding);
482 transport_table.attach (punch_out_button, col + 2, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
483 transport_table.attach (layered_button, col, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
486 transport_table.attach (recpunch_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
489 transport_table.attach (auto_input_button, col, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
490 transport_table.attach (monitor_in_button, col, col + 1, 1, 2 , FILL, SHRINK, hpadding, vpadding);
491 transport_table.attach (mon_space, col + 1, col + 2, 1, 2 , FILL, SHRINK, 2, vpadding);
492 transport_table.attach (monitor_disk_button, col + 2, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
495 transport_table.attach (monitoring_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
498 transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
499 transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
502 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
505 transport_table.attach (*primary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
506 transport_table.attach (*primary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
507 transport_table.attach (*primary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
510 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
513 if (!ARDOUR::Profile->get_small_screen()) {
514 transport_table.attach (*secondary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
515 transport_table.attach (*secondary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
516 transport_table.attach (*secondary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
517 secondary_clock->set_no_show_all (true);
518 secondary_clock->left_btn()->set_no_show_all (true);
519 secondary_clock->right_btn()->set_no_show_all (true);
522 secondary_clock_spacer = manage (new ArdourVSpacer ());
523 transport_table.attach (*secondary_clock_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
527 transport_table.attach (*alert_box, TCOL, 0, 2, SHRINK, EXPAND|FILL, hpadding, 0);
530 /* editor-meter, mini-timeline and selection clock are options in the transport_hbox */
531 transport_hbox.set_spacing (3);
532 transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, hpadding, 0);
535 /* lua script action buttons */
536 transport_table.attach (action_script_table, TCOL, 0, 2, SHRINK, EXPAND|FILL, 1, 0);
539 transport_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
540 transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
543 repack_transport_hbox ();
544 update_clock_visibility ();
547 feedback_alert_button.set_sensitive (false);
548 feedback_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
549 auditioning_alert_button.set_sensitive (false);
550 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
552 set_transport_sensitivity (false);
558 ARDOUR_UI::soloing_changed (bool onoff)
560 if (solo_alert_button.get_active() != onoff) {
561 solo_alert_button.set_active (onoff);
566 ARDOUR_UI::_auditioning_changed (bool onoff)
568 auditioning_alert_button.set_active (onoff);
569 auditioning_alert_button.set_sensitive (onoff);
571 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
573 set_transport_sensitivity (!onoff);
577 ARDOUR_UI::auditioning_changed (bool onoff)
579 UI::instance()->call_slot (MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::_auditioning_changed, this, onoff));
583 ARDOUR_UI::audition_alert_clicked ()
586 _session->cancel_audition();
591 ARDOUR_UI::error_alert_press (GdkEventButton* ev)
593 bool do_toggle = true;
594 if (ev->button == 1) {
595 if (_log_not_acknowledged == LogLevelError) {
596 // just acknowledge the error, don't hide the log if it's already visible
597 RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
598 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
599 if (tact && tact->get_active()) {
603 _log_not_acknowledged = LogLevelNone;
604 error_blink (false); // immediate acknowledge
606 // maybe fall through to to button toggle
611 ARDOUR_UI::layered_button_clicked ()
614 _session->config.set_layered_record_mode (!_session->config.get_layered_record_mode ());
619 ARDOUR_UI::solo_blink (bool onoff)
625 if (_session->soloing() || _session->listening()) {
627 solo_alert_button.set_active (true);
629 solo_alert_button.set_active (false);
632 solo_alert_button.set_active (false);
637 ARDOUR_UI::sync_blink (bool onoff)
639 if (_session == 0 || !_session->config.get_external_sync()) {
641 sync_button.set_active (false);
645 if (!_session->transport_locked()) {
646 /* not locked, so blink on and off according to the onoff argument */
649 sync_button.set_active (true);
651 sync_button.set_active (false);
655 sync_button.set_active (true);
660 ARDOUR_UI::audition_blink (bool onoff)
666 if (_session->is_auditioning()) {
668 auditioning_alert_button.set_active (true);
670 auditioning_alert_button.set_active (false);
673 auditioning_alert_button.set_active (false);
678 ARDOUR_UI::feedback_blink (bool onoff)
680 if (_feedback_exists) {
682 feedback_alert_button.set_active (true);
684 feedback_alert_button.set_active (false);
687 feedback_alert_button.set_active (false);
692 ARDOUR_UI::error_blink (bool onoff)
694 switch (_log_not_acknowledged) {
698 error_alert_button.set_custom_led_color(0xff0000ff); // bright red
700 error_alert_button.set_custom_led_color(0x880000ff); // dark red
703 case LogLevelWarning:
704 error_alert_button.set_custom_led_color(0xccaa00ff); // yellow
707 error_alert_button.set_custom_led_color(0x88cc00ff); // lime green
710 error_alert_button.set_custom_led_color(0x333333ff); // gray
715 ARDOUR_UI::set_transport_sensitivity (bool yn)
717 ActionManager::set_sensitive (ActionManager::transport_sensitive_actions, yn);
718 shuttle_box.set_sensitive (yn);
722 ARDOUR_UI::editor_realized ()
724 boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
725 Config->map_parameters (pc);
727 UIConfiguration::instance().reset_dpi ();
731 ARDOUR_UI::maximise_editing_space ()
734 editor->maximise_editing_space ();
739 ARDOUR_UI::restore_editing_space ()
742 editor->restore_editing_space ();
747 ARDOUR_UI::show_ui_prefs ()
749 if (rc_option_editor) {
750 show_tabbable (rc_option_editor);
751 rc_option_editor->set_current_page (_("Appearance"));
756 ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
758 if (ev->button != 3) {
759 /* this handler is just for button-3 clicks */
763 show_tabbable (rc_option_editor);
764 rc_option_editor->set_current_page (_("Metronome"));
769 ARDOUR_UI::sync_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 (_("Sync"));
782 ARDOUR_UI::toggle_follow_edits ()
784 RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
787 RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
790 UIConfiguration::instance().set_follow_edits (tact->get_active ());
794 ARDOUR_UI::update_title ()
797 bool dirty = _session->dirty();
801 if (_session->snap_name() != _session->name()) {
802 session_name = _session->snap_name();
804 session_name = _session->name();
808 session_name = "*" + session_name;
811 WindowTitle title (session_name);
812 title += Glib::get_application_name();
813 _main_window.set_title (title.get_string());
815 WindowTitle title (Glib::get_application_name());
816 _main_window.set_title (title.get_string());