control over transport-masters-just-roll-when-sync-is-lost

This commit is contained in:
Paul Davis 2020-03-23 19:08:57 -06:00
parent 43edfc8900
commit 3bbad66a99
2 changed files with 35 additions and 0 deletions

View file

@ -49,6 +49,7 @@ using namespace ArdourWidgets;
TransportMastersWidget::TransportMastersWidget ()
: table (4, 13)
, add_button (_("Add a new Transport Master"))
, lost_sync_button (_("Keeping rolling if sync is lost"))
, ignore_active_change (false)
{
midi_port_store = ListStore::create (port_columns);
@ -59,6 +60,13 @@ TransportMastersWidget::TransportMastersWidget ()
pack_start (table, PACK_EXPAND_WIDGET, 12);
pack_start (add_button, FALSE, FALSE);
pack_start (lost_sync_button, FALSE, FALSE, 12);
Config->ParameterChanged.connect (config_connection, invalidator (*this), boost::bind (&TransportMastersWidget::param_changed, this, _1), gui_context());
lost_sync_button.signal_toggled().connect (sigc::mem_fun (*this, &TransportMastersWidget::lost_sync_button_toggled));
lost_sync_button.set_active (Config->get_transport_masters_just_roll_when_sync_lost());
set_tooltip (lost_sync_button, string_compose (_("<b>When enabled</b>, if the signal from a transport master is lost, %1 will keep rolling at its current speed.\n"
"<b>When disabled</b>, loss of transport master sync causes %1 to stop"), PROGRAM_NAME));
add_button.signal_clicked ().connect (sigc::mem_fun (*this, &TransportMastersWidget::add_master));
@ -736,3 +744,24 @@ TransportMastersWidget::AddTransportMasterDialog::get_type() const
return LTC;
}
void
TransportMastersWidget::lost_sync_changed ()
{
lost_sync_button.set_active (Config->get_transport_masters_just_roll_when_sync_lost());
}
void
TransportMastersWidget::lost_sync_button_toggled ()
{
bool active = lost_sync_button.get_active ();
Config->set_transport_masters_just_roll_when_sync_lost (active);
}
void
TransportMastersWidget::param_changed (string const & p)
{
if (p == "transport-masters-just_roll-when-sync-lost") {
lost_sync_changed ();
}
}

View file

@ -130,6 +130,7 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
Gtk::Table table;
Gtk::Label col_title[14];
Gtk::Button add_button;
Gtk::CheckButton lost_sync_button;
sigc::connection update_connection;
PBD::ScopedConnection current_connection;
@ -163,6 +164,11 @@ class TransportMastersWidget : public Gtk::VBox, public ARDOUR::SessionHandlePtr
void add_master ();
void update_usability ();
void lost_sync_changed ();
void lost_sync_button_toggled ();
void param_changed (std::string const &);
PBD::ScopedConnection config_connection;
public:
bool idle_remove (Row*);
};