diff options
-rw-r--r-- | .pc/.quilt_patches | 1 | ||||
-rw-r--r-- | .pc/.quilt_series | 1 | ||||
-rw-r--r-- | .pc/.version | 1 | ||||
-rw-r--r-- | .pc/applied-patches | 3 | ||||
-rw-r--r-- | .pc/sound_nua.patch/src/sound-service-dbus.c | 489 | ||||
-rw-r--r-- | .pc/sound_ubuntustudio.patch/src/sound-service-dbus.c | 497 | ||||
-rw-r--r-- | .pc/sound_xubuntu.patch/src/sound-service-dbus.c | 495 | ||||
-rw-r--r-- | debian/changelog | 864 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 34 | ||||
-rw-r--r-- | debian/copyright | 37 | ||||
-rw-r--r-- | debian/patches/series | 3 | ||||
-rw-r--r-- | debian/patches/sound_nua.patch | 20 | ||||
-rw-r--r-- | debian/patches/sound_ubuntustudio.patch | 18 | ||||
-rw-r--r-- | debian/patches/sound_xubuntu.patch | 17 | ||||
-rwxr-xr-x | debian/rules | 13 | ||||
-rw-r--r-- | debian/source/format | 1 | ||||
-rw-r--r-- | debian/watch | 2 | ||||
-rw-r--r-- | src/sound-service-dbus.c | 12 |
19 files changed, 2508 insertions, 1 deletions
diff --git a/.pc/.quilt_patches b/.pc/.quilt_patches new file mode 100644 index 0000000..6857a8d --- /dev/null +++ b/.pc/.quilt_patches @@ -0,0 +1 @@ +debian/patches diff --git a/.pc/.quilt_series b/.pc/.quilt_series new file mode 100644 index 0000000..c206706 --- /dev/null +++ b/.pc/.quilt_series @@ -0,0 +1 @@ +series diff --git a/.pc/.version b/.pc/.version new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/.pc/.version @@ -0,0 +1 @@ +2 diff --git a/.pc/applied-patches b/.pc/applied-patches new file mode 100644 index 0000000..92929c8 --- /dev/null +++ b/.pc/applied-patches @@ -0,0 +1,3 @@ +sound_nua.patch +sound_xubuntu.patch +sound_ubuntustudio.patch diff --git a/.pc/sound_nua.patch/src/sound-service-dbus.c b/.pc/sound_nua.patch/src/sound-service-dbus.c new file mode 100644 index 0000000..5e004cb --- /dev/null +++ b/.pc/sound_nua.patch/src/sound-service-dbus.c @@ -0,0 +1,489 @@ +/* + * Copyright 2010 Canonical Ltd. + * + * Authors: + * Conor Curran <conor.curran@canonical.com> + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gio/gio.h> +#include <unistd.h> +#include <glib/gi18n.h> +#include <libindicator/indicator-service.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/client.h> + +#include "sound-service-dbus.h" +#include "device.h" +#include "gen-sound-service.xml.h" +#include "dbus-shared-names.h" +#include "sound-service-marshal.h" + +// DBUS methods +static void bus_method_call (GDBusConnection * connection, + const gchar * sender, + const gchar * path, + const gchar * interface, + const gchar * method, + GVariant * params, + GDBusMethodInvocation * invocation, + gpointer user_data); + +static GDBusInterfaceVTable interface_table = { + method_call: bus_method_call, + get_property: NULL, /* No properties */ + set_property: NULL /* No properties */ +}; + + +typedef struct _SoundServiceDbusPrivate SoundServiceDbusPrivate; + +struct _SoundServiceDbusPrivate { + GDBusConnection* connection; + DbusmenuMenuitem* root_menuitem; + Device* device; + gboolean greeter_mode; + guint registration_id; +}; + +enum { + TRACK_SPECIFIC_ITEM, + PLAYER_SPECIFIC_ITEM, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static GDBusNodeInfo * node_info = NULL; +static GDBusInterfaceInfo * interface_info = NULL; + +#define SOUND_SERVICE_DBUS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUND_SERVICE_DBUS_TYPE, SoundServiceDbusPrivate)) + +static void sound_service_dbus_class_init (SoundServiceDbusClass *klass); +static void sound_service_dbus_init (SoundServiceDbus *self); +static void sound_service_dbus_dispose (GObject *object); +static void sound_service_dbus_finalize (GObject *object); + +static void show_sound_settings_dialog (DbusmenuMenuitem *mi, + gpointer user_data); +static gboolean sound_service_dbus_blacklist_player (SoundServiceDbus* self, + const gchar* player_name, + gboolean blacklist); + +static gboolean sound_service_dbus_is_blacklisted (SoundServiceDbus* self, + const gchar* player_name); + +G_DEFINE_TYPE (SoundServiceDbus, sound_service_dbus, G_TYPE_OBJECT); + +static void +sound_service_dbus_class_init (SoundServiceDbusClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof(SoundServiceDbusPrivate)); + + object_class->dispose = sound_service_dbus_dispose; + object_class->finalize = sound_service_dbus_finalize; + + g_assert(klass != NULL); + + if (node_info == NULL) { + GError * error = NULL; + + node_info = g_dbus_node_info_new_for_xml(_sound_service, &error); + if (error != NULL) { + g_critical ("Unable to parse Indicator Service Interface description: %s", + error->message); + g_error_free(error); + } + } + + if (interface_info == NULL) { + interface_info = g_dbus_node_info_lookup_interface (node_info, + INDICATOR_SOUND_DBUS_INTERFACE); + + if (interface_info == NULL) { + g_critical("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'"); + } + } + signals[TRACK_SPECIFIC_ITEM] = g_signal_new("track-specific-item-requested", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + _sound_service_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, + G_TYPE_STRING); + signals[PLAYER_SPECIFIC_ITEM] = g_signal_new("player-specific-item-requested", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + _sound_service_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, + G_TYPE_STRING); +} + +static void +sound_service_dbus_init (SoundServiceDbus *self) +{ + GError *error = NULL; + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + + priv->connection = NULL; + + /* Fetch the session bus */ + priv->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + + if (error != NULL) { + g_critical ("sound-service-dbus:Unable to connect to the session bus when creating indicator sound service : %s", error->message); + g_error_free (error); + return; + } + /* register the service on it */ + priv->registration_id = g_dbus_connection_register_object (priv->connection, + INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH, + interface_info, + &interface_table, + self, + NULL, + &error); + if (error != NULL) { + g_critical ("Unable to register the sound service on DBus: %s", error->message); + g_error_free (error); + } +} + +DbusmenuMenuitem* +sound_service_dbus_create_root_item (SoundServiceDbus* self, gboolean greeter_mode) +{ + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + priv->greeter_mode = greeter_mode; + priv->root_menuitem = dbusmenu_menuitem_new(); + DbusmenuServer *server = dbusmenu_server_new (INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH); + dbusmenu_server_set_root (server, priv->root_menuitem); + g_object_unref (priv->root_menuitem); + priv->device = device_new (self); + return priv->root_menuitem; +} + +void +sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, + DbusmenuMenuitem* mute_item, + DbusmenuMenuitem* slider_item, + DbusmenuMenuitem* voip_input_menu_item) +{ + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + + // Mute, Volume and Voip widgets + dbusmenu_menuitem_child_add_position (priv->root_menuitem, mute_item, 0); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, slider_item, 1); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, voip_input_menu_item, 2); + + if (!priv->greeter_mode) { + // Separator + DbusmenuMenuitem* separator = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set (separator, + DBUSMENU_MENUITEM_PROP_TYPE, + DBUSMENU_CLIENT_TYPES_SEPARATOR); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3); + g_object_unref (separator); + + // Sound preferences dialog + DbusmenuMenuitem* settings_mi = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set( settings_mi, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Sound Settings...")); + dbusmenu_menuitem_child_append(priv->root_menuitem, settings_mi); + g_object_unref (settings_mi); + g_signal_connect(G_OBJECT(settings_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, + G_CALLBACK(show_sound_settings_dialog), NULL); + } +} + +/** +show_sound_settings_dialog: +Bring up the gnome volume preferences dialog +**/ +static void +show_sound_settings_dialog (DbusmenuMenuitem *mi, + gpointer user_data) +{ + GError * error = NULL; + if (!g_spawn_command_line_async("gnome-volume-control --page=applications", &error) && + !g_spawn_command_line_async("gnome-control-center sound", &error) && + !g_spawn_command_line_async("xfce4-mixer", &error)) + { + g_warning("Unable to show dialog: %s", error->message); + g_error_free(error); + } +} + +static void +sound_service_dbus_dispose (GObject *object) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (object); + + if (priv->connection && priv->registration_id) { + g_dbus_connection_unregister_object (priv->connection, priv->registration_id); + priv->registration_id = 0; + } + + g_clear_object(&priv->connection); + + G_OBJECT_CLASS (sound_service_dbus_parent_class)->dispose (object); + //TODO dispose of the active sink instance ! + return; +} + +static void +sound_service_dbus_finalize (GObject *object) +{ + G_OBJECT_CLASS (sound_service_dbus_parent_class)->finalize (object); + return; +} + + +// EMIT STATE SIGNAL +void +sound_service_dbus_update_sound_state (SoundServiceDbus* self, + SoundState new_state) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (self); + + GVariant* v_output = g_variant_new("(i)", (int)new_state); + + GError * error = NULL; + + if (priv->connection == NULL || + g_dbus_connection_is_closed (priv->connection) == TRUE){ + g_critical ("sound_service_dbus_update_sound_state - dbus connection is %s !!", + priv->connection == NULL? "NULL" : "closed"); + return; + } + + //g_debug ("emitting state signal with value %i", (int)new_state); + g_dbus_connection_emit_signal( priv->connection, + NULL, + INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH, + INDICATOR_SOUND_DBUS_INTERFACE, + INDICATOR_SOUND_SIGNAL_STATE_UPDATE, + v_output, + &error ); + if (error != NULL) { + g_critical ("Unable to emit signal because : %s", error->message); + g_error_free(error); + } +} + +//HANDLE DBUS METHOD CALLS +static void +bus_method_call (GDBusConnection * connection, + const gchar * sender, + const gchar * path, + const gchar * interface, + const gchar * method, + GVariant * params, + GDBusMethodInvocation * invocation, + gpointer user_data) +{ + SoundServiceDbus* service = SOUND_SERVICE_DBUS(user_data); + g_return_if_fail ( IS_SOUND_SERVICE_DBUS(service) ); + GVariant * retval = NULL; + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (service); + + if (g_strcmp0(method, "GetSoundState") == 0) { + g_debug("Get state - %i", device_get_state (priv->device)); + retval = g_variant_new ( "(i)", device_get_state (priv->device)); + } + else if (g_strcmp0(method, "BlacklistMediaPlayer") == 0) { + gboolean blacklist; + const gchar* player_name; + g_variant_get (params, "(&sb)", &player_name, &blacklist); + + g_debug ("BlacklistMediaPlayer - bool %i", blacklist); + g_debug ("BlacklistMediaPlayer - name %s", player_name); + gboolean result = sound_service_dbus_blacklist_player (service, + player_name, + blacklist); + retval = g_variant_new ("(b)", result); + } + else if (g_strcmp0(method, "IsBlacklisted") == 0) { + const gchar* player_name; + g_variant_get (params, "(&s)", &player_name); + + g_debug ("IsBlacklisted - name %s", player_name); + gboolean result = sound_service_dbus_is_blacklisted (service, + player_name); + retval = g_variant_new ("(b)", result); + } + else if (g_strcmp0(method, "EnableTrackSpecificItems") == 0) { + g_debug ("EnableTrackSpecificItems"); + gchar* player_object_path; + gchar* player_id; + g_variant_get (params, "(os)", &player_object_path, &player_id); + //g_debug ("object path = %s and id = %s", player_object_path, player_id); + g_signal_emit (service, + signals[TRACK_SPECIFIC_ITEM], + 0, + player_object_path, + player_id); + g_free (player_object_path); + g_free (player_id); + + } + else if (g_strcmp0(method, "EnablePlayerSpecificItems") == 0) { + gchar* player_object_path; + gchar* player_id; + g_variant_get (params, "(os)", &player_object_path, &player_id); + g_debug ("PLayer specific item - object path = %s and id = %s", + player_object_path, + player_id); + g_signal_emit (service, + signals[PLAYER_SPECIFIC_ITEM], + 0, + player_object_path, + player_id); + g_free (player_object_path); + g_free (player_id); + } + else { + g_warning("Calling method '%s' on the sound service but it's unknown", method); + } + g_dbus_method_invocation_return_value (invocation, retval); +} + +/** + TODO - Works nicely but refactor into at least two different methods +**/ +static gboolean sound_service_dbus_blacklist_player (SoundServiceDbus* self, + const gchar* player_name, + gboolean blacklist) +{ + g_return_val_if_fail (player_name != NULL, FALSE); + g_return_val_if_fail (IS_SOUND_SERVICE_DBUS (self), FALSE); + + GVariant* the_black_list; + gboolean result = FALSE; + GSettings* our_settings; + GVariantIter iter; + gchar *str; + GVariantBuilder builder; + + our_settings = g_settings_new ("com.canonical.indicator.sound"); + the_black_list = g_settings_get_value (our_settings, + "blacklisted-media-players"); + g_variant_iter_init (&iter, the_black_list); + g_variant_builder_init(&builder, G_VARIANT_TYPE_STRING_ARRAY); + + while (g_variant_iter_loop (&iter, "s", &str)){ + g_variant_builder_add (&builder, "s", str); + } + g_variant_iter_init (&iter, the_black_list); + + if (blacklist == TRUE){ + while (g_variant_iter_loop (&iter, "s", &str)){ + g_print ("first pass to check if %s is present\n", str); + if (g_strcmp0 (player_name, str) == 0){ + // Return if its already there + g_debug ("we have this already blacklisted, no need to do anything"); + g_variant_builder_clear (&builder); + g_object_unref (our_settings); + g_variant_unref (the_black_list); + return result; + } + } + // Otherwise blacklist it ! + g_debug ("about to blacklist %s", player_name); + g_variant_builder_add (&builder, "s", player_name); + } + else{ + gboolean present = FALSE; + g_variant_iter_init (&iter, the_black_list); + g_debug ("attempting to UN-blacklist %s", player_name); + + while (g_variant_iter_loop (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) == 0){ + present = TRUE; + } + } + // It was not there anyway, return false + if (present == FALSE){ + g_debug ("it was not blacklisted ?, no need to do anything"); + g_variant_builder_clear (&builder); + g_object_unref (our_settings); + g_variant_unref (the_black_list); + return result; + } + + // Otherwise free the builder and reconstruct ensuring no duplicates. + g_variant_builder_clear (&builder); + g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY); + + g_variant_iter_init (&iter, the_black_list); + + while (g_variant_iter_loop (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) != 0){ + g_variant_builder_add (&builder, "s", str); + } + } + } + GVariant* value = g_variant_builder_end (&builder); + result = g_settings_set_value (our_settings, + "blacklisted-media-players", + value); + + g_object_unref (our_settings); + g_variant_unref (the_black_list); + + return result; +} + +static gboolean sound_service_dbus_is_blacklisted (SoundServiceDbus *self, + const gchar *player_name) +{ + GSettings *our_settings; + GVariant *the_black_list; + GVariantIter iter; + gchar *str; + gboolean result = FALSE; + + g_return_val_if_fail (player_name != NULL, FALSE); + g_return_val_if_fail (IS_SOUND_SERVICE_DBUS (self), FALSE); + + our_settings = g_settings_new ("com.canonical.indicator.sound"); + the_black_list = g_settings_get_value (our_settings, + "blacklisted-media-players"); + g_variant_iter_init (&iter, the_black_list); + while (g_variant_iter_next (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) == 0) { + result = TRUE; + g_free (str); + break; + } + g_free (str); + } + + g_object_unref (our_settings); + g_variant_unref (the_black_list); + + return result; +} + diff --git a/.pc/sound_ubuntustudio.patch/src/sound-service-dbus.c b/.pc/sound_ubuntustudio.patch/src/sound-service-dbus.c new file mode 100644 index 0000000..c503220 --- /dev/null +++ b/.pc/sound_ubuntustudio.patch/src/sound-service-dbus.c @@ -0,0 +1,497 @@ +/* + * Copyright 2010 Canonical Ltd. + * + * Authors: + * Conor Curran <conor.curran@canonical.com> + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gio/gio.h> +#include <unistd.h> +#include <glib/gi18n.h> +#include <libindicator/indicator-service.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/client.h> + +#include "sound-service-dbus.h" +#include "device.h" +#include "gen-sound-service.xml.h" +#include "dbus-shared-names.h" +#include "sound-service-marshal.h" + +// DBUS methods +static void bus_method_call (GDBusConnection * connection, + const gchar * sender, + const gchar * path, + const gchar * interface, + const gchar * method, + GVariant * params, + GDBusMethodInvocation * invocation, + gpointer user_data); + +static GDBusInterfaceVTable interface_table = { + method_call: bus_method_call, + get_property: NULL, /* No properties */ + set_property: NULL /* No properties */ +}; + + +typedef struct _SoundServiceDbusPrivate SoundServiceDbusPrivate; + +struct _SoundServiceDbusPrivate { + GDBusConnection* connection; + DbusmenuMenuitem* root_menuitem; + Device* device; + gboolean greeter_mode; + guint registration_id; +}; + +enum { + TRACK_SPECIFIC_ITEM, + PLAYER_SPECIFIC_ITEM, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static GDBusNodeInfo * node_info = NULL; +static GDBusInterfaceInfo * interface_info = NULL; + +#define SOUND_SERVICE_DBUS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUND_SERVICE_DBUS_TYPE, SoundServiceDbusPrivate)) + +static void sound_service_dbus_class_init (SoundServiceDbusClass *klass); +static void sound_service_dbus_init (SoundServiceDbus *self); +static void sound_service_dbus_dispose (GObject *object); +static void sound_service_dbus_finalize (GObject *object); + +static void show_sound_settings_dialog (DbusmenuMenuitem *mi, + gpointer user_data); +static gboolean sound_service_dbus_blacklist_player (SoundServiceDbus* self, + const gchar* player_name, + gboolean blacklist); + +static gboolean sound_service_dbus_is_blacklisted (SoundServiceDbus* self, + const gchar* player_name); + +G_DEFINE_TYPE (SoundServiceDbus, sound_service_dbus, G_TYPE_OBJECT); + +static void +sound_service_dbus_class_init (SoundServiceDbusClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof(SoundServiceDbusPrivate)); + + object_class->dispose = sound_service_dbus_dispose; + object_class->finalize = sound_service_dbus_finalize; + + g_assert(klass != NULL); + + if (node_info == NULL) { + GError * error = NULL; + + node_info = g_dbus_node_info_new_for_xml(_sound_service, &error); + if (error != NULL) { + g_critical ("Unable to parse Indicator Service Interface description: %s", + error->message); + g_error_free(error); + } + } + + if (interface_info == NULL) { + interface_info = g_dbus_node_info_lookup_interface (node_info, + INDICATOR_SOUND_DBUS_INTERFACE); + + if (interface_info == NULL) { + g_critical("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'"); + } + } + signals[TRACK_SPECIFIC_ITEM] = g_signal_new("track-specific-item-requested", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + _sound_service_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, + G_TYPE_STRING); + signals[PLAYER_SPECIFIC_ITEM] = g_signal_new("player-specific-item-requested", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + _sound_service_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, + G_TYPE_STRING); +} + +static void +sound_service_dbus_init (SoundServiceDbus *self) +{ + GError *error = NULL; + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + + priv->connection = NULL; + + /* Fetch the session bus */ + priv->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + + if (error != NULL) { + g_critical ("sound-service-dbus:Unable to connect to the session bus when creating indicator sound service : %s", error->message); + g_error_free (error); + return; + } + /* register the service on it */ + priv->registration_id = g_dbus_connection_register_object (priv->connection, + INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH, + interface_info, + &interface_table, + self, + NULL, + &error); + if (error != NULL) { + g_critical ("Unable to register the sound service on DBus: %s", error->message); + g_error_free (error); + } +} + +DbusmenuMenuitem* +sound_service_dbus_create_root_item (SoundServiceDbus* self, gboolean greeter_mode) +{ + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + priv->greeter_mode = greeter_mode; + priv->root_menuitem = dbusmenu_menuitem_new(); + DbusmenuServer *server = dbusmenu_server_new (INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH); + dbusmenu_server_set_root (server, priv->root_menuitem); + g_object_unref (priv->root_menuitem); + priv->device = device_new (self); + return priv->root_menuitem; +} + +void +sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, + DbusmenuMenuitem* mute_item, + DbusmenuMenuitem* slider_item, + DbusmenuMenuitem* voip_input_menu_item) +{ + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + + // Mute, Volume and Voip widgets + dbusmenu_menuitem_child_add_position (priv->root_menuitem, mute_item, 0); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, slider_item, 1); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, voip_input_menu_item, 2); + + if (!priv->greeter_mode) { + // Separator + DbusmenuMenuitem* separator = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set (separator, + DBUSMENU_MENUITEM_PROP_TYPE, + DBUSMENU_CLIENT_TYPES_SEPARATOR); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3); + g_object_unref (separator); + + // Sound preferences dialog + DbusmenuMenuitem* settings_mi = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set( settings_mi, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Sound Settings...")); + dbusmenu_menuitem_child_append(priv->root_menuitem, settings_mi); + g_object_unref (settings_mi); + g_signal_connect(G_OBJECT(settings_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, + G_CALLBACK(show_sound_settings_dialog), NULL); + } +} + +/** +show_sound_settings_dialog: +Bring up the gnome volume preferences dialog +**/ +static void +show_sound_settings_dialog (DbusmenuMenuitem *mi, + gpointer user_data) +{ + GError * error = NULL; + gchar* cmd; + if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")) + cmd = "gnome-control-center sound-nua"; + else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) + cmd = "pavucontrol"; + else + cmd = "gnome-control-center sound"; + + if (!g_spawn_command_line_async("gnome-volume-control --page=applications", &error) && + !g_spawn_command_line_async(cmd, &error) && + !g_spawn_command_line_async("xfce4-mixer", &error)) + { + g_warning("Unable to show dialog: %s", error->message); + g_error_free(error); + } +} + +static void +sound_service_dbus_dispose (GObject *object) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (object); + + if (priv->connection && priv->registration_id) { + g_dbus_connection_unregister_object (priv->connection, priv->registration_id); + priv->registration_id = 0; + } + + g_clear_object(&priv->connection); + + G_OBJECT_CLASS (sound_service_dbus_parent_class)->dispose (object); + //TODO dispose of the active sink instance ! + return; +} + +static void +sound_service_dbus_finalize (GObject *object) +{ + G_OBJECT_CLASS (sound_service_dbus_parent_class)->finalize (object); + return; +} + + +// EMIT STATE SIGNAL +void +sound_service_dbus_update_sound_state (SoundServiceDbus* self, + SoundState new_state) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (self); + + GVariant* v_output = g_variant_new("(i)", (int)new_state); + + GError * error = NULL; + + if (priv->connection == NULL || + g_dbus_connection_is_closed (priv->connection) == TRUE){ + g_critical ("sound_service_dbus_update_sound_state - dbus connection is %s !!", + priv->connection == NULL? "NULL" : "closed"); + return; + } + + //g_debug ("emitting state signal with value %i", (int)new_state); + g_dbus_connection_emit_signal( priv->connection, + NULL, + INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH, + INDICATOR_SOUND_DBUS_INTERFACE, + INDICATOR_SOUND_SIGNAL_STATE_UPDATE, + v_output, + &error ); + if (error != NULL) { + g_critical ("Unable to emit signal because : %s", error->message); + g_error_free(error); + } +} + +//HANDLE DBUS METHOD CALLS +static void +bus_method_call (GDBusConnection * connection, + const gchar * sender, + const gchar * path, + const gchar * interface, + const gchar * method, + GVariant * params, + GDBusMethodInvocation * invocation, + gpointer user_data) +{ + SoundServiceDbus* service = SOUND_SERVICE_DBUS(user_data); + g_return_if_fail ( IS_SOUND_SERVICE_DBUS(service) ); + GVariant * retval = NULL; + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (service); + + if (g_strcmp0(method, "GetSoundState") == 0) { + g_debug("Get state - %i", device_get_state (priv->device)); + retval = g_variant_new ( "(i)", device_get_state (priv->device)); + } + else if (g_strcmp0(method, "BlacklistMediaPlayer") == 0) { + gboolean blacklist; + const gchar* player_name; + g_variant_get (params, "(&sb)", &player_name, &blacklist); + + g_debug ("BlacklistMediaPlayer - bool %i", blacklist); + g_debug ("BlacklistMediaPlayer - name %s", player_name); + gboolean result = sound_service_dbus_blacklist_player (service, + player_name, + blacklist); + retval = g_variant_new ("(b)", result); + } + else if (g_strcmp0(method, "IsBlacklisted") == 0) { + const gchar* player_name; + g_variant_get (params, "(&s)", &player_name); + + g_debug ("IsBlacklisted - name %s", player_name); + gboolean result = sound_service_dbus_is_blacklisted (service, + player_name); + retval = g_variant_new ("(b)", result); + } + else if (g_strcmp0(method, "EnableTrackSpecificItems") == 0) { + g_debug ("EnableTrackSpecificItems"); + gchar* player_object_path; + gchar* player_id; + g_variant_get (params, "(os)", &player_object_path, &player_id); + //g_debug ("object path = %s and id = %s", player_object_path, player_id); + g_signal_emit (service, + signals[TRACK_SPECIFIC_ITEM], + 0, + player_object_path, + player_id); + g_free (player_object_path); + g_free (player_id); + + } + else if (g_strcmp0(method, "EnablePlayerSpecificItems") == 0) { + gchar* player_object_path; + gchar* player_id; + g_variant_get (params, "(os)", &player_object_path, &player_id); + g_debug ("PLayer specific item - object path = %s and id = %s", + player_object_path, + player_id); + g_signal_emit (service, + signals[PLAYER_SPECIFIC_ITEM], + 0, + player_object_path, + player_id); + g_free (player_object_path); + g_free (player_id); + } + else { + g_warning("Calling method '%s' on the sound service but it's unknown", method); + } + g_dbus_method_invocation_return_value (invocation, retval); +} + +/** + TODO - Works nicely but refactor into at least two different methods +**/ +static gboolean sound_service_dbus_blacklist_player (SoundServiceDbus* self, + const gchar* player_name, + gboolean blacklist) +{ + g_return_val_if_fail (player_name != NULL, FALSE); + g_return_val_if_fail (IS_SOUND_SERVICE_DBUS (self), FALSE); + + GVariant* the_black_list; + gboolean result = FALSE; + GSettings* our_settings; + GVariantIter iter; + gchar *str; + GVariantBuilder builder; + + our_settings = g_settings_new ("com.canonical.indicator.sound"); + the_black_list = g_settings_get_value (our_settings, + "blacklisted-media-players"); + g_variant_iter_init (&iter, the_black_list); + g_variant_builder_init(&builder, G_VARIANT_TYPE_STRING_ARRAY); + + while (g_variant_iter_loop (&iter, "s", &str)){ + g_variant_builder_add (&builder, "s", str); + } + g_variant_iter_init (&iter, the_black_list); + + if (blacklist == TRUE){ + while (g_variant_iter_loop (&iter, "s", &str)){ + g_print ("first pass to check if %s is present\n", str); + if (g_strcmp0 (player_name, str) == 0){ + // Return if its already there + g_debug ("we have this already blacklisted, no need to do anything"); + g_variant_builder_clear (&builder); + g_object_unref (our_settings); + g_variant_unref (the_black_list); + return result; + } + } + // Otherwise blacklist it ! + g_debug ("about to blacklist %s", player_name); + g_variant_builder_add (&builder, "s", player_name); + } + else{ + gboolean present = FALSE; + g_variant_iter_init (&iter, the_black_list); + g_debug ("attempting to UN-blacklist %s", player_name); + + while (g_variant_iter_loop (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) == 0){ + present = TRUE; + } + } + // It was not there anyway, return false + if (present == FALSE){ + g_debug ("it was not blacklisted ?, no need to do anything"); + g_variant_builder_clear (&builder); + g_object_unref (our_settings); + g_variant_unref (the_black_list); + return result; + } + + // Otherwise free the builder and reconstruct ensuring no duplicates. + g_variant_builder_clear (&builder); + g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY); + + g_variant_iter_init (&iter, the_black_list); + + while (g_variant_iter_loop (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) != 0){ + g_variant_builder_add (&builder, "s", str); + } + } + } + GVariant* value = g_variant_builder_end (&builder); + result = g_settings_set_value (our_settings, + "blacklisted-media-players", + value); + + g_object_unref (our_settings); + g_variant_unref (the_black_list); + + return result; +} + +static gboolean sound_service_dbus_is_blacklisted (SoundServiceDbus *self, + const gchar *player_name) +{ + GSettings *our_settings; + GVariant *the_black_list; + GVariantIter iter; + gchar *str; + gboolean result = FALSE; + + g_return_val_if_fail (player_name != NULL, FALSE); + g_return_val_if_fail (IS_SOUND_SERVICE_DBUS (self), FALSE); + + our_settings = g_settings_new ("com.canonical.indicator.sound"); + the_black_list = g_settings_get_value (our_settings, + "blacklisted-media-players"); + g_variant_iter_init (&iter, the_black_list); + while (g_variant_iter_next (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) == 0) { + result = TRUE; + g_free (str); + break; + } + g_free (str); + } + + g_object_unref (our_settings); + g_variant_unref (the_black_list); + + return result; +} + diff --git a/.pc/sound_xubuntu.patch/src/sound-service-dbus.c b/.pc/sound_xubuntu.patch/src/sound-service-dbus.c new file mode 100644 index 0000000..84cf4e8 --- /dev/null +++ b/.pc/sound_xubuntu.patch/src/sound-service-dbus.c @@ -0,0 +1,495 @@ +/* + * Copyright 2010 Canonical Ltd. + * + * Authors: + * Conor Curran <conor.curran@canonical.com> + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 3, as published + * by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranties of + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <gio/gio.h> +#include <unistd.h> +#include <glib/gi18n.h> +#include <libindicator/indicator-service.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-glib/client.h> + +#include "sound-service-dbus.h" +#include "device.h" +#include "gen-sound-service.xml.h" +#include "dbus-shared-names.h" +#include "sound-service-marshal.h" + +// DBUS methods +static void bus_method_call (GDBusConnection * connection, + const gchar * sender, + const gchar * path, + const gchar * interface, + const gchar * method, + GVariant * params, + GDBusMethodInvocation * invocation, + gpointer user_data); + +static GDBusInterfaceVTable interface_table = { + method_call: bus_method_call, + get_property: NULL, /* No properties */ + set_property: NULL /* No properties */ +}; + + +typedef struct _SoundServiceDbusPrivate SoundServiceDbusPrivate; + +struct _SoundServiceDbusPrivate { + GDBusConnection* connection; + DbusmenuMenuitem* root_menuitem; + Device* device; + gboolean greeter_mode; + guint registration_id; +}; + +enum { + TRACK_SPECIFIC_ITEM, + PLAYER_SPECIFIC_ITEM, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + +static GDBusNodeInfo * node_info = NULL; +static GDBusInterfaceInfo * interface_info = NULL; + +#define SOUND_SERVICE_DBUS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUND_SERVICE_DBUS_TYPE, SoundServiceDbusPrivate)) + +static void sound_service_dbus_class_init (SoundServiceDbusClass *klass); +static void sound_service_dbus_init (SoundServiceDbus *self); +static void sound_service_dbus_dispose (GObject *object); +static void sound_service_dbus_finalize (GObject *object); + +static void show_sound_settings_dialog (DbusmenuMenuitem *mi, + gpointer user_data); +static gboolean sound_service_dbus_blacklist_player (SoundServiceDbus* self, + const gchar* player_name, + gboolean blacklist); + +static gboolean sound_service_dbus_is_blacklisted (SoundServiceDbus* self, + const gchar* player_name); + +G_DEFINE_TYPE (SoundServiceDbus, sound_service_dbus, G_TYPE_OBJECT); + +static void +sound_service_dbus_class_init (SoundServiceDbusClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (object_class, sizeof(SoundServiceDbusPrivate)); + + object_class->dispose = sound_service_dbus_dispose; + object_class->finalize = sound_service_dbus_finalize; + + g_assert(klass != NULL); + + if (node_info == NULL) { + GError * error = NULL; + + node_info = g_dbus_node_info_new_for_xml(_sound_service, &error); + if (error != NULL) { + g_critical ("Unable to parse Indicator Service Interface description: %s", + error->message); + g_error_free(error); + } + } + + if (interface_info == NULL) { + interface_info = g_dbus_node_info_lookup_interface (node_info, + INDICATOR_SOUND_DBUS_INTERFACE); + + if (interface_info == NULL) { + g_critical("Unable to find interface '" INDICATOR_SOUND_DBUS_INTERFACE "'"); + } + } + signals[TRACK_SPECIFIC_ITEM] = g_signal_new("track-specific-item-requested", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + _sound_service_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, + G_TYPE_STRING); + signals[PLAYER_SPECIFIC_ITEM] = g_signal_new("player-specific-item-requested", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + _sound_service_marshal_VOID__STRING_STRING, + G_TYPE_NONE, 2, G_TYPE_STRING, + G_TYPE_STRING); +} + +static void +sound_service_dbus_init (SoundServiceDbus *self) +{ + GError *error = NULL; + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + + priv->connection = NULL; + + /* Fetch the session bus */ + priv->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error); + + if (error != NULL) { + g_critical ("sound-service-dbus:Unable to connect to the session bus when creating indicator sound service : %s", error->message); + g_error_free (error); + return; + } + /* register the service on it */ + priv->registration_id = g_dbus_connection_register_object (priv->connection, + INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH, + interface_info, + &interface_table, + self, + NULL, + &error); + if (error != NULL) { + g_critical ("Unable to register the sound service on DBus: %s", error->message); + g_error_free (error); + } +} + +DbusmenuMenuitem* +sound_service_dbus_create_root_item (SoundServiceDbus* self, gboolean greeter_mode) +{ + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + priv->greeter_mode = greeter_mode; + priv->root_menuitem = dbusmenu_menuitem_new(); + DbusmenuServer *server = dbusmenu_server_new (INDICATOR_SOUND_MENU_DBUS_OBJECT_PATH); + dbusmenu_server_set_root (server, priv->root_menuitem); + g_object_unref (priv->root_menuitem); + priv->device = device_new (self); + return priv->root_menuitem; +} + +void +sound_service_dbus_build_sound_menu ( SoundServiceDbus* self, + DbusmenuMenuitem* mute_item, + DbusmenuMenuitem* slider_item, + DbusmenuMenuitem* voip_input_menu_item) +{ + SoundServiceDbusPrivate * priv = SOUND_SERVICE_DBUS_GET_PRIVATE(self); + + // Mute, Volume and Voip widgets + dbusmenu_menuitem_child_add_position (priv->root_menuitem, mute_item, 0); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, slider_item, 1); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, voip_input_menu_item, 2); + + if (!priv->greeter_mode) { + // Separator + DbusmenuMenuitem* separator = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set (separator, + DBUSMENU_MENUITEM_PROP_TYPE, + DBUSMENU_CLIENT_TYPES_SEPARATOR); + dbusmenu_menuitem_child_add_position (priv->root_menuitem, separator, 3); + g_object_unref (separator); + + // Sound preferences dialog + DbusmenuMenuitem* settings_mi = dbusmenu_menuitem_new(); + + dbusmenu_menuitem_property_set( settings_mi, + DBUSMENU_MENUITEM_PROP_LABEL, + _("Sound Settings...")); + dbusmenu_menuitem_child_append(priv->root_menuitem, settings_mi); + g_object_unref (settings_mi); + g_signal_connect(G_OBJECT(settings_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, + G_CALLBACK(show_sound_settings_dialog), NULL); + } +} + +/** +show_sound_settings_dialog: +Bring up the gnome volume preferences dialog +**/ +static void +show_sound_settings_dialog (DbusmenuMenuitem *mi, + gpointer user_data) +{ + GError * error = NULL; + gchar* cmd; + if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")) + cmd = "gnome-control-center sound-nua"; + else + cmd = "gnome-control-center sound"; + + if (!g_spawn_command_line_async("gnome-volume-control --page=applications", &error) && + !g_spawn_command_line_async(cmd, &error) && + !g_spawn_command_line_async("xfce4-mixer", &error)) + { + g_warning("Unable to show dialog: %s", error->message); + g_error_free(error); + } +} + +static void +sound_service_dbus_dispose (GObject *object) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (object); + + if (priv->connection && priv->registration_id) { + g_dbus_connection_unregister_object (priv->connection, priv->registration_id); + priv->registration_id = 0; + } + + g_clear_object(&priv->connection); + + G_OBJECT_CLASS (sound_service_dbus_parent_class)->dispose (object); + //TODO dispose of the active sink instance ! + return; +} + +static void +sound_service_dbus_finalize (GObject *object) +{ + G_OBJECT_CLASS (sound_service_dbus_parent_class)->finalize (object); + return; +} + + +// EMIT STATE SIGNAL +void +sound_service_dbus_update_sound_state (SoundServiceDbus* self, + SoundState new_state) +{ + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (self); + + GVariant* v_output = g_variant_new("(i)", (int)new_state); + + GError * error = NULL; + + if (priv->connection == NULL || + g_dbus_connection_is_closed (priv->connection) == TRUE){ + g_critical ("sound_service_dbus_update_sound_state - dbus connection is %s !!", + priv->connection == NULL? "NULL" : "closed"); + return; + } + + //g_debug ("emitting state signal with value %i", (int)new_state); + g_dbus_connection_emit_signal( priv->connection, + NULL, + INDICATOR_SOUND_SERVICE_DBUS_OBJECT_PATH, + INDICATOR_SOUND_DBUS_INTERFACE, + INDICATOR_SOUND_SIGNAL_STATE_UPDATE, + v_output, + &error ); + if (error != NULL) { + g_critical ("Unable to emit signal because : %s", error->message); + g_error_free(error); + } +} + +//HANDLE DBUS METHOD CALLS +static void +bus_method_call (GDBusConnection * connection, + const gchar * sender, + const gchar * path, + const gchar * interface, + const gchar * method, + GVariant * params, + GDBusMethodInvocation * invocation, + gpointer user_data) +{ + SoundServiceDbus* service = SOUND_SERVICE_DBUS(user_data); + g_return_if_fail ( IS_SOUND_SERVICE_DBUS(service) ); + GVariant * retval = NULL; + SoundServiceDbusPrivate *priv = SOUND_SERVICE_DBUS_GET_PRIVATE (service); + + if (g_strcmp0(method, "GetSoundState") == 0) { + g_debug("Get state - %i", device_get_state (priv->device)); + retval = g_variant_new ( "(i)", device_get_state (priv->device)); + } + else if (g_strcmp0(method, "BlacklistMediaPlayer") == 0) { + gboolean blacklist; + const gchar* player_name; + g_variant_get (params, "(&sb)", &player_name, &blacklist); + + g_debug ("BlacklistMediaPlayer - bool %i", blacklist); + g_debug ("BlacklistMediaPlayer - name %s", player_name); + gboolean result = sound_service_dbus_blacklist_player (service, + player_name, + blacklist); + retval = g_variant_new ("(b)", result); + } + else if (g_strcmp0(method, "IsBlacklisted") == 0) { + const gchar* player_name; + g_variant_get (params, "(&s)", &player_name); + + g_debug ("IsBlacklisted - name %s", player_name); + gboolean result = sound_service_dbus_is_blacklisted (service, + player_name); + retval = g_variant_new ("(b)", result); + } + else if (g_strcmp0(method, "EnableTrackSpecificItems") == 0) { + g_debug ("EnableTrackSpecificItems"); + gchar* player_object_path; + gchar* player_id; + g_variant_get (params, "(os)", &player_object_path, &player_id); + //g_debug ("object path = %s and id = %s", player_object_path, player_id); + g_signal_emit (service, + signals[TRACK_SPECIFIC_ITEM], + 0, + player_object_path, + player_id); + g_free (player_object_path); + g_free (player_id); + + } + else if (g_strcmp0(method, "EnablePlayerSpecificItems") == 0) { + gchar* player_object_path; + gchar* player_id; + g_variant_get (params, "(os)", &player_object_path, &player_id); + g_debug ("PLayer specific item - object path = %s and id = %s", + player_object_path, + player_id); + g_signal_emit (service, + signals[PLAYER_SPECIFIC_ITEM], + 0, + player_object_path, + player_id); + g_free (player_object_path); + g_free (player_id); + } + else { + g_warning("Calling method '%s' on the sound service but it's unknown", method); + } + g_dbus_method_invocation_return_value (invocation, retval); +} + +/** + TODO - Works nicely but refactor into at least two different methods +**/ +static gboolean sound_service_dbus_blacklist_player (SoundServiceDbus* self, + const gchar* player_name, + gboolean blacklist) +{ + g_return_val_if_fail (player_name != NULL, FALSE); + g_return_val_if_fail (IS_SOUND_SERVICE_DBUS (self), FALSE); + + GVariant* the_black_list; + gboolean result = FALSE; + GSettings* our_settings; + GVariantIter iter; + gchar *str; + GVariantBuilder builder; + + our_settings = g_settings_new ("com.canonical.indicator.sound"); + the_black_list = g_settings_get_value (our_settings, + "blacklisted-media-players"); + g_variant_iter_init (&iter, the_black_list); + g_variant_builder_init(&builder, G_VARIANT_TYPE_STRING_ARRAY); + + while (g_variant_iter_loop (&iter, "s", &str)){ + g_variant_builder_add (&builder, "s", str); + } + g_variant_iter_init (&iter, the_black_list); + + if (blacklist == TRUE){ + while (g_variant_iter_loop (&iter, "s", &str)){ + g_print ("first pass to check if %s is present\n", str); + if (g_strcmp0 (player_name, str) == 0){ + // Return if its already there + g_debug ("we have this already blacklisted, no need to do anything"); + g_variant_builder_clear (&builder); + g_object_unref (our_settings); + g_variant_unref (the_black_list); + return result; + } + } + // Otherwise blacklist it ! + g_debug ("about to blacklist %s", player_name); + g_variant_builder_add (&builder, "s", player_name); + } + else{ + gboolean present = FALSE; + g_variant_iter_init (&iter, the_black_list); + g_debug ("attempting to UN-blacklist %s", player_name); + + while (g_variant_iter_loop (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) == 0){ + present = TRUE; + } + } + // It was not there anyway, return false + if (present == FALSE){ + g_debug ("it was not blacklisted ?, no need to do anything"); + g_variant_builder_clear (&builder); + g_object_unref (our_settings); + g_variant_unref (the_black_list); + return result; + } + + // Otherwise free the builder and reconstruct ensuring no duplicates. + g_variant_builder_clear (&builder); + g_variant_builder_init (&builder, G_VARIANT_TYPE_STRING_ARRAY); + + g_variant_iter_init (&iter, the_black_list); + + while (g_variant_iter_loop (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) != 0){ + g_variant_builder_add (&builder, "s", str); + } + } + } + GVariant* value = g_variant_builder_end (&builder); + result = g_settings_set_value (our_settings, + "blacklisted-media-players", + value); + + g_object_unref (our_settings); + g_variant_unref (the_black_list); + + return result; +} + +static gboolean sound_service_dbus_is_blacklisted (SoundServiceDbus *self, + const gchar *player_name) +{ + GSettings *our_settings; + GVariant *the_black_list; + GVariantIter iter; + gchar *str; + gboolean result = FALSE; + + g_return_val_if_fail (player_name != NULL, FALSE); + g_return_val_if_fail (IS_SOUND_SERVICE_DBUS (self), FALSE); + + our_settings = g_settings_new ("com.canonical.indicator.sound"); + the_black_list = g_settings_get_value (our_settings, + "blacklisted-media-players"); + g_variant_iter_init (&iter, the_black_list); + while (g_variant_iter_next (&iter, "s", &str)){ + if (g_strcmp0 (player_name, str) == 0) { + result = TRUE; + g_free (str); + break; + } + g_free (str); + } + + g_object_unref (our_settings); + g_variant_unref (the_black_list); + + return result; +} + diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5e301ab --- /dev/null +++ b/debian/changelog @@ -0,0 +1,864 @@ +indicator-sound (12.10.1-0ubuntu1) quantal; urgency=low + + * New upstream release. + + -- Sebastien Bacher <seb128@ubuntu.com> Wed, 03 Oct 2012 21:52:53 +0200 + +indicator-sound (12.10.0-0ubuntu2) quantal; urgency=low + + * Drop GTK2 build since ido stopped providing support for that version + * debian/control: build with the current vala version + + -- Sebastien Bacher <seb128@ubuntu.com> Wed, 22 Aug 2012 12:05:18 +0200 + +indicator-sound (12.10.0-0ubuntu1) quantal; urgency=low + + * New upstream release. + - Allow setting preferred media players through a settings key. + - Fix sound indicator not working after Amarok close. + - Explicit handling of Ardour + - Fix deprecated GTK+ API calls + * debian/patches/lp_992262.patch: + * debian/patches/lp_902715.patch: + - dropped, the fix is in the new version + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 12 Jul 2012 20:07:48 +0200 + +indicator-sound (0.8.5.0-0ubuntu3) quantal; urgency=low + + * debian/patches/lp_992262.patch + - fix sound indicator not working after amarok close (LP: #992262) + * debian/patches/lp_902715.patch + - Partial fix which sets the accessibility property on the volume + slider menu item. Previously this was achieved by sending a signal + on the indicator object but now it seems the way to update orca is + to set/update the appropriate property on the menuitem. Orca doesn't + broadcast volume updates on slider movement but at least it updates + when the user moves to the item on the menu, previously it was entirely + silent. (LP: #902715) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 03 May 2012 16:07:19 -0700 + +indicator-sound (0.8.5.0-0ubuntu2) precise; urgency=low + + * debian/patches: + - sound_ubuntustudio.patch: added to prefer pavucontrol as the + mixer app in Ubuntu Studio. (LP: #972749) + + -- Janne Jokitalo (astraljava) <astraljava@kapsi.fi> Sun, 01 Apr 2012 21:45:34 +0300 + +indicator-sound (0.8.5.0-0ubuntu1) precise; urgency=low + + * New upstream release. + - Inconsistency between messaging menu and sound menu pips (LP: #933593) + - indicator-sound-service crashed with SIGSEGV in + fast_validate() (LP: #949837) + - free-memory-read crash in indicator-sound-service's file + monitoring (LP: #965848) + - minor memory leaks in blacklist handling (LP: #960578) + - FIX (LP: FIX) + * -debian/patches/lp_945827.patch, debian/patches/lp_960846.patch + - dropped, merged upstream + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 30 Mar 2012 14:45:03 -0400 + +indicator-sound (0.8.4.1-0ubuntu4) precise; urgency=low + + * debian/patches: + - sound_xubuntu.patch: added, prefer pavucontrol over xfce4-mixer on + Xubuntu. (lp: #961745) + + -- Lionel Le Folgoc <mrpouit@ubuntu.com> Thu, 22 Mar 2012 00:17:34 +0100 + +indicator-sound (0.8.4.1-0ubuntu3) precise; urgency=low + + * debian/patches/lp_960846.patch + - check that the active playlists container is not null (LP: #960846) + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 21 Mar 2012 11:00:15 -0400 + +indicator-sound (0.8.4.1-0ubuntu2) precise; urgency=low + + * debian/patches/lp_945827.patch + - fix for a playlist crasher (LP: #945827) + + -- Ken VanDine <ken.vandine@canonical.com> Tue, 20 Mar 2012 16:40:24 -0400 + +indicator-sound (0.8.4.1-0ubuntu1) precise; urgency=low + + * New upstream release. + - fix i18n of indicator-sound's accessible description (LP: #957517) + - don't abort isound via g_error() if it can't connect to the + bus (LP: #953111) + * debian/patches/sound_nua.patch + - don't try to free a static string (LP: #957387) + + -- Ken VanDine <ken.vandine@canonical.com> Mon, 19 Mar 2012 11:22:00 -0400 + +indicator-sound (0.8.4.0-0ubuntu1) precise; urgency=low + + * New upstream release. + - indicator-sound "Choose Playlist" menu item does nothing when using + Rhythmbox (LP: #952550) + - crashed with SIGSEGV in g_strdup() (LP: #946607) + - crashed with SIGABRT in pa_operation_unref() (LP: #944148) + - crashed with signal 5 in g_type_create_instance() (LP: #921755) + - slider on unmute resets volume (LP: #921065) + - play controls not exposed in HUD (LP: #949032) + - unity-panel-service at 100% cpu when opened /w rb without album + cover (LP: #806848) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 16 Mar 2012 14:04:30 -0400 + +indicator-sound (0.8.3.0-0ubuntu2) precise; urgency=low + + * debian/patches/sound_nua.patch + - Sound Settings link doesn't work in GNOME Classic (LP: #941704) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 16 Mar 2012 13:39:03 -0400 + +indicator-sound (0.8.3.0-0ubuntu1) precise; urgency=low + + * New upstream release. + - Fixed memory corruption issue (LP: #897218) + - crashed with SIGABRT in pa_operation_unref (LP: #908682) + - Banshee shown in sound menu after removal until reboot (LP: #771202) + - Coverity PASS_BY_VALUE - CID 10620 (LP: #937451) + - App icon and name are not aligned (LP: #939929) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 02 Mar 2012 11:26:41 -0500 + +indicator-sound (0.8.2.0-0ubuntu1) precise; urgency=low + + * New upstream release. + - crashed with SIGABRT in pa_cvolume_set (LP: #900117) + - Mouse on coverart flushes the sound menu (LP: #927733) + - album artwork misaligned and not visible (LP: #933359) + - unity-panel-service crashed with SIGSEGV in + transport_widget_is_selected (LP: #882109) + * -debian/patches/correct_ldflags_use.patch + - fixed upstream + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 22 Feb 2012 16:41:12 -0500 + +indicator-sound (0.8.1.0-0ubuntu1) precise; urgency=low + + * New upstream release. + - No easy way to turn the sound menu on/off (lp: #829648) + - Avoid spawning notification daemon at startup (lp: #912150) + - Creation of album-art-cache folder (lp: #799383) + - schema id & path are inconsistent with other indicators (lp: #914377) + * debian/patches/correct_ldflags_use.patch: + - typo fix in ldflags use + + -- Sebastien Bacher <seb128@ubuntu.com> Tue, 14 Feb 2012 19:46:41 +0100 + +indicator-sound (0.8.0.0-0ubuntu4) precise; urgency=low + + * debian/patches/sound_nua.patch + - open the new sound-nua panel in gnome-control-center + * debian/patches/dbusmenu_05_90.patch + - fixed FTBFS with dbusmenu 0.5.90 + * debian/control + - bump build depends for dbusmenu to >= 0.5.90 + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 09 Feb 2012 16:49:15 -0500 + +indicator-sound (0.8.0.0-0ubuntu3) precise; urgency=low + + * rebuild for libindicator7 + * debian/rules + - build with no-error=deprecated-declarations + * -debian/patches/disable_Werror.patch + - disabled in debian/rules instead + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 25 Jan 2012 10:00:00 -0500 + +indicator-sound (0.8.0.0-0ubuntu2) precise; urgency=low + + * Add lazy_init.patch: Avoid spawning notification daemon right at startup, + instead initialize it lazily when actually doing a notification. Improves + boot speed. (LP: #912150) + * Add disable_Werror.patch: Build without -Werror, to avoid build failure + due to deprecated declarations. (LP: #912160) + + -- Martin Pitt <martin.pitt@ubuntu.com> Thu, 05 Jan 2012 09:29:36 +0100 + +indicator-sound (0.8.0.0-0ubuntu1) precise; urgency=low + + * New upstream release. + * debian/control + - removed build depends for libgconf2-dev + * debian/patches/fix-864405.patch + - dropped, merged upstream + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 01 Dec 2011 14:33:34 -0500 + +indicator-sound (0.7.9.1-0ubuntu2) precise; urgency=low + + * debian/patches/fix-864405.patch: + - Clicking on left 25% of "Pause/Play" circle clicks "Previous". + (LP: #864405) + + -- Omer Akram <om26er@ubuntu.com> Mon, 28 Nov 2011 23:03:20 +0500 + +indicator-sound (0.7.9.1-0ubuntu1) precise; urgency=low + + * New upstream release. + - indicator-sound-service crashed with SIGABRT in raise() (LP: #840986) + - don't let the menu grow wide enough to push off the screen (LP: #873006) + - bump the limit for number of playlists to 20 (LP: #835384) + - indicator-sound-service crashed with SIGSEGV (LP: #864732) + - Music player icon is not top-aligned (LP: #874454) + * debian/control + - build with valac-0.14 + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 28 Oct 2011 09:45:22 -0400 + +indicator-sound (0.7.9-0ubuntu1) oneiric-proposed; urgency=low + + * New upstream release. + - Protect against source indexes that are lower than 0 (LP: #850662) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 13 Oct 2011 13:53:21 -0400 + +indicator-sound (0.7.8-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - indicator-sound interferes with gnome-settings-daemon (LP: #855557) + * debian/patches/01_fix_FTBFS.patch + - Dropped, fixed upstream + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 28 Sep 2011 14:34:38 -0400 + +indicator-sound (0.7.7.0-0ubuntu1) oneiric; urgency=low + + * New upstream release + * add 01_fix_FTBFS.patch for needed -lm link + + -- Didier Roche <didrocks@ubuntu.com> Tue, 13 Sep 2011 10:20:29 +0200 + +indicator-sound (0.7.6.1-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - theming fix for the spinner + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 24 Aug 2011 16:09:29 -0400 + +indicator-sound (0.7.6-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - mute action crashes the panel (LP: #828114) + - Clicking music player does not dismiss the menu (LP: #818293) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 18 Aug 2011 14:19:06 -0400 + +indicator-sound (0.7.5-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - Don't allow starting programs via the greeter indicators (LP: #811853) + - support libunity's Track and Player specific items (LP: #824050) + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 10 Aug 2011 12:51:49 -0400 + +indicator-sound (0.7.4.1-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - menu resizes on reopen (LP: #809275) + - pulse indication of SoundMenu play button not strong + enough (LP: #742251) + * debian/rules + - Moved autoreconf to the top + * New upstream release. + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 29 Jul 2011 13:21:41 -0400 + +indicator-sound (0.7.3-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - libindicator scroll signals (LP: #804618) + - metadatawidget collapse (LP: #806439) + * debian/control + - Bumped build depends for libindicator to 0.3.90 + * debian/patches/gtk3_define.patch + - dropped + * configure.ac + - Fixup pkgconfig check for libindicator-0.4 + * debian/rules + - Added autoreconf.mk + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 07 Jul 2011 15:37:27 -0400 + +indicator-sound (0.7.2-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - "Sound Preferences..." should be "Sound Settings" (LP: #785571) + - Not obvious what track info menu item does (LP: #699899) + * debian/patches/lp_750823.patch + - Dropped patch, merged upstream + * debian/patches/gtk3_define.patch + - Wrap another gtk3 block in an ifdef + * debian/control + - Updated standards version to 3.9.2 + - Cleaned up description to quiet lintian + - Added quilt build dep + + -- Ken VanDine <ken.vandine@canonical.com> Tue, 28 Jun 2011 10:51:51 -0400 + +indicator-sound (0.7.0-0ubuntu1) oneiric; urgency=low + + * New upstream release. + - Displayed cover don't keep the original ratio (LP: #654196) + - show record level control PULSE_PROP_media.role=production (LP: #736049) + - Volume notification is based on previous volume; should be based on + the new volume (LP: #748831) + - [gnome3] Sound Preferences link doesn't work (LP: #759390) + * debian/patches/lp_759390.patch + - dropped, merged upstream + * debian/control + - renamed the libnotify4-dev build depends to libnotify-dev + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 19 May 2011 15:38:19 -0400 + +indicator-sound (0.6.6.1-0ubuntu3) natty; urgency=low + + * debian/patches/lp_750823.patch + - Place timeout in the mpris controller to accommodate flaky mpris dbus + behaviour, it can be seen sometimes that the players emit a property + changed on the metadata property but the actual value of the property + which the service then tries to use is the old value (LP: #750823) + + -- Ken VanDine <ken.vandine@canonical.com> Mon, 18 Apr 2011 15:08:13 -0400 + +indicator-sound (0.6.6.1-0ubuntu2) natty; urgency=low + + * debian/patches/lp_759390.patch + - Sound Preferences link doesn't work in gnome3 (LP: #759390) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 15 Apr 2011 17:12:32 -0400 + +indicator-sound (0.6.6.1-0ubuntu1) natty; urgency=low + + * New upstream release. + - Fix crash with SIGABRT (LP: #738051) (LP: #744304) + - ensure that if the service crashes the indicator will not show + multiple sliders + + -- Ken VanDine <ken.vandine@canonical.com> Mon, 04 Apr 2011 10:02:19 -0400 + +indicator-sound (0.6.5.1-0ubuntu1) natty; urgency=low + + * New upstream release. + - Don't change the banshee id yet, that will change in 0.9.6 + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 23 Mar 2011 13:46:06 -0400 + +indicator-sound (0.6.5-0ubuntu1) natty; urgency=low + + * New upstream release. + - Media player should be automatically started up when play button is + pressed (LP: #714750) + - volume goes to zero when using some players like banshee or + rhythmbox (LP: #730925) + - handle banshee id change (LP: #737447) + - filter out video playlists (LP: #739273) + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 23 Mar 2011 12:03:02 -0400 + +indicator-sound (0.6.4-0ubuntu1) natty; urgency=low + + * New upstream release. + - Harmonize mute behaviour of both VOIP and volume slider (LP: #731870) + - keyboard handling for voip slider not working (LP: #732500) + - "Choose Playlist" needs to be marked for translation (LP: #736372) + - show record level control on PULSE_PROP_media.role=production + (LP: #736049) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 17 Mar 2011 14:08:17 -0400 + +indicator-sound (0.6.3-0ubuntu1) natty; urgency=low + + * New upstream release. + - Broken images on playlist items (LP: #727325) + - wrong icon for audio-input slider (LP: #723254) + - blacklist dbus api lacks query functionality (LP: #730526) + - volume goes to zero when using some players like banshee, + rhythmbox (LP: #730925) + - holding the FW or RW button should have an effect (LP: #694258) + - With new notify-osd the volume notification on scroll doesn't work as + expected (LP: #729849) + * debian/control + - Bumped build depends for dbusmenu to >= 0.3.101 + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 11 Mar 2011 12:47:26 -0500 + +indicator-sound (0.6.2-0ubuntu1) natty; urgency=low + + * New upstream release. + - Fixed crashed with SIGSEGV in pa_context_connect() (LP: #717453) + - Fixed crashed with SIGSEGV in pa_pdispatch_run() (LP: #723096) + - Fixed crashed with SIGSEGV (LP: #723096) + - Fixed crashed with SIGSEGV (LP: #717557) + - Fixed crashed with SIGSEGV in g_variant_builder_add_value() + (LP: #717999) + - Sound Menu Play lists show Favorites item twice in menu and icons for + all playlists not found (LP: #728263) + - Players are raised too quickly (LP: #723278) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 04 Mar 2011 13:07:40 -0500 + +indicator-sound (0.6.1-0ubuntu1) natty; urgency=low + + * New upstream release. + - Icon-only menu titles don't have accessible names (LP: #691677) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 24 Feb 2011 11:19:57 -0500 + +indicator-sound (0.6.0-0ubuntu1) natty; urgency=low + + * New upstream release. + - New voip slider will be displayed in the sound menu while in a call + - [Conexant CX20561(Hermosa)] No indicator that input is muted (LP: #683689) + - Ctrl+arrow jumps sound to max volume in indicator (LP: #669167) + - Fixed build with latest dbusmenu (LP: #717340) + - Ported to libnotify >= 0.7.0 + * debian/control + - Changed build depends for libnotify-dev to libnotify4-dev + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 18 Feb 2011 13:20:44 -0500 + +indicator-sound (0.5.9-0ubuntu2) natty; urgency=low + + * debian/control + - bump build depends for libindicator-dev to >= 0.3.19 + - bump build depends for libdbusmenu-glib-dev to >= 0.3.97 + - added build depends on dh-autoreconf + * src/Makefile.am + - Hand Dbusmenu-Glib-0.4 rename to Dbusmenu-0.4 + * debian/rules + - include autoreconf.mk to handle the Dbusmenu rename + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 17 Feb 2011 15:21:33 -0500 + +indicator-sound (0.5.9-0ubuntu1) natty; urgency=low + + * New upstream release. + - crashed with SIGSEGV in pa_cvolume_valid () (LP: #705009) + - The players list should be customizable (LP: #685725) + - Allow players to set their own title (LP: #709367) + - refactor pulse manager (LP: #709371) + - listen for playlist changed signal (LP: #715277) + - playlist name not updated corrrectly (LP: #715694) + - Not enough feedback when changing the volume (LP: #669163) + - indicator-sound volume does not detect sink change (LP: #700361) + * debian/control + - Added new build depends libnotify-dev + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 10 Feb 2011 11:52:59 -0500 + +indicator-sound (0.5.8-0ubuntu1) natty; urgency=low + + * New upstream release. + - Media buttons inconsistent with system-wide button behavior (LP: #651006) + - update to deal with dbusmenu api chages (LP: #709181) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 28 Jan 2011 09:28:10 -0500 + +indicator-sound (0.5.7-0ubuntu1) natty; urgency=low + + * New upstream release. + - Music control buttons flicker (LP: #684755) + - Sound Menu should re-read playlists from MPRIS apps when + PropertiesChanged is postec (LP: #707042) + - Spotify crashes the service (LP: #707367) + - Refactor service dbus code plus state handling (LP: #708793) + - changing the volume is impossible while muted (LP: #558784) + - Banshee icon changes to coloured icon once in use (LP: #692648) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 27 Jan 2011 15:57:41 -0500 + +indicator-sound (0.5.6-0ubuntu1) natty; urgency=low + + * New upstream release. + - Port the sound indicator to the new dbusmenu (LP: #701145) + * debian/control + - Bumped build depends for dbusmenu to >= 0.3.91 + - Dropped unneeded build depends for libindicate-dev and dh-autoreconf + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 14 Jan 2011 10:53:50 -0600 + +indicator-sound (0.5.5-0ubuntu1) natty; urgency=low + + * New upstream release. + - unity-panel-service crashed with SIGSEGV in cairo_translate (LP: #683184) + - Add MPRIS Playlist support (LP: #692644) + - only first word of application name is shown (LP: #695385) + - The players list should be customizable (LP: #685725) + - gio-unix-2.0 checks (LP: #694828) + - Desktop file loading should not manually use full path (LP: #693824) + - Banshee mpris interface crashes (LP: #701692) + * debian/control + - Added build depends for libxml2-dev + + -- Ken VanDine <ken.vandine@canonical.com> Tue, 11 Jan 2011 16:44:40 -0600 + +indicator-sound (0.5.3-0ubuntu1) natty; urgency=low + + * New upstream release. + - Libindicate removed from registration process (LP: #691189) + - Vala code now using Gdbus exclusively for mpris interaction + - Fixed memory leak with album art resizing (LP: #689686) + - Gconf removed and Gsettings schema added (LP: #656405) + - registration process now uses gsettings + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 16 Dec 2010 15:03:15 -0500 + +indicator-sound (0.5.2-0ubuntu2) natty; urgency=low + + * debian/control + - Bump build depends for libdbusmenu-* to >= 0.3.90 + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 09 Dec 2010 11:44:02 -0500 + +indicator-sound (0.5.2-0ubuntu1) natty; urgency=low + + * New upstream release. + - updated to accommodate vala 0.10 to vala 0.12 api changes + - grey scale icon for default music player + - button and key handling improvements + * debian/control + - Changed build depends from valac-0.10 to valac, it builds now with + the 0.12 series + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 18 Nov 2010 11:13:32 -0500 + +indicator-sound (0.5.1-0ubuntu1) natty; urgency=low + + * New upstream release. + - Includes a lot of Design updates collected at UDS. + * album art border, now rectangular with a simple top and bottom 1 pixel + border. top dark and bottom light. + * Empty album art image now has darker background rather than same + colour as menu background + * Application icon now uses application image as opposed to generic + image used in maverick + * Banshee is now the default player. + * spacing between metadata and transport widget has been resolved plus + the spacing between the transport and the separator below it. + * debian/control + - Bump standards version to 3.9.1 + - Changed build depends to valac-0.10, until it is ported to valac-0.12 + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 12 Nov 2010 10:14:49 -0500 + +indicator-sound (0.5.0.1-0ubuntu1) maverick-proposed; urgency=low + + * New upstream release. + - Fixed a regression, which would show the metadata widget when the + player has no current track (LP: #674016) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 12 Nov 2010 09:40:47 -0500 + +indicator-sound (0.5.0-0ubuntu1) maverick-proposed; urgency=low + + * New upstream release. + - Buttons' hover image stays after dragging (LP: #643395) + - Sound indicator works incorrect with playing status (LP: #656947) + - sound applet volume slider has no effect if pulseaudio is + restarted (LP: #662296) + - Default music player should be present in the menu from a clean + install (LP: #664743) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 04 Nov 2010 17:03:08 -0400 + +indicator-sound (0.4.9-0ubuntu1) maverick-proposed; urgency=low + + * New upstream release. + - fixes tranlation mpris name regression (LP: #654140) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Oct 2010 10:40:13 -0400 + +indicator-sound (0.4.8-0ubuntu1) maverick-proposed; urgency=low + + * New upstream release. + - indicator-sound-service eating CPU on second user login (LP: #581173) + - Right border of transport control is different colour while using + Ambiance (LP: #632774) + - Incorrect ellipsing (LP: #637580) + - always show unmuted at startup (LP: #648238) + - click or enter on metadata widget does not copy contents to + clipboard (LP: #651246) + - Sound menu has two Rhythmbox elements when using + translations (LP: #654140) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 07 Oct 2010 10:08:19 -0400 + +indicator-sound (0.4.7-0ubuntu2) maverick; urgency=low + + * Rebuild for libindicator ABI change (LP: #637692) + * debian/control: depends on latest libindicator-dev + + -- Didier Roche <didrocks@ubuntu.com> Wed, 22 Sep 2010 18:40:25 +0200 + +indicator-sound (0.4.7-0ubuntu1) maverick; urgency=low + + * New upstream release. + - Media Buttons should trigger action only on button release (LP: #624610) + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 15 Sep 2010 18:02:13 -0400 + +indicator-sound (0.4.6-0ubuntu1) maverick; urgency=low + + * New upstream release. + - indicator crashes in the event of the service crashing (LP: #638891) + - metadata widget should remain hidden if there is no track + data (LP: #637031) + + -- Ken VanDine <ken.vandine@canonical.com> Wed, 15 Sep 2010 08:47:49 -0400 + +indicator-sound (0.4.5-0ubuntu1) maverick; urgency=low + + * New upstream release. + - service crashes on last fm playback with rb (LP: #633654) + - sound_icon for indicator-sound missing for ubuntu-light (LP: #628896) + - indicator-sound-service crashed with signal 5 in dbusmenu_menuitem_handle_event() (LP: #633897) + - mpris2 playback status behaving as if it were static (LP: #631893) + + -- Ken VanDine <ken.vandine@canonical.com> Tue, 14 Sep 2010 15:13:50 -0400 + +indicator-sound (0.4.4-0ubuntu1) maverick; urgency=low + + * New upstream release, fix crash in gtk_range_get_value() (lp: #615277) + + -- Sebastien Bacher <seb128@ubuntu.com> Fri, 10 Sep 2010 17:49:49 +0200 + +indicator-sound (0.4.3-0ubuntu1) maverick; urgency=low + + * New upstream release. + + -- Sebastien Bacher <seb128@ubuntu.com> Wed, 08 Sep 2010 17:53:33 +0200 + +indicator-sound (0.4.2-0ubuntu1) maverick; urgency=low + + * New upstream release fixing those issues + - Media Buttons should trigger action only on button release (lp: #624610) + - Mouse wheel no longer works to change volume (lp: #620858) + - Crashes if Rhythmbox is playing from Last.FM (lp: #627505) + + -- Sebastien Bacher <seb128@ubuntu.com> Wed, 08 Sep 2010 12:32:24 +0200 + +indicator-sound (0.4.1-0ubuntu1) maverick; urgency=low + + * New upstream release. + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 26 Aug 2010 11:38:07 +0200 + +indicator-sound (0.4.0-0ubuntu1) maverick; urgency=low + + * New upstream release. + + -- Sebastien Bacher <seb128@ubuntu.com> Wed, 18 Aug 2010 15:51:03 +0200 + +indicator-sound (0.3.9-0ubuntu2) maverick; urgency=low + + * Backport upstream commit to fix the indicator crashing when rhythmbox starts + (lp: #612299) + + -- Sebastien Bacher <seb128@ubuntu.com> Mon, 02 Aug 2010 12:08:57 +0200 + +indicator-sound (0.3.9-0ubuntu1) maverick; urgency=low + + * New upstream release. + - Scrub bar should now work properly. + - Spacing between all UI widgets should be fixed. + - Playlist menuitem in place (for now this is just a mock up item, will + complete once there is a client with which I can test against) + - Transport bar has been visually tweaked. + * debian/control + - build depend on libido-0.1-dev (>= 0.1.11) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 29 Jul 2010 11:26:41 -0400 + +indicator-sound (0.3.8-0ubuntu1) maverick; urgency=low + + * New upstream release. + * debian/control: + - update ido requirement + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 22 Jul 2010 21:12:10 +0200 + +indicator-sound (0.3.6-0ubuntu1) maverick; urgency=low + + * New upstream release. + + -- Sebastien Bacher <seb128@ubuntu.com> Mon, 12 Jul 2010 17:45:06 +0200 + +indicator-sound (0.3.5-0ubuntu1) maverick; urgency=low + + * New upstream release: + -New transport widget integrated + -New title widget integrated which allows the user + to launch familiar app directly from the menu + - UI tidied + - Each player that registers with the menu will be stored in the + cache file allowing the menu to show the application even if it has + not been launched. + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 08 Jul 2010 19:32:29 +0200 + +indicator-sound (0.3.4-0ubuntu1) maverick; urgency=low + + * New upstream version: + - Album art now positioned correctly + - Track title, artist name and album name now the correct size, + weight and position + - Text truncated with an ellipsis if it is over the an estimated acceptable + width (no guidance given by design). + + -- Sebastien Bacher <seb128@ubuntu.com> Mon, 28 Jun 2010 17:20:03 +0200 + +indicator-sound (0.3.3-0ubuntu1) maverick; urgency=low + + * New upstream release. + - Fixes menu flicker when playing a song with artwork + displayed (LP: #598438) + + -- Ken VanDine <ken.vandine@canonical.com> Fri, 25 Jun 2010 11:19:15 -0400 + +indicator-sound (0.3.2-0ubuntu1) maverick; urgency=low + + * New upstream release. + - MPRIS transport status updates reflecting in UI + If externally a registered player transport is changed (play/stop) + the menu should reflect that + - The first time a player registers its desktop file path should be + stored ~.cache/indicators/sound/familiar-players-db.keyfile (provided + the application indicator has a desktop file set. + - Album art dynamically updated + - Album title dynamically updated + - Track title dynamically updated + - Artist name dynamically updated + - Play/pause transport control should be working from the menu + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 24 Jun 2010 13:55:01 -0400 + +indicator-sound (0.3.1-0ubuntu1) maverick; urgency=low + + * New upstream release. + * debian/control + - bumped build-dep version of libdbusmenu-glib-dev to (>= 0.3.1) + - Added build-dep for libindicate-dev (>= 0.4.1) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 17 Jun 2010 16:50:31 -0400 + +indicator-sound (0.2.3-0ubuntu1) lucid-proposed; urgency=low + + * New upstream version: + - "Changing left/right balance in sound-preferences changes the output + volume slider when indicator-applet is running" (lp: #532095) + - update the mute animation on theme changes (lp: #568586) + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 29 Apr 2010 11:53:37 +0200 + +indicator-sound (0.2.2-0ubuntu1) lucid; urgency=low + + * New upstream version + - Animation for mute-blocking state greatly improved + - Handles sink removal far better + - improves scrolling action icon on panel + + -- Sebastien Bacher <seb128@ubuntu.com> Wed, 31 Mar 2010 18:12:47 +0200 + +indicator-sound (0.2.2-0ubuntu1) UNRELEASED; urgency=low + + * New upstream release. + + -- Sebastien Bacher <seb128@ubuntu.com> Wed, 31 Mar 2010 17:49:12 +0200 + +indicator-sound (0.2.1-0ubuntu1) lucid; urgency=low + + * New upstream release. + - can't change audio using mouse wheel (LP: #521046) + + -- Ken VanDine <ken.vandine@canonical.com> Thu, 18 Mar 2010 15:07:24 -0400 + +indicator-sound (0.1.3.1-0ubuntu2) lucid; urgency=low + + * Backport upstream changes to fix those issues: + - "Wrong i18n for menu entries", thank Luca Ferretti (lp: #538704) + - "display a mute icon until volume is changed since update" (lp: #537977) + + -- Sebastien Bacher <seb128@ubuntu.com> Mon, 15 Mar 2010 15:51:35 +0100 + +indicator-sound (0.1.3.1-0ubuntu1) lucid; urgency=low + + * New upstream version: + - clear looks seg fault fix (lp: #537891) + - slider resizing properly (lp: #533208) + + -- Sebastien Bacher <seb128@ubuntu.com> Fri, 12 Mar 2010 20:29:25 +0100 + +indicator-sound (0.1.3-0ubuntu1) lucid; urgency=low + + * New upstream version: + - icon sizing fixed. + - correct icon names loaded with fallback mechanism + - no sink handling improved - now handles going from no sink to one sink + back to no sink properly + - Mute blocking state implemented with animation on title image. + - smoother sliding due new signals emitted from the 0.1.4 of ido + * debian/control: + - updated libindicator requirement + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 11 Mar 2010 18:53:58 +0100 + +indicator-sound (0.1.2-0ubuntu1) lucid; urgency=low + + * New upstream version: + - Stability of the service should now be much improved. The backend sound + service should now be able to handle Pulseaudio not being up or flapping. + (lp: #529324) + - Arrow keys should be working properly allowing users to move between + indicators. (lp: #525733) + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 04 Mar 2010 13:32:10 +0100 + +indicator-sound (0.1.1-0ubuntu2) lucid; urgency=low + + * Backporting trunk commit to fix keyboard controls (lp: #521088) + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 18 Feb 2010 19:13:03 +0100 + +indicator-sound (0.1.1-0ubuntu1) lucid; urgency=low + + * New upstream version + - resolve the UI keyboard controls which were lacking (lp: #521088) + - the volume control should now be far smoother + - included is the ability to dynamically swap output devices + using gnome volume control + - use of new icons from the new humanity theme. + - update volume slider in the right direction on mouse scroll (lp: #521090) + * debian/control: + - updated ido requirement + + -- Sebastien Bacher <seb128@ubuntu.com> Thu, 18 Feb 2010 17:46:11 +0100 + +indicator-sound (0.1.0-0ubuntu2) lucid; urgency=low + + * Backport trunk change to fix audiosink detection and volume controls + not working for some users (lp: #521286, #521930) + + -- Sebastien Bacher <seb128@ubuntu.com> Mon, 15 Feb 2010 16:44:01 +0100 + +indicator-sound (0.1.0-0ubuntu1) lucid; urgency=low + + * debian/control: + - depends on pulseaudio + - don't set lib section, the applet is not a library + * debian/rules: + - build using --as-needed to avoid unnecessary depends + + [ Ken VanDine ] + * Initial release + + -- Sebastien Bacher <seb128@ubuntu.com> Fri, 12 Feb 2010 11:13:22 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7f8f011 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +7 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..e6e6b3f --- /dev/null +++ b/debian/control @@ -0,0 +1,34 @@ +Source: indicator-sound +Section: sound +Priority: extra +Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com> +XSBC-Original-Maintainer: Conor Curran <conor.curran@canonical.com> +Build-Depends: debhelper (>= 7), + cdbs (>= 0.4.41), + quilt, + autotools-dev, + libglib2.0-dev (>= 2.22.3), + libgtk-3-dev, + libdbusmenu-glib-dev (>= 0.5.90), + libdbusmenu-gtk3-dev (>= 0.5.90), + libindicator3-dev (>= 0.3.90), + libpulse-dev (>= 0.9.18), + libpulse-mainloop-glib0 (>= 0.9.18), + libido3-0.1-dev (>= 0.2.90), + libgee-dev, + libxml2-dev, + libnotify-dev, + valac-0.18, + dh-autoreconf +Standards-Version: 3.9.3 +Homepage: https://launchpad.net/indicator-sound + +Package: indicator-sound +Architecture: any +Depends: ${shlibs:Depends}, + ${misc:Depends}, + pulseaudio +Description: System sound indicator. + System sound indicator which provides easy control of the PulseAudio sound + daemon. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..09ddeab --- /dev/null +++ b/debian/copyright @@ -0,0 +1,37 @@ +This package was debianized by: + + Conor Curran <conor.curran@canonical.com> on Fri, 22 Jan 2010 11:36:32 +0000 + +It was downloaded from: + + https://launchpad.net/indicator-sound + +Upstream Author(s): + + Conor Curran <conor.curran@canonical.com> + +Copyright: + + Copyright (C) 2010 Canonical Ltd + +License: + + 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 + the Free Software Foundation, version 3 of the License. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + +The Debian packaging is: + + Copyright (C) 2010 Conor Curran <conor.curran@canonical.com> + +On Debian systems, the complete text of the GNU General +Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..92929c8 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,3 @@ +sound_nua.patch +sound_xubuntu.patch +sound_ubuntustudio.patch diff --git a/debian/patches/sound_nua.patch b/debian/patches/sound_nua.patch new file mode 100644 index 0000000..869ae24 --- /dev/null +++ b/debian/patches/sound_nua.patch @@ -0,0 +1,20 @@ +=== modified file 'src/sound-service-dbus.c' +--- old/src/sound-service-dbus.c 2012-03-16 17:59:34 +0000 ++++ new/src/sound-service-dbus.c 2012-03-19 14:54:30 +0000 +@@ -227,8 +227,14 @@ + gpointer user_data) + { + GError * error = NULL; ++ gchar* cmd; ++ if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")) ++ cmd = "gnome-control-center sound-nua"; ++ else ++ cmd = "gnome-control-center sound"; ++ + if (!g_spawn_command_line_async("gnome-volume-control --page=applications", &error) && +- !g_spawn_command_line_async("gnome-control-center sound", &error) && ++ !g_spawn_command_line_async(cmd, &error) && + !g_spawn_command_line_async("xfce4-mixer", &error)) + { + g_warning("Unable to show dialog: %s", error->message); + diff --git a/debian/patches/sound_ubuntustudio.patch b/debian/patches/sound_ubuntustudio.patch new file mode 100644 index 0000000..23d27de --- /dev/null +++ b/debian/patches/sound_ubuntustudio.patch @@ -0,0 +1,18 @@ +Description: Use pavucontrol on Ubuntu Studio by default + Xfce4-mixer uses gstreamer0.10-pulseaudio, which doesn't provide full access + to all audio channels, only to 'Master'. +Author: Lionel Le Folgoc <mrpouit@ubuntu.com> +Author: Janne Jokitalo (astraljava) <astraljava@kapsi.fi> +Last-Update: 2012-04-03 + +--- indicator-sound-0.8.5.0.orig/src/sound-service-dbus.c ++++ indicator-sound-0.8.5.0/src/sound-service-dbus.c +@@ -232,6 +232,8 @@ show_sound_settings_dialog (DbusmenuMenu + cmd = "gnome-control-center sound-nua"; + else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) + cmd = "pavucontrol"; ++ else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "ubuntustudio")) ++ cmd = "pavucontrol"; + else + cmd = "gnome-control-center sound"; + diff --git a/debian/patches/sound_xubuntu.patch b/debian/patches/sound_xubuntu.patch new file mode 100644 index 0000000..bbf3db2 --- /dev/null +++ b/debian/patches/sound_xubuntu.patch @@ -0,0 +1,17 @@ +Description: Use pavucontrol on Xubuntu by default + Xfce4-mixer uses gstreamer0.10-pulseaudio, which doesn't provide full access + to all audio channels, only to 'Master'. +Author: Lionel Le Folgoc <mrpouit@ubuntu.com> +Last-Update: 2012-03-21 + +--- indicator-sound-0.8.4.1.orig/src/sound-service-dbus.c ++++ indicator-sound-0.8.4.1/src/sound-service-dbus.c +@@ -230,6 +230,8 @@ show_sound_settings_dialog (DbusmenuMenu + gchar* cmd; + if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")) + cmd = "gnome-control-center sound-nua"; ++ else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) ++ cmd = "pavucontrol"; + else + cmd = "gnome-control-center sound"; + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..4ffb502 --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/autoreconf.mk +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/gnome.mk + +DEB_CONFIGURE_EXTRA_FLAGS = --disable-static + +CFLAGS += -Wno-error=deprecated-declarations +LDFLAGS += -Wl,-z,defs -Wl,--as-needed + +common-install-arch:: + find debian/indicator-sound -name \*.la -delete diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..079f994 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +https://launchpad.net/indicator-sound/+download .*/indicator-sound-([0-9.]+)\.tar\.gz diff --git a/src/sound-service-dbus.c b/src/sound-service-dbus.c index 5e004cb..815333f 100644 --- a/src/sound-service-dbus.c +++ b/src/sound-service-dbus.c @@ -227,8 +227,18 @@ show_sound_settings_dialog (DbusmenuMenuitem *mi, gpointer user_data) { GError * error = NULL; + gchar* cmd; + if (!g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity")) + cmd = "gnome-control-center sound-nua"; + else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xubuntu")) + cmd = "pavucontrol"; + else if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "ubuntustudio")) + cmd = "pavucontrol"; + else + cmd = "gnome-control-center sound"; + if (!g_spawn_command_line_async("gnome-volume-control --page=applications", &error) && - !g_spawn_command_line_async("gnome-control-center sound", &error) && + !g_spawn_command_line_async(cmd, &error) && !g_spawn_command_line_async("xfce4-mixer", &error)) { g_warning("Unable to show dialog: %s", error->message); |