summaryrefslogtreecommitdiff
path: root/backends/null/null-backend.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-06-26 01:35:56 +0200
committerMichal Ratajsky <[email protected]>2014-06-26 01:35:56 +0200
commitf235385f34c81d4cd9092b94cb24670eb25421fa (patch)
tree489c2b9549302493da9b2d56b92aa4613722a90a /backends/null/null-backend.c
parent0362ccf20d51fa27d7febd0e6c0fa368f2f9e663 (diff)
downloadlibmatemixer-f235385f34c81d4cd9092b94cb24670eb25421fa.tar.bz2
libmatemixer-f235385f34c81d4cd9092b94cb24670eb25421fa.tar.xz
Minor fixes
Diffstat (limited to 'backends/null/null-backend.c')
-rw-r--r--backends/null/null-backend.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/backends/null/null-backend.c b/backends/null/null-backend.c
index 46c5fbf..05d06a8 100644
--- a/backends/null/null-backend.c
+++ b/backends/null/null-backend.c
@@ -15,8 +15,6 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-// XXX implement properties from MateMixerBackend
-
#include <glib.h>
#include <glib-object.h>
@@ -29,10 +27,22 @@
#define BACKEND_NAME "Null"
#define BACKEND_PRIORITY 0
+enum {
+ PROP_0,
+ PROP_STATE,
+ PROP_DEFAULT_INPUT,
+ PROP_DEFAULT_OUTPUT,
+ N_PROPERTIES
+};
+
static void mate_mixer_backend_interface_init (MateMixerBackendInterface *iface);
static void null_backend_class_init (NullBackendClass *klass);
static void null_backend_class_finalize (NullBackendClass *klass);
+static void null_backend_get_property (GObject *object,
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec);
static void null_backend_init (NullBackend *null);
G_DEFINE_DYNAMIC_TYPE_EXTENDED (NullBackend, null_backend,
@@ -72,6 +82,14 @@ mate_mixer_backend_interface_init (MateMixerBackendInterface *iface)
static void
null_backend_class_init (NullBackendClass *klass)
{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (klass);
+ object_class->get_property = null_backend_get_property;
+
+ g_object_class_override_property (object_class, PROP_STATE, "state");
+ g_object_class_override_property (object_class, PROP_DEFAULT_INPUT, "default-input");
+ g_object_class_override_property (object_class, PROP_DEFAULT_OUTPUT, "default-output");
}
/* Called in the code generated by G_DEFINE_DYNAMIC_TYPE_EXTENDED() */
@@ -81,6 +99,26 @@ null_backend_class_finalize (NullBackendClass *klass)
}
static void
+null_backend_get_property (GObject *object,
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ switch (param_id) {
+ case PROP_STATE:
+ g_value_set_enum (value, MATE_MIXER_STATE_READY);
+ break;
+ case PROP_DEFAULT_INPUT:
+ case PROP_DEFAULT_OUTPUT:
+ g_value_set_object (value, NULL);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+static void
null_backend_init (NullBackend *null)
{
}