Commit 6db64515 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels
Browse files

sound applet finished

parent bb51744b
[submodule "gnome-flashback/libsound-applet/gvc"]
path = gnome-flashback/libsound-applet/gvc
url = git://git.gnome.org/libgnome-volume-control
......@@ -12,6 +12,13 @@ PKG_NAME="gnome-flashback"
exit 1
}
if test ! -f gnome-flashback/libsound-applet/gvc/Makefile.am;
then
echo "+ Setting up submodules"
git submodule init
fi
git submodule update
which gnome-autogen.sh || {
echo "You need to install gnome-common."
exit 1
......
......@@ -29,6 +29,8 @@ GLIB_GSETTINGS
GTK_REQUIRED=3.10.0
LIBGNOME_DESKTOP_REQUIRED=3.8.0
CANBERRA_REQUIRED=0.13
GLIB_REQUIRED=2.39.91
PKG_CHECK_MODULES(GNOME_FLASHBACK, gtk+-3.0 >= $GTK_REQUIRED)
AC_SUBST(GNOME_FLASHBACK_CFLAGS)
......@@ -50,6 +52,13 @@ PKG_CHECK_MODULES(IDLE_MONITOR, gtk+-3.0 >= $GTK_REQUIRED)
AC_SUBST(IDLE_MONITOR_CFLAGS)
AC_SUBST(IDLE_MONITOR_LIBS)
PKG_CHECK_MODULES(GVC, gobject-2.0 libpulse libpulse-mainloop-glib)
AM_CONDITIONAL(HAVE_INTROSPECTION, false)
PKG_CHECK_MODULES(SOUND_APPLET, gtk+-3.0 >= $GTK_REQUIRED libcanberra-gtk3 >= $CANBERRA_REQUIRED glib-2.0 >= $GLIB_REQUIRED)
AC_SUBST(SOUND_APPLET_CFLAGS)
AC_SUBST(SOUND_APPLET_LIBS)
AC_CONFIG_FILES([
Makefile
gnome-flashback/Makefile
......@@ -57,6 +66,8 @@ gnome-flashback/libdesktop-background/Makefile
gnome-flashback/libdisplay-config/Makefile
gnome-flashback/libend-session-dialog/Makefile
gnome-flashback/libidle-monitor/Makefile
gnome-flashback/libsound-applet/Makefile
gnome-flashback/libsound-applet/gvc/Makefile
po/Makefile.in
sessions/Makefile
])
......
......@@ -2,7 +2,8 @@ SUBDIRS = \
libdesktop-background \
libdisplay-config \
libend-session-dialog \
libidle-monitor
libidle-monitor \
libsound-applet
bin_PROGRAMS = \
gnome-flashback
......@@ -22,7 +23,8 @@ gnome_flashback_LDADD = \
$(top_builddir)/gnome-flashback/libdesktop-background/libdesktop-background.la \
$(top_builddir)/gnome-flashback/libdisplay-config/libdisplay-config.la \
$(top_builddir)/gnome-flashback/libend-session-dialog/libend-session-dialog.la \
$(top_builddir)/gnome-flashback/libidle-monitor/libidle-monitor.la
$(top_builddir)/gnome-flashback/libidle-monitor/libidle-monitor.la \
$(top_builddir)/gnome-flashback/libsound-applet/libsound-applet.la
desktopdir = $(datadir)/applications
desktop_in_files = gnome-flashback.desktop.in
......
......@@ -23,6 +23,7 @@
#include "libdisplay-config/flashback-display-config.h"
#include "libend-session-dialog/flashback-end-session-dialog.h"
#include "libidle-monitor/flashback-idle-monitor.h"
#include "libsound-applet/gvc-applet.h"
#define FLASHBACK_SCHEMA "org.gnome.gnome-flashback"
#define KEY_DESKTOP_BACKGROUND "desktop-background"
......@@ -38,6 +39,7 @@ struct _FlashbackApplicationPrivate {
FlashbackDisplayConfig *config;
FlashbackEndSessionDialog *dialog;
FlashbackIdleMonitor *monitor;
GvcApplet *applet;
};
G_DEFINE_TYPE (FlashbackApplication, flashback_application, GTK_TYPE_APPLICATION);
......@@ -100,6 +102,19 @@ flashback_application_settings_changed (GSettings *settings,
}
}
}
if (key == NULL || g_strcmp0 (key, KEY_SOUND_APPLET) == 0) {
if (g_settings_get_boolean (settings, KEY_SOUND_APPLET)) {
if (app->priv->applet == NULL) {
app->priv->applet = gvc_applet_new ();
}
} else {
if (app->priv->applet) {
g_object_unref (app->priv->applet);
app->priv->applet = NULL;
}
}
}
}
static void
......@@ -152,6 +167,8 @@ flashback_application_shutdown (GApplication *application)
app->priv->monitor = NULL;
}
g_clear_object (&app->priv->applet);
if (app->priv->settings) {
g_object_unref (app->priv->settings);
app->priv->settings = NULL;
......
SUBDIRS = data
# This is used in PANEL_CFLAGS
cappletname = sound
NULL =
ccpanelsdir = $(PANELS_DIR)
ccpanels_LTLIBRARIES = libsound.la
bin_PROGRAMS = \
gnome-sound-applet \
$(NULL)
AM_CPPFLAGS = \
$(PANEL_CFLAGS) \
$(SOUND_PANEL_CFLAGS) \
-DLOCALE_DIR=\""$(datadir)/locale"\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
-DGLADEDIR=\""$(pkgdatadir)"\" \
-DSOUND_DATA_DIR="\"$(datadir)/sounds\"" \
-DSOUND_SET_DIR="\"$(pkgdatadir)/sounds\"" \
-DICON_DATA_DIR="\"$(pkgdatadir)/icons\"" \
$(NULL)
noinst_LTLIBRARIES = libgnomevolumecontrol.la
libgnomevolumecontrol_la_SOURCES = \
gvc-mixer-card.h \
gvc-mixer-card.c \
gvc-mixer-card-private.h \
gvc-mixer-stream.h \
gvc-mixer-stream.c \
gvc-mixer-stream-private.h \
gvc-channel-map.h \
gvc-channel-map.c \
gvc-channel-map-private.h \
gvc-mixer-ui-device.h \
gvc-mixer-ui-device.c \
gvc-mixer-sink.h \
gvc-mixer-sink.c \
gvc-mixer-source.h \
gvc-mixer-source.c \
gvc-mixer-sink-input.h \
gvc-mixer-sink-input.c \
gvc-mixer-source-output.h \
gvc-mixer-source-output.c \
gvc-mixer-event-role.h \
gvc-mixer-event-role.c \
gvc-mixer-control.h \
gvc-mixer-control.c \
gvc-mixer-control-private.h \
gvc-channel-bar.h \
gvc-channel-bar.c \
gvc-pulseaudio-fake.h \
$(NULL)
gnome_sound_applet_LDADD = \
-lm \
libgnomevolumecontrol.la \
$(SOUND_PANEL_LIBS) \
$(NULL)
gnome_sound_applet_SOURCES = \
gvc-stream-status-icon.h \
gvc-stream-status-icon.c \
gvc-applet.h \
gvc-applet.c \
gvc-log.h \
gvc-log.c \
applet-main.c \
$(NULL)
libsound_la_LIBADD = \
-lm \
libgnomevolumecontrol.la \
$(PANEL_LIBS) \
$(SOUND_PANEL_LIBS) \
$(NULL)
libsound_la_LDFLAGS = \
$(PANEL_LDFLAGS) \
$(NULL)
libsound_la_SOURCES = \
gvc-balance-bar.h \
gvc-balance-bar.c \
gvc-mixer-dialog.h \
gvc-mixer-dialog.c \
gvc-level-bar.h \
gvc-level-bar.c \
gvc-combo-box.h \
gvc-combo-box.c \
gvc-speaker-test.h \
gvc-speaker-test.c \
gvc-sound-theme-chooser.c \
gvc-sound-theme-chooser.h \
sound-theme-file-utils.c \
sound-theme-file-utils.h \
cc-sound-panel.c \
cc-sound-panel.h \
$(NULL)
BUILT_SOURCES = \
$(NULL)
CLEANFILES = \
$(BUILT_SOURCES) \
$(NULL)
MAINTAINERCLEANFILES = \
*~ \
Makefile.in
SUBDIRS = \
gvc
noinst_LTLIBRARIES = \
libsound-applet.la
AM_CPPFLAGS = \
$(SOUND_APPLET_CFLAGS) \
-I$(top_builddir)/gnome-flashback/libsound-applet \
-I$(srcdir)/gvc
libsound_applet_la_SOURCES = \
gvc-applet.c \
gvc-applet.h \
gvc-channel-bar.c \
gvc-channel-bar.h \
gvc-stream-status-icon.c \
gvc-stream-status-icon.h
libsound_applet_la_LIBADD = \
-lm \
$(SOUND_APPLET_LIBS) \
gvc/libgvc.la
-include $(top_srcdir)/git.mk
gvc @ e14dbe8a
Subproject commit e14dbe8aa6dfaeea4a9f3405cf2f3e238e88623b
......@@ -298,5 +298,7 @@ gvc_applet_new (void)
applet = g_object_new (GVC_TYPE_APPLET, NULL);
gvc_applet_start (GVC_APPLET (applet));
return GVC_APPLET (applet);
}
This diff is collapsed.
/*
* Copyright (C) 2008 Red Hat, Inc.
*
* 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, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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/>.
*/
#ifndef __GVC_CHANNEL_BAR_H
#define __GVC_CHANNEL_BAR_H
#include <glib-object.h>
G_BEGIN_DECLS
#define GVC_TYPE_CHANNEL_BAR (gvc_channel_bar_get_type ())
#define GVC_CHANNEL_BAR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GVC_TYPE_CHANNEL_BAR, GvcChannelBar))
#define GVC_CHANNEL_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GVC_TYPE_CHANNEL_BAR, GvcChannelBarClass))
#define GVC_IS_CHANNEL_BAR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GVC_TYPE_CHANNEL_BAR))
#define GVC_IS_CHANNEL_BAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GVC_TYPE_CHANNEL_BAR))
#define GVC_CHANNEL_BAR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GVC_TYPE_CHANNEL_BAR, GvcChannelBarClass))
typedef struct GvcChannelBarPrivate GvcChannelBarPrivate;
typedef struct
{
GtkBox parent;
GvcChannelBarPrivate *priv;
} GvcChannelBar;
typedef struct
{
GtkBoxClass parent_class;
} GvcChannelBarClass;
GType gvc_channel_bar_get_type (void);
GtkWidget * gvc_channel_bar_new (void);
void gvc_channel_bar_set_name (GvcChannelBar *bar,
const char *name);
void gvc_channel_bar_set_icon_name (GvcChannelBar *bar,
const char *icon_name);
void gvc_channel_bar_set_low_icon_name (GvcChannelBar *bar,
const char *icon_name);
void gvc_channel_bar_set_high_icon_name (GvcChannelBar *bar,
const char *icon_name);
void gvc_channel_bar_set_orientation (GvcChannelBar *bar,
GtkOrientation orientation);
GtkOrientation gvc_channel_bar_get_orientation (GvcChannelBar *bar);
GtkAdjustment * gvc_channel_bar_get_adjustment (GvcChannelBar *bar);
gboolean gvc_channel_bar_get_is_muted (GvcChannelBar *bar);
void gvc_channel_bar_set_is_muted (GvcChannelBar *bar,
gboolean is_muted);
gboolean gvc_channel_bar_get_show_mute (GvcChannelBar *bar);
void gvc_channel_bar_set_show_mute (GvcChannelBar *bar,
gboolean show_mute);
void gvc_channel_bar_set_size_group (GvcChannelBar *bar,
GtkSizeGroup *group,
gboolean symmetric);
void gvc_channel_bar_set_is_amplified (GvcChannelBar *bar,
gboolean amplified);
void gvc_channel_bar_set_base_volume (GvcChannelBar *bar,
guint32 base_volume);
gboolean gvc_channel_bar_get_ellipsize (GvcChannelBar *bar);
void gvc_channel_bar_set_ellipsize (GvcChannelBar *bar,
gboolean ellipsized);
gboolean gvc_channel_bar_scroll (GvcChannelBar *bar,
GdkEventScroll *event);
G_END_DECLS
#endif /* __GVC_CHANNEL_BAR_H */
/*
* Copyright (C) 2009 Red Hat, Inc.
*
* 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, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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/>.
*/
#include "config.h"
#include <glib.h>
#include <glib/gstdio.h>
#include "gvc-log.h"
static int log_levels = G_LOG_LEVEL_CRITICAL |
G_LOG_LEVEL_ERROR |
G_LOG_LEVEL_WARNING |
G_LOG_LEVEL_MESSAGE |
G_LOG_LEVEL_INFO |
G_LOG_LEVEL_DEBUG;
static void
gvc_log_default_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer unused_data)
{
if ((log_level & log_levels) == 0)
return;
g_log_default_handler (log_domain, log_level, message, unused_data);
}
void
gvc_log_init (void)
{
g_log_set_default_handler (gvc_log_default_handler, NULL);
}
void
gvc_log_set_debug (gboolean debug)
{
if (debug) {
log_levels |= (G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_INFO);
g_debug ("Enabling debugging");
} else {
log_levels &= ~ (G_LOG_LEVEL_DEBUG | G_LOG_LEVEL_INFO);
}
}
/*
* Copyright (C) 2009 Red Hat, Inc.
*
* 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, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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/>.
*/
#ifndef __GVC_LOG_H
#define __GVC_LOG_H
#include <glib.h>
G_BEGIN_DECLS
void gvc_log_init (void);
void gvc_log_set_debug (gboolean debug);
G_END_DECLS
#endif /* __GVC_LOG_H */
......@@ -4,6 +4,10 @@
gnome-flashback/gnome-flashback.desktop.in
gnome-flashback/libend-session-dialog/flashback-inhibit-dialog.c
[type: gettext/glade]gnome-flashback/libend-session-dialog/flashback-inhibit-dialog.ui
gnome-flashback/libsound-applet/gvc-applet.c
gnome-flashback/libsound-applet/gvc-channel-bar.c
gnome-flashback/libsound-applet/gvc-stream-status-icon.c
gnome-flashback/libsound-applet/gvc/gvc-mixer-control.c
gnome-flashback/org.gnome.gnome-flashback.gschema.xml.in.in
sessions/gnome-flashback-compiz.desktop.in.in
sessions/gnome-flashback-compiz.session.in
......
Markdown is supported
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