diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2014-09-18 17:25:11 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2014-09-18 17:25:11 -0500 |
commit | ceff2e3a62f839dc4ca180b46c78ba2ca11a7411 (patch) | |
tree | 6091c1365dfe5d4a178b7a05024e3e6d413ba1d5 /libs | |
parent | 41f13c0109316f8264788f0c11e9dd6b4d2e928c (diff) |
plugin widgets were written to use Internal values, so use that for now
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gtkmm2ext/barcontroller.cc | 81 | ||||
-rw-r--r-- | libs/gtkmm2ext/gtkmm2ext/barcontroller.h | 4 |
2 files changed, 0 insertions, 85 deletions
diff --git a/libs/gtkmm2ext/barcontroller.cc b/libs/gtkmm2ext/barcontroller.cc index f427b50389..5ac5821205 100644 --- a/libs/gtkmm2ext/barcontroller.cc +++ b/libs/gtkmm2ext/barcontroller.cc @@ -40,7 +40,6 @@ using namespace Gtkmm2ext; BarController::BarController (Gtk::Adjustment& adj, boost::shared_ptr<PBD::Controllable> mc) : _slider (&adj, 60, 16) - , _logarithmic (false) , _switching (false) , _switch_on_release (false) { @@ -59,8 +58,6 @@ BarController::BarController (Gtk::Adjustment& adj, Gtk::SpinButton& spinner = _slider.get_spin_button(); spinner.signal_activate().connect (mem_fun (*this, &BarController::entry_activated)); spinner.signal_focus_out_event().connect (mem_fun (*this, &BarController::entry_focus_out)); - spinner.signal_input().connect (mem_fun (*this, &BarController::entry_input)); - spinner.signal_output().connect (mem_fun (*this, &BarController::entry_output)); spinner.set_digits (9); spinner.set_numeric (true); spinner.set_name ("BarControlSpinner"); @@ -170,81 +167,3 @@ BarController::set_sensitive (bool yn) Alignment::set_sensitive (yn); _slider.set_sensitive (yn); } - -/* - This is called when we need to update the adjustment with the value - from the spinner's text entry. - - We need to use Gtk::Entry::get_text to avoid recursive nastiness :) - - If we're not in logarithmic mode we can return false to use the - default conversion. - - In theory we should check for conversion errors but set numeric - mode to true on the spinner prevents invalid input. -*/ -int -BarController::entry_input (double* new_value) -{ - if (!_logarithmic) { - return false; - } - - // extract a double from the string and take its log - Gtk::SpinButton& spinner = _slider.get_spin_button(); - Entry *entry = dynamic_cast<Entry *>(&spinner); - double value; - - { - // Switch to user's preferred locale so that - // if they use different LC_NUMERIC conventions, - // we will honor them. - - PBD::LocaleGuard lg (""); - sscanf (entry->get_text().c_str(), "%lf", &value); - } - - *new_value = log(value); - - return true; -} - -/* - This is called when we need to update the spinner's text entry - with the value of the adjustment. - - We need to use Gtk::Entry::set_text to avoid recursive nastiness :) - - If we're not in logarithmic mode we can return false to use the - default conversion. -*/ -bool -BarController::entry_output () -{ - if (!_logarithmic) { - return false; - } - - char buf[128]; - Gtk::SpinButton& spinner = _slider.get_spin_button(); - - // generate the exponential and turn it into a string - // convert to correct locale. - - stringstream stream; - string str; - - { - // Switch to user's preferred locale so that - // if they use different LC_NUMERIC conventions, - // we will honor them. - - PBD::LocaleGuard lg (""); - snprintf (buf, sizeof (buf), "%g", exp (spinner.get_adjustment()->get_value())); - } - - Entry *entry = dynamic_cast<Entry *>(&spinner); - entry->set_text(buf); - - return true; -} diff --git a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h index 9aa1630b02..be28ff015a 100644 --- a/libs/gtkmm2ext/gtkmm2ext/barcontroller.h +++ b/libs/gtkmm2ext/gtkmm2ext/barcontroller.h @@ -36,7 +36,6 @@ class LIBGTKMM2EXT_API BarController : public Gtk::Alignment virtual ~BarController (); void set_sensitive (bool yn); - void set_logarithmic (bool yn) { _logarithmic = yn; } PixFader::Tweaks tweaks() const { return _slider.tweaks (); } void set_tweaks (PixFader::Tweaks t) { _slider.set_tweaks (t);} @@ -65,15 +64,12 @@ class LIBGTKMM2EXT_API BarController : public Gtk::Alignment HSliderController _slider; bool entry_focus_out (GdkEventFocus*); void entry_activated (); - int entry_input (double* new_value); - bool entry_output (); void before_expose (); gint switch_to_bar (); gint switch_to_spinner (); bool _grabbed; - bool _logarithmic; bool _switching; bool _switch_on_release; |