From b37d923b48165a3f2b91902849ee96a6cfcd2c9d Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Thu, 7 Jan 2016 01:09:49 +0100 Subject: Add stored control notifications to the example program for completeness --- examples/monitor.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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. */ -- cgit v1.2.1