summaryrefslogtreecommitdiff
path: root/src/wx/wx_util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-06-09 23:56:33 +0100
committerCarl Hetherington <cth@carlh.net>2014-06-09 23:56:33 +0100
commit93c996b302589dee7d43d990f3650d636345a545 (patch)
tree976732dc7774b8b4ae5a3f2490bc4a6259d2892b /src/wx/wx_util.cc
parent7e690d21278df14b113f3602cbbd43f6214fd614 (diff)
Use a SpinCtrlDouble for audio gain, and change its representation
from float to double. Requested-by: Mattias Mattsson
Diffstat (limited to 'src/wx/wx_util.cc')
-rw-r--r--src/wx/wx_util.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc
index 96278b82b..b73cd490d 100644
--- a/src/wx/wx_util.cc
+++ b/src/wx/wx_util.cc
@@ -190,6 +190,15 @@ checked_set (wxSpinCtrl* widget, int value)
}
void
+checked_set (wxSpinCtrlDouble* widget, double value)
+{
+ /* XXX: completely arbitrary epsilon */
+ if (fabs (widget->GetValue() - value) < 1e-16) {
+ widget->SetValue (value);
+ }
+}
+
+void
checked_set (wxChoice* widget, int value)
{
if (widget->GetSelection() != value) {
@@ -297,6 +306,12 @@ wx_get (wxChoice* w)
return w->GetSelection ();
}
+double
+wx_get (wxSpinCtrlDouble* w)
+{
+ return w->GetValue ();
+}
+
void
run_gui_loop ()
{