2005-12-31 13:20:42 -05:00
|
|
|
/*
|
2008-08-04 18:37:24 -04:00
|
|
|
Copyright (C) 2005 Paul Davis
|
2005-12-31 13:20:42 -05:00
|
|
|
|
|
|
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
2006-01-07 21:56:49 -05:00
|
|
|
#include <gtkmm2ext/utils.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"
|
2005-12-31 13:20:42 -05:00
|
|
|
|
2013-10-20 09:04:48 -04:00
|
|
|
#include "canvas/wave_view.h"
|
2007-12-15 18:29:30 -05:00
|
|
|
|
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;
|
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) {
|
|
|
|
if (_session->config.get_video_pullup() != 0.0f) {
|
2013-09-19 17:34:23 -04:00
|
|
|
if (Config->get_sync_source() == Engine) {
|
2010-11-25 15:37:39 -05:00
|
|
|
MessageDialog msg (
|
|
|
|
_("It is not possible to use JACK as the the sync source\n\
|
2010-08-30 21:49:33 -04:00
|
|
|
when the pull up/down setting is non-zero."));
|
2010-11-25 15:37:39 -05:00
|
|
|
msg.run ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
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.
|
|
|
|
*
|
|
|
|
* Notficy RCOptionEditor by emitting a signal if the active
|
|
|
|
* 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 ()
|
|
|
|
{
|
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("SessionMonitorIn"));
|
|
|
|
if (!act) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
|
|
|
if (!tact) {
|
|
|
|
return;
|
|
|
|
}
|
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 ()
|
|
|
|
{
|
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("SessionMonitorDisk"));
|
|
|
|
if (!act) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
|
|
|
if (!tact) {
|
|
|
|
return;
|
|
|
|
}
|
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 ()
|
|
|
|
{
|
|
|
|
Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-03-17 16:54:03 -04:00
|
|
|
if (action) {
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
|
|
|
|
if (tact) {
|
|
|
|
ignore_dual_punch = true;
|
|
|
|
tact->set_active (false);
|
|
|
|
ignore_dual_punch = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_punch ()
|
|
|
|
{
|
|
|
|
if (ignore_dual_punch) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Glib::RefPtr<Action> action = ActionManager::get_action ("Transport", "TogglePunch");
|
|
|
|
|
|
|
|
if (action) {
|
|
|
|
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(action);
|
|
|
|
|
|
|
|
if (!tact) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* drive the other two actions from this one */
|
|
|
|
|
|
|
|
Glib::RefPtr<Action> in_action = ActionManager::get_action ("Transport", "TogglePunchIn");
|
|
|
|
Glib::RefPtr<Action> out_action = ActionManager::get_action ("Transport", "TogglePunchOut");
|
|
|
|
|
|
|
|
if (in_action && out_action) {
|
|
|
|
Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(in_action);
|
|
|
|
Glib::RefPtr<ToggleAction> toact = Glib::RefPtr<ToggleAction>::cast_dynamic(out_action);
|
|
|
|
tiact->set_active (tact->get_active());
|
|
|
|
toact->set_active (tact->get_active());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-01-08 00:19:38 -05:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_punch_in ()
|
|
|
|
{
|
2009-10-20 17:58:46 -04:00
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchIn"));
|
|
|
|
if (!act) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
|
|
|
if (!tact) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
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 ()
|
|
|
|
{
|
2009-10-20 17:58:46 -04:00
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("TogglePunchOut"));
|
|
|
|
if (!act) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
|
|
|
if (!tact) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
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 ()
|
|
|
|
{
|
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
|
|
|
if (!act) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
act->set_sensitive (false);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-10-20 17:58:46 -04:00
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
|
|
|
|
if (!tact) {
|
|
|
|
return;
|
|
|
|
}
|
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 */
|
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Rulers"), "toggle-loop-punch-ruler");
|
|
|
|
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()
|
|
|
|
{
|
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", "ToggleVideoSync");
|
|
|
|
if (act) {
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
2009-12-17 13:24:23 -05:00
|
|
|
_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()
|
|
|
|
{
|
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
|
2011-12-07 10:48:24 -05:00
|
|
|
|
2006-01-19 13:05:31 -05:00
|
|
|
if (act) {
|
|
|
|
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
|
|
|
if (tact->get_active()) {
|
2012-06-13 00:21:46 -04:00
|
|
|
maximise_editing_space ();
|
2006-01-19 13:05:31 -05:00
|
|
|
} else {
|
2012-06-13 00:21:46 -04:00
|
|
|
restore_editing_space ();
|
2006-01-19 13:05:31 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
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."));
|
2007-04-11 09:07:51 -04:00
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
|
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
|
2012-11-26 17:35:57 -05:00
|
|
|
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (true);
|
2009-11-09 15:05:18 -05:00
|
|
|
} else {
|
2012-10-10 23:10:18 -04:00
|
|
|
sync_button.set_text (sync_source_to_string (Config->get_sync_source(), true));
|
2015-12-10 06:47:08 -05:00
|
|
|
if (_session && _session->locations()->auto_loop_location()) {
|
|
|
|
// disable looping with external sync.
|
|
|
|
// This is not necessary because session-transport ignores the loop-state,
|
|
|
|
// but makes it clear to the user that it's disabled.
|
2015-12-15 02:39:44 -05:00
|
|
|
_session->request_play_loop (false, false);
|
2015-12-10 06:47:08 -05:00
|
|
|
}
|
|
|
|
/* XXX we need to make sure that auto-play is off as well as insensitive */
|
2007-04-11 09:07:51 -04:00
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (false);
|
|
|
|
ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (false);
|
2012-11-26 17:35:57 -05:00
|
|
|
ActionManager::get_action ("Transport", "ToggleFollowEdits")->set_sensitive (false);
|
2007-04-11 09:07:51 -04:00
|
|
|
}
|
2017-01-28 06:04:31 -05:00
|
|
|
set_loop_sensitivity ();
|
2011-06-01 13:00:29 -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") {
|
|
|
|
Glib::RefPtr<Action> iact = ActionManager::get_action (X_("Transport"), X_("SessionMonitorIn"));
|
|
|
|
Glib::RefPtr<Action> dact = ActionManager::get_action (X_("Transport"), X_("SessionMonitorDisk"));
|
|
|
|
if (iact && dact) {
|
|
|
|
Glib::RefPtr<ToggleAction> tdact = Glib::RefPtr<ToggleAction>::cast_dynamic(dact);
|
|
|
|
Glib::RefPtr<ToggleAction> tiact = Glib::RefPtr<ToggleAction>::cast_dynamic(iact);
|
|
|
|
if (tdact && tiact) {
|
|
|
|
switch (_session->config.get_session_monitoring ()) {
|
|
|
|
case MonitorDisk:
|
|
|
|
tdact->set_active (true);
|
2017-01-18 06:25:02 -05:00
|
|
|
tiact->set_active (false);
|
2017-01-16 13:54:20 -05:00
|
|
|
break;
|
|
|
|
case MonitorInput:
|
|
|
|
tiact->set_active (true);
|
2017-01-18 06:25:02 -05:00
|
|
|
tdact->set_active (false);
|
2017-01-16 13:54:20 -05:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
tdact->set_active (false);
|
|
|
|
tiact->set_active (false);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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);
|
2017-04-01 17:56:27 -04:00
|
|
|
} else if (p == "click-record-only") {
|
|
|
|
// TODO set a flag, blink or gray-out metronome button while rolling, only
|
|
|
|
if (Config->get_click_record_only()) {
|
|
|
|
click_button.set_name ("generic button"); // XXX
|
|
|
|
} else {
|
|
|
|
click_button.set_name ("transport button");
|
|
|
|
}
|
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();
|
2010-10-18 18:02:12 -04:00
|
|
|
} else if (p == "primary-clock-delta-edit-cursor") {
|
2015-01-02 09:44:54 -05:00
|
|
|
if (UIConfiguration::instance().get_primary_clock_delta_edit_cursor()) {
|
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");
|
|
|
|
}
|
2010-11-25 15:37:39 -05:00
|
|
|
} else if (p == "secondary-clock-delta-edit-cursor") {
|
2015-01-02 09:44:54 -05:00
|
|
|
if (UIConfiguration::instance().get_secondary_clock_delta_edit_cursor()) {
|
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") {
|
2015-01-02 09:44:54 -05:00
|
|
|
ArdourCanvas::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-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 ();
|
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") {
|
2015-01-02 09:44:54 -05:00
|
|
|
ArdourCanvas::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") {
|
2015-01-02 09:44:54 -05:00
|
|
|
ArdourCanvas::WaveView::set_global_shape (UIConfiguration::instance().get_waveform_shape() == Rectified
|
2014-05-26 18:34:27 -04:00
|
|
|
? ArdourCanvas::WaveView::Rectified : ArdourCanvas::WaveView::Normal);
|
|
|
|
} else if (p == "show-waveform-clipping") {
|
2015-01-02 09:44:54 -05:00
|
|
|
ArdourCanvas::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 */
|
2015-01-02 09:44:54 -05:00
|
|
|
ArdourCanvas::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 ();
|
|
|
|
for (int i = 0; i < 9; ++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 == "show-waveform-clipping") {
|
|
|
|
ArdourCanvas::WaveView::set_global_show_waveform_clipping (UIConfiguration::instance().get_show_waveform_clipping());
|
|
|
|
} else if (p == "waveform-gradient-depth") {
|
|
|
|
ArdourCanvas::WaveView::set_global_gradient_depth (UIConfiguration::instance().get_waveform_gradient_depth());
|
|
|
|
} 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());
|
|
|
|
}
|
2017-01-20 18:06:44 -05:00
|
|
|
} else if (p == "click-gain") {
|
|
|
|
float gain_db = accurate_coefficient_to_dB (Config->get_click_gain());
|
2017-01-20 19:46:40 -05:00
|
|
|
char tmp[32];
|
|
|
|
snprintf(tmp, 31, "%+.1f", gain_db);
|
|
|
|
set_tip (click_button, string_compose (_("Enable/Disable metronome\n\nRight-click to access preferences\nMouse-wheel to modify level\nSignal Level: %1 dBFS"), tmp));
|
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) {
|
2011-06-02 13:50:37 -04:00
|
|
|
primary_clock->set (_session->audible_frame(), true);
|
|
|
|
secondary_clock->set (_session->audible_frame(), 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 ()
|
|
|
|
{
|
2010-11-25 15:37:39 -05:00
|
|
|
Glib::RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
|
|
|
|
|
|
|
|
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 */
|
2013-09-19 17:34:23 -04:00
|
|
|
if (Config->get_sync_source() == 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
|
|
|
|
|
|
|
}
|
|
|
|
|