properly restore newer (cairo-canvas related) UI config parameters
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 21 Jun 2013 21:15:56 +0000 (17:15 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 21 Jun 2013 21:15:56 +0000 (17:15 -0400)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui_options.cc
gtk2_ardour/theme_manager.cc
gtk2_ardour/ui_config.cc
gtk2_ardour/ui_config.h
libs/canvas/wave_view.cc

index ad727d00d6c6f8eb7d54d48b4a64d9661e0a2cd4..d97dc880c4854844767e2a8dc5574f542430bfaa 100644 (file)
@@ -210,6 +210,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
        }
 
        ui_config = new UIConfiguration();
+       ui_config->ParameterChanged.connect (sigc::mem_fun (*this, &ARDOUR_UI::parameter_changed));
+       boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
+       ui_config->map_parameters (pc);
 
        editor = 0;
        mixer = 0;
index 8cb1376522c722e7f3790d6fbe73f57c21dce6e1..15c58a8b8d3b1e151531a80b05c505761f2c965d 100644 (file)
@@ -33,6 +33,8 @@
 #include "ardour/osc.h"
 #endif
 
+#include "canvas/wave_view.h"
+
 #include "audio_clock.h"
 #include "ardour_ui.h"
 #include "actions.h"
@@ -311,8 +313,6 @@ ARDOUR_UI::setup_session_options ()
 void
 ARDOUR_UI::parameter_changed (std::string p)
 {
-       ENSURE_GUI_THREAD (*this, &ARDOUR_UI::parameter_changed, p)
-
        if (p == "external-sync") {
 
                ActionManager::map_some_state ("Transport", "ToggleExternalSync", sigc::mem_fun (_session->config, &SessionConfiguration::get_external_sync));
@@ -413,6 +413,8 @@ ARDOUR_UI::parameter_changed (std::string p)
        } else if (p == "super-rapid-clock-update") {
                stop_clocking ();
                start_clocking ();
+       } else if (p == "waveform-gradient-depth") {
+               ArdourCanvas::WaveView::set_global_gradient_depth (config()->get_waveform_gradient_depth());
        }
 }
 
index cd2645ddf66fd54a642ceb3d7bb968d02455f818..1fabfacb7eba7219a1ca3593def7b9b4bc36dfb8 100644 (file)
@@ -296,7 +296,6 @@ ThemeManager::on_waveform_gradient_depth_change ()
        ArdourCanvas::WaveView::set_global_gradient_depth (v);
 }
 
-
 void
 ThemeManager::on_timeline_item_gradient_depth_change ()
 {
index 86f03bbd95ad5c4c9ab755c394bddc78f962f17f..7cb1953390ba232933727a719809d05ce124dfb7 100644 (file)
@@ -59,6 +59,15 @@ UIConfiguration::~UIConfiguration ()
 {
 }
 
+void
+UIConfiguration::map_parameters (boost::function<void (std::string)>& functor)
+{
+#undef  UI_CONFIG_VARIABLE
+#define UI_CONFIG_VARIABLE(Type,var,Name,value) functor (Name);
+#include "ui_config_vars.h"
+#undef  UI_CONFIG_VARIABLE
+}
+
 int
 UIConfiguration::load_defaults ()
 {
index ed8a88c1da26884dd0f9f7a63dbb3fb301082b23..bfa8859afdc671994b52935dfaae33a06e604bf5 100644 (file)
@@ -91,7 +91,8 @@ class UIConfiguration : public PBD::Stateful
 
        uint32_t color_by_name (const std::string&);
 
-       sigc::signal<void,const char*> ParameterChanged;
+        sigc::signal<void,std::string> ParameterChanged;
+       void map_parameters (boost::function<void (std::string)>&);
 
 #undef UI_CONFIG_VARIABLE
 #define UI_CONFIG_VARIABLE(Type,var,name,value) \
index ead80f7cbfb23e28690393615769f540c3963f8e..8a8b528b6f2bd7a576137f59169de0f958881c1c 100644 (file)
@@ -603,6 +603,7 @@ WaveView::CacheEntry::image ()
 
 #else
                cerr << "draw, logscaled = " << _wave_view->_logscaled << " global " << WaveView::_global_logscaled << endl;
+               cerr << "gradient depth: " << _wave_view->gradient_depth() << endl;
 
                boost::scoped_array<LineTips> tips (new LineTips[_n_peaks]);