Fix some bugs I introduced with the last commit.
[ardour.git] / gtk2_ardour / ardour_ui_options.cc
index 5bcecfaef5635c6d4b4de4e66f781b8b5f5a3612..27750eeb4384f62b33fc3ff72a2769f64f97ea89 100644 (file)
@@ -35,6 +35,7 @@
 #include "ardour/osc.h"
 #endif
 
+#include "audio_clock.h"
 #include "ardour_ui.h"
 #include "actions.h"
 #include "gui_thread.h"
@@ -278,6 +279,7 @@ void
 ARDOUR_UI::toggle_editing_space()
 {
        Glib::RefPtr<Action> act = ActionManager::get_action ("Common", "ToggleMaximalEditor");
+
        if (act) {
                Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
                if (tact->get_active()) {
@@ -296,27 +298,6 @@ ARDOUR_UI::setup_session_options ()
        _session->config.map_parameters (pc);
 }
 
-#if 0
-void
-ARDOUR_UI::handle_sync_change ()
-{
-       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);
-       }
-
-}
-#endif
-
 void
 ARDOUR_UI::parameter_changed (std::string p)
 {
@@ -327,11 +308,11 @@ ARDOUR_UI::parameter_changed (std::string p)
                ActionManager::map_some_state ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
 
                if (!_session->config.get_external_sync()) {
-                       sync_button.set_label (_("Internal"));
+                       sync_button.set_text (_("Internal"));
                        ActionManager::get_action ("Transport", "ToggleAutoPlay")->set_sensitive (true);
                        ActionManager::get_action ("Transport", "ToggleAutoReturn")->set_sensitive (true);
                } else {
-                       sync_button.set_label (sync_source_to_string (_session->config.get_sync_source(), true));
+                       sync_button.set_text (sync_source_to_string (_session->config.get_sync_source(), true));
                        /* 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);
@@ -379,8 +360,6 @@ ARDOUR_UI::parameter_changed (std::string p)
                }
        } else if (p == "clicking") {
                ActionManager::map_some_state ("Transport", "ToggleClick", &RCConfiguration::get_clicking);
-       } else if (p == "jack-time-master") {
-               ActionManager::map_some_state ("Transport",  "ToggleTimeMaster", sigc::mem_fun (_session->config, &SessionConfiguration::get_jack_time_master));
        } else if (p == "use-video-sync") {
                ActionManager::map_some_state ("Transport",  "ToggleVideoSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_use_video_sync));
        } else if (p == "video-pullup" || p == "timecode-format") {
@@ -395,9 +374,33 @@ ARDOUR_UI::parameter_changed (std::string p)
        } else if (p == "show-track-meters") {
                editor->toggle_meter_updating();
        } else if (p == "primary-clock-delta-edit-cursor") {
-               primary_clock.set_is_duration (Config->get_primary_clock_delta_edit_cursor());
+               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");
+               }
        } else if (p == "secondary-clock-delta-edit-cursor") {
-               secondary_clock.set_is_duration (Config->get_secondary_clock_delta_edit_cursor());
+               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");
+               }
+       }
+}
+
+void
+ARDOUR_UI::session_parameter_changed (std::string p)
+{
+       if (p == "native-file-data-format" || p == "native-file-header-format") {
+               update_format ();
        }
 }
 
@@ -407,11 +410,11 @@ ARDOUR_UI::reset_main_clocks ()
        ENSURE_GUI_THREAD (*this, &ARDOUR_UI::reset_main_clocks)
 
        if (_session) {
-               primary_clock.set (_session->audible_frame(), true);
-               secondary_clock.set (_session->audible_frame(), true);
+               primary_clock->set (_session->audible_frame(), true);
+               secondary_clock->set (_session->audible_frame(), true);
        } else {
-               primary_clock.set (0, true);
-               secondary_clock.set (0, true);
+               primary_clock->set (0, true);
+               secondary_clock->set (0, true);
        }
 }