properly restore newer (cairo-canvas related) UI config parameters

This commit is contained in:
Paul Davis 2013-06-21 17:15:56 -04:00
parent 1b73ab2065
commit 11becd4a6b
6 changed files with 19 additions and 4 deletions

View 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;

View 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());
}
}

View 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 ()
{

View 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 ()
{

View 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) \

View 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]);