summaryrefslogtreecommitdiff
path: root/backends/null
diff options
context:
space:
mode:
Diffstat (limited to 'backends/null')
-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)
{
}