aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/indicator-sound.c17
-rw-r--r--src/pulse-manager.c14
-rw-r--r--src/pulse-manager.h1
4 files changed, 17 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index d9fd14c..f472662 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,7 +13,7 @@ libsoundmenu_la_SOURCES = \
dbus-shared-names.h \
sound-service-client.h
-libsoundmenu_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror
+libsoundmenu_la_CFLAGS = $(APPLET_CFLAGS) -Wall -Werror -DG_LOG_DOMAIN=\"Indicator-Sound\"
libsoundmenu_la_LIBADD = $(APPLET_LIBS)
libsoundmenu_la_LDFLAGS = -module -avoid-version
diff --git a/src/indicator-sound.c b/src/indicator-sound.c
index 3bb5416..a67a0b0 100644
--- a/src/indicator-sound.c
+++ b/src/indicator-sound.c
@@ -249,7 +249,7 @@ static gboolean new_slider_item(DbusmenuMenuitem * newitem, DbusmenuMenuitem * p
io = g_object_get_data (G_OBJECT (client), "indicator");
- volume_slider = ido_scale_menu_item_new_with_range ("Volume", initial_volume_percent, 0, 100, 0.5);
+ volume_slider = ido_scale_menu_item_new_with_range ("Volume", initial_volume_percent, 0, 100, 1);
g_object_set(volume_slider, "reverse-scroll-events", TRUE, NULL);
g_signal_connect (volume_slider,
@@ -671,15 +671,18 @@ static gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, gpointer dat
static void
scroll (IndicatorObject *io, gint delta, IndicatorScrollDirection direction)
{
- IndicatorSound *sound = INDICATOR_SOUND (io);
- GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (sound->slider));
- gdouble value = gtk_range_get_value (GTK_RANGE (sound->slider));
+ if (device_available == FALSE || current_state == STATE_MUTED)
+ return;
+
+ IndicatorSound *sound = INDICATOR_SOUND (io);
+ GtkAdjustment *adj = gtk_range_get_adjustment (GTK_RANGE (sound->slider));
+ gdouble value = gtk_range_get_value (GTK_RANGE (sound->slider));
- if (direction == INDICATOR_OBJECT_SCROLL_UP)
+ if (direction == INDICATOR_OBJECT_SCROLL_UP)
value += adj->step_increment;
- else
+ else
value -= adj->step_increment;
- gtk_range_set_value (GTK_RANGE (sound->slider),
+ gtk_range_set_value (GTK_RANGE (sound->slider),
value);
}
diff --git a/src/pulse-manager.c b/src/pulse-manager.c
index a95c887..c6fc6ac 100644
--- a/src/pulse-manager.c
+++ b/src/pulse-manager.c
@@ -123,7 +123,6 @@ static void destroy_sink_info(void *value)
{
sink_info *sink = (sink_info*)value;
g_free(sink->name);
- g_free(sink->description);
g_free(sink);
}
@@ -299,7 +298,6 @@ static void pulse_sink_info_callback(pa_context *c, const pa_sink_info *sink, in
value = g_new0(sink_info, 1);
value->index = sink->index;
value->name = g_strdup(sink->name);
- value->description = g_strdup(sink->description);
value->mute = !!sink->mute;
value->volume = sink->volume;
value->base_volume = sink->base_volume;
@@ -368,13 +366,11 @@ static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, v
{
sink_info *s = g_hash_table_lookup(sink_hash, GINT_TO_POINTER(info->index));
s->name = g_strdup(info->name);
- s->description = g_strdup(info->description);
gboolean mute_changed = s->mute != !!info->mute;
s->mute = !!info->mute;
gboolean volume_changed = (pa_cvolume_equal(&info->volume, &s->volume) == 0);
s->volume = info->volume;
s->base_volume = info->base_volume;
- s->channel_map = info->channel_map;
if(DEFAULT_SINK_INDEX == s->index)
{
//update the UI
@@ -406,11 +402,9 @@ static void update_sink_info(pa_context *c, const pa_sink_info *info, int eol, v
value = g_new0(sink_info, 1);
value->index = info->index;
value->name = g_strdup(info->name);
- value->description = g_strdup(info->description);
value->mute = !!info->mute;
value->volume = info->volume;
value->base_volume = info->base_volume;
- value->channel_map = info->channel_map;
g_hash_table_insert(sink_hash, GINT_TO_POINTER(value->index), value);
g_debug("pulse-manager:update_sink_info -> After adding a new sink to our hash");
sound_service_dbus_update_sink_availability(dbus_service, TRUE);
@@ -463,9 +457,13 @@ static void subscribed_events_callback(pa_context *c, enum pa_subscription_event
g_debug("PA_SUBSCRIPTION_EVENT_SINK event triggered");
if ((t & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_REMOVE)
{
- if(index == DEFAULT_SINK_INDEX)
- g_debug("PA_SUBSCRIPTION_EVENT_SINK REMOVAL event triggered - default sink has been removed !!");
+ if(index == DEFAULT_SINK_INDEX){
+ g_debug("PA_SUBSCRIPTION_EVENT_SINK REMOVAL event triggered - default sink has been removed !! \n updating UI to reflect the change");
sound_service_dbus_update_sink_availability(dbus_service, FALSE);
+ }
+ else{
+ g_debug("PA_SUBSCRIPTION_EVENT_SINK REMOVAL - some device other than the default - no panic");
+ }
}
else
{
diff --git a/src/pulse-manager.h b/src/pulse-manager.h
index 60a7ad3..54978bb 100644
--- a/src/pulse-manager.h
+++ b/src/pulse-manager.h
@@ -30,7 +30,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
typedef struct {
gchar* name;
- gchar* description;
gint index;
pa_cvolume volume;
pa_channel_map channel_map;