remove "New Return" menu option from processor box; make return toggle processor...
[ardour.git] / gtk2_ardour / ardour_ui_options.cc
index 29c7c3cc6cd16014f04c2202d30ec94cb7e8277b..c00097d41712e980fa1067f580017a5358d55e1b 100644 (file)
@@ -47,6 +47,12 @@ using namespace ARDOUR;
 using namespace PBD;
 using namespace sigc;
 
+void
+ARDOUR_UI::toggle_external_sync()
+{
+       ActionManager::toggle_config_state_foo ("Transport", "ToggleExternalSync", mem_fun (session->config, &SessionConfiguration::set_external_sync), mem_fun (session->config, &SessionConfiguration::get_external_sync));
+}
+
 void
 ARDOUR_UI::toggle_time_master ()
 {
@@ -107,22 +113,6 @@ ARDOUR_UI::toggle_click ()
        ActionManager::toggle_config_state ("Transport", "ToggleClick", &RCConfiguration::set_clicking, &RCConfiguration::get_clicking);
 }
 
-void
-ARDOUR_UI::toggle_session_auto_loop ()
-{
-       if (session) {
-               if (session->get_play_loop()) {
-                       if (session->transport_rolling()) {
-                               transport_roll();
-                       } else {
-                               session->request_play_loop (false);
-                       }
-               } else {
-                       session->request_play_loop (true);
-               }
-       }
-}
-
 void
 ARDOUR_UI::unset_dual_punch ()
 {
@@ -279,70 +269,53 @@ ARDOUR_UI::toggle_editing_space()
 }
 
 void
-ARDOUR_UI::mtc_port_changed ()
+ARDOUR_UI::setup_session_options ()
 {
-       bool have_mtc;
-       bool have_midi_clock;
-
-       if (session) {
-               if (session->mtc_port()) {
-                       have_mtc = true;
-               } else {
-                       have_mtc = false;
-               }
-               if (session->midi_clock_port()) {
-                       have_midi_clock = true;
-               } else {
-                       have_midi_clock = false;
-               }
-       } else {
-               have_mtc = false;
-               have_midi_clock = false;
-       }
-
-       positional_sync_strings.clear ();
-       positional_sync_strings.push_back (slave_source_to_string (None));
-       if (have_mtc) {
-               positional_sync_strings.push_back (slave_source_to_string (MTC));
-       }
-       if (have_midi_clock) {
-               positional_sync_strings.push_back (slave_source_to_string (MIDIClock));
-       }
-       positional_sync_strings.push_back (slave_source_to_string (JACK));
-
-       set_popdown_strings (sync_option_combo, positional_sync_strings);
+       session->config.ParameterChanged.connect (mem_fun (*this, &ARDOUR_UI::parameter_changed));
+       session->config.map_parameters (mem_fun (*this, &ARDOUR_UI::parameter_changed));
 }
 
+#if 0
 void
-ARDOUR_UI::setup_session_options ()
+ARDOUR_UI::handle_sync_change ()
 {
-       mtc_port_changed ();
+       if (!session) {
+               return;
+       }
+       if (!session->config.get_external_sync()) {
+               sync_button.set_label (_("Internal"));
+               ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
+               ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
+       } else {
+               sync_button.set_label (_("External"));
+               /* 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);
+       }
 
-       Config->ParameterChanged.connect (mem_fun (*this, &ARDOUR_UI::parameter_changed));
 }
+#endif
 
 void
 ARDOUR_UI::parameter_changed (std::string p)
 {
        ENSURE_GUI_THREAD (bind (mem_fun (*this, &ARDOUR_UI::parameter_changed), p));
 
-       if (p == "slave-source") {
+       if (p == "external-sync") {
 
-               sync_option_combo.set_active_text (slave_source_to_string (Config->get_slave_source()));
+               ActionManager::map_some_state ("Transport", "ToggleExternalSync", mem_fun (session->config, &SessionConfiguration::get_external_sync));
 
-               switch (Config->get_slave_source()) {
-               case None:
+               if (!session->config.get_external_sync()) {
+                       sync_button.set_label (_("Internal"));
                        ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
                        ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
-                       break;
-
-               default:
+               } else {
+                       sync_button.set_label (sync_source_to_string (session->config.get_sync_source()));
                        /* 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);
-                       break;
                }
-
+       
        } else if (p == "send-mtc") {
 
                ActionManager::map_some_state ("options", "SendMTC", &RCConfiguration::get_send_mtc);
@@ -416,7 +389,7 @@ ARDOUR_UI::parameter_changed (std::string p)
                        shuttle_units_button.set_label(_("ST"));
                        break;
                }
-       } else if (p == "video-pullup" || p == "smpte-format") {
+       } else if (p == "video-pullup" || p == "timecode-format") {
                if (session) {
                        primary_clock.set (session->audible_frame(), true);
                        secondary_clock.set (session->audible_frame(), true);