From 8481ebdc843ec212e59f98c8ff5f718485f864c0 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Thu, 3 Jul 2014 19:06:24 +0200 Subject: Remove GStreamer parts and use libmatemixer --- plugins/media-keys/msd-media-keys-plugin.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'plugins/media-keys/msd-media-keys-plugin.c') diff --git a/plugins/media-keys/msd-media-keys-plugin.c b/plugins/media-keys/msd-media-keys-plugin.c index 93a805f..0b40418 100644 --- a/plugins/media-keys/msd-media-keys-plugin.c +++ b/plugins/media-keys/msd-media-keys-plugin.c @@ -20,8 +20,13 @@ #include "config.h" +#include #include -#include +#include + +#ifdef HAVE_LIBMATEMIXER +#include +#endif #include "mate-settings-plugin.h" #include "msd-media-keys-plugin.h" @@ -70,11 +75,13 @@ static void impl_activate (MateSettingsPlugin *plugin) { gboolean res; - GError *error; + GError *error = NULL; g_debug ("Activating media_keys plugin"); - error = NULL; +#ifdef HAVE_LIBMATEMIXER + mate_mixer_init (); +#endif res = msd_media_keys_manager_start (MSD_MEDIA_KEYS_PLUGIN (plugin)->priv->manager, &error); if (! res) { g_warning ("Unable to start media_keys manager: %s", error->message); @@ -87,12 +94,16 @@ impl_deactivate (MateSettingsPlugin *plugin) { g_debug ("Deactivating media_keys plugin"); msd_media_keys_manager_stop (MSD_MEDIA_KEYS_PLUGIN (plugin)->priv->manager); + +#ifdef HAVE_LIBMATEMIXER + mate_mixer_deinit (); +#endif } static void msd_media_keys_plugin_class_init (MsdMediaKeysPluginClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); MateSettingsPluginClass *plugin_class = MATE_SETTINGS_PLUGIN_CLASS (klass); object_class->finalize = msd_media_keys_plugin_finalize; @@ -107,4 +118,3 @@ static void msd_media_keys_plugin_class_finalize (MsdMediaKeysPluginClass *klass) { } - -- cgit v1.2.1 From 1eadf051aed2cbf103e2e9653107339be01a5740 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Sat, 5 Jul 2014 02:16:45 +0200 Subject: Clean things up a bit, update copyright, remove unused code, fix NEWS and compiler warnings --- plugins/media-keys/msd-media-keys-plugin.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'plugins/media-keys/msd-media-keys-plugin.c') diff --git a/plugins/media-keys/msd-media-keys-plugin.c b/plugins/media-keys/msd-media-keys-plugin.c index 0b40418..28134b2 100644 --- a/plugins/media-keys/msd-media-keys-plugin.c +++ b/plugins/media-keys/msd-media-keys-plugin.c @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- * * Copyright (C) 2007 William Jon McCann + * Copyright (C) 2014 Michal Ratajsky * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,7 +33,8 @@ #include "msd-media-keys-plugin.h" #include "msd-media-keys-manager.h" -struct MsdMediaKeysPluginPrivate { +struct _MsdMediaKeysPluginPrivate +{ MsdMediaKeysManager *manager; }; @@ -51,24 +53,17 @@ msd_media_keys_plugin_init (MsdMediaKeysPlugin *plugin) } static void -msd_media_keys_plugin_finalize (GObject *object) +msd_media_keys_plugin_dispose (GObject *object) { MsdMediaKeysPlugin *plugin; - g_return_if_fail (object != NULL); - g_return_if_fail (MSD_IS_MEDIA_KEYS_PLUGIN (object)); - - g_debug ("MsdMediaKeysPlugin finalizing"); + g_debug ("MsdMediaKeysPlugin disposing"); plugin = MSD_MEDIA_KEYS_PLUGIN (object); - g_return_if_fail (plugin->priv != NULL); - - if (plugin->priv->manager != NULL) { - g_object_unref (plugin->priv->manager); - } + g_clear_object (&plugin->priv->manager); - G_OBJECT_CLASS (msd_media_keys_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (msd_media_keys_plugin_parent_class)->dispose (object); } static void @@ -106,7 +101,7 @@ msd_media_keys_plugin_class_init (MsdMediaKeysPluginClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); MateSettingsPluginClass *plugin_class = MATE_SETTINGS_PLUGIN_CLASS (klass); - object_class->finalize = msd_media_keys_plugin_finalize; + object_class->dispose = msd_media_keys_plugin_dispose; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; -- cgit v1.2.1 From 3b519db084df2ad290cd897b1317daf7f53c05e4 Mon Sep 17 00:00:00 2001 From: Michal Ratajsky Date: Mon, 18 Aug 2014 21:17:09 +0200 Subject: Update to libmatemixer changes --- plugins/media-keys/msd-media-keys-plugin.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'plugins/media-keys/msd-media-keys-plugin.c') diff --git a/plugins/media-keys/msd-media-keys-plugin.c b/plugins/media-keys/msd-media-keys-plugin.c index 28134b2..3cce9d2 100644 --- a/plugins/media-keys/msd-media-keys-plugin.c +++ b/plugins/media-keys/msd-media-keys-plugin.c @@ -89,10 +89,6 @@ impl_deactivate (MateSettingsPlugin *plugin) { g_debug ("Deactivating media_keys plugin"); msd_media_keys_manager_stop (MSD_MEDIA_KEYS_PLUGIN (plugin)->priv->manager); - -#ifdef HAVE_LIBMATEMIXER - mate_mixer_deinit (); -#endif } static void -- cgit v1.2.1