From 498dfebcca3b97cdd7b83444040042fe06626241 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 9 Nov 2009 20:05:18 +0000 Subject: 90% done with external sync design changes (GUI now has toggle switch for ext/int sync; source chosen separately, currently in ardour prefs dialog ; fix libmidi++ and compilation scripts to correctly build JACK+ALSA support; minor contiuing tweaks on transport stuff git-svn-id: svn://localhost/ardour2/branches/3.0@6048 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui2.cc | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'gtk2_ardour/ardour_ui2.cc') diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index e2f4db7e5a..7f7d46150c 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -239,7 +239,7 @@ ARDOUR_UI::setup_transport () ARDOUR_UI::instance()->tooltips().set_tip (punch_in_button, _("Start recording at auto-punch start")); ARDOUR_UI::instance()->tooltips().set_tip (punch_out_button, _("Stop recording at auto-punch end")); ARDOUR_UI::instance()->tooltips().set_tip (click_button, _("Enable/Disable audio click")); - ARDOUR_UI::instance()->tooltips().set_tip (sync_option_combo, _("Positional sync source")); + ARDOUR_UI::instance()->tooltips().set_tip (sync_button, _("Positional sync source")); ARDOUR_UI::instance()->tooltips().set_tip (time_master_button, _("Does Ardour control the time?")); ARDOUR_UI::instance()->tooltips().set_tip (shuttle_box, _("Shuttle speed control")); ARDOUR_UI::instance()->tooltips().set_tip (shuttle_units_button, _("Select semitones or %%-age for speed display")); @@ -331,11 +331,10 @@ ARDOUR_UI::setup_transport () sdframe->set_shadow_type (SHADOW_IN); sdframe->add (speed_display_box); - mtc_port_changed (); - sync_option_combo.signal_changed().connect (mem_fun (*this, &ARDOUR_UI::sync_option_changed)); - // XXX HOW TO USE set_popdown_strings() and combo_fudge with this when we don't know - // the real strings till later? - set_size_request_to_display_given_text (sync_option_combo, X_("Igternal"), 4+COMBO_FUDGE, 10); + sync_button.set_name ("TransportSyncAlert"); + sync_button.signal_clicked().connect (mem_fun (*this, &ARDOUR_UI::sync_button_clicked)); + // XXX HOW TO USE set_popdown_strings() with this when we don't know the real strings till later? + set_size_request_to_display_given_text (sync_button, X_("Egternal"), 4, 10); shbox->pack_start (*sdframe, false, false); shbox->pack_start (shuttle_units_button, true, true); @@ -362,7 +361,7 @@ ARDOUR_UI::setup_transport () if (!Profile->get_sae()) { VBox* time_controls_box = manage (new VBox); - time_controls_box->pack_start (sync_option_combo, false, false); + time_controls_box->pack_start (sync_button, false, false); time_controls_box->pack_start (time_master_button, false, false); clock_box->pack_start (*time_controls_box, false, false, 1); } @@ -485,6 +484,24 @@ ARDOUR_UI::solo_blink (bool onoff) } } +void +ARDOUR_UI::sync_blink (bool onoff) +{ + if (session == 0 || !session->config.get_external_sync()) { + return; + } + + if (!session->transport_locked()) { + if (onoff) { + sync_button.set_state (STATE_ACTIVE); + } else { + sync_button.set_state (STATE_NORMAL); + } + } else { + sync_button.set_state (STATE_NORMAL); + } +} + void ARDOUR_UI::audition_blink (bool onoff) { @@ -846,13 +863,10 @@ ARDOUR_UI::editor_realized () } void -ARDOUR_UI::sync_option_changed () +ARDOUR_UI::sync_button_clicked () { if (session) { - ustring txt = sync_option_combo.get_active_text (); - if (txt.length()) { - session->request_slave_source (string_to_slave_source (txt)); - } + session->config.set_external_sync (sync_button.get_active()); } } -- cgit v1.2.3