From 8bb09ca0225886c18e351d3c6156521ed479edd1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 26 Jun 2014 22:13:13 -0500 Subject: Design prefers to have a volume slider instead of presets, so remove the AlarmVolume enum and replace it with an int range. --- src/exporter.cpp | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'src/exporter.cpp') diff --git a/src/exporter.cpp b/src/exporter.cpp index 3ba95bf..a5a059d 100644 --- a/src/exporter.cpp +++ b/src/exporter.cpp @@ -137,34 +137,10 @@ private: } - static void - on_gobject_notify_volume(GObject* o, GParamSpec* pspec, gpointer p) - { - int val = 0; - g_object_get (o, pspec->name, &val, nullptr); - static_cast*>(p)->set(AlarmVolume(val)); - } - void bind_volume_property(gpointer o, const char* propname, core::Property& p) - { - // initialize the GObject property from the Settings - g_object_set(o, propname, (int)p.get(), nullptr); - - // when the GObject changes, update the Settings - const std::string notify_propname = std::string("notify::") + propname; - g_signal_connect(o, notify_propname.c_str(), - G_CALLBACK(on_gobject_notify_volume), &p); - - // when the Settings changes, update the GObject - p.changed().connect([o, propname](AlarmVolume i){ - g_object_set(o, propname, (int)i, nullptr); - }); - } - - void alarm_properties_init() { bind_int_property(m_alarm_props, "duration", m_settings->alarm_duration); - bind_volume_property(m_alarm_props, "default-volume", m_settings->alarm_volume); + bind_int_property(m_alarm_props, "default-volume", m_settings->alarm_volume); bind_string_property(m_alarm_props, "default-sound", m_settings->alarm_sound); } -- cgit v1.2.3