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 "canvas/canvas.h"
34 #include "pbd/error.h"
35 #include "pbd/basename.h"
36 #include "pbd/fastlog.h"
38 #include "gtkmm2ext/cairocell.h"
39 #include "gtkmm2ext/utils.h"
40 #include "gtkmm2ext/click_box.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 "theme_manager.h"
56 #include "midi_tracer.h"
57 #include "mini_timeline.h"
58 #include "shuttle_control.h"
59 #include "global_port_matrix.h"
60 #include "location_ui.h"
61 #include "rc_option_editor.h"
66 using namespace ARDOUR;
68 using namespace Gtkmm2ext;
71 using namespace ARDOUR_UI_UTILS;
75 ARDOUR_UI::setup_tooltips ()
77 ArdourCanvas::Canvas::set_tooltip_timeout (Gtk::Settings::get_default()->property_gtk_tooltip_timeout ());
79 set_tip (roll_button, _("Play from playhead"));
80 set_tip (stop_button, _("Stop playback"));
81 set_tip (rec_button, _("Toggle record"));
82 set_tip (play_selection_button, _("Play range/selection"));
83 set_tip (goto_start_button, _("Go to start of session"));
84 set_tip (goto_end_button, _("Go to end of session"));
85 set_tip (auto_loop_button, _("Play loop range"));
86 set_tip (midi_panic_button, _("MIDI Panic\nSend note off and reset controller messages on all MIDI channels"));
87 set_tip (auto_return_button, _("Return to last playback start when stopped"));
88 set_tip (follow_edits_button, _("Playhead follows range selections and edits"));
89 set_tip (auto_input_button, _("Be sensible about input monitoring"));
90 set_tip (click_button, _("Enable/Disable audio click"));
91 set_tip (solo_alert_button, _("When active, something is soloed.\nClick to de-solo everything"));
92 set_tip (auditioning_alert_button, _("When active, auditioning is taking place.\nClick to stop the audition"));
93 set_tip (feedback_alert_button, _("When active, there is a feedback loop."));
94 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"));
95 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"));
96 set_tip (editor_meter_peak_display, _("Reset All Peak Indicators"));
97 set_tip (error_alert_button, _("Show Error Log and acknowledge warnings"));
99 synchronize_sync_source_and_video_pullup ();
101 editor->setup_tooltips ();
105 ARDOUR_UI::status_bar_button_press (GdkEventButton* ev)
107 bool handled = false;
109 switch (ev->button) {
111 status_bar_label.set_text ("");
122 ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuffer::Tag> ptag, RefPtr<TextBuffer::Tag> mtag, const char *msg)
126 UI::display_message (prefix, prefix_len, ptag, mtag, msg);
128 ArdourLogLevel ll = LogLevelNone;
130 if (strcmp (prefix, _("[ERROR]: ")) == 0) {
131 text = "<span color=\"red\" weight=\"bold\">";
133 } else if (strcmp (prefix, _("[WARNING]: ")) == 0) {
134 text = "<span color=\"yellow\" weight=\"bold\">";
135 ll = LogLevelWarning;
136 } else if (strcmp (prefix, _("[INFO]: ")) == 0) {
137 text = "<span color=\"green\" weight=\"bold\">";
140 text = "<span color=\"white\" weight=\"bold\">???";
143 _log_not_acknowledged = std::max(_log_not_acknowledged, ll);
150 status_bar_label.set_markup (text);
155 ARDOUR_UI::tearoff_settings (const char* name) const
157 XMLNode* ui_node = Config->extra_xml(X_("UI"));
160 XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
162 XMLNode* mnode = tearoff_node->child (name);
170 #define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
173 bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult result, Tabbable* tab)
175 if (result == Gtk::DRAG_RESULT_NO_TARGET) {
183 ARDOUR_UI::spacer_expose (GdkEventExpose* ev)
185 cairo_t *cr = gdk_cairo_create (ev->window);
187 cairo_rectangle (cr, 1, 0, ev->area.width-2, ev->area.height);
188 cairo_set_source_rgb (cr, 0,0,0);
195 ARDOUR_UI::transport_expose (GdkEventExpose* ev)
199 Gtk::Widget* window_parent;
200 Glib::RefPtr<Gdk::Window> win = Gtkmm2ext::window_to_draw_on (transport_table, &window_parent);
201 Glib::RefPtr<Gtk::Style> style = transport_table.get_style();
202 if (!win || !style) {
206 Cairo::RefPtr<Cairo::Context> cr = transport_table.get_window()->create_cairo_context ();
208 cr->rectangle (ev->area.x, ev->area.y, ev->area.width, ev->area.height);
211 transport_table.translate_coordinates (*window_parent, 0, 0, x0, y0);
213 cr->rectangle (x0, y0, transport_table.get_width(), transport_table.get_height());
214 Gdk::Color bg (style->get_bg (transport_table.get_state()));
215 cr->set_source_rgb (bg.get_red_p(), bg.get_green_p(), bg.get_blue_p());
218 static const int xmargin = 2;
219 static const int ymargin = 1;
221 /* draw box around record-options */
224 punch_label.translate_coordinates (transport_table, -xmargin, 0, xx, uu); // left
225 punch_out_button.translate_coordinates (transport_table, xmargin, 0, ww, uu); // right
226 ww += punch_out_button.get_width () - xx; // width
227 hh = transport_table.get_height() - 1;
229 Gtkmm2ext::rounded_rectangle (cr->cobj(), x0 + xx - 0.5, y0 + 0.5, ww + 1, hh, 6);
230 cr->set_source_rgb (0, 0, 0);
231 cr->set_line_width (1.0);
234 /* line to rec-enable */
236 rec_button.translate_coordinates (transport_table, -xmargin, 0, rx, uu); // top
237 int dx = rx + rec_button.get_width() - xx;
239 cr->move_to (x0 + xx, 1.5 + y0 + ymargin + round (punch_in_button.get_height () * .5));
240 cr->rel_line_to (dx, 0);
241 cr->set_line_width (2.0);
248 ARDOUR_UI::setup_transport ()
253 act = ActionManager::get_action ("Transport", "ToggleClick");
254 click_button.set_related_action (act);
255 click_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::click_button_clicked), false);
257 act = ActionManager::get_action (X_("Transport"), X_("Stop"));
258 stop_button.set_related_action (act);
259 act = ActionManager::get_action (X_("Transport"), X_("Roll"));
260 roll_button.set_related_action (act);
261 act = ActionManager::get_action (X_("Transport"), X_("Record"));
262 rec_button.set_related_action (act);
263 act = ActionManager::get_action (X_("Transport"), X_("GotoStart"));
264 goto_start_button.set_related_action (act);
265 act = ActionManager::get_action (X_("Transport"), X_("GotoEnd"));
266 goto_end_button.set_related_action (act);
267 act = ActionManager::get_action (X_("Transport"), X_("Loop"));
268 auto_loop_button.set_related_action (act);
269 act = ActionManager::get_action (X_("Transport"), X_("PlaySelection"));
270 play_selection_button.set_related_action (act);
271 act = ActionManager::get_action (X_("MIDI"), X_("panic"));
272 midi_panic_button.set_related_action (act);
273 act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
274 sync_button.set_related_action (act);
276 sync_button.set_sizing_text (_("Internal")); // longest of sync_source_to_string()
278 /* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
279 act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
280 solo_alert_button.set_related_action (act);
281 auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
282 error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
283 act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
284 error_alert_button.set_related_action(act);
285 error_alert_button.set_fallthrough_to_parent(true);
287 layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
289 editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
290 mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
291 prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
293 act = ActionManager::get_action ("Transport", "ToggleAutoReturn");
294 auto_return_button.set_related_action (act);
295 act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
296 follow_edits_button.set_related_action (act);
297 act = ActionManager::get_action ("Transport", "ToggleAutoInput");
298 auto_input_button.set_related_action (act);
300 act = ActionManager::get_action ("Transport", "TogglePunchIn");
301 punch_in_button.set_related_action (act);
302 act = ActionManager::get_action ("Transport", "TogglePunchOut");
303 punch_out_button.set_related_action (act);
305 /* connect signals */
306 ARDOUR_UI::Clock.connect (sigc::mem_fun (primary_clock, &AudioClock::set));
307 ARDOUR_UI::Clock.connect (sigc::mem_fun (secondary_clock, &AudioClock::set));
309 primary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
310 secondary_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
311 big_clock->ValueChanged.connect (sigc::mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
313 editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor));
314 mixer_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), mixer));
315 prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor));
317 /* catch context clicks so that we can show a menu on these buttons */
319 editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
320 mixer_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("mixer")), false);
321 prefs_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("preferences")), false);
323 /* setup widget style/name */
325 auto_return_button.set_name ("transport option button");
326 follow_edits_button.set_name ("transport option button");
327 auto_input_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 click_button.set_name ("transport button");
351 sync_button.set_name ("transport active option button");
353 /* and widget text */
354 auto_return_button.set_text(_("Auto Return"));
355 follow_edits_button.set_text(_("Follow Edits"));
356 //auto_input_button.set_text (_("Auto Input"));
357 punch_in_button.set_text (_("In"));
358 punch_out_button.set_text (_("Out"));
359 layered_button.set_text (_("Non-Layered"));
361 punch_label.set_text (_("Punch:"));
362 layered_label.set_text (_("Rec:"));
366 Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button,
367 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
368 "To put the window back, use the Window > %1 > Attach menu action"), editor->name()));
370 Gtkmm2ext::UI::instance()->set_tip (mixer_visibility_button,
371 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
372 "To put the window back, use the Window > %1 > Attach menu action"), mixer->name()));
374 Gtkmm2ext::UI::instance()->set_tip (prefs_visibility_button,
375 string_compose (_("Drag this tab to the desktop to show %1 in its own window\n\n"
376 "To put the window back, use the Window > %1 > Attach menu action"), rc_option_editor->name()));
378 Gtkmm2ext::UI::instance()->set_tip (punch_in_button, _("Start recording at auto-punch start"));
379 Gtkmm2ext::UI::instance()->set_tip (punch_out_button, _("Stop recording at auto-punch end"));
383 click_button.set_icon (ArdourIcon::TransportMetronom);
384 goto_start_button.set_icon (ArdourIcon::TransportStart);
385 goto_end_button.set_icon (ArdourIcon::TransportEnd);
386 roll_button.set_icon (ArdourIcon::TransportPlay);
387 stop_button.set_icon (ArdourIcon::TransportStop);
388 play_selection_button.set_icon (ArdourIcon::TransportRange);
389 auto_loop_button.set_icon (ArdourIcon::TransportLoop);
390 rec_button.set_icon (ArdourIcon::RecButton);
391 midi_panic_button.set_icon (ArdourIcon::TransportPanic);
393 /* transport control size-group */
395 Glib::RefPtr<SizeGroup> transport_button_size_group = SizeGroup::create (SIZE_GROUP_BOTH);
396 transport_button_size_group->add_widget (goto_start_button);
397 transport_button_size_group->add_widget (goto_end_button);
398 transport_button_size_group->add_widget (auto_loop_button);
399 transport_button_size_group->add_widget (rec_button);
400 transport_button_size_group->add_widget (play_selection_button);
401 transport_button_size_group->add_widget (roll_button);
402 transport_button_size_group->add_widget (stop_button);
404 Glib::RefPtr<SizeGroup> punch_button_size_group = SizeGroup::create (Gtk::SIZE_GROUP_HORIZONTAL);
405 punch_button_size_group->add_widget (punch_in_button);
406 punch_button_size_group->add_widget (punch_out_button);
408 shuttle_box = manage (new ShuttleControl);
409 mini_timeline = manage (new MiniTimeline);
411 /* and now the layout... */
413 /* top level packing */
414 transport_table.set_spacings (0);
415 transport_table.set_row_spacings (4);
416 transport_table.set_border_width (2);
417 transport_frame.add (transport_table);
418 transport_frame.set_name ("BaseFrame");
419 transport_frame.set_shadow_type (Gtk::SHADOW_NONE);
421 transport_table.signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::transport_expose), false);
423 /* transport controls sub-group */
424 click_button.set_size_request (PX_SCALE(20), PX_SCALE(20));
426 HBox* tbox = manage (new HBox);
427 tbox->set_spacing (PX_SCALE(2));
429 tbox->pack_start (midi_panic_button, true, true, 0);
430 tbox->pack_start (click_button, true, true, 0);
431 tbox->pack_start (goto_start_button, true, true);
432 tbox->pack_start (goto_end_button, true, true);
433 tbox->pack_start (auto_loop_button, true, true);
434 tbox->pack_start (play_selection_button, true, true);
436 tbox->pack_start (roll_button, true, true);
437 tbox->pack_start (stop_button, true, true);
438 tbox->pack_start (rec_button, true, true, 3);
440 /* alert box sub-group */
441 VBox* alert_box = manage (new VBox);
442 alert_box->set_homogeneous (true);
443 alert_box->set_spacing (1);
444 alert_box->set_border_width (0);
445 alert_box->pack_start (solo_alert_button, true, false, 0);
446 alert_box->pack_start (auditioning_alert_button, true, false, 0);
447 alert_box->pack_start (feedback_alert_button, true, false, 0);
449 /* clock button size groups */
450 Glib::RefPtr<SizeGroup> button_height_size_group = SizeGroup::create (Gtk::SIZE_GROUP_VERTICAL);
451 button_height_size_group->add_widget (follow_edits_button);
452 button_height_size_group->add_widget (*primary_clock->left_btn());
453 button_height_size_group->add_widget (*primary_clock->right_btn());
454 button_height_size_group->add_widget (*secondary_clock->left_btn());
455 button_height_size_group->add_widget (*secondary_clock->right_btn());
457 button_height_size_group->add_widget (stop_button);
458 // button_height_size_group->add_widget (sync_button);
459 // button_height_size_group->add_widget (layered_button);
460 button_height_size_group->add_widget (auto_return_button);
461 button_height_size_group->add_widget (editor_visibility_button);
462 button_height_size_group->add_widget (mixer_visibility_button);
464 Glib::RefPtr<SizeGroup> clock1_size_group = SizeGroup::create (SIZE_GROUP_BOTH);
465 clock1_size_group->add_widget (*primary_clock->left_btn());
466 clock1_size_group->add_widget (*primary_clock->right_btn());
468 Glib::RefPtr<SizeGroup> clock2_size_group = SizeGroup::create (SIZE_GROUP_BOTH);
469 clock2_size_group->add_widget (*secondary_clock->left_btn());
470 clock2_size_group->add_widget (*secondary_clock->right_btn());
472 /* and the main table layout */
474 transport_table.attach (*tbox, 0, 2, 0, 1 , SHRINK, SHRINK, 0, 0);
475 transport_table.attach (sync_button, 0, 1, 1, 2 , FILL, SHRINK, 0, 0);
476 transport_table.attach (*shuttle_box, 1, 2, 1, 2 , FILL, SHRINK, 3, 0);
479 EventBox *spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
480 spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false); spacer->show();
481 transport_table.attach (*spacer, 2, 3, 0, 2 , FILL, SHRINK, 3, 0);
483 transport_table.attach (punch_label, 3, 4, 0, 1 , FILL, SHRINK, 3, 0);
484 transport_table.attach (layered_label, 3, 4, 1, 2 , FILL, SHRINK, 3, 0);
486 transport_table.attach (punch_in_button, 4, 5, 0, 1 , FILL, SHRINK, 0, 2);
487 transport_table.attach (punch_out_button, 6, 7, 0, 1 , FILL, SHRINK, 0, 2);
488 transport_table.attach (layered_button, 4, 7, 1, 2 , FILL, SHRINK, 0, 2);
491 spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
492 spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false); spacer->show();
493 transport_table.attach (*spacer, 7, 8, 0, 2 , FILL, SHRINK, 3, 0);
495 transport_table.attach (follow_edits_button, 8, 9, 0, 1 , FILL, SHRINK, 2, 0);
496 transport_table.attach (auto_return_button, 8, 9, 1, 2 , FILL, SHRINK, 2, 0);
499 spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
500 spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false); spacer->show();
501 transport_table.attach (*spacer, 9, 10, 0, 2 , FILL, SHRINK, 3, 0);
503 transport_table.attach (*primary_clock, 10, 12, 0, 1 , FILL, SHRINK, 2, 0);
504 transport_table.attach (*primary_clock->left_btn(), 10, 11, 1, 2 , FILL, SHRINK, 2, 0);
505 transport_table.attach (*primary_clock->right_btn(), 11, 12, 1, 2 , FILL, SHRINK, 2, 0);
508 spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
509 spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false); spacer->show();
510 transport_table.attach (*spacer, 12, 13, 0, 2 , FILL, SHRINK, 3, 0);
512 if (!ARDOUR::Profile->get_small_screen()) {
513 transport_table.attach (*secondary_clock, 13, 15, 0, 1 , FILL, SHRINK, 2, 0);
514 transport_table.attach (*secondary_clock->left_btn(), 13, 14, 1, 2 , FILL, SHRINK, 2, 0);
515 transport_table.attach (*secondary_clock->right_btn(), 14, 15, 1, 2 , FILL, SHRINK, 2, 0);
519 spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
520 spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false); spacer->show();
521 transport_table.attach (*spacer, 15, 16, 0, 2 , FILL, SHRINK, 3, 0);
523 transport_table.attach (*alert_box, 16, 17, 0, 2, SHRINK, EXPAND|FILL, 2, 0);
526 spacer = manage (new EventBox ()); spacer->set_size_request(3, 42);
527 spacer->signal_expose_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::spacer_expose), false); spacer->show();
528 transport_table.attach (*spacer, 17, 18, 0, 2 , FILL, SHRINK, 3, 0);
531 /* editor-meter is in transport_hbox */
532 transport_hbox.set_spacing (PX_SCALE(1));
533 transport_table.attach (transport_hbox, 18, 19, 0, 2, SHRINK, EXPAND|FILL, 2, 0);
535 transport_table.attach (*mini_timeline, 19, 20, 0, 2, EXPAND|FILL, EXPAND|FILL, 1, 0);
537 /* lua script action buttons */
538 transport_table.attach (action_script_table, 20, 21, 0, 2, SHRINK, EXPAND|FILL, 1, 0);
540 transport_table.attach (editor_visibility_button, 21, 22, 0, 1 , FILL, SHRINK, 2, 0);
541 transport_table.attach (mixer_visibility_button, 21, 22, 1, 2 , FILL, SHRINK, 2, 0);
545 feedback_alert_button.set_sensitive (false);
546 feedback_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
547 auditioning_alert_button.set_sensitive (false);
548 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
550 stop_button.set_active (true);
551 set_transport_sensitivity (false);
556 ARDOUR_UI::soloing_changed (bool onoff)
558 if (solo_alert_button.get_active() != onoff) {
559 solo_alert_button.set_active (onoff);
564 ARDOUR_UI::_auditioning_changed (bool onoff)
566 auditioning_alert_button.set_active (onoff);
567 auditioning_alert_button.set_sensitive (onoff);
569 auditioning_alert_button.set_visual_state (Gtkmm2ext::NoVisualState);
571 set_transport_sensitivity (!onoff);
575 ARDOUR_UI::auditioning_changed (bool onoff)
577 UI::instance()->call_slot (MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::_auditioning_changed, this, onoff));
581 ARDOUR_UI::audition_alert_clicked ()
584 _session->cancel_audition();
589 ARDOUR_UI::error_alert_press (GdkEventButton* ev)
591 bool do_toggle = true;
592 if (ev->button == 1) {
593 if (_log_not_acknowledged == LogLevelError) {
594 // just acknowledge the error, don't hide the log if it's already visible
595 RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
596 Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
597 if (tact && tact->get_active()) {
601 _log_not_acknowledged = LogLevelNone;
602 error_blink (false); // immediate acknowledge
604 // maybe fall through to to button toggle
609 ARDOUR_UI::layered_button_clicked ()
612 _session->config.set_layered_record_mode (!_session->config.get_layered_record_mode ());
617 ARDOUR_UI::solo_blink (bool onoff)
623 if (_session->soloing() || _session->listening()) {
625 solo_alert_button.set_active (true);
627 solo_alert_button.set_active (false);
630 solo_alert_button.set_active (false);
635 ARDOUR_UI::sync_blink (bool onoff)
637 if (_session == 0 || !_session->config.get_external_sync()) {
639 sync_button.set_active (false);
643 if (!_session->transport_locked()) {
644 /* not locked, so blink on and off according to the onoff argument */
647 sync_button.set_active (true);
649 sync_button.set_active (false);
653 sync_button.set_active (true);
658 ARDOUR_UI::audition_blink (bool onoff)
664 if (_session->is_auditioning()) {
666 auditioning_alert_button.set_active (true);
668 auditioning_alert_button.set_active (false);
671 auditioning_alert_button.set_active (false);
676 ARDOUR_UI::feedback_blink (bool onoff)
678 if (_feedback_exists) {
680 feedback_alert_button.set_active (true);
682 feedback_alert_button.set_active (false);
685 feedback_alert_button.set_active (false);
690 ARDOUR_UI::error_blink (bool onoff)
692 switch (_log_not_acknowledged) {
696 error_alert_button.set_custom_led_color(0xff0000ff); // bright red
698 error_alert_button.set_custom_led_color(0x880000ff); // dark red
701 case LogLevelWarning:
702 error_alert_button.set_custom_led_color(0xccaa00ff); // yellow
705 error_alert_button.set_custom_led_color(0x88cc00ff); // lime green
708 error_alert_button.set_custom_led_color(0x333333ff); // gray
716 ARDOUR_UI::set_transport_sensitivity (bool yn)
718 ActionManager::set_sensitive (ActionManager::transport_sensitive_actions, yn);
719 shuttle_box->set_sensitive (yn);
723 ARDOUR_UI::editor_realized ()
725 boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
726 Config->map_parameters (pc);
728 UIConfiguration::instance().reset_dpi ();
732 ARDOUR_UI::maximise_editing_space ()
735 editor->maximise_editing_space ();
740 ARDOUR_UI::restore_editing_space ()
743 editor->restore_editing_space ();
748 ARDOUR_UI::show_ui_prefs ()
750 if (rc_option_editor) {
751 show_tabbable (rc_option_editor);
752 rc_option_editor->set_current_page (_("GUI"));
757 ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
759 if (ev->button != 3) {
760 /* this handler is just for button-3 clicks */
764 show_tabbable (rc_option_editor);
765 rc_option_editor->set_current_page (_("Misc/Click"));
770 ARDOUR_UI::toggle_follow_edits ()
772 RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
775 RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
778 UIConfiguration::instance().set_follow_edits (tact->get_active ());
782 ARDOUR_UI::update_title ()
785 bool dirty = _session->dirty();
789 if (_session->snap_name() != _session->name()) {
790 session_name = _session->snap_name();
792 session_name = _session->name();
796 session_name = "*" + session_name;
799 WindowTitle title (session_name);
800 title += Glib::get_application_name();
801 _main_window.set_title (title.get_string());
803 WindowTitle title (Glib::get_application_name());
804 _main_window.set_title (title.get_string());