diff options
author | Michal Ratajsky <[email protected]> | 2014-06-21 16:41:39 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2014-10-09 16:53:00 +0200 |
commit | 93b52cc3e0f8109da21d109e249911d1a3bde671 (patch) | |
tree | 84b2ba858563b8fbbb4e9984fa8d82ebe61abe0e /mate-volume-control/src/gvc-stream-status-icon.c | |
parent | de3e2fc0c8a77708b4921c4d3b3c83efee01cc28 (diff) | |
download | mate-media-93b52cc3e0f8109da21d109e249911d1a3bde671.tar.bz2 mate-media-93b52cc3e0f8109da21d109e249911d1a3bde671.tar.xz |
Adapt to libmatemixer decibel changes
Diffstat (limited to 'mate-volume-control/src/gvc-stream-status-icon.c')
-rw-r--r-- | mate-volume-control/src/gvc-stream-status-icon.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/mate-volume-control/src/gvc-stream-status-icon.c b/mate-volume-control/src/gvc-stream-status-icon.c index 51207ba..86cd947 100644 --- a/mate-volume-control/src/gvc-stream-status-icon.c +++ b/mate-volume-control/src/gvc-stream-status-icon.c @@ -30,20 +30,14 @@ #include "gvc-channel-bar.h" #include "gvc-stream-status-icon.h" -// XXX the gdk_spawn_command_line_on_screen causes compiler warnings, remove the GTK3 -// check and instead use GdkAppLaunchContext and GAppInfo which should work with -// both GDKs - +// XXX remove the #if and just use mate_gdk_spawn_command_line_on_screen after +// https://github.com/mate-desktop/mate-desktop/pull/120 #if GTK_CHECK_VERSION (3, 0, 0) #define MATE_DESKTOP_USE_UNSTABLE_API #include <libmate-desktop/mate-desktop-utils.h> #define gdk_spawn_command_line_on_screen mate_gdk_spawn_command_line_on_screen #endif -// XXX this file uses PA_DECIBEL_MININFTY, figure out how to handle it through the -// library and change it -#include <pulse/pulseaudio.h> - #define GVC_STREAM_STATUS_ICON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GVC_TYPE_STREAM_STATUS_ICON, GvcStreamStatusIconPrivate)) struct _GvcStreamStatusIconPrivate @@ -426,7 +420,7 @@ static void update_icon (GvcStreamStatusIcon *icon) { gint64 volume; - gdouble volume_db = 0; + gdouble decibel = 0; gint64 normal_volume; gboolean is_muted; guint n; @@ -444,7 +438,7 @@ update_icon (GvcStreamStatusIcon *icon) flags = mate_mixer_stream_get_flags (icon->priv->mixer_stream); if (flags & MATE_MIXER_STREAM_HAS_DECIBEL_VOLUME) { - volume_db = mate_mixer_stream_get_volume_db (icon->priv->mixer_stream); + decibel = mate_mixer_stream_get_decibel (icon->priv->mixer_stream); can_decibel = TRUE; } @@ -477,12 +471,12 @@ update_icon (GvcStreamStatusIcon *icon) icon->priv->display_name, _("Muted"), mate_mixer_stream_get_description (icon->priv->mixer_stream)); - } else if (can_decibel && (volume_db > PA_DECIBEL_MININFTY)) { + } else if (can_decibel && (decibel > -MATE_MIXER_INFINITY)) { markup = g_strdup_printf ( "<b>%s: %.0f%%</b>\n<small>%0.2f dB\n%s</small>", icon->priv->display_name, 100 * (float) volume / normal_volume, - volume_db, + decibel, mate_mixer_stream_get_description (icon->priv->mixer_stream)); } else if (can_decibel) { markup = g_strdup_printf ( |