Commit 20e53bcf authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

sound-applet: build also status notifier item

parent b01985c7
......@@ -33,10 +33,7 @@
#include "gf-sound-applet.h"
#include "gvc-mixer-control.h"
#include "gvc-stream-status-icon.h"
#ifdef WITH_LIBSTATUS_NOTIFIER
#include "gf-sound-item.h"
#endif
static const gchar *output_icons[] =
{
......@@ -64,10 +61,8 @@ struct _GfSoundApplet
GvcStreamStatusIcon *output_status_icon;
GvcMixerControl *control;
#ifdef WITH_LIBSTATUS_NOTIFIER
GfSoundItem *output_item;
GfSoundItem *input_item;
#endif
};
G_DEFINE_TYPE (GfSoundApplet, gf_sound_applet, G_TYPE_OBJECT)
......@@ -90,12 +85,10 @@ maybe_show_status_icons (GfSoundApplet *applet)
gtk_status_icon_set_visible (GTK_STATUS_ICON (applet->output_status_icon), show);
G_GNUC_END_IGNORE_DEPRECATIONS
#ifdef WITH_LIBSTATUS_NOTIFIER
if (show)
sn_item_register (SN_ITEM (applet->output_item));
else
sn_item_unregister (SN_ITEM (applet->output_item));
#endif
show = FALSE;
stream = gvc_mixer_control_get_default_source (applet->control);
......@@ -130,12 +123,10 @@ maybe_show_status_icons (GfSoundApplet *applet)
gtk_status_icon_set_visible (GTK_STATUS_ICON (applet->input_status_icon), show);
G_GNUC_END_IGNORE_DEPRECATIONS
#ifdef WITH_LIBSTATUS_NOTIFIER
if (show)
sn_item_register (SN_ITEM (applet->input_item));
else
sn_item_unregister (SN_ITEM (applet->input_item));
#endif
g_slist_free (source_outputs);
}
......@@ -150,9 +141,7 @@ update_default_sink (GfSoundApplet *applet)
if (stream != NULL)
{
gvc_stream_status_icon_set_mixer_stream (applet->output_status_icon, stream);
#ifdef WITH_LIBSTATUS_NOTIFIER
gf_sound_item_set_mixer_stream (applet->output_item, stream);
#endif
maybe_show_status_icons (applet);
}
else
......@@ -171,9 +160,7 @@ update_default_source (GfSoundApplet *applet)
if (stream != NULL)
{
gvc_stream_status_icon_set_mixer_stream (applet->input_status_icon, stream);
#ifdef WITH_LIBSTATUS_NOTIFIER
gf_sound_item_set_mixer_stream (applet->input_item, stream);
#endif
maybe_show_status_icons (applet);
}
else
......@@ -288,10 +275,8 @@ gf_sound_applet_dispose (GObject *object)
g_clear_object (&applet->input_status_icon);
g_clear_object (&applet->control);
#ifdef WITH_LIBSTATUS_NOTIFIER
g_clear_object (&applet->output_item);
g_clear_object (&applet->input_item);
#endif
G_OBJECT_CLASS (gf_sound_applet_parent_class)->dispose (object);
}
......@@ -311,9 +296,7 @@ static void
gf_sound_applet_init (GfSoundApplet *applet)
{
GvcStreamStatusIcon *icon;
#ifdef WITH_LIBSTATUS_NOTIFIER
SnItemCategory category;
#endif
/* Output icon */
icon = gvc_stream_status_icon_new (NULL, output_icons);
......@@ -335,7 +318,6 @@ gf_sound_applet_init (GfSoundApplet *applet)
applet->input_status_icon = icon;
#ifdef WITH_LIBSTATUS_NOTIFIER
category = SN_ITEM_CATEGORY_HARDWARE;
applet->output_item = gf_sound_item_new (category,
......@@ -349,7 +331,6 @@ gf_sound_applet_init (GfSoundApplet *applet)
_("Microphone Volume"),
_("Input"),
input_icons);
#endif
}
GfSoundApplet *
......
......@@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if 0
#include "config.h"
#include <glib/gi18n.h>
......@@ -687,4 +686,3 @@ gf_sound_item_set_mixer_stream (GfSoundItem *item,
update_icon (item);
}
#endif
......@@ -19,9 +19,9 @@
#define GF_SOUND_ITEM_H
#include <glib-object.h>
#include <libstatus-notifier/sn.h>
#include "gvc-mixer-stream.h"
#include "libstatus-notifier/sn-item.h"
G_BEGIN_DECLS
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment