2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2005-2006 Taybin Rutkin <taybin@taybin.com>
|
|
|
|
* Copyright (C) 2005-2015 Tim Mayberry <mojofunk@gmail.com>
|
|
|
|
* Copyright (C) 2005-2018 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2006-2007 Doug McLain <doug@nostar.net>
|
|
|
|
* Copyright (C) 2006-2012 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2006 Karsten Wiese <fzuuzf@googlemail.com>
|
|
|
|
* Copyright (C) 2006 Nick Mainsbridge <mainsbridge@gmail.com>
|
|
|
|
* Copyright (C) 2007-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2008 Hans Baier <hansfbaier@googlemail.com>
|
|
|
|
* Copyright (C) 2012-2019 Robin Gareus <robin@gareus.org>
|
|
|
|
* Copyright (C) 2014-2018 Ben Loftis <ben@harrisonconsoles.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-11-13 00:14:48 -05:00
|
|
|
#ifdef WAF_BUILD
|
|
|
|
#include "gtk2ardour-config.h"
|
|
|
|
#endif
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <signal.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <cerrno>
|
|
|
|
#include <iostream>
|
|
|
|
#include <cmath>
|
|
|
|
|
2021-06-18 16:26:22 -04:00
|
|
|
#include <gtkmm/menu.h>
|
|
|
|
#include <gtkmm/menuitem.h>
|
|
|
|
|
2005-10-10 16:38:53 -04:00
|
|
|
#include <sigc++/bind.h>
|
2017-07-16 21:48:18 -04:00
|
|
|
#include <gtkmm/settings.h>
|
|
|
|
|
2016-05-02 14:24:54 -04:00
|
|
|
#include "canvas/canvas.h"
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/error.h"
|
|
|
|
#include "pbd/basename.h"
|
|
|
|
#include "pbd/fastlog.h"
|
2015-07-09 13:56:12 -04:00
|
|
|
|
|
|
|
#include "gtkmm2ext/utils.h"
|
|
|
|
#include "gtkmm2ext/window_title.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2020-04-06 18:09:38 -04:00
|
|
|
#include "ardour/audioengine.h"
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/profile.h"
|
2012-05-24 02:09:29 -04:00
|
|
|
#include "ardour/session.h"
|
|
|
|
#include "ardour/types.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
#include "ardour_ui.h"
|
2007-02-08 22:36:00 -05:00
|
|
|
#include "keyboard.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "public_editor.h"
|
|
|
|
#include "audio_clock.h"
|
2005-11-28 10:29:49 -05:00
|
|
|
#include "actions.h"
|
2012-05-31 19:14:03 -04:00
|
|
|
#include "main_clock.h"
|
2016-02-25 11:08:33 -05:00
|
|
|
#include "mixer_ui.h"
|
2020-10-26 17:55:00 -04:00
|
|
|
#include "recorder_ui.h"
|
2021-11-08 20:27:38 -05:00
|
|
|
#include "trigger_page.h"
|
2005-10-10 16:38:53 -04:00
|
|
|
#include "utils.h"
|
2010-07-06 20:40:58 -04:00
|
|
|
#include "midi_tracer.h"
|
2010-08-17 22:20:15 -04:00
|
|
|
#include "global_port_matrix.h"
|
|
|
|
#include "location_ui.h"
|
2011-02-17 13:53:31 -05:00
|
|
|
#include "rc_option_editor.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace ARDOUR;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2005-09-25 16:33:00 -04:00
|
|
|
using namespace Gtkmm2ext;
|
2017-07-15 11:38:28 -04:00
|
|
|
using namespace ArdourWidgets;
|
2005-09-25 14:42:24 -04:00
|
|
|
using namespace Gtk;
|
2005-12-04 23:11:08 -05:00
|
|
|
using namespace Glib;
|
2014-06-25 15:27:37 -04:00
|
|
|
using namespace ARDOUR_UI_UTILS;
|
2021-06-18 16:26:22 -04:00
|
|
|
using namespace Menu_Helpers;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2010-02-08 19:50:24 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::setup_tooltips ()
|
|
|
|
{
|
2016-05-02 14:24:54 -04:00
|
|
|
ArdourCanvas::Canvas::set_tooltip_timeout (Gtk::Settings::get_default()->property_gtk_tooltip_timeout ());
|
|
|
|
|
2017-01-20 18:06:44 -05:00
|
|
|
parameter_changed("click-gain");
|
2015-03-16 14:04:17 -04:00
|
|
|
set_tip (error_alert_button, _("Show Error Log and acknowledge warnings"));
|
2010-02-08 19:50:24 -05:00
|
|
|
|
2010-11-25 15:37:39 -05:00
|
|
|
synchronize_sync_source_and_video_pullup ();
|
2010-08-30 21:49:33 -04:00
|
|
|
|
2010-02-08 19:50:24 -05:00
|
|
|
editor->setup_tooltips ();
|
|
|
|
}
|
|
|
|
|
2010-04-20 22:24:38 -04:00
|
|
|
bool
|
|
|
|
ARDOUR_UI::status_bar_button_press (GdkEventButton* ev)
|
|
|
|
{
|
|
|
|
bool handled = false;
|
|
|
|
|
|
|
|
switch (ev->button) {
|
|
|
|
case 1:
|
|
|
|
status_bar_label.set_text ("");
|
|
|
|
handled = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return handled;
|
|
|
|
}
|
|
|
|
|
2018-02-20 05:06:37 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::display_message (const char* prefix, gint prefix_len, RefPtr<TextBuffer::Tag> ptag, RefPtr<TextBuffer::Tag> mtag, const char* msg)
|
|
|
|
{
|
|
|
|
UI::display_message (prefix, prefix_len, ptag, mtag, msg);
|
|
|
|
|
|
|
|
ArdourLogLevel ll = LogLevelNone;
|
|
|
|
|
|
|
|
if (strcmp (prefix, _("[ERROR]: ")) == 0) {
|
|
|
|
ll = LogLevelError;
|
|
|
|
} else if (strcmp (prefix, _("[WARNING]: ")) == 0) {
|
|
|
|
ll = LogLevelWarning;
|
|
|
|
} else if (strcmp (prefix, _("[INFO]: ")) == 0) {
|
|
|
|
ll = LogLevelInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
_log_not_acknowledged = std::max(_log_not_acknowledged, ll);
|
|
|
|
}
|
|
|
|
|
2010-03-19 16:53:22 -04:00
|
|
|
XMLNode*
|
|
|
|
ARDOUR_UI::tearoff_settings (const char* name) const
|
|
|
|
{
|
2010-11-25 15:37:39 -05:00
|
|
|
XMLNode* ui_node = Config->extra_xml(X_("UI"));
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-11-25 15:37:39 -05:00
|
|
|
if (ui_node) {
|
|
|
|
XMLNode* tearoff_node = ui_node->child (X_("Tearoffs"));
|
|
|
|
if (tearoff_node) {
|
|
|
|
XMLNode* mnode = tearoff_node->child (name);
|
|
|
|
return mnode;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2010-03-19 16:53:22 -04:00
|
|
|
}
|
|
|
|
|
2015-01-02 09:44:54 -05:00
|
|
|
#define PX_SCALE(px) std::max((float)px, rintf((float)px * UIConfiguration::instance().get_ui_scale()))
|
2015-04-18 13:42:00 -04:00
|
|
|
|
2016-02-25 11:08:33 -05:00
|
|
|
static
|
|
|
|
bool drag_failed (const Glib::RefPtr<Gdk::DragContext>& context, DragResult result, Tabbable* tab)
|
|
|
|
{
|
|
|
|
if (result == Gtk::DRAG_RESULT_NO_TARGET) {
|
|
|
|
tab->detach ();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::setup_transport ()
|
|
|
|
{
|
|
|
|
RefPtr<Action> act;
|
|
|
|
/* setup actions */
|
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
/* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
|
2015-03-20 17:12:40 -04:00
|
|
|
error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
|
2018-12-10 08:33:31 -05:00
|
|
|
act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
|
2015-03-16 21:05:02 -04:00
|
|
|
error_alert_button.set_related_action(act);
|
2015-03-17 06:59:30 -04:00
|
|
|
error_alert_button.set_fallthrough_to_parent(true);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2018-12-10 08:33:31 -05:00
|
|
|
editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
|
|
|
|
mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
|
|
|
|
prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
|
2020-10-26 17:55:00 -04:00
|
|
|
recorder_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-recorder-visibility")));
|
2021-11-08 20:27:38 -05:00
|
|
|
trigger_page_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-trigger-visibility")));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
/* connect signals */
|
2022-10-07 18:12:27 -04:00
|
|
|
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (primary_clock, &MainClock::set), false));
|
|
|
|
ARDOUR_UI::Clock.connect (sigc::bind (sigc::mem_fun (secondary_clock, &MainClock::set), false));
|
2015-04-18 13:42:00 -04:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
editor_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), editor));
|
|
|
|
mixer_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), mixer));
|
|
|
|
prefs_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), rc_option_editor));
|
2020-10-26 17:55:00 -04:00
|
|
|
recorder_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), recorder));
|
2021-11-08 20:27:38 -05:00
|
|
|
trigger_page_visibility_button.signal_drag_failed().connect (sigc::bind (sigc::ptr_fun (drag_failed), trigger_page));
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
/* catch context clicks so that we can show a menu on these buttons */
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
editor_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("editor")), false);
|
|
|
|
mixer_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("mixer")), false);
|
|
|
|
prefs_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("preferences")), false);
|
2020-10-26 17:55:00 -04:00
|
|
|
recorder_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("recorder")), false);
|
2021-11-08 20:27:38 -05:00
|
|
|
trigger_page_visibility_button.signal_button_press_event().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::tabbable_visibility_button_press), X_("trigger")), false);
|
2011-11-07 15:06:13 -05:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
/* setup widget style/name */
|
2011-11-07 15:06:13 -05:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
editor_visibility_button.set_name (X_("page switch button"));
|
|
|
|
mixer_visibility_button.set_name (X_("page switch button"));
|
|
|
|
prefs_visibility_button.set_name (X_("page switch button"));
|
2020-10-26 17:55:00 -04:00
|
|
|
recorder_visibility_button.set_name (X_("page switch button"));
|
2021-11-08 20:27:38 -05:00
|
|
|
trigger_page_visibility_button.set_name (X_("page switch button"));
|
2011-11-07 15:06:13 -05:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
/* and widget text */
|
2008-01-10 16:20:59 -05:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
/* and tooltips */
|
2014-04-10 13:30:25 -04:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
Gtkmm2ext::UI::instance()->set_tip (editor_visibility_button,
|
2022-01-25 20:50:45 -05:00
|
|
|
string_compose (_("Left-Click to show the %1 window\n"
|
|
|
|
"Right-click to show more options"), editor->name()));
|
2014-04-10 13:30:25 -04:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
Gtkmm2ext::UI::instance()->set_tip (mixer_visibility_button,
|
2022-01-25 20:50:45 -05:00
|
|
|
string_compose (_("Left-Click to show the %1 window\n"
|
|
|
|
"Right-click to show more options"), mixer->name()));
|
2014-04-10 13:30:25 -04:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
Gtkmm2ext::UI::instance()->set_tip (prefs_visibility_button,
|
2022-01-25 20:50:45 -05:00
|
|
|
string_compose (_("Left-Click to show the %1 window\n"
|
|
|
|
"Right-click to show more options"), rc_option_editor->name()));
|
2011-06-09 17:51:15 -04:00
|
|
|
|
2020-10-26 17:55:00 -04:00
|
|
|
Gtkmm2ext::UI::instance()->set_tip (recorder_visibility_button,
|
2022-01-25 20:50:45 -05:00
|
|
|
string_compose (_("Left-Click to show the %1 window\n"
|
|
|
|
"Right-click to show more options"), recorder->name()));
|
2020-10-26 17:55:00 -04:00
|
|
|
|
2021-11-08 20:27:38 -05:00
|
|
|
Gtkmm2ext::UI::instance()->set_tip (trigger_page_visibility_button,
|
2022-01-25 20:50:45 -05:00
|
|
|
string_compose (_("Left-Click to show the %1 window\n"
|
|
|
|
"Right-click to show more options"), trigger_page->name()));
|
2021-11-08 20:27:38 -05:00
|
|
|
|
2011-11-09 12:29:23 -05:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
/* transport control size-group */
|
2011-06-03 18:18:47 -04:00
|
|
|
|
2017-01-18 09:28:25 -05:00
|
|
|
//tab selections
|
2021-11-08 20:27:38 -05:00
|
|
|
button_height_size_group->add_widget (trigger_page_visibility_button);
|
2020-10-26 17:55:00 -04:00
|
|
|
button_height_size_group->add_widget (recorder_visibility_button);
|
2016-12-17 23:32:38 -05:00
|
|
|
button_height_size_group->add_widget (editor_visibility_button);
|
|
|
|
button_height_size_group->add_widget (mixer_visibility_button);
|
2020-10-26 17:55:00 -04:00
|
|
|
button_height_size_group->add_widget (prefs_visibility_button);
|
2016-12-17 23:32:38 -05:00
|
|
|
|
2016-12-11 11:24:30 -05:00
|
|
|
/* and the main table layout */
|
2024-10-24 13:31:19 -04:00
|
|
|
int vpadding = 3;
|
|
|
|
int hpadding = 3;
|
2016-12-18 17:20:14 -05:00
|
|
|
int col = 0;
|
|
|
|
#define TCOL col, col + 1
|
|
|
|
|
2024-10-24 13:31:19 -04:00
|
|
|
tabbables_table.attach (recorder_visibility_button, TCOL, 0, 1 , FILL, FILL, hpadding, vpadding);
|
|
|
|
tabbables_table.attach (trigger_page_visibility_button, TCOL, 1, 2 , FILL, FILL, hpadding, vpadding);
|
2020-10-26 17:55:00 -04:00
|
|
|
++col;
|
2024-10-24 13:31:19 -04:00
|
|
|
tabbables_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, FILL, hpadding, vpadding);
|
|
|
|
tabbables_table.attach (mixer_visibility_button, TCOL, 1, 2 , FILL, FILL, hpadding, vpadding);
|
2016-12-18 17:20:14 -05:00
|
|
|
++col;
|
2016-12-16 19:43:09 -05:00
|
|
|
|
2024-10-24 13:31:19 -04:00
|
|
|
tabbables_table.show_all ();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
2015-04-18 13:42:00 -04:00
|
|
|
#undef PX_SCALE
|
2016-12-18 17:20:14 -05:00
|
|
|
#undef TCOL
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2015-03-14 12:28:20 -04:00
|
|
|
bool
|
2015-03-17 06:59:30 -04:00
|
|
|
ARDOUR_UI::error_alert_press (GdkEventButton* ev)
|
2015-03-14 12:28:20 -04:00
|
|
|
{
|
2015-03-20 17:48:53 -04:00
|
|
|
bool do_toggle = true;
|
2015-03-20 17:12:40 -04:00
|
|
|
if (ev->button == 1) {
|
2015-03-20 17:48:53 -04:00
|
|
|
if (_log_not_acknowledged == LogLevelError) {
|
|
|
|
// just acknowledge the error, don't hide the log if it's already visible
|
2019-02-28 17:54:42 -05:00
|
|
|
RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("toggle-log-window"));
|
|
|
|
if (tact->get_active()) {
|
2015-03-20 17:48:53 -04:00
|
|
|
do_toggle = false;
|
|
|
|
}
|
|
|
|
}
|
2015-03-20 17:12:40 -04:00
|
|
|
_log_not_acknowledged = LogLevelNone;
|
|
|
|
error_blink (false); // immediate acknowledge
|
2015-03-17 06:59:30 -04:00
|
|
|
}
|
2015-03-20 17:48:53 -04:00
|
|
|
// maybe fall through to to button toggle
|
|
|
|
return !do_toggle;
|
2015-03-14 12:28:20 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::error_blink (bool onoff)
|
|
|
|
{
|
2015-03-16 14:04:17 -04:00
|
|
|
switch (_log_not_acknowledged) {
|
|
|
|
case LogLevelError:
|
|
|
|
// blink
|
|
|
|
if (onoff) {
|
|
|
|
error_alert_button.set_custom_led_color(0xff0000ff); // bright red
|
|
|
|
} else {
|
|
|
|
error_alert_button.set_custom_led_color(0x880000ff); // dark red
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case LogLevelWarning:
|
|
|
|
error_alert_button.set_custom_led_color(0xccaa00ff); // yellow
|
|
|
|
break;
|
|
|
|
case LogLevelInfo:
|
|
|
|
error_alert_button.set_custom_led_color(0x88cc00ff); // lime green
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
error_alert_button.set_custom_led_color(0x333333ff); // gray
|
|
|
|
break;
|
2015-03-14 12:28:20 -04:00
|
|
|
}
|
|
|
|
}
|
2005-12-21 16:37:18 -05:00
|
|
|
|
2020-02-27 16:25:37 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::set_punch_sensitivity ()
|
|
|
|
{
|
|
|
|
bool can_punch = _session && _session->punch_is_possible() && _session->locations()->auto_punch_location ();
|
|
|
|
ActionManager::get_action ("Transport", "TogglePunchIn")->set_sensitive (can_punch);
|
|
|
|
ActionManager::get_action ("Transport", "TogglePunchOut")->set_sensitive (can_punch);
|
|
|
|
}
|
|
|
|
|
2005-12-21 16:37:18 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::editor_realized ()
|
|
|
|
{
|
2024-10-18 19:51:44 -04:00
|
|
|
std::function<void (string)> pc (std::bind (&ARDOUR_UI::parameter_changed, this, _1));
|
2009-12-12 10:02:15 -05:00
|
|
|
Config->map_parameters (pc);
|
2006-09-25 17:24:00 -04:00
|
|
|
|
2015-01-02 09:44:54 -05:00
|
|
|
UIConfiguration::instance().reset_dpi ();
|
2005-12-21 16:37:18 -05:00
|
|
|
}
|
2005-12-31 13:20:42 -05:00
|
|
|
|
2006-01-19 13:05:31 -05:00
|
|
|
void
|
2012-06-13 00:21:46 -04:00
|
|
|
ARDOUR_UI::maximise_editing_space ()
|
2006-01-19 13:05:31 -05:00
|
|
|
{
|
2012-01-24 22:03:25 -05:00
|
|
|
if (editor) {
|
2012-06-13 00:21:46 -04:00
|
|
|
editor->maximise_editing_space ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::restore_editing_space ()
|
|
|
|
{
|
|
|
|
if (editor) {
|
|
|
|
editor->restore_editing_space ();
|
2006-01-19 13:05:31 -05:00
|
|
|
}
|
|
|
|
}
|
2011-02-17 13:53:31 -05:00
|
|
|
|
2014-07-14 13:19:52 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::show_ui_prefs ()
|
|
|
|
{
|
2015-07-27 17:12:35 -04:00
|
|
|
if (rc_option_editor) {
|
|
|
|
show_tabbable (rc_option_editor);
|
2017-01-03 04:05:05 -05:00
|
|
|
rc_option_editor->set_current_page (_("Appearance"));
|
2015-07-27 17:12:35 -04:00
|
|
|
}
|
2014-07-14 13:19:52 -04:00
|
|
|
}
|
2021-07-06 20:11:06 -04:00
|
|
|
|
2020-07-20 23:51:56 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::show_mixer_prefs ()
|
|
|
|
{
|
|
|
|
if (rc_option_editor) {
|
|
|
|
show_tabbable (rc_option_editor);
|
2021-02-18 10:46:57 -05:00
|
|
|
rc_option_editor->set_current_page (_("Signal Flow"));
|
2020-07-20 23:51:56 -04:00
|
|
|
}
|
|
|
|
}
|
2014-07-14 13:19:52 -04:00
|
|
|
|
2021-07-06 20:11:06 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::show_plugin_prefs ()
|
|
|
|
{
|
|
|
|
if (rc_option_editor) {
|
|
|
|
show_tabbable (rc_option_editor);
|
|
|
|
rc_option_editor->set_current_page (_("Plugins"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-17 13:53:31 -05:00
|
|
|
bool
|
|
|
|
ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
|
|
|
|
{
|
|
|
|
if (ev->button != 3) {
|
|
|
|
/* this handler is just for button-3 clicks */
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-07-27 17:12:35 -04:00
|
|
|
show_tabbable (rc_option_editor);
|
2017-01-03 04:05:05 -05:00
|
|
|
rc_option_editor->set_current_page (_("Metronome"));
|
2011-02-17 13:53:31 -05:00
|
|
|
return true;
|
|
|
|
}
|
2011-12-01 18:22:05 -05:00
|
|
|
|
|
|
|
void
|
2014-07-03 13:25:35 -04:00
|
|
|
ARDOUR_UI::toggle_follow_edits ()
|
2011-12-01 18:22:05 -05:00
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("ToggleFollowEdits"));
|
2015-01-02 09:44:54 -05:00
|
|
|
UIConfiguration::instance().set_follow_edits (tact->get_active ());
|
2011-12-01 18:22:05 -05:00
|
|
|
}
|
2012-01-30 17:53:22 -05:00
|
|
|
|
2015-07-09 13:56:12 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::update_title ()
|
|
|
|
{
|
2020-10-01 12:27:59 -04:00
|
|
|
stringstream snap_label;
|
|
|
|
snap_label << X_("<span weight=\"ultralight\">")
|
|
|
|
<< _("Name")
|
|
|
|
<< X_("</span>: ");
|
|
|
|
|
2015-07-09 13:56:12 -04:00
|
|
|
if (_session) {
|
|
|
|
bool dirty = _session->dirty();
|
2015-10-05 10:17:49 -04:00
|
|
|
|
2015-07-09 13:56:12 -04:00
|
|
|
string session_name;
|
|
|
|
|
|
|
|
if (_session->snap_name() != _session->name()) {
|
|
|
|
session_name = _session->snap_name();
|
|
|
|
} else {
|
|
|
|
session_name = _session->name();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dirty) {
|
|
|
|
session_name = "*" + session_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
WindowTitle title (session_name);
|
|
|
|
title += Glib::get_application_name();
|
|
|
|
_main_window.set_title (title.get_string());
|
2020-10-01 12:27:59 -04:00
|
|
|
|
|
|
|
snap_label << Gtkmm2ext::markup_escape_text (session_name);
|
2015-07-09 13:56:12 -04:00
|
|
|
} else {
|
|
|
|
WindowTitle title (Glib::get_application_name());
|
|
|
|
_main_window.set_title (title.get_string());
|
2020-10-01 12:27:59 -04:00
|
|
|
snap_label << "-";
|
2015-07-09 13:56:12 -04:00
|
|
|
}
|
2020-10-01 12:27:59 -04:00
|
|
|
snapshot_name_label.set_markup (snap_label.str());
|
2015-07-09 13:56:12 -04:00
|
|
|
}
|
2018-12-03 19:55:52 -05:00
|
|
|
|