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"
|
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
|
|
|
|
2007-12-15 18:29:30 -05:00
|
|
|
#ifdef HAVE_LIBLO
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/osc.h"
|
2007-12-15 18:29:30 -05:00
|
|
|
#endif
|
|
|
|
|
2013-06-21 17:15:56 -04:00
|
|
|
#include "canvas/wave_view.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
|
|
|
|
|
|
|
#include "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
|
|
|
|
2010-07-23 19:29:36 -04:00
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_keep_tearoffs ()
|
|
|
|
{
|
|
|
|
ActionManager::toggle_config_state ("Common", "KeepTearoffs", &RCConfiguration::set_keep_tearoffs, &RCConfiguration::get_keep_tearoffs);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2012-06-13 00:21:46 -04:00
|
|
|
ARDOUR_UI::update_tearoff_visibility();
|
2010-07-23 19:29:36 -04: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) {
|
2012-10-10 23:10:18 -04:00
|
|
|
if (Config->get_sync_source() == JACK) {
|
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 ()
|
|
|
|
{
|
2009-05-13 20:13:27 -04: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 ()
|
|
|
|
{
|
2009-05-13 20:13:27 -04: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 ()
|
|
|
|
{
|
2009-05-13 20:13:27 -04: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 ()
|
|
|
|
{
|
2009-05-13 20:13:27 -04:00
|
|
|
ActionManager::toggle_config_state ("options", "UseMMC", &RCConfiguration::set_mmc_control, &RCConfiguration::get_mmc_control);
|
2005-12-31 13:20:42 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_send_midi_feedback ()
|
|
|
|
{
|
2009-05-13 20:13:27 -04:00
|
|
|
ActionManager::toggle_config_state ("options", "SendMIDIfeedback", &RCConfiguration::set_midi_feedback, &RCConfiguration::get_midi_feedback);
|
2006-09-29 17:39:39 -04: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
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ARDOUR_UI::toggle_auto_return ()
|
|
|
|
{
|
2009-12-17 13:24:23 -05:00
|
|
|
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
|
|
|
}
|
|
|
|
|
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()) {
|
2011-11-10 10:25:01 -05:00
|
|
|
sync_button.set_text (_("Internal"));
|
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));
|
2007-04-11 09:07:51 -04:00
|
|
|
/* XXX need to make auto-play is off as well as insensitive */
|
|
|
|
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
|
|
|
}
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2012-01-30 17:53:22 -05:00
|
|
|
} else if (p == "always-play-range") {
|
|
|
|
|
2012-11-20 14:43:43 -05:00
|
|
|
ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &RCConfiguration::get_always_play_range);
|
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
|
|
|
|
2009-05-13 20:13:27 -04: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
|
|
|
|
2009-05-13 20:13:27 -04: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 == "use-osc") {
|
2007-04-11 09:07:51 -04:00
|
|
|
|
|
|
|
#ifdef HAVE_LIBLO
|
|
|
|
if (Config->get_use_osc()) {
|
|
|
|
osc->start ();
|
|
|
|
} else {
|
|
|
|
osc->stop ();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-07-23 19:29:36 -04:00
|
|
|
} else if (p == "keep-tearoffs") {
|
|
|
|
ActionManager::map_some_state ("Common", "KeepTearoffs", &RCConfiguration::get_keep_tearoffs);
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "mmc-control") {
|
2009-05-13 20:13:27 -04:00
|
|
|
ActionManager::map_some_state ("options", "UseMMC", &RCConfiguration::get_mmc_control);
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "midi-feedback") {
|
2009-05-13 20:13:27 -04:00
|
|
|
ActionManager::map_some_state ("options", "SendMIDIfeedback", &RCConfiguration::get_midi_feedback);
|
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));
|
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));
|
2009-10-26 10:38:58 -04:00
|
|
|
} else if (p == "video-pullup" || p == "timecode-format") {
|
2010-08-30 21:49:33 -04:00
|
|
|
|
2010-11-25 15:37:39 -05:00
|
|
|
synchronize_sync_source_and_video_pullup ();
|
2009-12-01 08:21:41 -05:00
|
|
|
reset_main_clocks ();
|
2013-03-12 17:00:09 -04:00
|
|
|
editor->queue_visual_videotimeline_update();
|
2010-08-30 21:49:33 -04:00
|
|
|
|
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 ();
|
2010-08-30 21:49:33 -04:00
|
|
|
|
2009-05-15 21:22:43 -04:00
|
|
|
} else if (p == "show-track-meters") {
|
2008-01-10 16:20:59 -05:00
|
|
|
editor->toggle_meter_updating();
|
2010-10-18 18:02:12 -04:00
|
|
|
} else if (p == "primary-clock-delta-edit-cursor") {
|
2011-11-18 12:06:11 -05:00
|
|
|
if (Config->get_primary_clock_delta_edit_cursor()) {
|
|
|
|
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") {
|
2011-11-18 12:06:11 -05:00
|
|
|
if (Config->get_secondary_clock_delta_edit_cursor()) {
|
|
|
|
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") {
|
|
|
|
stop_clocking ();
|
|
|
|
start_clocking ();
|
2013-06-21 17:15:56 -04:00
|
|
|
} else if (p == "waveform-gradient-depth") {
|
|
|
|
ArdourCanvas::WaveView::set_global_gradient_depth (config()->get_waveform_gradient_depth());
|
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 ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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 */
|
2012-10-10 23:10:18 -04:00
|
|
|
if (Config->get_sync_source() == JACK) {
|
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
|
|
|
|
|
|
|
}
|
|
|
|
|