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::tearoff_settings (const char* name) const
114 XMLNode* ui_node = Config->extra_xml(X_("UI"));
117 XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
119 XMLNode* mnode = tearoff_node->child (name);
127 #define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
130 bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult result, Tabbable* tab)
132 if (result == Gtk::DRAG_RESULT_NO_TARGET) {
140 ARDOUR_UI::repack_transport_hbox ()
143 if (time_info_box->get_parent()) {
144 transport_hbox.remove (*time_info_box);
146 if (UIConfiguration::instance().get_show_toolbar_selclock ()) {
147 transport_hbox.pack_start (*time_info_box, false, false);
148 time_info_box->show();
152 if (mini_timeline.get_parent()) {
153 transport_hbox.remove (mini_timeline);
155 if (UIConfiguration::instance().get_show_mini_timeline ()) {
156 transport_hbox.pack_start (mini_timeline, true, true);
157 mini_timeline.show();
161 if (editor_meter_table.get_parent()) {
162 transport_hbox.remove (editor_meter_table);
164 if (meterbox_spacer.get_parent()) {
165 transport_hbox.remove (meterbox_spacer);
166 transport_hbox.remove (meterbox_spacer2);
169 if (UIConfiguration::instance().get_show_editor_meter()) {
170 transport_hbox.pack_end (meterbox_spacer, false, false, 3);
171 transport_hbox.pack_end (editor_meter_table, false, false);
172 transport_hbox.pack_end (meterbox_spacer2, false, false, 3);
173 editor_meter_table.show();
174 meterbox_spacer.show();
175 meterbox_spacer2.show();
179 bool show_mon = UIConfiguration::instance().get_show_toolbar_monitoring ();
181 monitor_in_button.show ();
182 monitor_disk_button.show ();
183 auto_input_button.show ();
184 monitoring_spacer.show ();
186 monitor_in_button.hide ();
187 monitor_disk_button.hide ();
188 auto_input_button.hide ();
189 monitoring_spacer.hide ();
192 bool show_rec = UIConfiguration::instance().get_show_toolbar_recpunch ();
195 layered_label.show ();
196 punch_in_button.show ();
197 punch_out_button.show ();
198 layered_button.show ();
199 recpunch_spacer.show ();
202 layered_label.hide ();
203 punch_in_button.hide ();
204 punch_out_button.hide ();
205 layered_button.hide ();
206 recpunch_spacer.hide ();
212 ARDOUR_UI::update_clock_visibility ()
214 if (ARDOUR::Profile->get_small_screen()) {
217 if (UIConfiguration::instance().get_show_secondary_clock ()) {
218 secondary_clock->show();
219 secondary_clock->left_btn()->show();
220 secondary_clock->right_btn()->show();
221 if (secondary_clock_spacer) {
222 secondary_clock_spacer->show();
225 secondary_clock->hide();
226 secondary_clock->left_btn()->hide();
227 secondary_clock->right_btn()->hide();
228 if (secondary_clock_spacer) {
229 secondary_clock_spacer->hide();
235 ARDOUR_UI::setup_transport ()
240 act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
241 sync_button.set_related_action (act);
242 sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false);
244 sync_button.set_sizing_text (S_("LogestSync|M-Clk"));
246 /* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
247 act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
248 solo_alert_button.set_related_action (act);
249 auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
250 error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
251 act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
252 error_alert_button.set_related_action(act);
253 error_alert_button.set_fallthrough_to_parent(true);
255 layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
257 editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
258 mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
259 prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
261 act = ActionManager::get_action ("Transport", "ToggleAutoReturn");
262 auto_return_button.set_related_action (act);
263 act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
264 follow_edits_button.set_related_action (act);
265 act = ActionManager::get_action ("Transport", "ToggleAutoInput");
266 auto_input_button.set_related_action (act);
268 act = ActionManager::get_action ("Transport", "TogglePunchIn");
269 punch_in_button.set_related_action (act);
270 act = ActionManager::get_action ("Transport", "TogglePunchOut");
271 punch_out_button.set_related_action (act);
273 act = ActionManager::get_action ("Transport", "SessionMonitorIn");
274 monitor_in_button.set_related_action (act);
275 act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
276 monitor_disk_button.set_related_action (act);
278 /* connect signals */
279 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false, 0));
280 ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false, 0));
282 primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
283 secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
284 big_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
286 editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor));
287 mixer_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), mixer));
288 prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor));
290 /* catch context clicks so that we can show a menu on these buttons */
292 editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
293 mixer_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("mixer")), false);
294 prefs_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("preferences")), false);
296 /* setup widget style/name */
298 auto_return_button.set_name ("transport option button");
299 follow_edits_button.set_name ("transport option button");
301 solo_alert_button.set_name ("rude solo");
302 auditioning_alert_button.set_name ("rude audition");
303 feedback_alert_button.set_name ("feedback alert");
304 error_alert_button.set_name ("error alert");
306 solo_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
307 auditioning_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
308 feedback_alert_button.set_elements (ArdourButton::Element(ArdourButton::Body|ArdourButton::Text));
310 solo_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
311 auditioning_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
312 feedback_alert_button.set_layout_font (UIConfiguration::instance().get_SmallerFont());
314 editor_visibility_button.set_name (X_("page switch button"));
315 mixer_visibility_button.set_name (X_("page switch button"));
316 prefs_visibility_button.set_name (X_("page switch button"));
318 punch_in_button.set_name ("punch button");
319 punch_out_button.set_name ("punch button");
320 layered_button.set_name (("layered button"));
322 monitor_in_button.set_name ("monitor button");
323 monitor_disk_button.set_name ("monitor button");
324 auto_input_button.set_name ("transport option button");
326 sync_button.set_name ("transport active option button");
328 /* and widget text */
329 auto_return_button.set_text(_("Auto Return"));
330 follow_edits_button.set_text(_("Follow Range"));
331 punch_in_button.set_text (_("In"));
332 punch_out_button.set_text (_("Out"));
333 layered_button.set_text (_("Non-Layered"));
335 monitor_in_button.set_text (_("All In"));
336 monitor_disk_button.set_text (_("All Disk"));
337 auto_input_button.set_text (_("Auto-Input"));
339 punch_label.set_text (_("Punch:"));
340 layered_label.set_text (_("Rec:"));
344 Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button,
345 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
346 "To re-attach the window, use the Window > %1 > Attach menu action"), editor->name()));
348 Gtkmm2ext::UI::instance()->set_tip (mixer_visibility_button,
349 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
350 "To re-attach the window, use the Window > %1 > Attach menu action"), mixer->name()));
352 Gtkmm2ext::UI::instance()->set_tip (prefs_visibility_button,
353 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
354 "To re-attach the window, use the Window > %1 > Attach menu action"), rc_option_editor->name()));
356 Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
357 Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
359 Gtkmm2ext::UI::instance()->set_tip (monitor_in_button, _("Force all tracks to monitor Input, unless they are explicitly set to monitor Disk"));
360 Gtkmm2ext::UI::instance()->set_tip (monitor_disk_button, _("Force all tracks to monitor Disk playback, unless they are explicitly set to Input"));
362 /* transport control size-group */
364 Glib::RefPtr<SizeGroup> punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
365 punch_button_size_group->add_widget (punch_in_button);
366 punch_button_size_group->add_widget (punch_out_button);
368 Glib::RefPtr<SizeGroup> monitor_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
369 monitor_button_size_group->add_widget (monitor_in_button);
370 monitor_button_size_group->add_widget (monitor_disk_button);
372 /* and now the layout... */
374 /* top level packing */
375 transport_table.set_spacings (0);
376 transport_table.set_row_spacings (4);
377 transport_table.set_border_width (2);
379 transport_frame.set_name ("TransportFrame");
380 transport_frame.set_shadow_type (Gtk::SHADOW_NONE);
382 /* An event box to hold the table. We use this because we want specific
383 control over the background color, and without this event box,
384 nothing inside the transport_sample actually draws a background. We
385 would therefore end up seeing the background of the parent widget,
386 which is probably some default color. Adding the EventBox adds a
387 widget that will draw the background, using a style based on
388 the parent, "TransportFrame".
390 Gtk::EventBox* ebox = manage (new Gtk::EventBox);
391 transport_frame.add (*ebox);
392 ebox->add (transport_table);
394 /* alert box sub-group */
395 VBox* alert_box = manage (new VBox);
396 alert_box->set_homogeneous (true);
397 alert_box->set_spacing (1);
398 alert_box->set_border_width (0);
399 alert_box->pack_start (solo_alert_button, true, true);
400 alert_box->pack_start (auditioning_alert_button, true, true);
401 alert_box->pack_start (feedback_alert_button, true, true);
403 /* clock button size groups */
404 Glib::RefPtr<SizeGroup> button_height_size_group = SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL);
405 button_height_size_group->add_widget (follow_edits_button);
406 button_height_size_group->add_widget (*primary_clock->left_btn());
407 button_height_size_group->add_widget (*primary_clock->right_btn());
408 button_height_size_group->add_widget (*secondary_clock->left_btn());
409 button_height_size_group->add_widget (*secondary_clock->right_btn());
411 button_height_size_group->add_widget (transport_ctrl.size_button ());
412 // button_height_size_group->add_widget (sync_button);
413 button_height_size_group->add_widget (auto_return_button);
416 button_height_size_group->add_widget (editor_visibility_button);
417 button_height_size_group->add_widget (mixer_visibility_button);
420 button_height_size_group->add_widget (punch_in_button);
421 button_height_size_group->add_widget (punch_out_button);
422 button_height_size_group->add_widget (layered_button);
424 //input monitoring section
425 button_height_size_group->add_widget (monitor_in_button);
426 button_height_size_group->add_widget (monitor_disk_button);
427 button_height_size_group->add_widget (auto_input_button);
429 Glib::RefPtr<SizeGroup> clock1_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
430 clock1_size_group->add_widget (*primary_clock->left_btn());
431 clock1_size_group->add_widget (*primary_clock->right_btn());
433 Glib::RefPtr<SizeGroup> clock2_size_group = SizeGroup::create (SIZE_GROUP_HORIZONTAL);
434 clock2_size_group->add_widget (*secondary_clock->left_btn());
435 clock2_size_group->add_widget (*secondary_clock->right_btn());
437 /* sub-layout for Sync | Shuttle (grow) */
438 HBox* ssbox = manage (new HBox);
439 ssbox->set_spacing (PX_SCALE(2));
440 ssbox->pack_start (sync_button, false, false, 0);
441 ssbox->pack_start (shuttle_box, true, true, 0);
442 ssbox->pack_start (*shuttle_box.info_button(), false, false, 0);
445 /* and the main table layout */
449 #define TCOL col, col + 1
451 transport_table.attach (transport_ctrl, TCOL, 0, 1 , SHRINK, SHRINK, 0, 0);
452 transport_table.attach (*ssbox, TCOL, 1, 2 , FILL, SHRINK, 0, 0);
455 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
458 transport_table.attach (punch_label, TCOL, 0, 1 , FILL, SHRINK, 3, 0);
459 transport_table.attach (layered_label, TCOL, 1, 2 , FILL, SHRINK, 3, 0);
462 transport_table.attach (punch_in_button, col, col + 1, 0, 1 , FILL, SHRINK, hpadding, vpadding);
463 transport_table.attach (punch_space, col + 1, col + 2, 0, 1 , FILL, SHRINK, 0, vpadding);
464 transport_table.attach (punch_out_button, col + 2, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
465 transport_table.attach (layered_button, col, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
468 transport_table.attach (recpunch_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
471 transport_table.attach (auto_input_button, col, col + 3, 0, 1 , FILL, SHRINK, hpadding, vpadding);
472 transport_table.attach (monitor_in_button, col, col + 1, 1, 2 , FILL, SHRINK, hpadding, vpadding);
473 transport_table.attach (mon_space, col + 1, col + 2, 1, 2 , FILL, SHRINK, 2, vpadding);
474 transport_table.attach (monitor_disk_button, col + 2, col + 3, 1, 2 , FILL, SHRINK, hpadding, vpadding);
477 transport_table.attach (monitoring_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
480 transport_table.attach (follow_edits_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
481 transport_table.attach (auto_return_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
484 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
487 transport_table.attach (*primary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
488 transport_table.attach (*primary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
489 transport_table.attach (*primary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
492 transport_table.attach (*(manage (new ArdourVSpacer ())), TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
495 if (!ARDOUR::Profile->get_small_screen()) {
496 transport_table.attach (*secondary_clock, col, col + 2, 0, 1 , FILL, SHRINK, hpadding, 0);
497 transport_table.attach (*secondary_clock->left_btn(), col, col + 1, 1, 2 , FILL, SHRINK, hpadding, 0);
498 transport_table.attach (*secondary_clock->right_btn(), col + 1, col + 2, 1, 2 , FILL, SHRINK, hpadding, 0);
499 secondary_clock->set_no_show_all (true);
500 secondary_clock->left_btn()->set_no_show_all (true);
501 secondary_clock->right_btn()->set_no_show_all (true);
504 secondary_clock_spacer = manage (new ArdourVSpacer ());
505 transport_table.attach (*secondary_clock_spacer, TCOL, 0, 2 , SHRINK, EXPAND|FILL, 3, 0);
509 transport_table.attach (*alert_box, TCOL, 0, 2, SHRINK, EXPAND|FILL, hpadding, 0);
512 /* editor-meter, mini-timeline and selection clock are options in the transport_hbox */
513 transport_hbox.set_spacing (3);
514 transport_table.attach (transport_hbox, TCOL, 0, 2, EXPAND|FILL, EXPAND|FILL, hpadding, 0);
517 /* lua script action buttons */
518 transport_table.attach (action_script_table, TCOL, 0, 2, SHRINK, EXPAND|FILL, 1, 0);
521 transport_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
522 transport_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, SHRINK, hpadding, vpadding);
525 repack_transport_hbox ();
526 update_clock_visibility ();
529 feedback_alert_button.set_sensitive (false);
530 feedback_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
531 auditioning_alert_button.set_sensitive (false);
532 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
534 set_transport_sensitivity (false);
540 ARDOUR_UI::soloing_changed (bool onoff)
542 if (solo_alert_button.get_active() != onoff) {
543 solo_alert_button.set_active (onoff);
548 ARDOUR_UI::_auditioning_changed (bool onoff)
550 auditioning_alert_button.set_active (onoff);
551 auditioning_alert_button.set_sensitive (onoff);
553 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
555 set_transport_sensitivity (!onoff);
559 ARDOUR_UI::auditioning_changed (bool onoff)
561 UI::instance()->call_slot (MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::_auditioning_changed, this, onoff));
565 ARDOUR_UI::audition_alert_clicked ()
568 _session->cancel_audition();
573 ARDOUR_UI::error_alert_press (GdkEventButton* ev)
575 bool do_toggle = true;
576 if (ev->button == 1) {
577 if (_log_not_acknowledged == LogLevelError) {
578 // just acknowledge the error, don't hide the log if it's already visible
579 RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
580 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
581 if (tact && tact->get_active()) {
585 _log_not_acknowledged = LogLevelNone;
586 error_blink (false); // immediate acknowledge
588 // maybe fall through to to button toggle
593 ARDOUR_UI::layered_button_clicked ()
596 _session->config.set_layered_record_mode (!_session->config.get_layered_record_mode ());
601 ARDOUR_UI::solo_blink (bool onoff)
607 if (_session->soloing() || _session->listening()) {
609 solo_alert_button.set_active (true);
611 solo_alert_button.set_active (false);
614 solo_alert_button.set_active (false);
619 ARDOUR_UI::sync_blink (bool onoff)
621 if (_session == 0 || !_session->config.get_external_sync()) {
623 sync_button.set_active (false);
627 if (!_session->transport_locked()) {
628 /* not locked, so blink on and off according to the onoff argument */
631 sync_button.set_active (true);
633 sync_button.set_active (false);
637 sync_button.set_active (true);
642 ARDOUR_UI::audition_blink (bool onoff)
648 if (_session->is_auditioning()) {
650 auditioning_alert_button.set_active (true);
652 auditioning_alert_button.set_active (false);
655 auditioning_alert_button.set_active (false);
660 ARDOUR_UI::feedback_blink (bool onoff)
662 if (_feedback_exists) {
664 feedback_alert_button.set_active (true);
666 feedback_alert_button.set_active (false);
669 feedback_alert_button.set_active (false);
674 ARDOUR_UI::error_blink (bool onoff)
676 switch (_log_not_acknowledged) {
680 error_alert_button.set_custom_led_color(0xff0000ff); // bright red
682 error_alert_button.set_custom_led_color(0x880000ff); // dark red
685 case LogLevelWarning:
686 error_alert_button.set_custom_led_color(0xccaa00ff); // yellow
689 error_alert_button.set_custom_led_color(0x88cc00ff); // lime green
692 error_alert_button.set_custom_led_color(0x333333ff); // gray
697 ARDOUR_UI::set_transport_sensitivity (bool yn)
699 ActionManager::set_sensitive (ActionManager::transport_sensitive_actions, yn);
700 shuttle_box.set_sensitive (yn);
704 ARDOUR_UI::editor_realized ()
706 boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
707 Config->map_parameters (pc);
709 UIConfiguration::instance().reset_dpi ();
713 ARDOUR_UI::maximise_editing_space ()
716 editor->maximise_editing_space ();
721 ARDOUR_UI::restore_editing_space ()
724 editor->restore_editing_space ();
729 ARDOUR_UI::show_ui_prefs ()
731 if (rc_option_editor) {
732 show_tabbable (rc_option_editor);
733 rc_option_editor->set_current_page (_("Appearance"));
738 ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
740 if (ev->button != 3) {
741 /* this handler is just for button-3 clicks */
745 show_tabbable (rc_option_editor);
746 rc_option_editor->set_current_page (_("Metronome"));
751 ARDOUR_UI::sync_button_clicked (GdkEventButton* ev)
753 if (ev->button != 3) {
754 /* this handler is just for button-3 clicks */
758 show_tabbable (rc_option_editor);
759 rc_option_editor->set_current_page (_("Sync"));
764 ARDOUR_UI::toggle_follow_edits ()
766 RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
769 RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
772 UIConfiguration::instance().set_follow_edits (tact->get_active ());
776 ARDOUR_UI::update_title ()
779 bool dirty = _session->dirty();
783 if (_session->snap_name() != _session->name()) {
784 session_name = _session->snap_name();
786 session_name = _session->name();
790 session_name = "*" + session_name;
793 WindowTitle title (session_name);
794 title += Glib::get_application_name();
795 _main_window.set_title (title.get_string());
797 WindowTitle title (Glib::get_application_name());
798 _main_window.set_title (title.get_string());