2005-12-31 18:20:42 +00:00
|
|
|
/*
|
2019-08-02 23:26:43 +02: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 18:20:42 +00:00
|
|
|
|
2009-07-13 00:26:28 +00:00
|
|
|
#ifdef WAF_BUILD
|
|
|
|
|
#include "gtk2ardour-config.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "pbd/convert.h"
|
2017-01-16 19:54:20 +01:00
|
|
|
#include "pbd/unwind.h"
|
2006-04-25 20:23:50 +00:00
|
|
|
|
2020-06-30 16:46:06 +02:00
|
|
|
#include "ardour/lv2_plugin.h"
|
2010-10-18 22:02:12 +00:00
|
|
|
#include "ardour/rc_configuration.h"
|
2012-05-24 06:09:29 +00:00
|
|
|
#include "ardour/session.h"
|
2018-10-05 12:35:13 -04:00
|
|
|
#include "ardour/transport_master_manager.h"
|
2005-12-31 18:20:42 +00:00
|
|
|
|
2017-07-17 20:12:33 +02:00
|
|
|
#include "gtkmm2ext/utils.h"
|
|
|
|
|
#include "waveview/wave_view.h"
|
2007-12-15 23:29:30 +00:00
|
|
|
|
2020-01-15 22:01:30 +01:00
|
|
|
#include "ardour_message.h"
|
2011-06-02 17:50:37 +00:00
|
|
|
#include "audio_clock.h"
|
2005-12-31 18:20:42 +00:00
|
|
|
#include "ardour_ui.h"
|
|
|
|
|
#include "actions.h"
|
2006-01-08 02:56:49 +00:00
|
|
|
#include "gui_thread.h"
|
2008-01-10 21:20:59 +00:00
|
|
|
#include "public_editor.h"
|
2012-05-31 23:14:03 +00:00
|
|
|
#include "main_clock.h"
|
2006-01-08 02:56:49 +00:00
|
|
|
|
2016-07-14 14:44:52 -04:00
|
|
|
#include "pbd/i18n.h"
|
2005-12-31 18:20:42 +00:00
|
|
|
|
2024-03-22 13:12:50 -06:00
|
|
|
#ifdef __APPLE__
|
|
|
|
|
extern void use_cocoa_invalidation (int); // cocoacarbon.mm
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-12-31 18:20:42 +00:00
|
|
|
using namespace Gtk;
|
2006-01-08 02:56:49 +00:00
|
|
|
using namespace Gtkmm2ext;
|
2005-12-31 18:20:42 +00:00
|
|
|
using namespace ARDOUR;
|
2006-06-21 23:01:03 +00:00
|
|
|
using namespace PBD;
|
2017-07-15 17:38:28 +02:00
|
|
|
using namespace ArdourWidgets;
|
2005-12-31 18:20:42 +00:00
|
|
|
|
2009-11-10 04:30:08 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_external_sync()
|
|
|
|
|
{
|
2010-11-25 20:37:39 +00: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-26 02:59:25 +02: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 20:37:39 +00:00
|
|
|
}
|
2023-05-19 23:27:01 +02:00
|
|
|
if (_session->default_play_speed() != 1.0f && (TransportMasterManager::instance().current()->type() == Engine)) {
|
|
|
|
|
ArdourMessageDialog msg (_("It is not possible to use JACK as the sync source\n when the vari-speed is enabled."));
|
|
|
|
|
msg.run ();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2013-01-05 10:40:07 +00: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 16:49:11 +00: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 16:49:11 +00:00
|
|
|
* status changed:
|
|
|
|
|
*/
|
|
|
|
|
Config->ParameterChanged("sync-source");
|
2010-11-25 20:37:39 +00:00
|
|
|
}
|
2009-11-10 04:30:08 +00:00
|
|
|
}
|
|
|
|
|
|
2006-09-25 21:24:00 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_time_master ()
|
|
|
|
|
{
|
2009-12-17 18:24:23 +00: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 21:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
2005-12-31 18:20:42 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_send_mtc ()
|
|
|
|
|
{
|
2016-02-28 01:11:48 +01:00
|
|
|
ActionManager::toggle_config_state ("Options", "SendMTC", &RCConfiguration::set_send_mtc, &RCConfiguration::get_send_mtc);
|
2005-12-31 18:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_send_mmc ()
|
|
|
|
|
{
|
2016-02-28 01:11:48 +01:00
|
|
|
ActionManager::toggle_config_state ("Options", "SendMMC", &RCConfiguration::set_send_mmc, &RCConfiguration::get_send_mmc);
|
2005-12-31 18:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-26 23:32:55 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_send_midi_clock ()
|
|
|
|
|
{
|
2016-02-28 01:11:48 +01:00
|
|
|
ActionManager::toggle_config_state ("Options", "SendMidiClock", &RCConfiguration::set_send_midi_clock, &RCConfiguration::get_send_midi_clock);
|
2008-11-26 23:32:55 +00:00
|
|
|
}
|
|
|
|
|
|
2005-12-31 18:20:42 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_use_mmc ()
|
|
|
|
|
{
|
2016-02-28 01:11:48 +01:00
|
|
|
ActionManager::toggle_config_state ("Options", "UseMMC", &RCConfiguration::set_mmc_control, &RCConfiguration::get_mmc_control);
|
2005-12-31 18:20:42 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-08 05:19:38 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_auto_input ()
|
|
|
|
|
{
|
2009-12-17 18:24:23 +00: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 05:19:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_auto_play ()
|
|
|
|
|
{
|
2009-12-17 18:24:23 +00: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 05:19:38 +00: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 05:19:38 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_click ()
|
|
|
|
|
{
|
2009-05-14 00:13:27 +00:00
|
|
|
ActionManager::toggle_config_state ("Transport", "ToggleClick", &RCConfiguration::set_clicking, &RCConfiguration::get_clicking);
|
2006-01-08 05:19:38 +00:00
|
|
|
}
|
|
|
|
|
|
2017-01-16 19:54:20 +01:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_session_monitoring_in ()
|
|
|
|
|
{
|
2019-02-28 23:54:42 +01:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorIn"));
|
2021-02-24 00:21:44 +01:00
|
|
|
MonitorChoice mc = _session->config.get_session_monitoring ();
|
2017-01-18 12:25:02 +01:00
|
|
|
|
2021-02-24 00:21:44 +01:00
|
|
|
if (tact->get_active() == (0 != (mc & MonitorInput))) {
|
2017-01-18 12:25:02 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-16 19:54:20 +01:00
|
|
|
if (tact->get_active()) {
|
2021-02-24 00:21:44 +01:00
|
|
|
mc = MonitorChoice (mc | MonitorInput);
|
2017-01-16 19:54:20 +01:00
|
|
|
} else {
|
2021-02-24 00:21:44 +01:00
|
|
|
mc = MonitorChoice (mc & ~MonitorInput);
|
2017-01-16 19:54:20 +01:00
|
|
|
}
|
2021-02-24 00:21:44 +01:00
|
|
|
_session->config.set_session_monitoring (mc);
|
2017-01-16 19:54:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_session_monitoring_disk ()
|
|
|
|
|
{
|
2019-02-28 23:54:42 +01:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("SessionMonitorDisk"));
|
2021-02-24 00:21:44 +01:00
|
|
|
MonitorChoice mc = _session->config.get_session_monitoring ();
|
|
|
|
|
if (tact->get_active() == (0 != (mc & MonitorDisk))) {
|
2017-01-18 12:25:02 +01:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-16 19:54:20 +01:00
|
|
|
if (tact->get_active()) {
|
2021-02-24 00:21:44 +01:00
|
|
|
mc = MonitorChoice (mc | MonitorDisk);
|
2017-01-16 19:54:20 +01:00
|
|
|
} else {
|
2021-02-24 00:21:44 +01:00
|
|
|
mc = MonitorChoice (mc & ~MonitorDisk);
|
2017-01-16 19:54:20 +01:00
|
|
|
}
|
2021-02-24 00:21:44 +01:00
|
|
|
_session->config.set_session_monitoring (mc);
|
2017-01-16 19:54:20 +01:00
|
|
|
}
|
|
|
|
|
|
2008-03-17 20:54:03 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::unset_dual_punch ()
|
|
|
|
|
{
|
2019-02-28 23:54:42 +01: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 20:54:03 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_punch ()
|
|
|
|
|
{
|
|
|
|
|
if (ignore_dual_punch) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-28 23:54:42 +01:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "TogglePunch");
|
2008-03-17 20:54:03 +00:00
|
|
|
|
2019-02-28 23:54:42 +01: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 20:54:03 +00:00
|
|
|
|
2019-02-28 23:54:42 +01:00
|
|
|
in_action->set_active (tact->get_active());
|
|
|
|
|
out_action->set_active (tact->get_active());
|
2008-03-17 20:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-08 05:19:38 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_punch_in ()
|
|
|
|
|
{
|
2019-02-28 23:54:42 +01:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("TogglePunchIn"));
|
2009-10-20 21:58:46 +00:00
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
if (tact->get_active() != _session->config.get_punch_in()) {
|
|
|
|
|
_session->config.set_punch_in (tact->get_active ());
|
2009-10-20 21:58:46 +00: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 05:19:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_punch_out ()
|
|
|
|
|
{
|
2019-02-28 23:54:42 +01:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("TogglePunchOut"));
|
2009-10-20 21:58:46 +00:00
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
if (tact->get_active() != _session->config.get_punch_out()) {
|
|
|
|
|
_session->config.set_punch_out (tact->get_active ());
|
2009-10-20 21:58:46 +00: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 ()
|
|
|
|
|
{
|
2024-05-16 22:58:55 -06:00
|
|
|
/* XXX FIX ME */
|
|
|
|
|
Glib::RefPtr<ToggleAction> tact; // = ActionManager::get_toggle_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
2009-10-20 21:58:46 +00:00
|
|
|
|
2019-02-28 23:54:42 +01:00
|
|
|
tact->set_sensitive (false);
|
2011-06-01 17:00:29 +00:00
|
|
|
|
2009-10-20 21:58:46 +00: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 ()
|
|
|
|
|
{
|
2024-05-16 22:58:55 -06:00
|
|
|
/* XXX FIX ME */
|
2009-12-17 18:24:23 +00:00
|
|
|
if (!_session->config.get_punch_in() && !_session->config.get_punch_out()) {
|
2009-10-20 21:58:46 +00:00
|
|
|
/* if punch in/out are now both off, reallow hiding of the loop/punch ruler */
|
2024-05-16 22:58:55 -06:00
|
|
|
Glib::RefPtr<Action> act; // = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
2009-10-20 21:58:46 +00:00
|
|
|
if (act) {
|
|
|
|
|
act->set_sensitive (true);
|
|
|
|
|
}
|
|
|
|
|
}
|
2006-01-08 05:19:38 +00:00
|
|
|
}
|
|
|
|
|
|
2006-09-25 21:24:00 +00:00
|
|
|
void
|
2006-08-31 13:23:43 +00:00
|
|
|
ARDOUR_UI::toggle_video_sync()
|
|
|
|
|
{
|
2019-02-28 23:54:42 +01:00
|
|
|
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action ("Transport", "ToggleVideoSync");
|
|
|
|
|
_session->config.set_use_video_sync (tact->get_active());
|
2006-08-31 13:23:43 +00:00
|
|
|
}
|
|
|
|
|
|
2006-01-19 18:05:31 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::toggle_editing_space()
|
|
|
|
|
{
|
2019-02-28 23:54:42 +01: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 18:05:31 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-29 01:23:48 +02: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-08 02:56:49 +00:00
|
|
|
void
|
2009-11-09 20:05:18 +00:00
|
|
|
ARDOUR_UI::setup_session_options ()
|
2006-01-08 02:56:49 +00:00
|
|
|
{
|
2012-04-25 12:58:19 +00:00
|
|
|
_session->config.ParameterChanged.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
|
2009-12-12 15:02:15 +00:00
|
|
|
boost::function<void (std::string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
|
2009-12-17 18:24:23 +00:00
|
|
|
_session->config.map_parameters (pc);
|
2006-01-08 02:56:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2009-05-16 01:22:43 +00:00
|
|
|
ARDOUR_UI::parameter_changed (std::string p)
|
2006-09-25 21:24:00 +00:00
|
|
|
{
|
2009-11-09 20:05:18 +00:00
|
|
|
if (p == "external-sync") {
|
2009-11-10 04:30:08 +00:00
|
|
|
|
2018-09-18 18:52:20 -04:00
|
|
|
/* session parameter */
|
|
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
|
2009-11-10 04:30:08 +00:00
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
if (!_session->config.get_external_sync()) {
|
2016-12-18 23:17:29 +01: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 20:05:18 +00:00
|
|
|
} else {
|
2015-12-10 12:47:08 +01: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 16:46:42 -07:00
|
|
|
if (!_session->synced_to_engine()) {
|
|
|
|
|
/* JACK transport allows auto-return */
|
|
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
|
|
|
|
|
}
|
2007-04-11 13:07:51 +00:00
|
|
|
}
|
2011-06-01 17:00:29 +00: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 15:55:20 -05:00
|
|
|
} else if (p == "follow-edits") {
|
2012-01-30 22:53:22 +00:00
|
|
|
|
2014-12-22 13:39:41 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &UIConfiguration::get_follow_edits);
|
2012-01-30 22:53:22 +00:00
|
|
|
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "send-mtc") {
|
2006-09-25 21:24:00 +00:00
|
|
|
|
2016-02-28 01:11:48 +01:00
|
|
|
ActionManager::map_some_state ("Options", "SendMTC", &RCConfiguration::get_send_mtc);
|
2006-09-25 21:24:00 +00:00
|
|
|
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "send-mmc") {
|
2006-09-25 21:24:00 +00:00
|
|
|
|
2016-02-28 01:11:48 +01:00
|
|
|
ActionManager::map_some_state ("Options", "SendMMC", &RCConfiguration::get_send_mmc);
|
2006-09-25 21:24:00 +00:00
|
|
|
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "mmc-control") {
|
2016-02-28 01:11:48 +01:00
|
|
|
ActionManager::map_some_state ("Options", "UseMMC", &RCConfiguration::get_mmc_control);
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "auto-play") {
|
2009-12-17 18:24:23 +00:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleAutoPlay", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_play));
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "auto-return") {
|
2009-12-17 18:24:23 +00:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleAutoReturn", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_return));
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "auto-input") {
|
2009-12-17 18:24:23 +00:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleAutoInput", sigc::mem_fun (_session->config, &SessionConfiguration::get_auto_input));
|
2017-01-16 19:54:20 +01:00
|
|
|
} else if (p == "session-monitoring") {
|
2019-02-28 23:54:42 +01: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"));
|
2021-02-24 00:21:44 +01:00
|
|
|
MonitorChoice mc = _session->config.get_session_monitoring ();
|
|
|
|
|
tiact->set_active (0 != (mc & MonitorInput));
|
|
|
|
|
tdact->set_active (0 != (mc & MonitorDisk));
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "punch-out") {
|
2009-12-17 18:24:23 +00: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 20:54:03 +00:00
|
|
|
unset_dual_punch ();
|
|
|
|
|
}
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "punch-in") {
|
2009-12-17 18:24:23 +00: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 20:54:03 +00:00
|
|
|
unset_dual_punch ();
|
|
|
|
|
}
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "clicking") {
|
2009-05-14 00:13:27 +00:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleClick", &RCConfiguration::get_clicking);
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "use-video-sync") {
|
2009-12-17 18:24:23 +00:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleVideoSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_use_video_sync));
|
2010-11-25 20:37:39 +00:00
|
|
|
} else if (p == "sync-source") {
|
2010-08-31 01:49:33 +00:00
|
|
|
|
2010-11-25 20:37:39 +00:00
|
|
|
synchronize_sync_source_and_video_pullup ();
|
2014-08-30 20:57:22 +02:00
|
|
|
set_fps_timeout_connection ();
|
2010-08-31 01:49:33 +00:00
|
|
|
|
2009-05-16 01:22:43 +00:00
|
|
|
} else if (p == "show-track-meters") {
|
2014-12-22 13:39:41 -05:00
|
|
|
if (editor) editor->toggle_meter_updating();
|
2017-11-22 22:10:37 +01:00
|
|
|
} else if (p == "primary-clock-delta-mode") {
|
2022-11-06 19:12:20 +01:00
|
|
|
primary_clock->set_display_delta_mode(UIConfiguration::instance().get_primary_clock_delta_mode());
|
2017-11-22 22:10:37 +01:00
|
|
|
} else if (p == "secondary-clock-delta-mode") {
|
2022-11-06 19:12:20 +01:00
|
|
|
secondary_clock->set_display_delta_mode(UIConfiguration::instance().get_secondary_clock_delta_mode());
|
2013-03-03 13:45:32 +00:00
|
|
|
} else if (p == "super-rapid-clock-update") {
|
2014-08-31 07:54:59 +02:00
|
|
|
if (_session) {
|
|
|
|
|
stop_clocking ();
|
|
|
|
|
start_clocking ();
|
|
|
|
|
}
|
2016-04-27 01:06:01 +02: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 20:12:33 +02:00
|
|
|
ArdourWaveView::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
|
2016-12-20 03:11:21 +01:00
|
|
|
} else if (p == "show-mini-timeline") {
|
|
|
|
|
repack_transport_hbox ();
|
2017-12-28 15:53:40 +01:00
|
|
|
} else if (p == "show-dsp-load-info") {
|
|
|
|
|
repack_transport_hbox ();
|
2018-01-14 18:41:21 +01:00
|
|
|
} else if (p == "show-disk-space-info") {
|
|
|
|
|
repack_transport_hbox ();
|
2017-01-16 21:58:53 +01:00
|
|
|
} else if (p == "show-toolbar-recpunch") {
|
|
|
|
|
repack_transport_hbox ();
|
|
|
|
|
} else if (p == "show-toolbar-monitoring") {
|
|
|
|
|
repack_transport_hbox ();
|
2016-12-20 03:11:21 +01:00
|
|
|
} else if (p == "show-toolbar-selclock") {
|
|
|
|
|
repack_transport_hbox ();
|
2019-09-29 01:23:48 +02:00
|
|
|
} else if (p == "show-toolbar-latency") {
|
|
|
|
|
repack_transport_hbox ();
|
2022-03-01 17:53:11 +01:00
|
|
|
} else if (p == "show-toolbar-cuectrl") {
|
|
|
|
|
repack_transport_hbox ();
|
2020-09-17 22:37:12 +02:00
|
|
|
} else if (p == "show-toolbar-monitor-info") {
|
|
|
|
|
repack_transport_hbox ();
|
2013-08-04 00:06:29 +02:00
|
|
|
} else if (p == "show-editor-meter") {
|
2016-12-20 03:11:21 +01:00
|
|
|
repack_transport_hbox ();
|
2016-12-21 23:01:34 +01:00
|
|
|
} else if (p == "show-secondary-clock") {
|
|
|
|
|
update_clock_visibility ();
|
2014-05-27 00:34:27 +02:00
|
|
|
} else if (p == "waveform-scale") {
|
2017-07-17 20:12:33 +02:00
|
|
|
ArdourWaveView::WaveView::set_global_logscaled (UIConfiguration::instance().get_waveform_scale() == Logarithmic);
|
2015-01-28 02:22:52 +01:00
|
|
|
} else if (p == "widget-prelight") {
|
2015-01-02 21:44:54 +07:00
|
|
|
CairoWidget::set_widget_prelight (UIConfiguration::instance().get_widget_prelight());
|
2014-05-27 00:34:27 +02:00
|
|
|
} else if (p == "waveform-shape") {
|
2017-07-17 20:12:33 +02:00
|
|
|
ArdourWaveView::WaveView::set_global_shape (UIConfiguration::instance().get_waveform_shape() == Rectified
|
|
|
|
|
? ArdourWaveView::WaveView::Rectified : ArdourWaveView::WaveView::Normal);
|
2014-05-27 00:34:27 +02:00
|
|
|
} else if (p == "show-waveform-clipping") {
|
2017-07-17 20:12:33 +02: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 20:12:33 +02: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-25 00:16:08 +02:00
|
|
|
} else if (p == "action-table-columns") {
|
|
|
|
|
const uint32_t cols = UIConfiguration::instance().get_action_table_columns ();
|
2019-09-03 04:31:35 +02:00
|
|
|
for (int i = 0; i < MAX_LUA_ACTION_BUTTONS; ++i) {
|
2016-12-11 17:24:30 +01:00
|
|
|
const int col = i / 2;
|
2016-04-25 00:16:08 +02:00
|
|
|
if (cols & (1<<col)) {
|
|
|
|
|
action_script_call_btn[i].show();
|
|
|
|
|
} else {
|
|
|
|
|
action_script_call_btn[i].hide();
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-02-25 14:29:12 +01:00
|
|
|
if (cols == 0) {
|
|
|
|
|
scripts_spacer.hide ();
|
|
|
|
|
} else {
|
|
|
|
|
scripts_spacer.show ();
|
|
|
|
|
}
|
2022-02-12 21:45:53 -06:00
|
|
|
} else if (p == "cue-behavior") {
|
2022-02-19 10:56:59 -06:00
|
|
|
CueBehavior cb (_session->config.get_cue_behavior());
|
2022-02-12 21:45:53 -06:00
|
|
|
_cue_play_enable.set_active (cb & ARDOUR::FollowCues);
|
2022-09-19 22:47:59 +02:00
|
|
|
} else if (p == "record-mode") {
|
|
|
|
|
size_t m = _session->config.get_record_mode ();
|
|
|
|
|
assert (m < record_mode_strings.size ());
|
|
|
|
|
record_mode_selector.set_active (record_mode_strings[m]);
|
2016-12-29 23:04:39 +01: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 16:46:06 +02:00
|
|
|
LV2Plugin::set_global_ui_style_flat (flat);
|
2016-12-29 23:04:39 +01:00
|
|
|
}
|
2018-10-02 21:28:26 +02: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 16:46:06 +02:00
|
|
|
LV2Plugin::set_global_ui_style_boxy (boxy);
|
2018-10-02 21:28:26 +02:00
|
|
|
}
|
2018-02-09 09:59:39 -06: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 20:37:07 +02: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;
|
|
|
|
|
}
|
2020-12-01 22:31:07 -07:00
|
|
|
} else if (p == "clock-display-limit") {
|
|
|
|
|
/* limit upper value to 99:59:59 (HH:MM:SS) */
|
|
|
|
|
using namespace Temporal;
|
|
|
|
|
const samplecnt_t limit = (99*60*60) + (59*60) + (59); /* seconds */
|
|
|
|
|
|
|
|
|
|
if (UIConfiguration::instance().get_clock_display_limit() > limit) {
|
|
|
|
|
UIConfiguration::instance().set_clock_display_limit (limit);
|
|
|
|
|
}
|
2023-11-10 15:50:44 -07:00
|
|
|
} else if (p == "no-strobe") {
|
|
|
|
|
stop_clocking ();
|
|
|
|
|
start_clocking ();
|
2024-03-22 13:12:50 -06:00
|
|
|
} else if (p == "use-cocoa-invalidation") {
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
|
use_cocoa_invalidation (UIConfiguration::instance().get_use_cocoa_invalidation());
|
|
|
|
|
#endif
|
2010-11-25 20:37:39 +00:00
|
|
|
}
|
2006-01-08 02:56:49 +00:00
|
|
|
}
|
2009-12-01 13:21:41 +00:00
|
|
|
|
2011-07-03 00:45:15 +00: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 20:57:22 +02:00
|
|
|
} else if (p == "timecode-format") {
|
|
|
|
|
set_fps_timeout_connection ();
|
2014-08-30 20:11:07 +02:00
|
|
|
} else if (p == "video-pullup" || p == "timecode-format") {
|
2014-08-30 20:57:22 +02:00
|
|
|
set_fps_timeout_connection ();
|
|
|
|
|
|
2014-08-30 20:11:07 +02:00
|
|
|
synchronize_sync_source_and_video_pullup ();
|
|
|
|
|
reset_main_clocks ();
|
|
|
|
|
editor->queue_visual_videotimeline_update();
|
2014-08-31 07:12:21 +02: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-03 00:45:15 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-12-01 13:21:41 +00:00
|
|
|
void
|
|
|
|
|
ARDOUR_UI::reset_main_clocks ()
|
|
|
|
|
{
|
2009-12-11 23:29:48 +00:00
|
|
|
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::reset_main_clocks)
|
2009-12-01 13:21:41 +00:00
|
|
|
|
2009-12-17 18:24:23 +00:00
|
|
|
if (_session) {
|
2020-10-19 12:37:54 -06:00
|
|
|
primary_clock->set (timepos_t (_session->audible_sample()), true);
|
|
|
|
|
secondary_clock->set (timepos_t (_session->audible_sample()), true);
|
2009-12-01 13:21:41 +00:00
|
|
|
} else {
|
2020-10-19 12:37:54 -06:00
|
|
|
primary_clock->set (timepos_t(), true);
|
|
|
|
|
secondary_clock->set (timepos_t(), true);
|
2009-12-01 13:21:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
2010-08-31 01:49:33 +00: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 20:37:39 +00: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 20:37:39 +00: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-31 01:49:33 +00:00
|
|
|
|
|
|
|
|
just_label:
|
2010-11-25 20:37:39 +00: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-31 01:49:33 +00:00
|
|
|
|
|
|
|
|
}
|