2005-12-31 13:20:42 -05:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2005-2019 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2006-2007 Doug McLain <doug@nostar.net>
|
|
|
|
* Copyright (C) 2006-2007 Nick Mainsbridge <mainsbridge@gmail.com>
|
|
|
|
* Copyright (C) 2006 Sampo Savolainen <v2@iki.fi>
|
|
|
|
* Copyright (C) 2007-2015 Tim Mayberry <mojofunk@gmail.com>
|
|
|
|
* Copyright (C) 2008-2012 David Robillard <d@drobilla.net>
|
|
|
|
* Copyright (C) 2008 Hans Baier <hansfbaier@googlemail.com>
|
|
|
|
* Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* 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-12-31 13:20:42 -05:00
|
|
|
|
2009-07-12 20:26:28 -04:00
|
|
|
#ifdef WAF_BUILD
|
|
|
|
#include "gtk2ardour-config.h"
|
|
|
|
#endif
|
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/convert.h"
|
|
|
|
#include "pbd/stacktrace.h"
|
2017-01-16 13:54:20 -05:00
|
|
|
#include "pbd/unwind.h"
|
2006-04-25 16:23:50 -04:00
|
|
|
|
2020-06-30 10:46:06 -04:00
|
|
|
#include "ardour/lv2_plugin.h"
|
2010-10-18 18:02:12 -04:00
|
|
|
#include "ardour/rc_configuration.h"
|
2012-05-24 02:09:29 -04:00
|
|
|
#include "ardour/session.h"
|
2018-10-05 12:35:13 -04:00
|
|
|
#include "ardour/transport_master_manager.h"
|
2005-12-31 13:20:42 -05:00
|
|
|
|
2017-07-17 14:12:33 -04:00
|
|
|
#include "gtkmm2ext/utils.h"
|
|
|
|
#include "waveview/wave_view.h"
|
2007-12-15 18:29:30 -05:00
|
|
|
|
2020-01-15 16:01:30 -05:00
|
|
|
#include "ardour_message.h"
|
2011-06-02 13:50:37 -04:00
|
|
|
#include "audio_clock.h"
|
2005-12-31 13:20:42 -05:00
|
|
|
#include "ardour_ui.h"
|
|
|
|
#include "actions.h"
|
2006-01-07 21:56:49 -05:00
|
|
|
#include "gui_thread.h"
|
2008-01-10 16:20:59 -05:00
|
|
|
#include "public_editor.h"
|
2012-05-31 19:14:03 -04:00
|
|
|
#include "main_clock.h"
|
2006-01-07 21:56:49 -05:00
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2005-12-31 13:20:42 -05:00
|
|
|
|
|
|
|
using namespace Gtk;
|
2006-01-07 21:56:49 -05:00
|
|
|
using namespace Gtkmm2ext;
|
2005-12-31 13:20:42 -05:00
|
|
|
using namespace ARDOUR;
|
2006-06-21 19:01:03 -04:00
|
|
|
using namespace PBD;
|
2017-07-15 11:38:28 -04:00
|
|
|
using namespace ArdourWidgets;
|
2005-12-31 13:20:42 -05:00
|
|
|
|
2009-11-09 23:30:08 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_external_sync()
|
|
|
|
{
|
2010-11-25 15:37:39 -05:00
|
|
|
if (_session) {
|
2018-10-05 12:35:13 -04:00
|
|
|
if (_session->config.get_video_pullup() != 0.0f && (TransportMasterManager::instance().current()->type() == Engine)) {
|
2020-04-25 20:59:25 -04:00
|
|
|
ArdourMessageDialog msg (_("It is not possible to use JACK as the sync source\n when the pull up/down setting is non-zero."));
|
2018-10-05 12:35:13 -04:00
|
|
|
msg.run ();
|
|
|
|
return;
|
2010-11-25 15:37:39 -05:00
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2013-01-05 05:40:07 -05:00
|
|
|
ActionManager::toggle_config_state_foo ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::set_external_sync), sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
|
|
|
|
|
2012-11-12 11:49:11 -05:00
|
|
|
/* activating a slave is a session-property.
|
|
|
|
* The slave type is a RC property.
|
|
|
|
* When the slave is active is must not be reconfigured.
|
|
|
|
* This is a UI limitation, imposed by audio-clock and
|
|
|
|
* status displays which combine RC-config & session-properties.
|
|
|
|
*
|
2018-09-18 18:52:20 -04:00
|
|
|
* Notify RCOptionEditor by emitting a signal if the active
|
2012-11-12 11:49:11 -05:00
|
|
|
* status changed:
|
|
|
|
*/
|
|
|
|
Config->ParameterChanged("sync-source");
|
2010-11-25 15:37:39 -05:00
|
|
|
}
|
2009-11-09 23:30:08 -05:00
|
|
|
}
|
|
|
|
|
2006-09-25 17:24:00 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_time_master ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::toggle_config_state_foo ("Transport", "ToggleTimeMaster", sigc::mem_fun (_session->config, &SessionConfiguration::set_jack_time_master), sigc::mem_fun (_session->config, &SessionConfiguration::get_jack_time_master));
|
2006-09-25 17:24:00 -04:00
|
|
|
}
|
|
|
|
|
2005-12-31 13:20:42 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_send_mtc ()
|
|
|
|
{
|
2016-02-27 19:11:48 -05:00
|
|
|
ActionManager::toggle_config_state ("Options", "SendMTC", &RCConfiguration::set_send_mtc, &RCConfiguration::get_send_mtc);
|
2005-12-31 13:20:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_send_mmc ()
|
|
|
|
{
|
2016-02-27 19:11:48 -05:00
|
|
|
ActionManager::toggle_config_state ("Options", "SendMMC", &RCConfiguration::set_send_mmc, &RCConfiguration::get_send_mmc);
|
2005-12-31 13:20:42 -05:00
|
|
|
}
|
|
|
|
|
2008-11-26 18:32:55 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_send_midi_clock ()
|
|
|
|
{
|
2016-02-27 19:11:48 -05:00
|
|
|
ActionManager::toggle_config_state ("Options", "SendMidiClock", &RCConfiguration::set_send_midi_clock, &RCConfiguration::get_send_midi_clock);
|
2008-11-26 18:32:55 -05:00
|
|
|
}
|
|
|
|
|
2005-12-31 13:20:42 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_use_mmc ()
|
|
|
|
{
|
2016-02-27 19:11:48 -05:00
|
|
|
ActionManager::toggle_config_state ("Options", "UseMMC", &RCConfiguration::set_mmc_control, &RCConfiguration::get_mmc_control);
|
2005-12-31 13:20:42 -05:00
|
|
|
}
|
|
|
|
|
2006-01-08 00:19:38 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_auto_input ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::toggle_config_state_foo ("Transport", "ToggleAutoInput", sigc::mem_fun (_session->config, &SessionConfiguration::set_auto_input), sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_input));
|
2006-01-08 00:19:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_auto_play ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::toggle_config_state_foo ("Transport", "ToggleAutoPlay", sigc::mem_fun (_session->config, &SessionConfiguration::set_auto_play), sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_play));
|
2006-01-08 00:19:38 -05:00
|
|
|
}
|
|
|
|
|
2015-06-25 12:47:29 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_auto_return ()
|
|
|
|
{
|
|
|
|
ActionManager::toggle_config_state_foo ("Transport", "ToggleAutoReturn", sigc::mem_fun (_session->config, &SessionConfiguration::set_auto_return), sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_return));
|
|
|
|
}
|
|
|
|
|
2006-01-08 00:19:38 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_click ()
|
|
|
|
{
|
2009-05-13 20:13:27 -04:00
|
|
|
ActionManager::toggle_config_state ("Transport", "ToggleClick", &RCConfiguration::set_clicking, &RCConfiguration::get_clicking);
|
2006-01-08 00:19:38 -05:00
|
|
|
}
|
|
|
|
|
2017-01-16 13:54:20 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_session_monitoring_in ()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorIn"));
|
2017-01-18 06:25:02 -05:00
|
|
|
|
|
|
|
if (tact->get_active() && _session->config.get_session_monitoring () == MonitorInput) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!tact->get_active() && _session->config.get_session_monitoring () != MonitorInput) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-01-16 13:54:20 -05:00
|
|
|
if (tact->get_active()) {
|
|
|
|
_session->config.set_session_monitoring (MonitorInput);
|
|
|
|
} else {
|
|
|
|
_session->config.set_session_monitoring (MonitorAuto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_session_monitoring_disk ()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorDisk"));
|
2017-01-18 06:25:02 -05:00
|
|
|
if (tact->get_active() && _session->config.get_session_monitoring () == MonitorDisk) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (!tact->get_active() && _session->config.get_session_monitoring () != MonitorDisk) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-01-16 13:54:20 -05:00
|
|
|
if (tact->get_active()) {
|
|
|
|
_session->config.set_session_monitoring (MonitorDisk);
|
|
|
|
} else {
|
|
|
|
_session->config.set_session_monitoring (MonitorAuto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::unset_dual_punch ()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "TogglePunch");
|
|
|
|
if (tact) {
|
|
|
|
ignore_dual_punch = true;
|
|
|
|
tact->set_active (false);
|
|
|
|
ignore_dual_punch = false;
|
2008-03-17 16:54:03 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_punch ()
|
|
|
|
{
|
|
|
|
if (ignore_dual_punch) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "TogglePunch");
|
2008-03-17 16:54:03 -04:00
|
|
|
|
2019-02-28 17:54:42 -05:00
|
|
|
/* drive the other two actions from this one */
|
|
|
|
Glib::RefPtr<ToggleAction> in_action = ActionManager::get_toggle_action ("Transport", "TogglePunchIn");
|
|
|
|
Glib::RefPtr<ToggleAction> out_action = ActionManager::get_toggle_action ("Transport", "TogglePunchOut");
|
2008-03-17 16:54:03 -04:00
|
|
|
|
2019-02-28 17:54:42 -05:00
|
|
|
in_action->set_active (tact->get_active());
|
|
|
|
out_action->set_active (tact->get_active());
|
2008-03-17 16:54:03 -04:00
|
|
|
}
|
|
|
|
|
2006-01-08 00:19:38 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_punch_in ()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("TogglePunchIn"));
|
2009-10-20 17:58:46 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (tact->get_active() != _session->config.get_punch_in()) {
|
|
|
|
_session->config.set_punch_in (tact->get_active ());
|
2009-10-20 17:58:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tact->get_active()) {
|
|
|
|
/* if punch-in is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
|
|
|
|
to avoid confusing the user */
|
|
|
|
show_loop_punch_ruler_and_disallow_hide ();
|
|
|
|
}
|
|
|
|
|
|
|
|
reenable_hide_loop_punch_ruler_if_appropriate ();
|
2006-01-08 00:19:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_punch_out ()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("TogglePunchOut"));
|
2009-10-20 17:58:46 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (tact->get_active() != _session->config.get_punch_out()) {
|
|
|
|
_session->config.set_punch_out (tact->get_active ());
|
2009-10-20 17:58:46 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (tact->get_active()) {
|
|
|
|
/* if punch-out is turned on, make sure the loop/punch ruler is visible, and stop it being hidden,
|
|
|
|
to avoid confusing the user */
|
|
|
|
show_loop_punch_ruler_and_disallow_hide ();
|
|
|
|
}
|
|
|
|
|
|
|
|
reenable_hide_loop_punch_ruler_if_appropriate ();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::show_loop_punch_ruler_and_disallow_hide ()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
2009-10-20 17:58:46 -04:00
|
|
|
|
2019-02-28 17:54:42 -05:00
|
|
|
tact->set_sensitive (false);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-10-20 17:58:46 -04:00
|
|
|
if (!tact->get_active()) {
|
|
|
|
tact->set_active ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is a bit of a silly name for a method */
|
|
|
|
void
|
|
|
|
ARDOUR_UI::reenable_hide_loop_punch_ruler_if_appropriate ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
if (!_session->config.get_punch_in() && !_session->config.get_punch_out()) {
|
2009-10-20 17:58:46 -04:00
|
|
|
/* if punch in/out are now both off, reallow hiding of the loop/punch ruler */
|
2018-12-10 08:33:31 -05:00
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
2009-10-20 17:58:46 -04:00
|
|
|
if (act) {
|
|
|
|
act->set_sensitive (true);
|
|
|
|
}
|
|
|
|
}
|
2006-01-08 00:19:38 -05:00
|
|
|
}
|
|
|
|
|
2006-09-25 17:24:00 -04:00
|
|
|
void
|
2006-08-31 09:23:43 -04:00
|
|
|
ARDOUR_UI::toggle_video_sync()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "ToggleVideoSync");
|
|
|
|
_session->config.set_use_video_sync (tact->get_active());
|
2006-08-31 09:23:43 -04:00
|
|
|
}
|
|
|
|
|
2006-01-19 13:05:31 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_editing_space()
|
|
|
|
{
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Common", "ToggleMaximalEditor");
|
|
|
|
if (tact->get_active()) {
|
|
|
|
maximise_editing_space ();
|
|
|
|
} else {
|
|
|
|
restore_editing_space ();
|
2006-01-19 13:05:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-28 19:23:48 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_latency_switch ()
|
|
|
|
{
|
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Main", "ToggleLatencyCompensation");
|
|
|
|
ARDOUR::Latent::force_zero_latency (tact->get_active());
|
|
|
|
}
|
|
|
|
|
2006-01-07 21:56:49 -05:00
|
|
|
void
|
2009-11-09 15:05:18 -05:00
|
|
|
ARDOUR_UI::setup_session_options ()
|
2006-01-07 21:56:49 -05:00
|
|
|
{
|
2012-04-25 08:58:19 -04:00
|
|
|
_session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
|
2009-12-12 10:02:15 -05:00
|
|
|
boost::function<void (std::string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
|
2009-12-17 13:24:23 -05:00
|
|
|
_session->config.map_parameters (pc);
|
2006-01-07 21:56:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2009-05-15 21:22:43 -04:00
|
|
|
ARDOUR_UI::parameter_changed (std::string p)
|
2006-09-25 17:24:00 -04:00
|
|
|
{
|
2009-11-09 15:05:18 -05:00
|
|
|
if (p == "external-sync") {
|
2009-11-09 23:30:08 -05:00
|
|
|
|
2018-09-18 18:52:20 -04:00
|
|
|
/* session parameter */
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
|
2009-11-09 23:30:08 -05:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (!_session->config.get_external_sync()) {
|
2016-12-18 17:17:29 -05:00
|
|
|
sync_button.set_text (S_("SyncSource|Int."));
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
|
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
|
|
|
|
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (true);
|
2009-11-09 15:05:18 -05:00
|
|
|
} else {
|
2015-12-10 06:47:08 -05:00
|
|
|
/* XXX we need to make sure that auto-play is off as well as insensitive */
|
2018-12-10 08:33:31 -05:00
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
|
|
|
|
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (false);
|
2019-02-28 18:46:42 -05:00
|
|
|
if (!_session->synced_to_engine()) {
|
|
|
|
/* JACK transport allows auto-return */
|
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
|
|
|
|
}
|
2007-04-11 09:07:51 -04:00
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2018-09-18 18:52:20 -04:00
|
|
|
} else if (p == "sync-source") {
|
|
|
|
|
|
|
|
/* app parameter (RC config) */
|
|
|
|
|
|
|
|
if (_session) {
|
|
|
|
if (!_session->config.get_external_sync()) {
|
|
|
|
sync_button.set_text (S_("SyncSource|Int."));
|
|
|
|
} else {
|
2018-10-05 12:35:13 -04:00
|
|
|
sync_button.set_text (TransportMasterManager::instance().current()->display_name());
|
2018-09-18 18:52:20 -04:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* changing sync source without a session is unlikely/impossible , except during startup */
|
2018-10-05 12:35:13 -04:00
|
|
|
sync_button.set_text (TransportMasterManager::instance().current()->display_name());
|
2018-09-18 18:52:20 -04:00
|
|
|
}
|
|
|
|
|
2014-07-28 16:55:20 -04:00
|
|
|
} else if (p == "follow-edits") {
|
2012-01-30 17:53:22 -05:00
|
|
|
|
2014-12-22 13:39:41 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &UIConfiguration::get_follow_edits);
|
2012-01-30 17:53:22 -05:00
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "send-mtc") {
|
2006-09-25 17:24:00 -04:00
|
|
|
|
2016-02-27 19:11:48 -05:00
|
|
|
ActionManager::map_some_state ("Options", "SendMTC", &RCConfiguration::get_send_mtc);
|
2006-09-25 17:24:00 -04:00
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "send-mmc") {
|
2006-09-25 17:24:00 -04:00
|
|
|
|
2016-02-27 19:11:48 -05:00
|
|
|
ActionManager::map_some_state ("Options", "SendMMC", &RCConfiguration::get_send_mmc);
|
2006-09-25 17:24:00 -04:00
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "mmc-control") {
|
2016-02-27 19:11:48 -05:00
|
|
|
ActionManager::map_some_state ("Options", "UseMMC", &RCConfiguration::get_mmc_control);
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "auto-play") {
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleAutoPlay", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_play));
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "auto-return") {
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleAutoReturn", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_return));
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "auto-input") {
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleAutoInput", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_input));
|
2017-01-16 13:54:20 -05:00
|
|
|
} else if (p == "session-monitoring") {
|
2019-02-28 17:54:42 -05:00
|
|
|
Glib::RefPtr<ToggleAction> tiact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorIn"));
|
|
|
|
Glib::RefPtr<ToggleAction> tdact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorDisk"));
|
|
|
|
switch (_session->config.get_session_monitoring ()) {
|
|
|
|
case MonitorDisk:
|
|
|
|
tdact->set_active (true);
|
|
|
|
tiact->set_active (false);
|
|
|
|
break;
|
|
|
|
case MonitorInput:
|
|
|
|
tiact->set_active (true);
|
|
|
|
tdact->set_active (false);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
tdact->set_active (false);
|
|
|
|
tiact->set_active (false);
|
|
|
|
break;
|
2017-01-16 13:54:20 -05:00
|
|
|
}
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "punch-out") {
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "TogglePunchOut", sigc::mem_fun (_session->config, &SessionConfiguration::get_punch_out));
|
|
|
|
if (!_session->config.get_punch_out()) {
|
2008-03-17 16:54:03 -04:00
|
|
|
unset_dual_punch ();
|
|
|
|
}
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "punch-in") {
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "TogglePunchIn", sigc::mem_fun (_session->config, &SessionConfiguration::get_punch_in));
|
|
|
|
if (!_session->config.get_punch_in()) {
|
2008-03-17 16:54:03 -04:00
|
|
|
unset_dual_punch ();
|
|
|
|
}
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "clicking") {
|
2009-05-13 20:13:27 -04:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleClick", &RCConfiguration::get_clicking);
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "use-video-sync") {
|
2009-12-17 13:24:23 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleVideoSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_use_video_sync));
|
2010-11-25 15:37:39 -05:00
|
|
|
} else if (p == "sync-source") {
|
2010-08-30 21:49:33 -04:00
|
|
|
|
2010-11-25 15:37:39 -05:00
|
|
|
synchronize_sync_source_and_video_pullup ();
|
2014-08-30 14:57:22 -04:00
|
|
|
set_fps_timeout_connection ();
|
2010-08-30 21:49:33 -04:00
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "show-track-meters") {
|
2014-12-22 13:39:41 -05:00
|
|
|
if (editor) editor->toggle_meter_updating();
|
2017-11-22 16:10:37 -05:00
|
|
|
} else if (p == "primary-clock-delta-mode") {
|
|
|
|
if (UIConfiguration::instance().get_primary_clock_delta_mode() != NoDelta) {
|
2011-11-18 12:06:11 -05:00
|
|
|
primary_clock->set_is_duration (true);
|
|
|
|
primary_clock->set_editable (false);
|
|
|
|
primary_clock->set_widget_name ("transport delta");
|
|
|
|
} else {
|
|
|
|
primary_clock->set_is_duration (false);
|
|
|
|
primary_clock->set_editable (true);
|
|
|
|
primary_clock->set_widget_name ("transport");
|
|
|
|
}
|
2017-11-22 16:10:37 -05:00
|
|
|
} else if (p == "secondary-clock-delta-mode") {
|
|
|
|
if (UIConfiguration::instance().get_secondary_clock_delta_mode() != NoDelta) {
|
2011-11-18 12:06:11 -05:00
|
|
|
secondary_clock->set_is_duration (true);
|
|
|
|
secondary_clock->set_editable (false);
|
|
|
|
secondary_clock->set_widget_name ("secondary delta");
|
|
|
|
} else {
|
|
|
|
secondary_clock->set_is_duration (false);
|
|
|
|
secondary_clock->set_editable (true);
|
|
|
|
secondary_clock->set_widget_name ("secondary");
|
|
|
|
}
|
2013-03-03 08:45:32 -05:00
|
|
|
} else if (p == "super-rapid-clock-update") {
|
2014-08-31 01:54:59 -04:00
|
|
|
if (_session) {
|
|
|
|
stop_clocking ();
|
|
|
|
start_clocking ();
|
|
|
|
}
|
2016-04-26 19:06:01 -04:00
|
|
|
} else if (p == "use-tooltips") {
|
|
|
|
/* this doesn't really belong here but it has to go somewhere */
|
|
|
|
if (UIConfiguration::instance().get_use_tooltips()) {
|
|
|
|
Gtkmm2ext::enable_tooltips ();
|
|
|
|
} else {
|
|
|
|
Gtkmm2ext::disable_tooltips ();
|
|
|
|
}
|
2013-06-21 17:15:56 -04:00
|
|
|
} else if (p == "waveform-gradient-depth") {
|
2017-07-17 14:12:33 -04:00
|
|
|
ArdourWaveView::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
|
2016-12-19 21:11:21 -05:00
|
|
|
} else if (p == "show-mini-timeline") {
|
|
|
|
repack_transport_hbox ();
|
2017-12-28 09:53:40 -05:00
|
|
|
} else if (p == "show-dsp-load-info") {
|
|
|
|
repack_transport_hbox ();
|
2018-01-14 12:41:21 -05:00
|
|
|
} else if (p == "show-disk-space-info") {
|
|
|
|
repack_transport_hbox ();
|
2017-01-16 15:58:53 -05:00
|
|
|
} else if (p == "show-toolbar-recpunch") {
|
|
|
|
repack_transport_hbox ();
|
|
|
|
} else if (p == "show-toolbar-monitoring") {
|
|
|
|
repack_transport_hbox ();
|
2016-12-19 21:11:21 -05:00
|
|
|
} else if (p == "show-toolbar-selclock") {
|
|
|
|
repack_transport_hbox ();
|
2019-09-28 19:23:48 -04:00
|
|
|
} else if (p == "show-toolbar-latency") {
|
|
|
|
repack_transport_hbox ();
|
2020-09-17 16:37:12 -04:00
|
|
|
} else if (p == "show-toolbar-monitor-info") {
|
|
|
|
repack_transport_hbox ();
|
2013-08-03 18:06:29 -04:00
|
|
|
} else if (p == "show-editor-meter") {
|
2016-12-19 21:11:21 -05:00
|
|
|
repack_transport_hbox ();
|
2016-12-21 17:01:34 -05:00
|
|
|
} else if (p == "show-secondary-clock") {
|
|
|
|
update_clock_visibility ();
|
2014-05-26 18:34:27 -04:00
|
|
|
} else if (p == "waveform-scale") {
|
2017-07-17 14:12:33 -04:00
|
|
|
ArdourWaveView::WaveView::set_global_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
|
2015-01-27 20:22:52 -05:00
|
|
|
} else if (p == "widget-prelight") {
|
2015-01-02 09:44:54 -05:00
|
|
|
CairoWidget::set_widget_prelight (UIConfiguration::instance().get_widget_prelight());
|
2014-05-26 18:34:27 -04:00
|
|
|
} else if (p == "waveform-shape") {
|
2017-07-17 14:12:33 -04:00
|
|
|
ArdourWaveView::WaveView::set_global_shape (UIConfiguration::instance().get_waveform_shape() == Rectified
|
|
|
|
? ArdourWaveView::WaveView::Rectified : ArdourWaveView::WaveView::Normal);
|
2014-05-26 18:34:27 -04:00
|
|
|
} else if (p == "show-waveform-clipping") {
|
2017-07-17 14:12:33 -04:00
|
|
|
ArdourWaveView::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
|
2015-06-23 08:18:11 -04:00
|
|
|
} else if (p == "waveform-cache-size") {
|
|
|
|
/* GUI option has units of megabytes; image cache uses units of bytes */
|
2017-07-17 14:12:33 -04:00
|
|
|
ArdourWaveView::WaveView::set_image_cache_size (UIConfiguration::instance().get_waveform_cache_size() * 1048576);
|
2016-06-07 18:29:40 -04:00
|
|
|
} else if (p == "use-wm-visibility") {
|
|
|
|
VisibilityTracker::set_use_window_manager_visibility (UIConfiguration::instance().get_use_wm_visibility());
|
2016-04-24 18:16:08 -04:00
|
|
|
} else if (p == "action-table-columns") {
|
|
|
|
const uint32_t cols = UIConfiguration::instance().get_action_table_columns ();
|
2019-09-02 22:31:35 -04:00
|
|
|
for (int i = 0; i < MAX_LUA_ACTION_BUTTONS; ++i) {
|
2016-12-11 11:24:30 -05:00
|
|
|
const int col = i / 2;
|
2016-04-24 18:16:08 -04:00
|
|
|
if (cols & (1<<col)) {
|
|
|
|
action_script_call_btn[i].show();
|
|
|
|
} else {
|
|
|
|
action_script_call_btn[i].hide();
|
|
|
|
}
|
|
|
|
}
|
2016-12-12 15:48:29 -05:00
|
|
|
} else if (p == "layered-record-mode") {
|
|
|
|
layered_button.set_active (_session->config.get_layered_record_mode ());
|
2016-12-29 17:04:39 -05:00
|
|
|
} else if (p == "flat-buttons") {
|
|
|
|
bool flat = UIConfiguration::instance().get_flat_buttons();
|
|
|
|
if (ArdourButton::flat_buttons () != flat) {
|
|
|
|
ArdourButton::set_flat_buttons (flat);
|
|
|
|
/* force a redraw */
|
|
|
|
gtk_rc_reset_styles (gtk_settings_get_default());
|
2020-06-30 10:46:06 -04:00
|
|
|
LV2Plugin::set_global_ui_style_flat (flat);
|
2016-12-29 17:04:39 -05:00
|
|
|
}
|
2018-10-02 15:28:26 -04:00
|
|
|
} else if (p == "boxy-buttons") {
|
|
|
|
bool boxy = UIConfiguration::instance().get_boxy_buttons();
|
|
|
|
if (ArdourButton::boxy_buttons () != boxy) {
|
|
|
|
ArdourButton::set_boxy_buttons (boxy);
|
|
|
|
/* force a redraw */
|
|
|
|
gtk_rc_reset_styles (gtk_settings_get_default());
|
2020-06-30 10:46:06 -04:00
|
|
|
LV2Plugin::set_global_ui_style_boxy (boxy);
|
2018-10-02 15:28:26 -04:00
|
|
|
}
|
2018-02-09 10:59:39 -05:00
|
|
|
} else if ( (p == "snap-to-region-sync") || (p == "snap-to-region-start") || (p == "snap-to-region-end") ) {
|
|
|
|
if (editor) editor->mark_region_boundary_cache_dirty();
|
2019-08-11 14:37:07 -04:00
|
|
|
} else if (p == "screen-saver-mode") {
|
|
|
|
switch (UIConfiguration::instance().get_screen_saver_mode ()) {
|
|
|
|
using namespace ARDOUR_UI_UTILS;
|
|
|
|
case InhibitWhileRecording:
|
|
|
|
inhibit_screensaver (_session && _session->actively_recording ());
|
|
|
|
break;
|
|
|
|
case InhibitAlways:
|
|
|
|
inhibit_screensaver (true);
|
|
|
|
break;
|
|
|
|
case InhibitNever:
|
|
|
|
inhibit_screensaver (false);
|
|
|
|
break;
|
|
|
|
}
|
2010-11-25 15:37:39 -05:00
|
|
|
}
|
2006-01-07 21:56:49 -05:00
|
|
|
}
|
2009-12-01 08:21:41 -05:00
|
|
|
|
2011-07-02 20:45:15 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::session_parameter_changed (std::string p)
|
|
|
|
{
|
|
|
|
if (p == "native-file-data-format" || p == "native-file-header-format") {
|
|
|
|
update_format ();
|
2014-08-30 14:57:22 -04:00
|
|
|
} else if (p == "timecode-format") {
|
|
|
|
set_fps_timeout_connection ();
|
2014-08-30 14:11:07 -04:00
|
|
|
} else if (p == "video-pullup" || p == "timecode-format") {
|
2014-08-30 14:57:22 -04:00
|
|
|
set_fps_timeout_connection ();
|
|
|
|
|
2014-08-30 14:11:07 -04:00
|
|
|
synchronize_sync_source_and_video_pullup ();
|
|
|
|
reset_main_clocks ();
|
|
|
|
editor->queue_visual_videotimeline_update();
|
2014-08-31 01:12:21 -04:00
|
|
|
} else if (p == "track-name-number") {
|
|
|
|
/* DisplaySuspender triggers _route->redisplay() when going out of scope
|
|
|
|
* which eventually calls reset_controls_layout_width() and re-sets the
|
|
|
|
* track-header width.
|
|
|
|
* see also RouteTimeAxisView::update_track_number_visibility()
|
|
|
|
*/
|
|
|
|
DisplaySuspender ds;
|
2011-07-02 20:45:15 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-01 08:21:41 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::reset_main_clocks ()
|
|
|
|
{
|
2009-12-11 18:29:48 -05:00
|
|
|
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::reset_main_clocks)
|
2009-12-01 08:21:41 -05:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
if (_session) {
|
2017-09-18 12:39:17 -04:00
|
|
|
primary_clock->set (_session->audible_sample(), true);
|
|
|
|
secondary_clock->set (_session->audible_sample(), true);
|
2009-12-01 08:21:41 -05:00
|
|
|
} else {
|
2011-06-02 13:50:37 -04:00
|
|
|
primary_clock->set (0, true);
|
|
|
|
secondary_clock->set (0, true);
|
2009-12-01 08:21:41 -05:00
|
|
|
}
|
|
|
|
}
|
2010-08-30 21:49:33 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::synchronize_sync_source_and_video_pullup ()
|
|
|
|
{
|
2018-12-10 08:33:31 -05:00
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
|
2010-11-25 15:37:39 -05:00
|
|
|
|
|
|
|
if (!act) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!_session) {
|
|
|
|
goto just_label;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_session->config.get_video_pullup() == 0.0f) {
|
|
|
|
/* with no video pull up/down, any sync source is OK */
|
|
|
|
act->set_sensitive (true);
|
|
|
|
} else {
|
|
|
|
/* can't sync to JACK if video pullup != 0.0 */
|
2018-10-05 12:35:13 -04:00
|
|
|
if (TransportMasterManager::instance().current()->type() == Engine) {
|
2010-11-25 15:37:39 -05:00
|
|
|
act->set_sensitive (false);
|
|
|
|
} else {
|
|
|
|
act->set_sensitive (true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX should really be able to set the video pull up
|
|
|
|
action to insensitive/sensitive, but there is no action.
|
|
|
|
FIXME
|
|
|
|
*/
|
2010-08-30 21:49:33 -04:00
|
|
|
|
|
|
|
just_label:
|
2010-11-25 15:37:39 -05:00
|
|
|
if (act->get_sensitive ()) {
|
|
|
|
set_tip (sync_button, _("Enable/Disable external positional sync"));
|
|
|
|
} else {
|
|
|
|
set_tip (sync_button, _("Sync to JACK is not possible: video pull up/down is set"));
|
|
|
|
}
|
2010-08-30 21:49:33 -04:00
|
|
|
|
|
|
|
}
|