summaryrefslogtreecommitdiff
path: root/examples/monitor.c
diff options
context:
space:
mode:
authorMichal Ratajsky <[email protected]>2014-11-10 11:45:48 +0100
committerMichal Ratajsky <[email protected]>2014-11-10 11:45:48 +0100
commit782078cdb25fa9fa4c9e8654f44708356b844ffe (patch)
treebd3feb651b65a5edaf7ee23e6075e97de5538be9 /examples/monitor.c
parent38a6d46a1058cd98466589427d5da704db7bfe09 (diff)
downloadlibmatemixer-782078cdb25fa9fa4c9e8654f44708356b844ffe.tar.bz2
libmatemixer-782078cdb25fa9fa4c9e8654f44708356b844ffe.tar.xz
Provide a debug option in the example program
Diffstat (limited to 'examples/monitor.c')
-rw-r--r--examples/monitor.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/monitor.c b/examples/monitor.c
index 3e99053..0c7155f 100644
--- a/examples/monitor.c
+++ b/examples/monitor.c
@@ -364,11 +364,13 @@ int main (int argc, char *argv[])
{
MateMixerState state;
GOptionContext *ctx;
+ gboolean debug = FALSE;
gchar *backend = NULL;
gchar *server = NULL;
GError *error = NULL;
GOptionEntry entries[] = {
{ "backend", 'b', 0, G_OPTION_ARG_STRING, &backend, "Sound system to use (pulseaudio, alsa, oss, null)", NULL },
+ { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug, "Enable debug", NULL },
{ "server", 's', 0, G_OPTION_ARG_STRING, &server, "Sound server address", NULL },
{ NULL }
};
@@ -386,6 +388,9 @@ int main (int argc, char *argv[])
g_option_context_free (ctx);
+ if (debug == TRUE)
+ g_setenv ("G_MESSAGES_DEBUG", "all", FALSE);
+
/* Initialize the library.
* If the function returns FALSE, the library is not usable. */
if (mate_mixer_init () == FALSE)