summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2016-01-07 01:09:49 +0100
committerraveit65 <[email protected]>2017-02-21 11:55:59 +0100
commitb37d923b48165a3f2b91902849ee96a6cfcd2c9d (patch)
tree6eb494b2a687c7df746dd40a0fa308cafdd532a4 /examples
parent7666c62a307e3cb23994add9f58c8d03478f152f (diff)
downloadlibmatemixer-b37d923b48165a3f2b91902849ee96a6cfcd2c9d.tar.bz2
libmatemixer-b37d923b48165a3f2b91902849ee96a6cfcd2c9d.tar.xz
Add stored control notifications to the example program for completeness
Diffstat (limited to 'examples')
-rw-r--r--examples/monitor.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/monitor.c b/examples/monitor.c
index 28288d3..9f1e2a2 100644
--- a/examples/monitor.c
+++ b/examples/monitor.c
@@ -350,6 +350,22 @@ on_context_stream_removed (MateMixerContext *context, MateMixerStream *stream)
g_print ("Stream removed: %s\n", mate_mixer_stream_get_name (stream));
}
+static void
+on_context_stored_control_added (MateMixerContext *context,
+ MateMixerStreamControl *control)
+{
+ g_print ("Stored control added: %s\n",
+ mate_mixer_stream_control_get_name (control));
+}
+
+static void
+on_context_stored_control_removed (MateMixerContext *context,
+ MateMixerStreamControl *control)
+{
+ g_print ("Stored control removed: %s\n",
+ mate_mixer_stream_control_get_name (control));
+}
+
#ifdef G_OS_UNIX
static gboolean
on_signal (gpointer mainloop)
@@ -453,6 +469,14 @@ int main (int argc, char *argv[])
"stream-removed",
G_CALLBACK (on_context_stream_removed),
NULL);
+ g_signal_connect (G_OBJECT (context),
+ "stored-control-added",
+ G_CALLBACK (on_context_stored_control_added),
+ NULL);
+ g_signal_connect (G_OBJECT (context),
+ "stored-control-removed",
+ G_CALLBACK (on_context_stored_control_removed),
+ NULL);
/* When mate_mixer_context_open() returns TRUE, the state must be either
* MATE_MIXER_STATE_READY or MATE_MIXER_STATE_CONNECTING. */