aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in1076
-rw-r--r--src/familiar-players-db.c519
-rw-r--r--src/metadata-menu-item.c164
-rw-r--r--src/mpris-controller-v2.c130
-rw-r--r--src/mpris-controller.c669
-rw-r--r--src/music-player-bridge.c567
-rw-r--r--src/music-player-bridge.h299
-rw-r--r--src/player-controller.c596
-rw-r--r--src/player-item.c446
-rw-r--r--src/sound-service-client.h177
-rw-r--r--src/sound-service-server.h170
-rw-r--r--src/title-menu-item.c199
-rw-r--r--src/transport-menu-item.c218
13 files changed, 5230 insertions, 0 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..6f0fd0c
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,1076 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+libexec_PROGRAMS = indicator-sound-service$(EXEEXT)
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(soundmenulibdir)" \
+ "$(DESTDIR)$(libexecdir)"
+LTLIBRARIES = $(soundmenulib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libsoundmenu_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_libsoundmenu_la_OBJECTS = libsoundmenu_la-transport-widget.lo \
+ libsoundmenu_la-metadata-widget.lo \
+ libsoundmenu_la-play-button.lo \
+ libsoundmenu_la-indicator-sound.lo \
+ libsoundmenu_la-title-widget.lo
+libsoundmenu_la_OBJECTS = $(am_libsoundmenu_la_OBJECTS)
+AM_V_lt = $(am__v_lt_$(V))
+am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
+am__v_lt_0 = --silent
+libsoundmenu_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(libsoundmenu_la_CFLAGS) $(CFLAGS) $(libsoundmenu_la_LDFLAGS) \
+ $(LDFLAGS) -o $@
+PROGRAMS = $(libexec_PROGRAMS)
+am__objects_1 = indicator_sound_service-music-player-bridge.$(OBJEXT) \
+ indicator_sound_service-transport-menu-item.$(OBJEXT) \
+ indicator_sound_service-metadata-menu-item.$(OBJEXT) \
+ indicator_sound_service-title-menu-item.$(OBJEXT) \
+ indicator_sound_service-player-controller.$(OBJEXT) \
+ indicator_sound_service-mpris-controller-v2.$(OBJEXT) \
+ indicator_sound_service-mpris-controller.$(OBJEXT) \
+ indicator_sound_service-player-item.$(OBJEXT) \
+ indicator_sound_service-familiar-players-db.$(OBJEXT)
+am_indicator_sound_service_OBJECTS = \
+ indicator_sound_service-sound-service.$(OBJEXT) \
+ indicator_sound_service-dbus-menu-manager.$(OBJEXT) \
+ indicator_sound_service-pulse-manager.$(OBJEXT) \
+ indicator_sound_service-sound-service-dbus.$(OBJEXT) \
+ indicator_sound_service-slider-menu-item.$(OBJEXT) \
+ $(am__objects_1)
+indicator_sound_service_OBJECTS = \
+ $(am_indicator_sound_service_OBJECTS)
+indicator_sound_service_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+indicator_sound_service_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+ $(indicator_sound_service_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_$(V))
+am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
+am__v_CC_0 = @echo " CC " $@;
+AM_V_at = $(am__v_at_$(V))
+am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
+am__v_at_0 = @
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_$(V))
+am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
+am__v_CCLD_0 = @echo " CCLD " $@;
+AM_V_GEN = $(am__v_GEN_$(V))
+am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
+am__v_GEN_0 = @echo " GEN " $@;
+SOURCES = $(libsoundmenu_la_SOURCES) \
+ $(indicator_sound_service_SOURCES)
+DIST_SOURCES = $(libsoundmenu_la_SOURCES) \
+ $(indicator_sound_service_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLET_CFLAGS = @APPLET_CFLAGS@
+APPLET_LIBS = @APPLET_LIBS@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DBUSSERVICEDIR = @DBUSSERVICEDIR@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GCONFTOOL = @GCONFTOOL@
+GCONF_CFLAGS = @GCONF_CFLAGS@
+GCONF_LIBS = @GCONF_LIBS@
+GCONF_SCHEMA_CONFIG_SOURCE = @GCONF_SCHEMA_CONFIG_SOURCE@
+GCONF_SCHEMA_FILE_DIR = @GCONF_SCHEMA_FILE_DIR@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GNOMELOCALEDIR = @GNOMELOCALEDIR@
+GREP = @GREP@
+INDICATORDIR = @INDICATORDIR@
+INDICATORICONSDIR = @INDICATORICONSDIR@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGFMT_OPTS = @MSGFMT_OPTS@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+POFILES = @POFILES@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PULSEAUDIO_CFLAGS = @PULSEAUDIO_CFLAGS@
+PULSEAUDIO_LIBS = @PULSEAUDIO_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SOUNDERVICE_LIBS = @SOUNDERVICE_LIBS@
+SOUNDSERVICE_CFLAGS = @SOUNDSERVICE_CFLAGS@
+SOUNDSERVICE_LIBS = @SOUNDSERVICE_LIBS@
+STRIP = @STRIP@
+USE_NLS = @USE_NLS@
+VALAC = @VALAC@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+###################
+# Indicator Stuff
+###################
+soundmenulibdir = $(INDICATORDIR)
+soundmenulib_LTLIBRARIES = libsoundmenu.la
+libsoundmenu_la_SOURCES = \
+ common-defs.h \
+ indicator-sound.h \
+ transport-widget.c \
+ transport-widget.h \
+ metadata-widget.c \
+ metadata-widget.h \
+ play-button.c \
+ play-button.h \
+ indicator-sound.c \
+ title-widget.c \
+ title-widget.h \
+ dbus-shared-names.h \
+ sound-service-client.h
+
+libsoundmenu_la_CFLAGS = $(APPLET_CFLAGS) -Wall -DG_LOG_DOMAIN=\"Indicator-Sound\"
+libsoundmenu_la_LIBADD = $(APPLET_LIBS)
+libsoundmenu_la_LDFLAGS = -module -avoid-version
+
+#####################
+# libsoundmenu vala
+#####################
+music_bridge_VALASOURCES = \
+ music-player-bridge.vala \
+ transport-menu-item.vala \
+ metadata-menu-item.vala \
+ title-menu-item.vala \
+ player-controller.vala \
+ mpris-controller-v2.vala \
+ mpris-controller.vala \
+ player-item.vala \
+ familiar-players-db.vala
+
+music_bridge_VALAFLAGS = \
+ --ccode \
+ -H music-player-bridge.h -d . \
+ --vapidir=$(top_srcdir)/vapi/ \
+ --vapidir=./ \
+ --thread \
+ --pkg gee-1.0 \
+ --pkg Indicate-0.2 \
+ --pkg Dbusmenu-Glib-0.2 \
+ --pkg common-defs \
+ --pkg dbus-glib-1 \
+ --pkg gio-unix-2.0
+
+music_bridge_APIFILES = \
+ music-player-bridge.h
+
+
+###############################
+# libsoundmenu C
+###############################
+indicator_sound_service_SOURCES = \
+ common-defs.h \
+ sound-service.h \
+ sound-service.c \
+ dbus-menu-manager.c \
+ dbus-menu-manager.h \
+ pulse-manager.h \
+ pulse-manager.c \
+ sound-service-dbus.h \
+ sound-service-dbus.c \
+ sound-service-server.h \
+ slider-menu-item.h \
+ slider-menu-item.c \
+ $(music_bridge_VALASOURCES:.vala=.c)
+
+indicator_sound_service_CFLAGS = $(PULSEAUDIO_CFLAGS) $(SOUNDSERVICE_CFLAGS) $(GCONF_CFLAGS) -DLIBEXECDIR=\"$(libexecdir)\" -Wall
+indicator_sound_service_LDADD = $(PULSEAUDIO_LIBS) $(SOUNDSERVICE_LIBS) $(GCONF_LIBS)
+
+#########################
+# Extra stuff to package
+#########################
+EXTRA_DIST = \
+ sound-service.xml \
+ sound-service.list \
+ $(music_bridge_APIFILES) \
+ $(music_bridge_VALASOURCES)
+
+
+#######################
+# Stuff to clean Stuff
+#######################
+BUILT_SOURCES = \
+ music_bridge_vala.stamp \
+ sound-service-client.h \
+ sound-service-server.h \
+ $(music_bridge_APIFILES) \
+ $(music_bridge_VALASOURCES:.vala=.c)
+
+CLEANFILES = \
+ $(BUILT_SOURCES)
+
+all: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-soundmenulibLTLIBRARIES: $(soundmenulib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(soundmenulibdir)" || $(MKDIR_P) "$(DESTDIR)$(soundmenulibdir)"
+ @list='$(soundmenulib_LTLIBRARIES)'; test -n "$(soundmenulibdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(soundmenulibdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(soundmenulibdir)"; \
+ }
+
+uninstall-soundmenulibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(soundmenulib_LTLIBRARIES)'; test -n "$(soundmenulibdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(soundmenulibdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(soundmenulibdir)/$$f"; \
+ done
+
+clean-soundmenulibLTLIBRARIES:
+ -test -z "$(soundmenulib_LTLIBRARIES)" || rm -f $(soundmenulib_LTLIBRARIES)
+ @list='$(soundmenulib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libsoundmenu.la: $(libsoundmenu_la_OBJECTS) $(libsoundmenu_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libsoundmenu_la_LINK) -rpath $(soundmenulibdir) $(libsoundmenu_la_OBJECTS) $(libsoundmenu_la_LIBADD) $(LIBS)
+install-libexecPROGRAMS: $(libexec_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p || test -f $$p1; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-libexecPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files
+
+clean-libexecPROGRAMS:
+ @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+indicator-sound-service$(EXEEXT): $(indicator_sound_service_OBJECTS) $(indicator_sound_service_DEPENDENCIES)
+ @rm -f indicator-sound-service$(EXEEXT)
+ $(AM_V_CCLD)$(indicator_sound_service_LINK) $(indicator_sound_service_OBJECTS) $(indicator_sound_service_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-dbus-menu-manager.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-familiar-players-db.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-metadata-menu-item.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-mpris-controller-v2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-mpris-controller.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-music-player-bridge.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-player-controller.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-player-item.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-pulse-manager.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-slider-menu-item.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-sound-service-dbus.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-sound-service.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-title-menu-item.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/indicator_sound_service-transport-menu-item.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-indicator-sound.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-metadata-widget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-play-button.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-title-widget.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsoundmenu_la-transport-widget.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libsoundmenu_la-transport-widget.lo: transport-widget.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-transport-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-transport-widget.Tpo -c -o libsoundmenu_la-transport-widget.lo `test -f 'transport-widget.c' || echo '$(srcdir)/'`transport-widget.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-transport-widget.Tpo $(DEPDIR)/libsoundmenu_la-transport-widget.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transport-widget.c' object='libsoundmenu_la-transport-widget.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-transport-widget.lo `test -f 'transport-widget.c' || echo '$(srcdir)/'`transport-widget.c
+
+libsoundmenu_la-metadata-widget.lo: metadata-widget.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-metadata-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-metadata-widget.Tpo -c -o libsoundmenu_la-metadata-widget.lo `test -f 'metadata-widget.c' || echo '$(srcdir)/'`metadata-widget.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-metadata-widget.Tpo $(DEPDIR)/libsoundmenu_la-metadata-widget.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='metadata-widget.c' object='libsoundmenu_la-metadata-widget.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-metadata-widget.lo `test -f 'metadata-widget.c' || echo '$(srcdir)/'`metadata-widget.c
+
+libsoundmenu_la-play-button.lo: play-button.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-play-button.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-play-button.Tpo -c -o libsoundmenu_la-play-button.lo `test -f 'play-button.c' || echo '$(srcdir)/'`play-button.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-play-button.Tpo $(DEPDIR)/libsoundmenu_la-play-button.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='play-button.c' object='libsoundmenu_la-play-button.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-play-button.lo `test -f 'play-button.c' || echo '$(srcdir)/'`play-button.c
+
+libsoundmenu_la-indicator-sound.lo: indicator-sound.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-indicator-sound.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-indicator-sound.Tpo -c -o libsoundmenu_la-indicator-sound.lo `test -f 'indicator-sound.c' || echo '$(srcdir)/'`indicator-sound.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-indicator-sound.Tpo $(DEPDIR)/libsoundmenu_la-indicator-sound.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='indicator-sound.c' object='libsoundmenu_la-indicator-sound.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-indicator-sound.lo `test -f 'indicator-sound.c' || echo '$(srcdir)/'`indicator-sound.c
+
+libsoundmenu_la-title-widget.lo: title-widget.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -MT libsoundmenu_la-title-widget.lo -MD -MP -MF $(DEPDIR)/libsoundmenu_la-title-widget.Tpo -c -o libsoundmenu_la-title-widget.lo `test -f 'title-widget.c' || echo '$(srcdir)/'`title-widget.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsoundmenu_la-title-widget.Tpo $(DEPDIR)/libsoundmenu_la-title-widget.Plo
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='title-widget.c' object='libsoundmenu_la-title-widget.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsoundmenu_la_CFLAGS) $(CFLAGS) -c -o libsoundmenu_la-title-widget.lo `test -f 'title-widget.c' || echo '$(srcdir)/'`title-widget.c
+
+indicator_sound_service-sound-service.o: sound-service.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service.Tpo -c -o indicator_sound_service-sound-service.o `test -f 'sound-service.c' || echo '$(srcdir)/'`sound-service.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service.Tpo $(DEPDIR)/indicator_sound_service-sound-service.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service.c' object='indicator_sound_service-sound-service.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service.o `test -f 'sound-service.c' || echo '$(srcdir)/'`sound-service.c
+
+indicator_sound_service-sound-service.obj: sound-service.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service.Tpo -c -o indicator_sound_service-sound-service.obj `if test -f 'sound-service.c'; then $(CYGPATH_W) 'sound-service.c'; else $(CYGPATH_W) '$(srcdir)/sound-service.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service.Tpo $(DEPDIR)/indicator_sound_service-sound-service.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service.c' object='indicator_sound_service-sound-service.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service.obj `if test -f 'sound-service.c'; then $(CYGPATH_W) 'sound-service.c'; else $(CYGPATH_W) '$(srcdir)/sound-service.c'; fi`
+
+indicator_sound_service-dbus-menu-manager.o: dbus-menu-manager.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-dbus-menu-manager.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-dbus-menu-manager.Tpo -c -o indicator_sound_service-dbus-menu-manager.o `test -f 'dbus-menu-manager.c' || echo '$(srcdir)/'`dbus-menu-manager.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-dbus-menu-manager.Tpo $(DEPDIR)/indicator_sound_service-dbus-menu-manager.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dbus-menu-manager.c' object='indicator_sound_service-dbus-menu-manager.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-dbus-menu-manager.o `test -f 'dbus-menu-manager.c' || echo '$(srcdir)/'`dbus-menu-manager.c
+
+indicator_sound_service-dbus-menu-manager.obj: dbus-menu-manager.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-dbus-menu-manager.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-dbus-menu-manager.Tpo -c -o indicator_sound_service-dbus-menu-manager.obj `if test -f 'dbus-menu-manager.c'; then $(CYGPATH_W) 'dbus-menu-manager.c'; else $(CYGPATH_W) '$(srcdir)/dbus-menu-manager.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-dbus-menu-manager.Tpo $(DEPDIR)/indicator_sound_service-dbus-menu-manager.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dbus-menu-manager.c' object='indicator_sound_service-dbus-menu-manager.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-dbus-menu-manager.obj `if test -f 'dbus-menu-manager.c'; then $(CYGPATH_W) 'dbus-menu-manager.c'; else $(CYGPATH_W) '$(srcdir)/dbus-menu-manager.c'; fi`
+
+indicator_sound_service-pulse-manager.o: pulse-manager.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-pulse-manager.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-pulse-manager.Tpo -c -o indicator_sound_service-pulse-manager.o `test -f 'pulse-manager.c' || echo '$(srcdir)/'`pulse-manager.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-pulse-manager.Tpo $(DEPDIR)/indicator_sound_service-pulse-manager.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pulse-manager.c' object='indicator_sound_service-pulse-manager.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-pulse-manager.o `test -f 'pulse-manager.c' || echo '$(srcdir)/'`pulse-manager.c
+
+indicator_sound_service-pulse-manager.obj: pulse-manager.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-pulse-manager.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-pulse-manager.Tpo -c -o indicator_sound_service-pulse-manager.obj `if test -f 'pulse-manager.c'; then $(CYGPATH_W) 'pulse-manager.c'; else $(CYGPATH_W) '$(srcdir)/pulse-manager.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-pulse-manager.Tpo $(DEPDIR)/indicator_sound_service-pulse-manager.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pulse-manager.c' object='indicator_sound_service-pulse-manager.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-pulse-manager.obj `if test -f 'pulse-manager.c'; then $(CYGPATH_W) 'pulse-manager.c'; else $(CYGPATH_W) '$(srcdir)/pulse-manager.c'; fi`
+
+indicator_sound_service-sound-service-dbus.o: sound-service-dbus.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service-dbus.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo -c -o indicator_sound_service-sound-service-dbus.o `test -f 'sound-service-dbus.c' || echo '$(srcdir)/'`sound-service-dbus.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo $(DEPDIR)/indicator_sound_service-sound-service-dbus.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service-dbus.c' object='indicator_sound_service-sound-service-dbus.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service-dbus.o `test -f 'sound-service-dbus.c' || echo '$(srcdir)/'`sound-service-dbus.c
+
+indicator_sound_service-sound-service-dbus.obj: sound-service-dbus.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-sound-service-dbus.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo -c -o indicator_sound_service-sound-service-dbus.obj `if test -f 'sound-service-dbus.c'; then $(CYGPATH_W) 'sound-service-dbus.c'; else $(CYGPATH_W) '$(srcdir)/sound-service-dbus.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-sound-service-dbus.Tpo $(DEPDIR)/indicator_sound_service-sound-service-dbus.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sound-service-dbus.c' object='indicator_sound_service-sound-service-dbus.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-sound-service-dbus.obj `if test -f 'sound-service-dbus.c'; then $(CYGPATH_W) 'sound-service-dbus.c'; else $(CYGPATH_W) '$(srcdir)/sound-service-dbus.c'; fi`
+
+indicator_sound_service-slider-menu-item.o: slider-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-slider-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo -c -o indicator_sound_service-slider-menu-item.o `test -f 'slider-menu-item.c' || echo '$(srcdir)/'`slider-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo $(DEPDIR)/indicator_sound_service-slider-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slider-menu-item.c' object='indicator_sound_service-slider-menu-item.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-slider-menu-item.o `test -f 'slider-menu-item.c' || echo '$(srcdir)/'`slider-menu-item.c
+
+indicator_sound_service-slider-menu-item.obj: slider-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-slider-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo -c -o indicator_sound_service-slider-menu-item.obj `if test -f 'slider-menu-item.c'; then $(CYGPATH_W) 'slider-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/slider-menu-item.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-slider-menu-item.Tpo $(DEPDIR)/indicator_sound_service-slider-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='slider-menu-item.c' object='indicator_sound_service-slider-menu-item.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-slider-menu-item.obj `if test -f 'slider-menu-item.c'; then $(CYGPATH_W) 'slider-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/slider-menu-item.c'; fi`
+
+indicator_sound_service-music-player-bridge.o: music-player-bridge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-music-player-bridge.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo -c -o indicator_sound_service-music-player-bridge.o `test -f 'music-player-bridge.c' || echo '$(srcdir)/'`music-player-bridge.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo $(DEPDIR)/indicator_sound_service-music-player-bridge.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='music-player-bridge.c' object='indicator_sound_service-music-player-bridge.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-music-player-bridge.o `test -f 'music-player-bridge.c' || echo '$(srcdir)/'`music-player-bridge.c
+
+indicator_sound_service-music-player-bridge.obj: music-player-bridge.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-music-player-bridge.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo -c -o indicator_sound_service-music-player-bridge.obj `if test -f 'music-player-bridge.c'; then $(CYGPATH_W) 'music-player-bridge.c'; else $(CYGPATH_W) '$(srcdir)/music-player-bridge.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-music-player-bridge.Tpo $(DEPDIR)/indicator_sound_service-music-player-bridge.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='music-player-bridge.c' object='indicator_sound_service-music-player-bridge.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-music-player-bridge.obj `if test -f 'music-player-bridge.c'; then $(CYGPATH_W) 'music-player-bridge.c'; else $(CYGPATH_W) '$(srcdir)/music-player-bridge.c'; fi`
+
+indicator_sound_service-transport-menu-item.o: transport-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-transport-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo -c -o indicator_sound_service-transport-menu-item.o `test -f 'transport-menu-item.c' || echo '$(srcdir)/'`transport-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo $(DEPDIR)/indicator_sound_service-transport-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transport-menu-item.c' object='indicator_sound_service-transport-menu-item.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-transport-menu-item.o `test -f 'transport-menu-item.c' || echo '$(srcdir)/'`transport-menu-item.c
+
+indicator_sound_service-transport-menu-item.obj: transport-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-transport-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo -c -o indicator_sound_service-transport-menu-item.obj `if test -f 'transport-menu-item.c'; then $(CYGPATH_W) 'transport-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/transport-menu-item.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-transport-menu-item.Tpo $(DEPDIR)/indicator_sound_service-transport-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='transport-menu-item.c' object='indicator_sound_service-transport-menu-item.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-transport-menu-item.obj `if test -f 'transport-menu-item.c'; then $(CYGPATH_W) 'transport-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/transport-menu-item.c'; fi`
+
+indicator_sound_service-metadata-menu-item.o: metadata-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-metadata-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo -c -o indicator_sound_service-metadata-menu-item.o `test -f 'metadata-menu-item.c' || echo '$(srcdir)/'`metadata-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo $(DEPDIR)/indicator_sound_service-metadata-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='metadata-menu-item.c' object='indicator_sound_service-metadata-menu-item.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-metadata-menu-item.o `test -f 'metadata-menu-item.c' || echo '$(srcdir)/'`metadata-menu-item.c
+
+indicator_sound_service-metadata-menu-item.obj: metadata-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-metadata-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo -c -o indicator_sound_service-metadata-menu-item.obj `if test -f 'metadata-menu-item.c'; then $(CYGPATH_W) 'metadata-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/metadata-menu-item.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-metadata-menu-item.Tpo $(DEPDIR)/indicator_sound_service-metadata-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='metadata-menu-item.c' object='indicator_sound_service-metadata-menu-item.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-metadata-menu-item.obj `if test -f 'metadata-menu-item.c'; then $(CYGPATH_W) 'metadata-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/metadata-menu-item.c'; fi`
+
+indicator_sound_service-title-menu-item.o: title-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-title-menu-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-title-menu-item.Tpo -c -o indicator_sound_service-title-menu-item.o `test -f 'title-menu-item.c' || echo '$(srcdir)/'`title-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-title-menu-item.Tpo $(DEPDIR)/indicator_sound_service-title-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='title-menu-item.c' object='indicator_sound_service-title-menu-item.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-title-menu-item.o `test -f 'title-menu-item.c' || echo '$(srcdir)/'`title-menu-item.c
+
+indicator_sound_service-title-menu-item.obj: title-menu-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-title-menu-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-title-menu-item.Tpo -c -o indicator_sound_service-title-menu-item.obj `if test -f 'title-menu-item.c'; then $(CYGPATH_W) 'title-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/title-menu-item.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-title-menu-item.Tpo $(DEPDIR)/indicator_sound_service-title-menu-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='title-menu-item.c' object='indicator_sound_service-title-menu-item.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-title-menu-item.obj `if test -f 'title-menu-item.c'; then $(CYGPATH_W) 'title-menu-item.c'; else $(CYGPATH_W) '$(srcdir)/title-menu-item.c'; fi`
+
+indicator_sound_service-player-controller.o: player-controller.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-controller.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-controller.Tpo -c -o indicator_sound_service-player-controller.o `test -f 'player-controller.c' || echo '$(srcdir)/'`player-controller.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-controller.Tpo $(DEPDIR)/indicator_sound_service-player-controller.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-controller.c' object='indicator_sound_service-player-controller.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-controller.o `test -f 'player-controller.c' || echo '$(srcdir)/'`player-controller.c
+
+indicator_sound_service-player-controller.obj: player-controller.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-controller.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-controller.Tpo -c -o indicator_sound_service-player-controller.obj `if test -f 'player-controller.c'; then $(CYGPATH_W) 'player-controller.c'; else $(CYGPATH_W) '$(srcdir)/player-controller.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-controller.Tpo $(DEPDIR)/indicator_sound_service-player-controller.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-controller.c' object='indicator_sound_service-player-controller.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-controller.obj `if test -f 'player-controller.c'; then $(CYGPATH_W) 'player-controller.c'; else $(CYGPATH_W) '$(srcdir)/player-controller.c'; fi`
+
+indicator_sound_service-mpris-controller-v2.o: mpris-controller-v2.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris-controller-v2.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris-controller-v2.Tpo -c -o indicator_sound_service-mpris-controller-v2.o `test -f 'mpris-controller-v2.c' || echo '$(srcdir)/'`mpris-controller-v2.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris-controller-v2.Tpo $(DEPDIR)/indicator_sound_service-mpris-controller-v2.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris-controller-v2.c' object='indicator_sound_service-mpris-controller-v2.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris-controller-v2.o `test -f 'mpris-controller-v2.c' || echo '$(srcdir)/'`mpris-controller-v2.c
+
+indicator_sound_service-mpris-controller-v2.obj: mpris-controller-v2.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris-controller-v2.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris-controller-v2.Tpo -c -o indicator_sound_service-mpris-controller-v2.obj `if test -f 'mpris-controller-v2.c'; then $(CYGPATH_W) 'mpris-controller-v2.c'; else $(CYGPATH_W) '$(srcdir)/mpris-controller-v2.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris-controller-v2.Tpo $(DEPDIR)/indicator_sound_service-mpris-controller-v2.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris-controller-v2.c' object='indicator_sound_service-mpris-controller-v2.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris-controller-v2.obj `if test -f 'mpris-controller-v2.c'; then $(CYGPATH_W) 'mpris-controller-v2.c'; else $(CYGPATH_W) '$(srcdir)/mpris-controller-v2.c'; fi`
+
+indicator_sound_service-mpris-controller.o: mpris-controller.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris-controller.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris-controller.Tpo -c -o indicator_sound_service-mpris-controller.o `test -f 'mpris-controller.c' || echo '$(srcdir)/'`mpris-controller.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris-controller.Tpo $(DEPDIR)/indicator_sound_service-mpris-controller.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris-controller.c' object='indicator_sound_service-mpris-controller.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris-controller.o `test -f 'mpris-controller.c' || echo '$(srcdir)/'`mpris-controller.c
+
+indicator_sound_service-mpris-controller.obj: mpris-controller.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-mpris-controller.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-mpris-controller.Tpo -c -o indicator_sound_service-mpris-controller.obj `if test -f 'mpris-controller.c'; then $(CYGPATH_W) 'mpris-controller.c'; else $(CYGPATH_W) '$(srcdir)/mpris-controller.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-mpris-controller.Tpo $(DEPDIR)/indicator_sound_service-mpris-controller.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpris-controller.c' object='indicator_sound_service-mpris-controller.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-mpris-controller.obj `if test -f 'mpris-controller.c'; then $(CYGPATH_W) 'mpris-controller.c'; else $(CYGPATH_W) '$(srcdir)/mpris-controller.c'; fi`
+
+indicator_sound_service-player-item.o: player-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-item.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-item.Tpo -c -o indicator_sound_service-player-item.o `test -f 'player-item.c' || echo '$(srcdir)/'`player-item.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-item.Tpo $(DEPDIR)/indicator_sound_service-player-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-item.c' object='indicator_sound_service-player-item.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-item.o `test -f 'player-item.c' || echo '$(srcdir)/'`player-item.c
+
+indicator_sound_service-player-item.obj: player-item.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-player-item.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-player-item.Tpo -c -o indicator_sound_service-player-item.obj `if test -f 'player-item.c'; then $(CYGPATH_W) 'player-item.c'; else $(CYGPATH_W) '$(srcdir)/player-item.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-player-item.Tpo $(DEPDIR)/indicator_sound_service-player-item.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='player-item.c' object='indicator_sound_service-player-item.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-player-item.obj `if test -f 'player-item.c'; then $(CYGPATH_W) 'player-item.c'; else $(CYGPATH_W) '$(srcdir)/player-item.c'; fi`
+
+indicator_sound_service-familiar-players-db.o: familiar-players-db.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-familiar-players-db.o -MD -MP -MF $(DEPDIR)/indicator_sound_service-familiar-players-db.Tpo -c -o indicator_sound_service-familiar-players-db.o `test -f 'familiar-players-db.c' || echo '$(srcdir)/'`familiar-players-db.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-familiar-players-db.Tpo $(DEPDIR)/indicator_sound_service-familiar-players-db.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='familiar-players-db.c' object='indicator_sound_service-familiar-players-db.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-familiar-players-db.o `test -f 'familiar-players-db.c' || echo '$(srcdir)/'`familiar-players-db.c
+
+indicator_sound_service-familiar-players-db.obj: familiar-players-db.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -MT indicator_sound_service-familiar-players-db.obj -MD -MP -MF $(DEPDIR)/indicator_sound_service-familiar-players-db.Tpo -c -o indicator_sound_service-familiar-players-db.obj `if test -f 'familiar-players-db.c'; then $(CYGPATH_W) 'familiar-players-db.c'; else $(CYGPATH_W) '$(srcdir)/familiar-players-db.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/indicator_sound_service-familiar-players-db.Tpo $(DEPDIR)/indicator_sound_service-familiar-players-db.Po
+@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='familiar-players-db.c' object='indicator_sound_service-familiar-players-db.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(indicator_sound_service_CFLAGS) $(CFLAGS) -c -o indicator_sound_service-familiar-players-db.obj `if test -f 'familiar-players-db.c'; then $(CYGPATH_W) 'familiar-players-db.c'; else $(CYGPATH_W) '$(srcdir)/familiar-players-db.c'; fi`
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(soundmenulibdir)" "$(DESTDIR)$(libexecdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-am
+
+clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \
+ clean-soundmenulibLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-soundmenulibLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libexecPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libexecPROGRAMS \
+ uninstall-soundmenulibLTLIBRARIES
+
+.MAKE: all check install install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libexecPROGRAMS clean-libtool \
+ clean-soundmenulibLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libexecPROGRAMS install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-soundmenulibLTLIBRARIES \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-libexecPROGRAMS uninstall-soundmenulibLTLIBRARIES
+
+
+checkxml: $(srcdir)/sound-service.xml
+ @xmllint -valid -noout $<
+ @echo $< checks out ok
+
+sound-service-client.h: $(srcdir)/sound-service.xml
+ dbus-binding-tool \
+ --prefix=_sound_service_client \
+ --mode=glib-client \
+ --output=sound-service-client.h \
+ $(srcdir)/sound-service.xml
+
+####################################################################
+# Sound Service
+####################################################################
+
+#################
+# dbus interface
+#################
+sound-service-server.h: $(srcdir)/sound-service.xml
+ dbus-binding-tool \
+ --prefix=_sound_service_server \
+ --mode=glib-server \
+ --output=sound-service-server.h \
+ $(srcdir)/sound-service.xml
+ $(MAINTAINER_VALAFLAGS)
+
+music_bridge_vala.stamp $(music_bridge_APIFILES): $(music_bridge_VALASOURCES)
+ $(AM_V_GEN) $(VALAC) $(music_bridge_VALAFLAGS) $^
+ touch music_bridge_vala.stamp
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/familiar-players-db.c b/src/familiar-players-db.c
new file mode 100644
index 0000000..9933d4d
--- /dev/null
+++ b/src/familiar-players-db.c
@@ -0,0 +1,519 @@
+/* familiar-players-db.c generated by valac, the Vala compiler
+ * generated from familiar-players-db.vala, do not modify */
+
+/*
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gee.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib/gstdio.h>
+
+
+#define TYPE_FAMILIAR_PLAYERS_DB (familiar_players_db_get_type ())
+#define FAMILIAR_PLAYERS_DB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDB))
+#define FAMILIAR_PLAYERS_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBClass))
+#define IS_FAMILIAR_PLAYERS_DB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FAMILIAR_PLAYERS_DB))
+#define IS_FAMILIAR_PLAYERS_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FAMILIAR_PLAYERS_DB))
+#define FAMILIAR_PLAYERS_DB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBClass))
+
+typedef struct _FamiliarPlayersDB FamiliarPlayersDB;
+typedef struct _FamiliarPlayersDBClass FamiliarPlayersDBClass;
+typedef struct _FamiliarPlayersDBPrivate FamiliarPlayersDBPrivate;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_key_file_free0(var) ((var == NULL) ? NULL : (var = (g_key_file_free (var), NULL)))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+
+struct _FamiliarPlayersDB {
+ GObject parent_instance;
+ FamiliarPlayersDBPrivate * priv;
+};
+
+struct _FamiliarPlayersDBClass {
+ GObjectClass parent_class;
+};
+
+struct _FamiliarPlayersDBPrivate {
+ GeeHashMap* players_DB;
+ char* file_name;
+ char* dir_name;
+ GKeyFile* key_file;
+ guint write_id;
+};
+
+
+static gpointer familiar_players_db_parent_class = NULL;
+
+GType familiar_players_db_get_type (void);
+#define FAMILIAR_PLAYERS_DB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBPrivate))
+enum {
+ FAMILIAR_PLAYERS_DB_DUMMY_PROPERTY
+};
+#define FAMILIAR_PLAYERS_DB_GROUP_NAME "Seen Database"
+#define FAMILIAR_PLAYERS_DB_KEY_NAME "DesktopFiles"
+static gboolean familiar_players_db_create_key_file (FamiliarPlayersDB* self);
+static gboolean familiar_players_db_check_for_keys (FamiliarPlayersDB* self);
+static gboolean familiar_players_db_load_data_from_key_file (FamiliarPlayersDB* self);
+FamiliarPlayersDB* familiar_players_db_new (void);
+FamiliarPlayersDB* familiar_players_db_construct (GType object_type);
+static void _vala_array_add1 (char*** array, int* length, int* size, char* value);
+static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self);
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop);
+static gboolean _familiar_players_db_write_db_gsource_func (gpointer self);
+void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop);
+GeeSet* familiar_players_db_records (FamiliarPlayersDB* self);
+static void familiar_players_db_finalize (GObject* obj);
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
+
+
+
+FamiliarPlayersDB* familiar_players_db_construct (GType object_type) {
+ FamiliarPlayersDB * self;
+ GeeHashMap* _tmp0_;
+ char* _tmp1_;
+ char* _tmp2_;
+ gboolean _tmp3_ = FALSE;
+ gboolean _tmp4_ = FALSE;
+ self = (FamiliarPlayersDB*) g_object_new (object_type, NULL);
+ self->priv->write_id = (guint) 0;
+ self->priv->players_DB = (_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, G_TYPE_BOOLEAN, NULL, NULL, NULL, NULL, NULL), _g_object_unref0 (self->priv->players_DB), _tmp0_);
+ self->priv->dir_name = (_tmp1_ = g_build_filename (g_get_user_cache_dir (), "indicators", "sound", NULL), _g_free0 (self->priv->dir_name), _tmp1_);
+ self->priv->file_name = (_tmp2_ = g_build_filename (self->priv->dir_name, "familiar-players-db.keyfile", NULL), _g_free0 (self->priv->file_name), _tmp2_);
+ if (familiar_players_db_create_key_file (self)) {
+ _tmp4_ = familiar_players_db_check_for_keys (self);
+ } else {
+ _tmp4_ = FALSE;
+ }
+ if (_tmp4_) {
+ _tmp3_ = familiar_players_db_load_data_from_key_file (self);
+ } else {
+ _tmp3_ = FALSE;
+ }
+ if (_tmp3_) {
+ g_debug ("familiar-players-db.vala:45: keyfiles in place and ready for action");
+ } else {
+ GKeyFile* _tmp5_;
+ self->priv->key_file = (_tmp5_ = NULL, _g_key_file_free0 (self->priv->key_file), _tmp5_);
+ g_warning ("familiar-players-db.vala:49: FamiliarPlayersDB:: problems loading key " \
+"file - can't go any further");
+ }
+ return self;
+}
+
+
+FamiliarPlayersDB* familiar_players_db_new (void) {
+ return familiar_players_db_construct (TYPE_FAMILIAR_PLAYERS_DB);
+}
+
+
+static gboolean familiar_players_db_create_key_file (FamiliarPlayersDB* self) {
+ gboolean result = FALSE;
+ GError * _inner_error_;
+ g_return_val_if_fail (self != NULL, FALSE);
+ _inner_error_ = NULL;
+ if (g_file_test (self->priv->file_name, G_FILE_TEST_EXISTS)) {
+ GKeyFile* _tmp0_;
+ self->priv->key_file = (_tmp0_ = g_key_file_new (), _g_key_file_free0 (self->priv->key_file), _tmp0_);
+ {
+ gboolean _tmp1_;
+ _tmp1_ = g_key_file_load_from_file (self->priv->key_file, self->priv->file_name, G_KEY_FILE_NONE, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_FILE_ERROR) {
+ goto __catch3_g_file_error;
+ }
+ goto __finally3;
+ }
+ if (_tmp1_ == TRUE) {
+ result = TRUE;
+ return result;
+ }
+ }
+ goto __finally3;
+ __catch3_g_file_error:
+ {
+ GError * e;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ g_warning ("familiar-players-db.vala:62: FamiliarPlayersDB - error trying to load " \
+"KeyFile");
+ _g_error_free0 (e);
+ }
+ }
+ __finally3:
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ }
+ result = FALSE;
+ return result;
+}
+
+
+static gboolean familiar_players_db_check_for_keys (FamiliarPlayersDB* self) {
+ gboolean result = FALSE;
+ GError * _inner_error_;
+ g_return_val_if_fail (self != NULL, FALSE);
+ _inner_error_ = NULL;
+ {
+ gboolean _tmp0_;
+ _tmp0_ = g_key_file_has_key (self->priv->key_file, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_KEY_FILE_ERROR) {
+ goto __catch4_g_key_file_error;
+ }
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ if (_tmp0_ == TRUE) {
+ result = TRUE;
+ return result;
+ }
+ }
+ goto __finally4;
+ __catch4_g_key_file_error:
+ {
+ GError * e;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ result = FALSE;
+ _g_error_free0 (e);
+ return result;
+ }
+ }
+ __finally4:
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ g_warning ("familiar-players-db.vala:77: Seen DB '%s' does not have key '%s' in gr" \
+"oup '%s'", self->priv->file_name, FAMILIAR_PLAYERS_DB_KEY_NAME, FAMILIAR_PLAYERS_DB_GROUP_NAME);
+ result = FALSE;
+ return result;
+}
+
+
+static gboolean familiar_players_db_load_data_from_key_file (FamiliarPlayersDB* self) {
+ gboolean result = FALSE;
+ GError * _inner_error_;
+ g_return_val_if_fail (self != NULL, FALSE);
+ _inner_error_ = NULL;
+ {
+ char** _tmp1_;
+ gint _desktops_size_;
+ gint desktops_length1;
+ gsize _tmp0_;
+ char** desktops;
+ desktops = (_tmp1_ = g_key_file_get_string_list (self->priv->key_file, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, &_tmp0_, &_inner_error_), desktops_length1 = _tmp0_, _desktops_size_ = desktops_length1, _tmp1_);
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_FILE_ERROR) {
+ goto __catch5_g_file_error;
+ }
+ goto __finally5;
+ }
+ {
+ char** s_collection;
+ int s_collection_length1;
+ int s_it;
+ s_collection = desktops;
+ s_collection_length1 = desktops_length1;
+ for (s_it = 0; s_it < desktops_length1; s_it = s_it + 1) {
+ char* s;
+ s = g_strdup (s_collection[s_it]);
+ {
+ gee_abstract_map_set ((GeeAbstractMap*) self->priv->players_DB, s, GINT_TO_POINTER (TRUE));
+ _g_free0 (s);
+ }
+ }
+ }
+ result = TRUE;
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ return result;
+ }
+ goto __finally5;
+ __catch5_g_file_error:
+ {
+ GError * _error_;
+ _error_ = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ g_warning ("familiar-players-db.vala:91: Error loading the Desktop string list");
+ result = FALSE;
+ _g_error_free0 (_error_);
+ return result;
+ }
+ }
+ __finally5:
+ {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+}
+
+
+static void _vala_array_add1 (char*** array, int* length, int* size, char* value) {
+ if ((*length) == (*size)) {
+ *size = (*size) ? (2 * (*size)) : 4;
+ *array = g_renew (char*, *array, (*size) + 1);
+ }
+ (*array)[(*length)++] = value;
+ (*array)[*length] = NULL;
+}
+
+
+static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) {
+ gboolean result = FALSE;
+ GError * _inner_error_;
+ GKeyFile* keyfile;
+ char** _tmp1_;
+ gint _desktops_size_;
+ gint desktops_length1;
+ char** _tmp0_ = NULL;
+ char** desktops;
+ gsize data_length = 0UL;
+ char* data;
+ g_return_val_if_fail (self != NULL, FALSE);
+ _inner_error_ = NULL;
+ keyfile = g_key_file_new ();
+ desktops = (_tmp1_ = (_tmp0_ = g_new0 (char*, 0 + 1), _tmp0_), desktops_length1 = 0, _desktops_size_ = desktops_length1, _tmp1_);
+ {
+ GeeSet* _tmp2_;
+ GeeIterator* _tmp3_;
+ GeeIterator* _key_it;
+ _key_it = (_tmp3_ = gee_iterable_iterator ((GeeIterable*) (_tmp2_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB))), _g_object_unref0 (_tmp2_), _tmp3_);
+ while (TRUE) {
+ char* key;
+ if (!gee_iterator_next (_key_it)) {
+ break;
+ }
+ key = (char*) gee_iterator_get (_key_it);
+ _vala_array_add1 (&desktops, &desktops_length1, &_desktops_size_, g_strdup (key));
+ _g_free0 (key);
+ }
+ _g_object_unref0 (_key_it);
+ }
+ g_key_file_set_string_list (keyfile, FAMILIAR_PLAYERS_DB_GROUP_NAME, FAMILIAR_PLAYERS_DB_KEY_NAME, (const gchar* const*) desktops, desktops_length1);
+ data = NULL;
+ {
+ char* _tmp4_;
+ data = (_tmp4_ = g_key_file_to_data (keyfile, &data_length, NULL), _g_free0 (data), _tmp4_);
+ }
+ goto __finally6;
+ __catch6_g_error:
+ {
+ GError * e;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ g_warning ("familiar-players-db.vala:112: Problems dumping keyfile to a string");
+ result = FALSE;
+ _g_error_free0 (e);
+ _g_key_file_free0 (keyfile);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (data);
+ return result;
+ }
+ }
+ __finally6:
+ if (_inner_error_ != NULL) {
+ _g_key_file_free0 (keyfile);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (data);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ if (g_mkdir_with_parents (self->priv->dir_name, 0700) != 0) {
+ g_warning ("familiar-players-db.vala:117: Unable to make directory: %s", self->priv->dir_name);
+ result = FALSE;
+ _g_key_file_free0 (keyfile);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (data);
+ return result;
+ }
+ {
+ gboolean _tmp5_;
+ _tmp5_ = g_file_set_contents (self->priv->file_name, data, (gssize) data_length, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_FILE_ERROR) {
+ goto __catch7_g_file_error;
+ }
+ _g_key_file_free0 (keyfile);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (data);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ if (_tmp5_ == FALSE) {
+ g_warning ("familiar-players-db.vala:123: Unable to write out file '%s'", self->priv->file_name);
+ }
+ }
+ goto __finally7;
+ __catch7_g_file_error:
+ {
+ GError * err;
+ err = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ g_warning ("familiar-players-db.vala:127: Unable to write out file '%s'", self->priv->file_name);
+ _g_error_free0 (err);
+ }
+ }
+ __finally7:
+ if (_inner_error_ != NULL) {
+ _g_key_file_free0 (keyfile);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (data);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return FALSE;
+ }
+ result = TRUE;
+ _g_key_file_free0 (keyfile);
+ desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (data);
+ return result;
+}
+
+
+static gboolean _familiar_players_db_write_db_gsource_func (gpointer self) {
+ gboolean result;
+ result = familiar_players_db_write_db (self);
+ return result;
+}
+
+
+void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop) {
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (desktop != NULL);
+ if (familiar_players_db_already_familiar (self, desktop) == FALSE) {
+ char* _tmp0_;
+ if (self->priv->write_id != 0) {
+ g_source_remove (self->priv->write_id);
+ self->priv->write_id = (guint) 0;
+ }
+ self->priv->write_id = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 60, _familiar_players_db_write_db_gsource_func, g_object_ref (self), g_object_unref);
+ gee_abstract_map_set ((GeeAbstractMap*) self->priv->players_DB, _tmp0_ = g_strdup (desktop), GINT_TO_POINTER (TRUE));
+ _g_free0 (_tmp0_);
+ }
+}
+
+
+static char* bool_to_string (gboolean self) {
+ char* result = NULL;
+ if (self) {
+ result = g_strdup ("true");
+ return result;
+ } else {
+ result = g_strdup ("false");
+ return result;
+ }
+}
+
+
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop) {
+ gboolean result = FALSE;
+ char* _tmp1_;
+ GeeSet* _tmp0_;
+ GeeSet* _tmp2_;
+ gboolean _tmp3_;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (desktop != NULL, FALSE);
+ g_debug ("familiar-players-db.vala:146: playerDB->already_familiar - result %s", _tmp1_ = bool_to_string (gee_collection_contains ((GeeCollection*) (_tmp0_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB)), desktop)));
+ _g_free0 (_tmp1_);
+ _g_object_unref0 (_tmp0_);
+ result = (_tmp3_ = gee_collection_contains ((GeeCollection*) (_tmp2_ = gee_map_get_keys ((GeeMap*) self->priv->players_DB)), desktop), _g_object_unref0 (_tmp2_), _tmp3_);
+ return result;
+}
+
+
+GeeSet* familiar_players_db_records (FamiliarPlayersDB* self) {
+ GeeSet* result = NULL;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = gee_map_get_keys ((GeeMap*) self->priv->players_DB);
+ return result;
+}
+
+
+static void familiar_players_db_class_init (FamiliarPlayersDBClass * klass) {
+ familiar_players_db_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (FamiliarPlayersDBPrivate));
+ G_OBJECT_CLASS (klass)->finalize = familiar_players_db_finalize;
+}
+
+
+static void familiar_players_db_instance_init (FamiliarPlayersDB * self) {
+ self->priv = FAMILIAR_PLAYERS_DB_GET_PRIVATE (self);
+}
+
+
+static void familiar_players_db_finalize (GObject* obj) {
+ FamiliarPlayersDB * self;
+ self = FAMILIAR_PLAYERS_DB (obj);
+ _g_object_unref0 (self->priv->players_DB);
+ _g_free0 (self->priv->file_name);
+ _g_free0 (self->priv->dir_name);
+ _g_key_file_free0 (self->priv->key_file);
+ G_OBJECT_CLASS (familiar_players_db_parent_class)->finalize (obj);
+}
+
+
+GType familiar_players_db_get_type (void) {
+ static volatile gsize familiar_players_db_type_id__volatile = 0;
+ if (g_once_init_enter (&familiar_players_db_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (FamiliarPlayersDBClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) familiar_players_db_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (FamiliarPlayersDB), 0, (GInstanceInitFunc) familiar_players_db_instance_init, NULL };
+ GType familiar_players_db_type_id;
+ familiar_players_db_type_id = g_type_register_static (G_TYPE_OBJECT, "FamiliarPlayersDB", &g_define_type_info, 0);
+ g_once_init_leave (&familiar_players_db_type_id__volatile, familiar_players_db_type_id);
+ }
+ return familiar_players_db_type_id__volatile;
+}
+
+
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
+ }
+}
+
+
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+
+
+
diff --git a/src/metadata-menu-item.c b/src/metadata-menu-item.c
new file mode 100644
index 0000000..518bad8
--- /dev/null
+++ b/src/metadata-menu-item.c
@@ -0,0 +1,164 @@
+/* metadata-menu-item.c generated by valac, the Vala compiler
+ * generated from metadata-menu-item.vala, do not modify */
+
+/*
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+#include <common-defs.h>
+#include <gee.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define TYPE_PLAYER_ITEM (player_item_get_type ())
+#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
+#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
+#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
+#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
+#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
+
+typedef struct _PlayerItem PlayerItem;
+typedef struct _PlayerItemClass PlayerItemClass;
+typedef struct _PlayerItemPrivate PlayerItemPrivate;
+
+#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ())
+#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem))
+#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
+#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM))
+#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM))
+#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
+
+typedef struct _MetadataMenuitem MetadataMenuitem;
+typedef struct _MetadataMenuitemClass MetadataMenuitemClass;
+typedef struct _MetadataMenuitemPrivate MetadataMenuitemPrivate;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+struct _PlayerItem {
+ DbusmenuMenuitem parent_instance;
+ PlayerItemPrivate * priv;
+};
+
+struct _PlayerItemClass {
+ DbusmenuMenuitemClass parent_class;
+};
+
+struct _MetadataMenuitem {
+ PlayerItem parent_instance;
+ MetadataMenuitemPrivate * priv;
+};
+
+struct _MetadataMenuitemClass {
+ PlayerItemClass parent_class;
+};
+
+
+static gpointer metadata_menuitem_parent_class = NULL;
+
+GType player_item_get_type (void);
+GType metadata_menuitem_get_type (void);
+enum {
+ METADATA_MENUITEM_DUMMY_PROPERTY
+};
+MetadataMenuitem* metadata_menuitem_new (void);
+MetadataMenuitem* metadata_menuitem_construct (GType object_type);
+GeeHashSet* metadata_menuitem_attributes_format (void);
+gboolean metadata_menuitem_populated (MetadataMenuitem* self);
+static int _vala_strcmp0 (const char * str1, const char * str2);
+
+
+
+MetadataMenuitem* metadata_menuitem_construct (GType object_type) {
+ MetadataMenuitem * self;
+ self = (MetadataMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_METADATA_MENUITEM_TYPE, NULL);
+ return self;
+}
+
+
+MetadataMenuitem* metadata_menuitem_new (void) {
+ return metadata_menuitem_construct (TYPE_METADATA_MENUITEM);
+}
+
+
+GeeHashSet* metadata_menuitem_attributes_format (void) {
+ GeeHashSet* result = NULL;
+ GeeHashSet* attrs;
+ attrs = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TEXT_TITLE);
+ gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TEXT_ARTIST);
+ gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_TEXT_ALBUM);
+ gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_METADATA_MENUITEM_ARTURL);
+ result = attrs;
+ return result;
+}
+
+
+gboolean metadata_menuitem_populated (MetadataMenuitem* self) {
+ gboolean result = FALSE;
+ gboolean _tmp0_ = FALSE;
+ g_return_val_if_fail (self != NULL, FALSE);
+ if (dbusmenu_menuitem_property_get ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_TEXT_TITLE) != NULL) {
+ _tmp0_ = _vala_strcmp0 (dbusmenu_menuitem_property_get ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_TEXT_TITLE), "") != 0;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ result = _tmp0_;
+ return result;
+}
+
+
+static void metadata_menuitem_class_init (MetadataMenuitemClass * klass) {
+ metadata_menuitem_parent_class = g_type_class_peek_parent (klass);
+}
+
+
+static void metadata_menuitem_instance_init (MetadataMenuitem * self) {
+}
+
+
+GType metadata_menuitem_get_type (void) {
+ static volatile gsize metadata_menuitem_type_id__volatile = 0;
+ if (g_once_init_enter (&metadata_menuitem_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (MetadataMenuitemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) metadata_menuitem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MetadataMenuitem), 0, (GInstanceInitFunc) metadata_menuitem_instance_init, NULL };
+ GType metadata_menuitem_type_id;
+ metadata_menuitem_type_id = g_type_register_static (TYPE_PLAYER_ITEM, "MetadataMenuitem", &g_define_type_info, 0);
+ g_once_init_leave (&metadata_menuitem_type_id__volatile, metadata_menuitem_type_id);
+ }
+ return metadata_menuitem_type_id__volatile;
+}
+
+
+static int _vala_strcmp0 (const char * str1, const char * str2) {
+ if (str1 == NULL) {
+ return -(str1 != str2);
+ }
+ if (str2 == NULL) {
+ return str1 != str2;
+ }
+ return strcmp (str1, str2);
+}
+
+
+
+
diff --git a/src/mpris-controller-v2.c b/src/mpris-controller-v2.c
new file mode 100644
index 0000000..40fe3da
--- /dev/null
+++ b/src/mpris-controller-v2.c
@@ -0,0 +1,130 @@
+/* mpris-controller-v2.c generated by valac, the Vala compiler
+ * generated from mpris-controller-v2.vala, do not modify */
+
+/*
+This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel.
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ())
+#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController))
+#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER))
+#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER))
+#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+
+typedef struct _MprisController MprisController;
+typedef struct _MprisControllerClass MprisControllerClass;
+typedef struct _MprisControllerPrivate MprisControllerPrivate;
+
+#define TYPE_MPRIS_CONTROLLER_V2 (mpris_controller_v2_get_type ())
+#define MPRIS_CONTROLLER_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2))
+#define MPRIS_CONTROLLER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2Class))
+#define IS_MPRIS_CONTROLLER_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER_V2))
+#define IS_MPRIS_CONTROLLER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER_V2))
+#define MPRIS_CONTROLLER_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2Class))
+
+typedef struct _MprisControllerV2 MprisControllerV2;
+typedef struct _MprisControllerV2Class MprisControllerV2Class;
+typedef struct _MprisControllerV2Private MprisControllerV2Private;
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+
+struct _MprisController {
+ GObject parent_instance;
+ MprisControllerPrivate * priv;
+};
+
+struct _MprisControllerClass {
+ GObjectClass parent_class;
+};
+
+struct _MprisControllerV2 {
+ MprisController parent_instance;
+ MprisControllerV2Private * priv;
+};
+
+struct _MprisControllerV2Class {
+ MprisControllerClass parent_class;
+};
+
+
+static gpointer mpris_controller_v2_parent_class = NULL;
+
+GType mpris_controller_get_type (void);
+GType mpris_controller_v2_get_type (void);
+enum {
+ MPRIS_CONTROLLER_V2_DUMMY_PROPERTY
+};
+GType player_controller_get_type (void);
+MprisControllerV2* mpris_controller_v2_new (PlayerController* ctrl, const char* inter);
+MprisControllerV2* mpris_controller_v2_construct (GType object_type, PlayerController* ctrl, const char* inter);
+
+
+
+MprisControllerV2* mpris_controller_v2_construct (GType object_type, PlayerController* ctrl, const char* inter) {
+ MprisControllerV2 * self;
+ g_return_val_if_fail (ctrl != NULL, NULL);
+ g_return_val_if_fail (inter != NULL, NULL);
+ self = (MprisControllerV2*) g_object_new (object_type, "owner", ctrl, "mpris-interface", inter, NULL);
+ return self;
+}
+
+
+MprisControllerV2* mpris_controller_v2_new (PlayerController* ctrl, const char* inter) {
+ return mpris_controller_v2_construct (TYPE_MPRIS_CONTROLLER_V2, ctrl, inter);
+}
+
+
+static void mpris_controller_v2_class_init (MprisControllerV2Class * klass) {
+ mpris_controller_v2_parent_class = g_type_class_peek_parent (klass);
+}
+
+
+static void mpris_controller_v2_instance_init (MprisControllerV2 * self) {
+}
+
+
+GType mpris_controller_v2_get_type (void) {
+ static volatile gsize mpris_controller_v2_type_id__volatile = 0;
+ if (g_once_init_enter (&mpris_controller_v2_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (MprisControllerV2Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mpris_controller_v2_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MprisControllerV2), 0, (GInstanceInitFunc) mpris_controller_v2_instance_init, NULL };
+ GType mpris_controller_v2_type_id;
+ mpris_controller_v2_type_id = g_type_register_static (TYPE_MPRIS_CONTROLLER, "MprisControllerV2", &g_define_type_info, 0);
+ g_once_init_leave (&mpris_controller_v2_type_id__volatile, mpris_controller_v2_type_id);
+ }
+ return mpris_controller_v2_type_id__volatile;
+}
+
+
+
+
diff --git a/src/mpris-controller.c b/src/mpris-controller.c
new file mode 100644
index 0000000..041177c
--- /dev/null
+++ b/src/mpris-controller.c
@@ -0,0 +1,669 @@
+/* mpris-controller.c generated by valac, the Vala compiler
+ * generated from mpris-controller.vala, do not modify */
+
+/*
+This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel.
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <dbus/dbus-glib-lowlevel.h>
+#include <dbus/dbus-glib.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gee.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+
+
+#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ())
+#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController))
+#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER))
+#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER))
+#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+
+typedef struct _MprisController MprisController;
+typedef struct _MprisControllerClass MprisControllerClass;
+typedef struct _MprisControllerPrivate MprisControllerPrivate;
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+#define _dbus_g_connection_unref0(var) ((var == NULL) ? NULL : (var = (dbus_g_connection_unref (var), NULL)))
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+typedef struct _PlayerControllerPrivate PlayerControllerPrivate;
+
+#define TYPE_PLAYER_ITEM (player_item_get_type ())
+#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
+#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
+#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
+#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
+#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
+
+typedef struct _PlayerItem PlayerItem;
+typedef struct _PlayerItemClass PlayerItemClass;
+
+#define TRANSPORT_MENUITEM_TYPE_ACTION (transport_menuitem_action_get_type ())
+
+#define MPRIS_CONTROLLER_TYPE_STATUS (mpris_controller_status_get_type ())
+typedef struct _MprisControllerstatus MprisControllerstatus;
+#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+
+#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ())
+#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem))
+#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM))
+#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM))
+#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+
+typedef struct _TransportMenuitem TransportMenuitem;
+typedef struct _TransportMenuitemClass TransportMenuitemClass;
+
+struct _MprisController {
+ GObject parent_instance;
+ MprisControllerPrivate * priv;
+};
+
+struct _MprisControllerClass {
+ GObjectClass parent_class;
+};
+
+struct _MprisControllerPrivate {
+ DBusGConnection* connection;
+ DBusGProxy* _mpris_player;
+ PlayerController* _owner;
+ char* _mpris_interface;
+ char* name;
+};
+
+struct _PlayerController {
+ GObject parent_instance;
+ PlayerControllerPrivate * priv;
+ gint current_state;
+ GeeArrayList* custom_items;
+ MprisController* mpris_adaptor;
+};
+
+struct _PlayerControllerClass {
+ GObjectClass parent_class;
+};
+
+typedef enum {
+ TRANSPORT_MENUITEM_ACTION_PREVIOUS,
+ TRANSPORT_MENUITEM_ACTION_PLAY_PAUSE,
+ TRANSPORT_MENUITEM_ACTION_NEXT
+} TransportMenuitemaction;
+
+struct _MprisControllerstatus {
+ gint32 playback;
+};
+
+
+static gpointer mpris_controller_parent_class = NULL;
+
+GType mpris_controller_get_type (void);
+GType player_controller_get_type (void);
+#define MPRIS_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MPRIS_CONTROLLER, MprisControllerPrivate))
+enum {
+ MPRIS_CONTROLLER_DUMMY_PROPERTY,
+ MPRIS_CONTROLLER_MPRIS_PLAYER,
+ MPRIS_CONTROLLER_OWNER,
+ MPRIS_CONTROLLER_MPRIS_INTERFACE
+};
+MprisController* mpris_controller_new (PlayerController* ctrl, const char* inter);
+MprisController* mpris_controller_construct (GType object_type, PlayerController* ctrl, const char* inter);
+PlayerController* mpris_controller_get_owner (MprisController* self);
+GType player_item_get_type (void);
+#define PLAYER_CONTROLLER_METADATA 2
+void player_item_reset (PlayerItem* self, GeeHashSet* attrs);
+GeeHashSet* metadata_menuitem_attributes_format (void);
+void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes);
+static void mpris_controller_onTrackChange (MprisController* self, DBusGProxy* mpris_client, GHashTable* ht);
+GType transport_menuitem_action_get_type (void);
+DBusGProxy* mpris_controller_get_mpris_player (MprisController* self);
+static GType mpris_controller_status_get_type (void) G_GNUC_UNUSED;
+static MprisControllerstatus* mpris_controller_status_dup (const MprisControllerstatus* self);
+static void mpris_controller_status_free (MprisControllerstatus* self);
+static void _dynamic_GetStatus0 (DBusGProxy* self, MprisControllerstatus* result, GError** error);
+static void _dynamic_Play1 (DBusGProxy* self, GError** error);
+static void _dynamic_Pause2 (DBusGProxy* self, GError** error);
+static void _dynamic_Prev3 (DBusGProxy* self, GError** error);
+static void _dynamic_Next4 (DBusGProxy* self, GError** error);
+void mpris_controller_transport_event (MprisController* self, TransportMenuitemaction command);
+gboolean mpris_controller_connected (MprisController* self);
+static GValue* _g_value_dup (GValue* self);
+#define PLAYER_CONTROLLER_TRANSPORT 3
+GeeHashSet* transport_menuitem_attributes_format (void);
+static void mpris_controller_onStatusChange (MprisController* self, DBusGProxy* mpris_client, MprisControllerstatus* st);
+static void mpris_controller_set_mpris_player (MprisController* self, DBusGProxy* value);
+static void mpris_controller_set_owner (MprisController* self, PlayerController* value);
+const char* mpris_controller_get_mpris_interface (MprisController* self);
+static void mpris_controller_set_mpris_interface (MprisController* self, const char* value);
+const char* player_controller_get_name (PlayerController* self);
+static void _mpris_controller_onTrackChange_dynamic_TrackChange0_ (DBusGProxy* _sender, GHashTable* ht, gpointer self);
+void _dynamic_TrackChange1_connect (gpointer obj, const char * signal_name, GCallback handler, gpointer data);
+static void _mpris_controller_onStatusChange_dynamic_StatusChange2_ (DBusGProxy* _sender, MprisControllerstatus* st, gpointer self);
+void _dynamic_StatusChange3_connect (gpointer obj, const char * signal_name, GCallback handler, gpointer data);
+static void _dynamic_GetStatus5 (DBusGProxy* self, MprisControllerstatus* result, GError** error);
+GType transport_menuitem_get_type (void);
+void transport_menuitem_change_play_state (TransportMenuitem* self, gint state);
+static GHashTable* _dynamic_GetMetadata6 (DBusGProxy* self, GError** error);
+static GObject * mpris_controller_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void mpris_controller_finalize (GObject* obj);
+static void mpris_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void mpris_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+
+
+static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
+
+MprisController* mpris_controller_construct (GType object_type, PlayerController* ctrl, const char* inter) {
+ MprisController * self;
+ g_return_val_if_fail (ctrl != NULL, NULL);
+ g_return_val_if_fail (inter != NULL, NULL);
+ self = (MprisController*) g_object_new (object_type, "owner", ctrl, "mpris-interface", inter, NULL);
+ return self;
+}
+
+
+MprisController* mpris_controller_new (PlayerController* ctrl, const char* inter) {
+ return mpris_controller_construct (TYPE_MPRIS_CONTROLLER, ctrl, inter);
+}
+
+
+static void mpris_controller_onTrackChange (MprisController* self, DBusGProxy* mpris_client, GHashTable* ht) {
+ GeeHashSet* _tmp1_;
+ PlayerItem* _tmp0_;
+ GeeHashSet* _tmp3_;
+ PlayerItem* _tmp2_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (mpris_client != NULL);
+ g_return_if_fail (ht != NULL);
+ g_debug ("mpris-controller.vala:68: onTrackChange");
+ player_item_reset (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, PLAYER_CONTROLLER_METADATA), _tmp1_ = metadata_menuitem_attributes_format ());
+ _g_object_unref0 (_tmp1_);
+ _g_object_unref0 (_tmp0_);
+ player_item_update (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, PLAYER_CONTROLLER_METADATA), ht, _tmp3_ = metadata_menuitem_attributes_format ());
+ _g_object_unref0 (_tmp3_);
+ _g_object_unref0 (_tmp2_);
+}
+
+
+static void _dynamic_GetStatus0 (DBusGProxy* self, MprisControllerstatus* result, GError** error) {
+ GValueArray* dbus_result;
+ dbus_g_proxy_call (self, "GetStatus", error, G_TYPE_INVALID, dbus_g_type_get_struct ("GValueArray", G_TYPE_INT, G_TYPE_INVALID), &dbus_result, G_TYPE_INVALID);
+ if (*error) {
+ return;
+ }
+ result->playback = g_value_get_int (&dbus_result->values[0]);
+}
+
+
+static void _dynamic_Play1 (DBusGProxy* self, GError** error) {
+ dbus_g_proxy_call (self, "Play", error, G_TYPE_INVALID, G_TYPE_INVALID);
+ if (*error) {
+ return;
+ }
+}
+
+
+static void _dynamic_Pause2 (DBusGProxy* self, GError** error) {
+ dbus_g_proxy_call (self, "Pause", error, G_TYPE_INVALID, G_TYPE_INVALID);
+ if (*error) {
+ return;
+ }
+}
+
+
+static void _dynamic_Prev3 (DBusGProxy* self, GError** error) {
+ dbus_g_proxy_call (self, "Prev", error, G_TYPE_INVALID, G_TYPE_INVALID);
+ if (*error) {
+ return;
+ }
+}
+
+
+static void _dynamic_Next4 (DBusGProxy* self, GError** error) {
+ dbus_g_proxy_call (self, "Next", error, G_TYPE_INVALID, G_TYPE_INVALID);
+ if (*error) {
+ return;
+ }
+}
+
+
+void mpris_controller_transport_event (MprisController* self, TransportMenuitemaction command) {
+ GError * _inner_error_;
+ g_return_if_fail (self != NULL);
+ _inner_error_ = NULL;
+ g_debug ("mpris-controller.vala:80: transport_event input = %i", (gint) command);
+ if (command == TRANSPORT_MENUITEM_ACTION_PLAY_PAUSE) {
+ MprisControllerstatus _tmp0_ = {0};
+ MprisControllerstatus st;
+ gboolean play_state;
+ gboolean new_play_state;
+ st = (_dynamic_GetStatus0 (self->priv->_mpris_player, &_tmp0_, &_inner_error_), _tmp0_);
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ play_state = st.playback == 1;
+ g_debug ("mpris-controller.vala:84: toggle_playback - initial play state %i", (gint) play_state);
+ new_play_state = !play_state;
+ g_debug ("mpris-controller.vala:86: toggle_playback - new play state %i", (gint) new_play_state);
+ if (new_play_state == TRUE) {
+ g_debug ("mpris-controller.vala:88: about to play");
+ _dynamic_Play1 (self->priv->_mpris_player, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ } else {
+ g_debug ("mpris-controller.vala:92: about to pause");
+ _dynamic_Pause2 (self->priv->_mpris_player, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ }
+ } else {
+ if (command == TRANSPORT_MENUITEM_ACTION_PREVIOUS) {
+ _dynamic_Prev3 (self->priv->_mpris_player, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ } else {
+ if (command == TRANSPORT_MENUITEM_ACTION_NEXT) {
+ _dynamic_Next4 (self->priv->_mpris_player, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ }
+ }
+ }
+}
+
+
+gboolean mpris_controller_connected (MprisController* self) {
+ gboolean result = FALSE;
+ g_return_val_if_fail (self != NULL, FALSE);
+ result = self->priv->_mpris_player != NULL;
+ return result;
+}
+
+
+static GValue* _g_value_dup (GValue* self) {
+ return g_boxed_copy (G_TYPE_VALUE, self);
+}
+
+
+static gpointer __g_value_dup0 (gpointer self) {
+ return self ? _g_value_dup (self) : NULL;
+}
+
+
+static void mpris_controller_onStatusChange (MprisController* self, DBusGProxy* mpris_client, MprisControllerstatus* st) {
+ MprisControllerstatus* status;
+ GValueArray* ar;
+ gint play_state;
+ GHashTable* ht;
+ GValue v = {0};
+ GeeHashSet* _tmp1_;
+ PlayerItem* _tmp0_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (mpris_client != NULL);
+ g_debug ("mpris-controller.vala:111: onStatusChange - signal received");
+ status = st;
+ ar = (GValueArray*) status;
+ play_state = g_value_get_int (g_value_array_get_nth (ar, (guint) 0));
+ g_debug ("mpris-controller.vala:115: onStatusChange - play state %i", play_state);
+ ht = g_hash_table_new (g_str_hash, g_str_equal);
+ g_value_init (&v, G_TYPE_INT);
+ g_value_set_int (&v, play_state);
+ g_hash_table_insert (ht, g_strdup ("state"), __g_value_dup0 (&v));
+ player_item_update (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, PLAYER_CONTROLLER_TRANSPORT), ht, _tmp1_ = transport_menuitem_attributes_format ());
+ _g_object_unref0 (_tmp1_);
+ _g_object_unref0 (_tmp0_);
+ _g_hash_table_unref0 (ht);
+ G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL;
+}
+
+
+DBusGProxy* mpris_controller_get_mpris_player (MprisController* self) {
+ DBusGProxy* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_mpris_player;
+ return result;
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+ return self ? g_object_ref (self) : NULL;
+}
+
+
+static void mpris_controller_set_mpris_player (MprisController* self, DBusGProxy* value) {
+ DBusGProxy* _tmp0_;
+ g_return_if_fail (self != NULL);
+ self->priv->_mpris_player = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_mpris_player), _tmp0_);
+ g_object_notify ((GObject *) self, "mpris-player");
+}
+
+
+PlayerController* mpris_controller_get_owner (MprisController* self) {
+ PlayerController* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_owner;
+ return result;
+}
+
+
+static void mpris_controller_set_owner (MprisController* self, PlayerController* value) {
+ PlayerController* _tmp0_;
+ g_return_if_fail (self != NULL);
+ self->priv->_owner = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_owner), _tmp0_);
+ g_object_notify ((GObject *) self, "owner");
+}
+
+
+const char* mpris_controller_get_mpris_interface (MprisController* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_mpris_interface;
+ return result;
+}
+
+
+static void mpris_controller_set_mpris_interface (MprisController* self, const char* value) {
+ char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ self->priv->_mpris_interface = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_mpris_interface), _tmp0_);
+ g_object_notify ((GObject *) self, "mpris-interface");
+}
+
+
+static void _mpris_controller_onTrackChange_dynamic_TrackChange0_ (DBusGProxy* _sender, GHashTable* ht, gpointer self) {
+ mpris_controller_onTrackChange (self, _sender, ht);
+}
+
+
+void _dynamic_TrackChange1_connect (gpointer obj, const char * signal_name, GCallback handler, gpointer data) {
+ dbus_g_object_register_marshaller (g_cclosure_user_marshal_VOID__BOXED, G_TYPE_NONE, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), G_TYPE_INVALID);
+ dbus_g_proxy_add_signal (obj, "TrackChange", dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal (obj, signal_name, handler, data, NULL);
+}
+
+
+static void _mpris_controller_onStatusChange_dynamic_StatusChange2_ (DBusGProxy* _sender, MprisControllerstatus* st, gpointer self) {
+ mpris_controller_onStatusChange (self, _sender, st);
+}
+
+
+void _dynamic_StatusChange3_connect (gpointer obj, const char * signal_name, GCallback handler, gpointer data) {
+ dbus_g_object_register_marshaller (g_cclosure_user_marshal_VOID__BOXED, G_TYPE_NONE, dbus_g_type_get_struct ("GValueArray", G_TYPE_INT, G_TYPE_INVALID), G_TYPE_INVALID);
+ dbus_g_proxy_add_signal (obj, "StatusChange", dbus_g_type_get_struct ("GValueArray", G_TYPE_INT, G_TYPE_INVALID), G_TYPE_INVALID);
+ dbus_g_proxy_connect_signal (obj, signal_name, handler, data, NULL);
+}
+
+
+static void _dynamic_GetStatus5 (DBusGProxy* self, MprisControllerstatus* result, GError** error) {
+ GValueArray* dbus_result;
+ dbus_g_proxy_call (self, "GetStatus", error, G_TYPE_INVALID, dbus_g_type_get_struct ("GValueArray", G_TYPE_INT, G_TYPE_INVALID), &dbus_result, G_TYPE_INVALID);
+ if (*error) {
+ return;
+ }
+ result->playback = g_value_get_int (&dbus_result->values[0]);
+}
+
+
+static GHashTable* _dynamic_GetMetadata6 (DBusGProxy* self, GError** error) {
+ GHashTable* result;
+ dbus_g_proxy_call (self, "GetMetadata", error, G_TYPE_INVALID, dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), &result, G_TYPE_INVALID);
+ if (*error) {
+ return NULL;
+ }
+ return result;
+}
+
+
+static GObject * mpris_controller_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ GObjectClass * parent_class;
+ MprisController * self;
+ GError * _inner_error_;
+ parent_class = G_OBJECT_CLASS (mpris_controller_parent_class);
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = MPRIS_CONTROLLER (obj);
+ _inner_error_ = NULL;
+ {
+ DBusGProxy* _tmp4_;
+ char* _tmp3_;
+ char* _tmp2_;
+ char* _tmp6_;
+ char* _tmp5_;
+ MprisControllerstatus _tmp7_ = {0};
+ MprisControllerstatus st;
+ gint play_state;
+ TransportMenuitem* _tmp9_;
+ PlayerItem* _tmp8_;
+ GHashTable* _tmp10_;
+ GeeHashSet* _tmp13_;
+ GHashTable* _tmp12_;
+ PlayerItem* _tmp11_;
+ {
+ DBusGConnection* _tmp0_;
+ DBusGConnection* _tmp1_;
+ _tmp0_ = dbus_g_bus_get (DBUS_BUS_SESSION, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ goto __catch1_g_error;
+ }
+ self->priv->connection = (_tmp1_ = _tmp0_, _dbus_g_connection_unref0 (self->priv->connection), _tmp1_);
+ }
+ goto __finally1;
+ __catch1_g_error:
+ {
+ GError * e;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ g_error ("mpris-controller.vala:47: Problems connecting to the session bus - %s", e->message);
+ _g_error_free0 (e);
+ }
+ }
+ __finally1:
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ }
+ mpris_controller_set_mpris_player (self, _tmp4_ = dbus_g_proxy_new_for_name (self->priv->connection, _tmp3_ = g_strconcat ("org.mpris.", _tmp2_ = g_utf8_strdown (player_controller_get_name (self->priv->_owner), -1), NULL), "/Player", self->priv->_mpris_interface));
+ _g_object_unref0 (_tmp4_);
+ _g_free0 (_tmp3_);
+ _g_free0 (_tmp2_);
+ g_debug ("mpris-controller.vala:51: just attempting to establish an mpris connec" \
+"tion to %s, %s, %s", _tmp6_ = g_strconcat ("org.mpris.", _tmp5_ = g_utf8_strdown (player_controller_get_name (self->priv->_owner), -1), NULL), "/Player", self->priv->_mpris_interface);
+ _g_free0 (_tmp6_);
+ _g_free0 (_tmp5_);
+ _dynamic_TrackChange1_connect (self->priv->_mpris_player, "TrackChange", (GCallback) _mpris_controller_onTrackChange_dynamic_TrackChange0_, self);
+ _dynamic_StatusChange3_connect (self->priv->_mpris_player, "StatusChange", (GCallback) _mpris_controller_onStatusChange_dynamic_StatusChange2_, self);
+ st = (_dynamic_GetStatus5 (self->priv->_mpris_player, &_tmp7_, &_inner_error_), _tmp7_);
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ }
+ play_state = (gint) st.playback;
+ g_debug ("mpris-controller.vala:58: GetStatusChange - play state %i", play_state);
+ transport_menuitem_change_play_state (_tmp9_ = (_tmp8_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, PLAYER_CONTROLLER_TRANSPORT), IS_TRANSPORT_MENUITEM (_tmp8_) ? ((TransportMenuitem*) _tmp8_) : NULL), play_state);
+ _g_object_unref0 (_tmp9_);
+ _tmp10_ = _dynamic_GetMetadata6 (self->priv->_mpris_player, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ }
+ player_item_update (_tmp11_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, PLAYER_CONTROLLER_METADATA), _tmp12_ = _tmp10_, _tmp13_ = metadata_menuitem_attributes_format ());
+ _g_object_unref0 (_tmp13_);
+ _g_hash_table_unref0 (_tmp12_);
+ _g_object_unref0 (_tmp11_);
+ }
+ return obj;
+}
+
+
+static MprisControllerstatus* mpris_controller_status_dup (const MprisControllerstatus* self) {
+ MprisControllerstatus* dup;
+ dup = g_new0 (MprisControllerstatus, 1);
+ memcpy (dup, self, sizeof (MprisControllerstatus));
+ return dup;
+}
+
+
+static void mpris_controller_status_free (MprisControllerstatus* self) {
+ g_free (self);
+}
+
+
+static GType mpris_controller_status_get_type (void) {
+ static volatile gsize mpris_controller_status_type_id__volatile = 0;
+ if (g_once_init_enter (&mpris_controller_status_type_id__volatile)) {
+ GType mpris_controller_status_type_id;
+ mpris_controller_status_type_id = g_boxed_type_register_static ("MprisControllerstatus", (GBoxedCopyFunc) mpris_controller_status_dup, (GBoxedFreeFunc) mpris_controller_status_free);
+ g_once_init_leave (&mpris_controller_status_type_id__volatile, mpris_controller_status_type_id);
+ }
+ return mpris_controller_status_type_id__volatile;
+}
+
+
+static void mpris_controller_class_init (MprisControllerClass * klass) {
+ mpris_controller_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (MprisControllerPrivate));
+ G_OBJECT_CLASS (klass)->get_property = mpris_controller_get_property;
+ G_OBJECT_CLASS (klass)->set_property = mpris_controller_set_property;
+ G_OBJECT_CLASS (klass)->constructor = mpris_controller_constructor;
+ G_OBJECT_CLASS (klass)->finalize = mpris_controller_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS_CONTROLLER_MPRIS_PLAYER, g_param_spec_object ("mpris-player", "mpris-player", "mpris-player", DBUS_TYPE_G_PROXY, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS_CONTROLLER_OWNER, g_param_spec_object ("owner", "owner", "owner", TYPE_PLAYER_CONTROLLER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), MPRIS_CONTROLLER_MPRIS_INTERFACE, g_param_spec_string ("mpris-interface", "mpris-interface", "mpris-interface", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+}
+
+
+static void mpris_controller_instance_init (MprisController * self) {
+ self->priv = MPRIS_CONTROLLER_GET_PRIVATE (self);
+}
+
+
+static void mpris_controller_finalize (GObject* obj) {
+ MprisController * self;
+ self = MPRIS_CONTROLLER (obj);
+ _dbus_g_connection_unref0 (self->priv->connection);
+ _g_object_unref0 (self->priv->_mpris_player);
+ _g_object_unref0 (self->priv->_owner);
+ _g_free0 (self->priv->_mpris_interface);
+ _g_free0 (self->priv->name);
+ G_OBJECT_CLASS (mpris_controller_parent_class)->finalize (obj);
+}
+
+
+GType mpris_controller_get_type (void) {
+ static volatile gsize mpris_controller_type_id__volatile = 0;
+ if (g_once_init_enter (&mpris_controller_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (MprisControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) mpris_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MprisController), 0, (GInstanceInitFunc) mpris_controller_instance_init, NULL };
+ GType mpris_controller_type_id;
+ mpris_controller_type_id = g_type_register_static (G_TYPE_OBJECT, "MprisController", &g_define_type_info, 0);
+ g_once_init_leave (&mpris_controller_type_id__volatile, mpris_controller_type_id);
+ }
+ return mpris_controller_type_id__volatile;
+}
+
+
+static void mpris_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ MprisController * self;
+ self = MPRIS_CONTROLLER (object);
+ switch (property_id) {
+ case MPRIS_CONTROLLER_MPRIS_PLAYER:
+ g_value_set_object (value, mpris_controller_get_mpris_player (self));
+ break;
+ case MPRIS_CONTROLLER_OWNER:
+ g_value_set_object (value, mpris_controller_get_owner (self));
+ break;
+ case MPRIS_CONTROLLER_MPRIS_INTERFACE:
+ g_value_set_string (value, mpris_controller_get_mpris_interface (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void mpris_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+ MprisController * self;
+ self = MPRIS_CONTROLLER (object);
+ switch (property_id) {
+ case MPRIS_CONTROLLER_MPRIS_PLAYER:
+ mpris_controller_set_mpris_player (self, g_value_get_object (value));
+ break;
+ case MPRIS_CONTROLLER_OWNER:
+ mpris_controller_set_owner (self, g_value_get_object (value));
+ break;
+ case MPRIS_CONTROLLER_MPRIS_INTERFACE:
+ mpris_controller_set_mpris_interface (self, g_value_get_string (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+
+static void g_cclosure_user_marshal_VOID__BOXED (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
+ typedef void (*GMarshalFunc_VOID__BOXED) (gpointer data1, gpointer arg_1, gpointer data2);
+ register GMarshalFunc_VOID__BOXED callback;
+ register GCClosure * cc;
+ register gpointer data1, data2;
+ cc = (GCClosure *) closure;
+ g_return_if_fail (n_param_values == 2);
+ if (G_CCLOSURE_SWAP_DATA (closure)) {
+ data1 = closure->data;
+ data2 = param_values->data[0].v_pointer;
+ } else {
+ data1 = param_values->data[0].v_pointer;
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_VOID__BOXED) (marshal_data ? marshal_data : cc->callback);
+ callback (data1, g_value_get_boxed (param_values + 1), data2);
+}
+
+
+
diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c
new file mode 100644
index 0000000..2dfc99c
--- /dev/null
+++ b/src/music-player-bridge.c
@@ -0,0 +1,567 @@
+/* music-player-bridge.c generated by valac, the Vala compiler
+ * generated from music-player-bridge.vala, do not modify */
+
+/*
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <libindicate/./indicator-messages.h>
+#include <libindicate/./indicator.h>
+#include <libindicate/./interests.h>
+#include <libindicate/./listener.h>
+#include <libindicate/./server.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+#include <gee.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gio/gdesktopappinfo.h>
+#include <gio/gio.h>
+
+
+#define TYPE_MUSIC_PLAYER_BRIDGE (music_player_bridge_get_type ())
+#define MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridge))
+#define MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass))
+#define IS_MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MUSIC_PLAYER_BRIDGE))
+#define IS_MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MUSIC_PLAYER_BRIDGE))
+#define MUSIC_PLAYER_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass))
+
+typedef struct _MusicPlayerBridge MusicPlayerBridge;
+typedef struct _MusicPlayerBridgeClass MusicPlayerBridgeClass;
+typedef struct _MusicPlayerBridgePrivate MusicPlayerBridgePrivate;
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+
+#define TYPE_FAMILIAR_PLAYERS_DB (familiar_players_db_get_type ())
+#define FAMILIAR_PLAYERS_DB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDB))
+#define FAMILIAR_PLAYERS_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBClass))
+#define IS_FAMILIAR_PLAYERS_DB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FAMILIAR_PLAYERS_DB))
+#define IS_FAMILIAR_PLAYERS_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FAMILIAR_PLAYERS_DB))
+#define FAMILIAR_PLAYERS_DB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBClass))
+
+typedef struct _FamiliarPlayersDB FamiliarPlayersDB;
+typedef struct _FamiliarPlayersDBClass FamiliarPlayersDBClass;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+
+#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ())
+
+struct _MusicPlayerBridge {
+ GObject parent_instance;
+ MusicPlayerBridgePrivate * priv;
+};
+
+struct _MusicPlayerBridgeClass {
+ GObjectClass parent_class;
+};
+
+struct _MusicPlayerBridgePrivate {
+ IndicateListener* listener;
+ DbusmenuMenuitem* root_menu;
+ GeeHashMap* registered_clients;
+ FamiliarPlayersDB* playersDB;
+};
+
+typedef enum {
+ PLAYER_CONTROLLER_STATE_OFFLINE,
+ PLAYER_CONTROLLER_STATE_INSTANTIATING,
+ PLAYER_CONTROLLER_STATE_READY,
+ PLAYER_CONTROLLER_STATE_CONNECTED,
+ PLAYER_CONTROLLER_STATE_DISCONNECTED
+} PlayerControllerstate;
+
+
+static gpointer music_player_bridge_parent_class = NULL;
+
+GType music_player_bridge_get_type (void);
+GType player_controller_get_type (void);
+GType familiar_players_db_get_type (void);
+#define MUSIC_PLAYER_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgePrivate))
+enum {
+ MUSIC_PLAYER_BRIDGE_DUMMY_PROPERTY
+};
+FamiliarPlayersDB* familiar_players_db_new (void);
+FamiliarPlayersDB* familiar_players_db_construct (GType object_type);
+void music_player_bridge_on_indicator_added (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0);
+static void _music_player_bridge_on_indicator_added_indicate_listener_indicator_added (IndicateListener* _sender, IndicateListenerServer* object, IndicateListenerIndicator* p0, gpointer self);
+void music_player_bridge_on_indicator_removed (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0);
+static void _music_player_bridge_on_indicator_removed_indicate_listener_indicator_removed (IndicateListener* _sender, IndicateListenerServer* object, IndicateListenerIndicator* p0, gpointer self);
+void music_player_bridge_on_indicator_modified (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0, const char* s);
+static void _music_player_bridge_on_indicator_modified_indicate_listener_indicator_modified (IndicateListener* _sender, IndicateListenerServer* object, IndicateListenerIndicator* p0, const char* p1, gpointer self);
+void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
+static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self);
+void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
+static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self);
+void music_player_bridge_on_server_count_changed (MusicPlayerBridge* self, IndicateListenerServer* object, guint i);
+static void _music_player_bridge_on_server_count_changed_indicate_listener_server_count_changed (IndicateListener* _sender, IndicateListenerServer* object, guint p0, gpointer self);
+MusicPlayerBridge* music_player_bridge_new (void);
+MusicPlayerBridge* music_player_bridge_construct (GType object_type);
+GeeSet* familiar_players_db_records (FamiliarPlayersDB* self);
+static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self);
+GType player_controller_state_get_type (void);
+PlayerController* player_controller_new (DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state);
+static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self);
+static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const char* type);
+void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state);
+void player_controller_activate (PlayerController* self);
+GAppInfo* player_controller_get_app_info (PlayerController* self);
+static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, char* path, void* data);
+void player_controller_vanish (PlayerController* self);
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop);
+void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop);
+GAppInfo* music_player_bridge_create_app_info (const char* path);
+void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu);
+static void music_player_bridge_finalize (GObject* obj);
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static gint _vala_array_length (gpointer array);
+
+
+
+static void _music_player_bridge_on_indicator_added_indicate_listener_indicator_added (IndicateListener* _sender, IndicateListenerServer* object, IndicateListenerIndicator* p0, gpointer self) {
+ music_player_bridge_on_indicator_added (self, object, p0);
+}
+
+
+static void _music_player_bridge_on_indicator_removed_indicate_listener_indicator_removed (IndicateListener* _sender, IndicateListenerServer* object, IndicateListenerIndicator* p0, gpointer self) {
+ music_player_bridge_on_indicator_removed (self, object, p0);
+}
+
+
+static void _music_player_bridge_on_indicator_modified_indicate_listener_indicator_modified (IndicateListener* _sender, IndicateListenerServer* object, IndicateListenerIndicator* p0, const char* p1, gpointer self) {
+ music_player_bridge_on_indicator_modified (self, object, p0, p1);
+}
+
+
+static void _music_player_bridge_on_server_added_indicate_listener_server_added (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self) {
+ music_player_bridge_on_server_added (self, object, p0);
+}
+
+
+static void _music_player_bridge_on_server_removed_indicate_listener_server_removed (IndicateListener* _sender, IndicateListenerServer* object, const char* p0, gpointer self) {
+ music_player_bridge_on_server_removed (self, object, p0);
+}
+
+
+static void _music_player_bridge_on_server_count_changed_indicate_listener_server_count_changed (IndicateListener* _sender, IndicateListenerServer* object, guint p0, gpointer self) {
+ music_player_bridge_on_server_count_changed (self, object, p0);
+}
+
+
+MusicPlayerBridge* music_player_bridge_construct (GType object_type) {
+ MusicPlayerBridge * self;
+ FamiliarPlayersDB* _tmp0_;
+ GeeHashMap* _tmp1_;
+ IndicateListener* _tmp2_;
+ self = (MusicPlayerBridge*) g_object_new (object_type, NULL);
+ self->priv->playersDB = (_tmp0_ = familiar_players_db_new (), _g_object_unref0 (self->priv->playersDB), _tmp0_);
+ self->priv->registered_clients = (_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, TYPE_PLAYER_CONTROLLER, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL), _g_object_unref0 (self->priv->registered_clients), _tmp1_);
+ self->priv->listener = (_tmp2_ = indicate_listener_ref_default (), _g_object_unref0 (self->priv->listener), _tmp2_);
+ g_signal_connect_object (self->priv->listener, "indicator-added", (GCallback) _music_player_bridge_on_indicator_added_indicate_listener_indicator_added, self, 0);
+ g_signal_connect_object (self->priv->listener, "indicator-removed", (GCallback) _music_player_bridge_on_indicator_removed_indicate_listener_indicator_removed, self, 0);
+ g_signal_connect_object (self->priv->listener, "indicator-modified", (GCallback) _music_player_bridge_on_indicator_modified_indicate_listener_indicator_modified, self, 0);
+ g_signal_connect_object (self->priv->listener, "server-added", (GCallback) _music_player_bridge_on_server_added_indicate_listener_server_added, self, 0);
+ g_signal_connect_object (self->priv->listener, "server-removed", (GCallback) _music_player_bridge_on_server_removed_indicate_listener_server_removed, self, 0);
+ g_signal_connect_object (self->priv->listener, "server-count-changed", (GCallback) _music_player_bridge_on_server_count_changed_indicate_listener_server_count_changed, self, 0);
+ return self;
+}
+
+
+MusicPlayerBridge* music_player_bridge_new (void) {
+ return music_player_bridge_construct (TYPE_MUSIC_PLAYER_BRIDGE);
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+ return self ? g_object_ref (self) : NULL;
+}
+
+
+static char* string_strip (const char* self) {
+ char* result = NULL;
+ char* _result_;
+ g_return_val_if_fail (self != NULL, NULL);
+ _result_ = g_strdup (self);
+ g_strstrip (_result_);
+ result = _result_;
+ return result;
+}
+
+
+static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlayerBridge* self) {
+ gint count;
+ g_return_if_fail (self != NULL);
+ count = 0;
+ {
+ GeeSet* _tmp0_;
+ GeeIterator* _tmp1_;
+ GeeIterator* _app_it;
+ _app_it = (_tmp1_ = gee_iterable_iterator ((GeeIterable*) (_tmp0_ = familiar_players_db_records (self->priv->playersDB))), _g_object_unref0 (_tmp0_), _tmp1_);
+ while (TRUE) {
+ char* app;
+ if (!gee_iterator_next (_app_it)) {
+ break;
+ }
+ app = (char*) gee_iterator_get (_app_it);
+ if (count == 0) {
+ GDesktopAppInfo* info;
+ GDesktopAppInfo* _tmp2_;
+ GAppInfo* app_info;
+ PlayerController* ctrl;
+ char* _tmp4_;
+ char* _tmp3_;
+ char* _tmp6_;
+ char* _tmp5_;
+ if (app == NULL) {
+ g_warning ("music-player-bridge.vala:52: App string in keyfile is null therefore m" \
+"oving on to next player");
+ _g_free0 (app);
+ continue;
+ }
+ info = g_desktop_app_info_new_from_filename (app);
+ if (info == NULL) {
+ g_warning ("music-player-bridge.vala:57: Could not create a desktopappinfo instanc" \
+"e from app: %s", app);
+ _g_object_unref0 (info);
+ _g_free0 (app);
+ continue;
+ }
+ app_info = _g_object_ref0 ((_tmp2_ = info, G_IS_APP_INFO (_tmp2_) ? ((GAppInfo*) _tmp2_) : NULL));
+ ctrl = player_controller_new (self->priv->root_menu, g_app_info_get_name (app_info), music_player_bridge_calculate_menu_position (self), PLAYER_CONTROLLER_STATE_OFFLINE);
+ g_object_set ((GObject*) ctrl, "app_info", app_info, NULL);
+ gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, _tmp4_ = string_strip (_tmp3_ = g_utf8_strdown (g_app_info_get_name (app_info), -1)), ctrl);
+ _g_free0 (_tmp4_);
+ _g_free0 (_tmp3_);
+ g_debug ("music-player-bridge.vala:67: Created a player controller for %s which " \
+"was found in the cache file", _tmp6_ = string_strip (_tmp5_ = g_utf8_strdown (g_app_info_get_name (app_info), -1)));
+ _g_free0 (_tmp6_);
+ _g_free0 (_tmp5_);
+ count = count + 1;
+ _g_object_unref0 (info);
+ _g_object_unref0 (app_info);
+ _g_object_unref0 (ctrl);
+ }
+ _g_free0 (app);
+ break;
+ }
+ _g_object_unref0 (_app_it);
+ }
+}
+
+
+static gint music_player_bridge_calculate_menu_position (MusicPlayerBridge* self) {
+ gint result = 0;
+ g_return_val_if_fail (self != NULL, 0);
+ if (gee_map_get_size ((GeeMap*) self->priv->registered_clients) == 0) {
+ result = 2;
+ return result;
+ } else {
+ result = 2 + (gee_map_get_size ((GeeMap*) self->priv->registered_clients) * 4);
+ return result;
+ }
+}
+
+
+void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type) {
+ gint _tmp1__length1;
+ char** _tmp1_;
+ char** _tmp0_;
+ char* _tmp2_;
+ char* client_name;
+ gboolean _tmp3_ = FALSE;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (type != NULL);
+ g_debug ("music-player-bridge.vala:86: MusicPlayerBridge -> on_server_added with" \
+" value %s", type);
+ if (music_player_bridge_server_is_not_of_interest (self, type)) {
+ return;
+ }
+ client_name = (_tmp2_ = g_strdup ((_tmp1_ = _tmp0_ = g_strsplit (type, ".", 0), _tmp1__length1 = _vala_array_length (_tmp0_), _tmp1_)[1]), _tmp1_ = (_vala_array_free (_tmp1_, _tmp1__length1, (GDestroyNotify) g_free), NULL), _tmp2_);
+ if (self->priv->root_menu != NULL) {
+ _tmp3_ = client_name != NULL;
+ } else {
+ _tmp3_ = FALSE;
+ }
+ if (_tmp3_) {
+ GeeSet* _tmp4_;
+ gboolean _tmp5_;
+ PlayerController* _tmp8_;
+ gboolean _tmp9_;
+ if ((_tmp5_ = gee_collection_contains ((GeeCollection*) (_tmp4_ = gee_map_get_keys ((GeeMap*) self->priv->registered_clients)), client_name), _g_object_unref0 (_tmp4_), _tmp5_)) {
+ PlayerController* _tmp6_;
+ PlayerController* _tmp7_;
+ g_debug ("music-player-bridge.vala:92: It figured out that it already has an ins" \
+"tance for this player already");
+ player_controller_update_state (_tmp6_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, client_name), PLAYER_CONTROLLER_STATE_READY);
+ _g_object_unref0 (_tmp6_);
+ player_controller_activate (_tmp7_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, client_name));
+ _g_object_unref0 (_tmp7_);
+ } else {
+ PlayerController* ctrl;
+ ctrl = player_controller_new (self->priv->root_menu, client_name, music_player_bridge_calculate_menu_position (self), PLAYER_CONTROLLER_STATE_READY);
+ gee_abstract_map_set ((GeeAbstractMap*) self->priv->registered_clients, client_name, ctrl);
+ g_debug ("music-player-bridge.vala:105: New Client of name %s has successfully r" \
+"egistered with us", client_name);
+ _g_object_unref0 (ctrl);
+ }
+ if ((_tmp9_ = player_controller_get_app_info (_tmp8_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, client_name)) == NULL, _g_object_unref0 (_tmp8_), _tmp9_)) {
+ indicate_listener_get_server_property_cb cb;
+ cb = (indicate_listener_get_server_property_cb) music_player_bridge_desktop_info_callback;
+ indicate_listener_server_get_desktop (self->priv->listener, object, cb, self);
+ }
+ }
+ _g_free0 (client_name);
+}
+
+
+void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type) {
+ gint _tmp1__length1;
+ char** _tmp1_;
+ char** _tmp0_;
+ char* _tmp2_;
+ char* client_name;
+ gboolean _tmp3_ = FALSE;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (type != NULL);
+ g_debug ("music-player-bridge.vala:117: MusicPlayerBridge -> on_server_removed w" \
+"ith value %s", type);
+ if (music_player_bridge_server_is_not_of_interest (self, type)) {
+ return;
+ }
+ client_name = (_tmp2_ = g_strdup ((_tmp1_ = _tmp0_ = g_strsplit (type, ".", 0), _tmp1__length1 = _vala_array_length (_tmp0_), _tmp1_)[1]), _tmp1_ = (_vala_array_free (_tmp1_, _tmp1__length1, (GDestroyNotify) g_free), NULL), _tmp2_);
+ if (self->priv->root_menu != NULL) {
+ _tmp3_ = client_name != NULL;
+ } else {
+ _tmp3_ = FALSE;
+ }
+ if (_tmp3_) {
+ PlayerController* _tmp4_;
+ player_controller_vanish (_tmp4_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) self->priv->registered_clients, client_name));
+ _g_object_unref0 (_tmp4_);
+ gee_map_remove ((GeeMap*) self->priv->registered_clients, client_name, NULL);
+ g_debug ("music-player-bridge.vala:123: Successively removed menu_item for clien" \
+"t %s from registered_clients", client_name);
+ }
+ _g_free0 (client_name);
+}
+
+
+static gboolean string_contains (const char* self, const char* needle) {
+ gboolean result = FALSE;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (needle != NULL, FALSE);
+ result = strstr (self, needle) != NULL;
+ return result;
+}
+
+
+static gboolean music_player_bridge_server_is_not_of_interest (MusicPlayerBridge* self, const char* type) {
+ gboolean result = FALSE;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (type != NULL, FALSE);
+ if (type == NULL) {
+ result = TRUE;
+ return result;
+ }
+ if (string_contains (type, "music") == FALSE) {
+ g_debug ("music-player-bridge.vala:131: server is of no interest, it is not an " \
+"music server");
+ result = TRUE;
+ return result;
+ }
+ result = FALSE;
+ return result;
+}
+
+
+static void music_player_bridge_desktop_info_callback (MusicPlayerBridge* self, IndicateListenerServer* server, char* path, void* data) {
+ void* _tmp0_;
+ MusicPlayerBridge* bridge;
+ gboolean _tmp1_ = FALSE;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (path != NULL);
+ bridge = _g_object_ref0 ((_tmp0_ = data, IS_MUSIC_PLAYER_BRIDGE (_tmp0_) ? ((MusicPlayerBridge*) _tmp0_) : NULL));
+ if (string_contains (path, "/")) {
+ _tmp1_ = familiar_players_db_already_familiar (bridge->priv->playersDB, path) == FALSE;
+ } else {
+ _tmp1_ = FALSE;
+ }
+ if (_tmp1_) {
+ GAppInfo* app_info;
+ g_debug ("music-player-bridge.vala:142: About to store desktop file path: %s", path);
+ familiar_players_db_insert (bridge->priv->playersDB, path);
+ app_info = music_player_bridge_create_app_info (path);
+ if (app_info != NULL) {
+ char* _tmp3_;
+ char* _tmp2_;
+ PlayerController* _tmp4_;
+ PlayerController* ctrl;
+ ctrl = (_tmp4_ = (PlayerController*) gee_abstract_map_get ((GeeAbstractMap*) bridge->priv->registered_clients, _tmp3_ = string_strip (_tmp2_ = g_utf8_strdown (g_app_info_get_name (app_info), -1))), _g_free0 (_tmp3_), _g_free0 (_tmp2_), _tmp4_);
+ g_object_set ((GObject*) ctrl, "app_info", app_info, NULL);
+ g_debug ("music-player-bridge.vala:148: successfully created appinfo from path a" \
+"nd set it on the respective instance");
+ _g_object_unref0 (ctrl);
+ }
+ _g_object_unref0 (app_info);
+ } else {
+ g_debug ("music-player-bridge.vala:152: Ignoring desktop file path because its e" \
+"ither invalid of the db cache file has it already: %s", path);
+ }
+ _g_object_unref0 (bridge);
+ _g_free0 (path);
+}
+
+
+void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu) {
+ DbusmenuMenuitem* _tmp0_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (menu != NULL);
+ self->priv->root_menu = (_tmp0_ = _g_object_ref0 (menu), _g_object_unref0 (self->priv->root_menu), _tmp0_);
+ music_player_bridge_try_to_add_inactive_familiar_clients (self);
+}
+
+
+void music_player_bridge_on_server_count_changed (MusicPlayerBridge* self, IndicateListenerServer* object, guint i) {
+ g_return_if_fail (self != NULL);
+ g_debug ("music-player-bridge.vala:164: MusicPlayerBridge-> on_server_count_chan" \
+"ged with value %u", i);
+}
+
+
+void music_player_bridge_on_indicator_added (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0) {
+ g_return_if_fail (self != NULL);
+ g_debug ("music-player-bridge.vala:168: MusicPlayerBridge-> on_indicator_added");
+}
+
+
+void music_player_bridge_on_indicator_removed (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0) {
+ g_return_if_fail (self != NULL);
+ g_debug ("music-player-bridge.vala:173: MusicPlayerBridge -> on_indicator_remove" \
+"d");
+}
+
+
+void music_player_bridge_on_indicator_modified (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0, const char* s) {
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (s != NULL);
+ g_debug ("music-player-bridge.vala:178: MusicPlayerBridge -> indicator_modified " \
+"with vale %s", s);
+}
+
+
+GAppInfo* music_player_bridge_create_app_info (const char* path) {
+ GAppInfo* result = NULL;
+ GDesktopAppInfo* info;
+ GDesktopAppInfo* _tmp0_;
+ GAppInfo* app_info;
+ g_return_val_if_fail (path != NULL, NULL);
+ info = g_desktop_app_info_new_from_filename (path);
+ if (path == NULL) {
+ g_warning ("music-player-bridge.vala:185: Could not create a desktopappinfo instan" \
+"ce from app: %s", path);
+ result = NULL;
+ _g_object_unref0 (info);
+ return result;
+ }
+ app_info = _g_object_ref0 ((_tmp0_ = info, G_IS_APP_INFO (_tmp0_) ? ((GAppInfo*) _tmp0_) : NULL));
+ result = app_info;
+ _g_object_unref0 (info);
+ return result;
+}
+
+
+static void music_player_bridge_class_init (MusicPlayerBridgeClass * klass) {
+ music_player_bridge_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (MusicPlayerBridgePrivate));
+ G_OBJECT_CLASS (klass)->finalize = music_player_bridge_finalize;
+}
+
+
+static void music_player_bridge_instance_init (MusicPlayerBridge * self) {
+ self->priv = MUSIC_PLAYER_BRIDGE_GET_PRIVATE (self);
+}
+
+
+static void music_player_bridge_finalize (GObject* obj) {
+ MusicPlayerBridge * self;
+ self = MUSIC_PLAYER_BRIDGE (obj);
+ _g_object_unref0 (self->priv->listener);
+ _g_object_unref0 (self->priv->root_menu);
+ _g_object_unref0 (self->priv->registered_clients);
+ _g_object_unref0 (self->priv->playersDB);
+ G_OBJECT_CLASS (music_player_bridge_parent_class)->finalize (obj);
+}
+
+
+GType music_player_bridge_get_type (void) {
+ static volatile gsize music_player_bridge_type_id__volatile = 0;
+ if (g_once_init_enter (&music_player_bridge_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (MusicPlayerBridgeClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) music_player_bridge_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MusicPlayerBridge), 0, (GInstanceInitFunc) music_player_bridge_instance_init, NULL };
+ GType music_player_bridge_type_id;
+ music_player_bridge_type_id = g_type_register_static (G_TYPE_OBJECT, "MusicPlayerBridge", &g_define_type_info, 0);
+ g_once_init_leave (&music_player_bridge_type_id__volatile, music_player_bridge_type_id);
+ }
+ return music_player_bridge_type_id__volatile;
+}
+
+
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
+ }
+}
+
+
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+
+static gint _vala_array_length (gpointer array) {
+ int length;
+ length = 0;
+ if (array) {
+ while (((gpointer*) array)[length]) {
+ length++;
+ }
+ }
+ return length;
+}
+
+
+
+
diff --git a/src/music-player-bridge.h b/src/music-player-bridge.h
new file mode 100644
index 0000000..baeb597
--- /dev/null
+++ b/src/music-player-bridge.h
@@ -0,0 +1,299 @@
+/* music-player-bridge.h generated by valac, the Vala compiler, do not modify */
+
+
+#ifndef __MUSIC_PLAYER_BRIDGE_H__
+#define __MUSIC_PLAYER_BRIDGE_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <libindicate/./indicator-messages.h>
+#include <libindicate/./indicator.h>
+#include <libindicate/./interests.h>
+#include <libindicate/./listener.h>
+#include <libindicate/./server.h>
+#include <stdlib.h>
+#include <string.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+#include <gio/gio.h>
+#include <gee.h>
+#include <dbus/dbus-glib-lowlevel.h>
+#include <dbus/dbus-glib.h>
+
+G_BEGIN_DECLS
+
+
+#define TYPE_MUSIC_PLAYER_BRIDGE (music_player_bridge_get_type ())
+#define MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridge))
+#define MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass))
+#define IS_MUSIC_PLAYER_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MUSIC_PLAYER_BRIDGE))
+#define IS_MUSIC_PLAYER_BRIDGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MUSIC_PLAYER_BRIDGE))
+#define MUSIC_PLAYER_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgeClass))
+
+typedef struct _MusicPlayerBridge MusicPlayerBridge;
+typedef struct _MusicPlayerBridgeClass MusicPlayerBridgeClass;
+typedef struct _MusicPlayerBridgePrivate MusicPlayerBridgePrivate;
+
+#define TYPE_PLAYER_ITEM (player_item_get_type ())
+#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
+#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
+#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
+#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
+#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
+
+typedef struct _PlayerItem PlayerItem;
+typedef struct _PlayerItemClass PlayerItemClass;
+typedef struct _PlayerItemPrivate PlayerItemPrivate;
+
+#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ())
+#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem))
+#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM))
+#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM))
+#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+
+typedef struct _TransportMenuitem TransportMenuitem;
+typedef struct _TransportMenuitemClass TransportMenuitemClass;
+typedef struct _TransportMenuitemPrivate TransportMenuitemPrivate;
+
+#define TRANSPORT_MENUITEM_TYPE_ACTION (transport_menuitem_action_get_type ())
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+
+#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ())
+#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem))
+#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
+#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM))
+#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM))
+#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
+
+typedef struct _MetadataMenuitem MetadataMenuitem;
+typedef struct _MetadataMenuitemClass MetadataMenuitemClass;
+typedef struct _MetadataMenuitemPrivate MetadataMenuitemPrivate;
+
+#define TYPE_TITLE_MENUITEM (title_menuitem_get_type ())
+#define TITLE_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TITLE_MENUITEM, TitleMenuitem))
+#define TITLE_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TITLE_MENUITEM, TitleMenuitemClass))
+#define IS_TITLE_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TITLE_MENUITEM))
+#define IS_TITLE_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TITLE_MENUITEM))
+#define TITLE_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TITLE_MENUITEM, TitleMenuitemClass))
+
+typedef struct _TitleMenuitem TitleMenuitem;
+typedef struct _TitleMenuitemClass TitleMenuitemClass;
+typedef struct _TitleMenuitemPrivate TitleMenuitemPrivate;
+typedef struct _PlayerControllerPrivate PlayerControllerPrivate;
+
+#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ())
+#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController))
+#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER))
+#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER))
+#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+
+typedef struct _MprisController MprisController;
+typedef struct _MprisControllerClass MprisControllerClass;
+
+#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ())
+typedef struct _MprisControllerPrivate MprisControllerPrivate;
+
+#define TYPE_MPRIS_CONTROLLER_V2 (mpris_controller_v2_get_type ())
+#define MPRIS_CONTROLLER_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2))
+#define MPRIS_CONTROLLER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2Class))
+#define IS_MPRIS_CONTROLLER_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER_V2))
+#define IS_MPRIS_CONTROLLER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER_V2))
+#define MPRIS_CONTROLLER_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER_V2, MprisControllerV2Class))
+
+typedef struct _MprisControllerV2 MprisControllerV2;
+typedef struct _MprisControllerV2Class MprisControllerV2Class;
+typedef struct _MprisControllerV2Private MprisControllerV2Private;
+
+#define TYPE_FAMILIAR_PLAYERS_DB (familiar_players_db_get_type ())
+#define FAMILIAR_PLAYERS_DB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDB))
+#define FAMILIAR_PLAYERS_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBClass))
+#define IS_FAMILIAR_PLAYERS_DB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FAMILIAR_PLAYERS_DB))
+#define IS_FAMILIAR_PLAYERS_DB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FAMILIAR_PLAYERS_DB))
+#define FAMILIAR_PLAYERS_DB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBClass))
+
+typedef struct _FamiliarPlayersDB FamiliarPlayersDB;
+typedef struct _FamiliarPlayersDBClass FamiliarPlayersDBClass;
+typedef struct _FamiliarPlayersDBPrivate FamiliarPlayersDBPrivate;
+
+struct _MusicPlayerBridge {
+ GObject parent_instance;
+ MusicPlayerBridgePrivate * priv;
+};
+
+struct _MusicPlayerBridgeClass {
+ GObjectClass parent_class;
+};
+
+struct _PlayerItem {
+ DbusmenuMenuitem parent_instance;
+ PlayerItemPrivate * priv;
+};
+
+struct _PlayerItemClass {
+ DbusmenuMenuitemClass parent_class;
+};
+
+struct _TransportMenuitem {
+ PlayerItem parent_instance;
+ TransportMenuitemPrivate * priv;
+};
+
+struct _TransportMenuitemClass {
+ PlayerItemClass parent_class;
+};
+
+typedef enum {
+ TRANSPORT_MENUITEM_ACTION_PREVIOUS,
+ TRANSPORT_MENUITEM_ACTION_PLAY_PAUSE,
+ TRANSPORT_MENUITEM_ACTION_NEXT
+} TransportMenuitemaction;
+
+struct _MetadataMenuitem {
+ PlayerItem parent_instance;
+ MetadataMenuitemPrivate * priv;
+};
+
+struct _MetadataMenuitemClass {
+ PlayerItemClass parent_class;
+};
+
+struct _TitleMenuitem {
+ PlayerItem parent_instance;
+ TitleMenuitemPrivate * priv;
+};
+
+struct _TitleMenuitemClass {
+ PlayerItemClass parent_class;
+};
+
+struct _PlayerController {
+ GObject parent_instance;
+ PlayerControllerPrivate * priv;
+ gint current_state;
+ GeeArrayList* custom_items;
+ MprisController* mpris_adaptor;
+};
+
+struct _PlayerControllerClass {
+ GObjectClass parent_class;
+};
+
+typedef enum {
+ PLAYER_CONTROLLER_STATE_OFFLINE,
+ PLAYER_CONTROLLER_STATE_INSTANTIATING,
+ PLAYER_CONTROLLER_STATE_READY,
+ PLAYER_CONTROLLER_STATE_CONNECTED,
+ PLAYER_CONTROLLER_STATE_DISCONNECTED
+} PlayerControllerstate;
+
+struct _MprisController {
+ GObject parent_instance;
+ MprisControllerPrivate * priv;
+};
+
+struct _MprisControllerClass {
+ GObjectClass parent_class;
+};
+
+struct _MprisControllerV2 {
+ MprisController parent_instance;
+ MprisControllerV2Private * priv;
+};
+
+struct _MprisControllerV2Class {
+ MprisControllerClass parent_class;
+};
+
+struct _FamiliarPlayersDB {
+ GObject parent_instance;
+ FamiliarPlayersDBPrivate * priv;
+};
+
+struct _FamiliarPlayersDBClass {
+ GObjectClass parent_class;
+};
+
+
+GType music_player_bridge_get_type (void);
+MusicPlayerBridge* music_player_bridge_new (void);
+MusicPlayerBridge* music_player_bridge_construct (GType object_type);
+void music_player_bridge_on_server_added (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
+void music_player_bridge_on_server_removed (MusicPlayerBridge* self, IndicateListenerServer* object, const char* type);
+void music_player_bridge_set_root_menu_item (MusicPlayerBridge* self, DbusmenuMenuitem* menu);
+void music_player_bridge_on_server_count_changed (MusicPlayerBridge* self, IndicateListenerServer* object, guint i);
+void music_player_bridge_on_indicator_added (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0);
+void music_player_bridge_on_indicator_removed (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0);
+void music_player_bridge_on_indicator_modified (MusicPlayerBridge* self, IndicateListenerServer* object, IndicateListenerIndicator* p0, const char* s);
+GAppInfo* music_player_bridge_create_app_info (const char* path);
+GType player_item_get_type (void);
+GType transport_menuitem_get_type (void);
+GType transport_menuitem_action_get_type (void);
+GType player_controller_get_type (void);
+TransportMenuitem* transport_menuitem_new (PlayerController* parent);
+TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent);
+void transport_menuitem_change_play_state (TransportMenuitem* self, gint state);
+GeeHashSet* transport_menuitem_attributes_format (void);
+GType metadata_menuitem_get_type (void);
+MetadataMenuitem* metadata_menuitem_new (void);
+MetadataMenuitem* metadata_menuitem_construct (GType object_type);
+GeeHashSet* metadata_menuitem_attributes_format (void);
+gboolean metadata_menuitem_populated (MetadataMenuitem* self);
+GType title_menuitem_get_type (void);
+TitleMenuitem* title_menuitem_new (PlayerController* parent);
+TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent);
+GeeHashSet* title_menuitem_attributes_format (void);
+GType mpris_controller_get_type (void);
+GType player_controller_state_get_type (void);
+#define PLAYER_CONTROLLER_METADATA 2
+PlayerController* player_controller_new (DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state);
+void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state);
+void player_controller_activate (PlayerController* self);
+void player_controller_instantiate (PlayerController* self);
+void player_controller_vanish (PlayerController* self);
+const char* player_controller_get_name (PlayerController* self);
+void player_controller_set_name (PlayerController* self, const char* value);
+GAppInfo* player_controller_get_app_info (PlayerController* self);
+void player_controller_set_app_info (PlayerController* self, GAppInfo* value);
+gint player_controller_get_menu_offset (PlayerController* self);
+void player_controller_set_menu_offset (PlayerController* self, gint value);
+GType mpris_controller_v2_get_type (void);
+MprisControllerV2* mpris_controller_v2_new (PlayerController* ctrl, const char* inter);
+MprisControllerV2* mpris_controller_v2_construct (GType object_type, PlayerController* ctrl, const char* inter);
+MprisController* mpris_controller_new (PlayerController* ctrl, const char* inter);
+MprisController* mpris_controller_construct (GType object_type, PlayerController* ctrl, const char* inter);
+void mpris_controller_transport_event (MprisController* self, TransportMenuitemaction command);
+gboolean mpris_controller_connected (MprisController* self);
+DBusGProxy* mpris_controller_get_mpris_player (MprisController* self);
+PlayerController* mpris_controller_get_owner (MprisController* self);
+const char* mpris_controller_get_mpris_interface (MprisController* self);
+PlayerItem* player_item_new (const char* type);
+PlayerItem* player_item_construct (GType object_type, const char* type);
+void player_item_reset (PlayerItem* self, GeeHashSet* attrs);
+void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes);
+PlayerController* player_item_get_owner (PlayerItem* self);
+const char* player_item_get_item_type (PlayerItem* self);
+GType familiar_players_db_get_type (void);
+FamiliarPlayersDB* familiar_players_db_new (void);
+FamiliarPlayersDB* familiar_players_db_construct (GType object_type);
+void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop);
+gboolean familiar_players_db_already_familiar (FamiliarPlayersDB* self, const char* desktop);
+GeeSet* familiar_players_db_records (FamiliarPlayersDB* self);
+
+
+G_END_DECLS
+
+#endif
diff --git a/src/player-controller.c b/src/player-controller.c
new file mode 100644
index 0000000..ca1485e
--- /dev/null
+++ b/src/player-controller.c
@@ -0,0 +1,596 @@
+/* player-controller.c generated by valac, the Vala compiler
+ * generated from player-controller.vala, do not modify */
+
+/*
+This service primarily controls PulseAudio and is driven by the sound indicator menu on the panel.
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gee.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gio/gio.h>
+
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+typedef struct _PlayerControllerPrivate PlayerControllerPrivate;
+
+#define TYPE_PLAYER_ITEM (player_item_get_type ())
+#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
+#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
+#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
+#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
+#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
+
+typedef struct _PlayerItem PlayerItem;
+typedef struct _PlayerItemClass PlayerItemClass;
+
+#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ())
+#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController))
+#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER))
+#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER))
+#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+
+typedef struct _MprisController MprisController;
+typedef struct _MprisControllerClass MprisControllerClass;
+
+#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ())
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+
+#define TYPE_TITLE_MENUITEM (title_menuitem_get_type ())
+#define TITLE_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TITLE_MENUITEM, TitleMenuitem))
+#define TITLE_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TITLE_MENUITEM, TitleMenuitemClass))
+#define IS_TITLE_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TITLE_MENUITEM))
+#define IS_TITLE_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TITLE_MENUITEM))
+#define TITLE_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TITLE_MENUITEM, TitleMenuitemClass))
+
+typedef struct _TitleMenuitem TitleMenuitem;
+typedef struct _TitleMenuitemClass TitleMenuitemClass;
+
+#define TYPE_METADATA_MENUITEM (metadata_menuitem_get_type ())
+#define METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitem))
+#define METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
+#define IS_METADATA_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_METADATA_MENUITEM))
+#define IS_METADATA_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_METADATA_MENUITEM))
+#define METADATA_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_METADATA_MENUITEM, MetadataMenuitemClass))
+
+typedef struct _MetadataMenuitem MetadataMenuitem;
+typedef struct _MetadataMenuitemClass MetadataMenuitemClass;
+
+#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ())
+#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem))
+#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM))
+#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM))
+#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+
+typedef struct _TransportMenuitem TransportMenuitem;
+typedef struct _TransportMenuitemClass TransportMenuitemClass;
+
+struct _PlayerController {
+ GObject parent_instance;
+ PlayerControllerPrivate * priv;
+ gint current_state;
+ GeeArrayList* custom_items;
+ MprisController* mpris_adaptor;
+};
+
+struct _PlayerControllerClass {
+ GObjectClass parent_class;
+};
+
+struct _PlayerControllerPrivate {
+ DbusmenuMenuitem* root_menu;
+ char* _name;
+ GAppInfo* _app_info;
+ gint _menu_offset;
+};
+
+typedef enum {
+ PLAYER_CONTROLLER_STATE_OFFLINE,
+ PLAYER_CONTROLLER_STATE_INSTANTIATING,
+ PLAYER_CONTROLLER_STATE_READY,
+ PLAYER_CONTROLLER_STATE_CONNECTED,
+ PLAYER_CONTROLLER_STATE_DISCONNECTED
+} PlayerControllerstate;
+
+
+static gpointer player_controller_parent_class = NULL;
+
+GType player_controller_get_type (void);
+GType player_item_get_type (void);
+GType mpris_controller_get_type (void);
+#define PLAYER_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLAYER_CONTROLLER, PlayerControllerPrivate))
+enum {
+ PLAYER_CONTROLLER_DUMMY_PROPERTY,
+ PLAYER_CONTROLLER_NAME,
+ PLAYER_CONTROLLER_APP_INFO,
+ PLAYER_CONTROLLER_MENU_OFFSET
+};
+GType player_controller_state_get_type (void);
+#define PLAYER_CONTROLLER_METADATA 2
+#define PLAYER_CONTROLLER_TRANSPORT 3
+static char* player_controller_format_client_name (const char* client_name);
+void player_controller_set_name (PlayerController* self, const char* value);
+void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state);
+void player_controller_set_menu_offset (PlayerController* self, gint value);
+static void player_controller_construct_widgets (PlayerController* self);
+static void player_controller_establish_mpris_connection (PlayerController* self);
+static void player_controller_update_layout (PlayerController* self);
+PlayerController* player_controller_new (DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state);
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state);
+const char* player_controller_get_name (PlayerController* self);
+void player_controller_activate (PlayerController* self);
+GAppInfo* player_controller_get_app_info (PlayerController* self);
+void player_controller_instantiate (PlayerController* self);
+MprisController* mpris_controller_new (PlayerController* ctrl, const char* inter);
+MprisController* mpris_controller_construct (GType object_type, PlayerController* ctrl, const char* inter);
+gboolean mpris_controller_connected (MprisController* self);
+void player_controller_vanish (PlayerController* self);
+PlayerItem* player_item_new (const char* type);
+PlayerItem* player_item_construct (GType object_type, const char* type);
+TitleMenuitem* title_menuitem_new (PlayerController* parent);
+TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent);
+GType title_menuitem_get_type (void);
+MetadataMenuitem* metadata_menuitem_new (void);
+MetadataMenuitem* metadata_menuitem_construct (GType object_type);
+GType metadata_menuitem_get_type (void);
+TransportMenuitem* transport_menuitem_new (PlayerController* parent);
+TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent);
+GType transport_menuitem_get_type (void);
+gint player_controller_get_menu_offset (PlayerController* self);
+void player_controller_set_app_info (PlayerController* self, GAppInfo* value);
+static void player_controller_finalize (GObject* obj);
+static void player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static int _vala_strcmp0 (const char * str1, const char * str2);
+
+
+
+GType player_controller_state_get_type (void) {
+ static volatile gsize player_controller_state_type_id__volatile = 0;
+ if (g_once_init_enter (&player_controller_state_type_id__volatile)) {
+ static const GEnumValue values[] = {{PLAYER_CONTROLLER_STATE_OFFLINE, "PLAYER_CONTROLLER_STATE_OFFLINE", "offline"}, {PLAYER_CONTROLLER_STATE_INSTANTIATING, "PLAYER_CONTROLLER_STATE_INSTANTIATING", "instantiating"}, {PLAYER_CONTROLLER_STATE_READY, "PLAYER_CONTROLLER_STATE_READY", "ready"}, {PLAYER_CONTROLLER_STATE_CONNECTED, "PLAYER_CONTROLLER_STATE_CONNECTED", "connected"}, {PLAYER_CONTROLLER_STATE_DISCONNECTED, "PLAYER_CONTROLLER_STATE_DISCONNECTED", "disconnected"}, {0, NULL, NULL}};
+ GType player_controller_state_type_id;
+ player_controller_state_type_id = g_enum_register_static ("PlayerControllerstate", values);
+ g_once_init_leave (&player_controller_state_type_id__volatile, player_controller_state_type_id);
+ }
+ return player_controller_state_type_id__volatile;
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+ return self ? g_object_ref (self) : NULL;
+}
+
+
+static char* string_strip (const char* self) {
+ char* result = NULL;
+ char* _result_;
+ g_return_val_if_fail (self != NULL, NULL);
+ _result_ = g_strdup (self);
+ g_strstrip (_result_);
+ result = _result_;
+ return result;
+}
+
+
+PlayerController* player_controller_construct (GType object_type, DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state) {
+ PlayerController * self;
+ DbusmenuMenuitem* _tmp0_;
+ char* _tmp2_;
+ char* _tmp1_;
+ GeeArrayList* _tmp3_;
+ g_return_val_if_fail (root != NULL, NULL);
+ g_return_val_if_fail (client_name != NULL, NULL);
+ self = (PlayerController*) g_object_new (object_type, NULL);
+ self->priv->root_menu = (_tmp0_ = _g_object_ref0 (root), _g_object_unref0 (self->priv->root_menu), _tmp0_);
+ player_controller_set_name (self, _tmp2_ = player_controller_format_client_name (_tmp1_ = string_strip (client_name)));
+ _g_free0 (_tmp2_);
+ _g_free0 (_tmp1_);
+ self->custom_items = (_tmp3_ = gee_array_list_new (TYPE_PLAYER_ITEM, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL), _g_object_unref0 (self->custom_items), _tmp3_);
+ player_controller_update_state (self, initial_state);
+ player_controller_set_menu_offset (self, offset);
+ g_debug ("player-controller.vala:54: offset = %i", offset);
+ player_controller_construct_widgets (self);
+ player_controller_establish_mpris_connection (self);
+ player_controller_update_layout (self);
+ return self;
+}
+
+
+PlayerController* player_controller_new (DbusmenuMenuitem* root, const char* client_name, gint offset, PlayerControllerstate initial_state) {
+ return player_controller_construct (TYPE_PLAYER_CONTROLLER, root, client_name, offset, initial_state);
+}
+
+
+void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state) {
+ g_return_if_fail (self != NULL);
+ g_debug ("player-controller.vala:62: update_state - player controller %s : new s" \
+"tate %i", self->priv->_name, (gint) new_state);
+ self->current_state = (gint) new_state;
+}
+
+
+void player_controller_activate (PlayerController* self) {
+ PlayerItem* _tmp0_;
+ g_return_if_fail (self != NULL);
+ player_controller_establish_mpris_connection (self);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, PLAYER_CONTROLLER_METADATA)), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
+ _g_object_unref0 (_tmp0_);
+}
+
+
+void player_controller_instantiate (PlayerController* self) {
+ GError * _inner_error_;
+ g_return_if_fail (self != NULL);
+ _inner_error_ = NULL;
+ g_debug ("player-controller.vala:80: instantiate in player controller for %s", self->priv->_name);
+ {
+ g_app_info_launch (self->priv->_app_info, NULL, NULL, &_inner_error_);
+ if (_inner_error_ != NULL) {
+ goto __catch0_g_error;
+ }
+ player_controller_update_state (self, PLAYER_CONTROLLER_STATE_INSTANTIATING);
+ }
+ goto __finally0;
+ __catch0_g_error:
+ {
+ GError * _error_;
+ _error_ = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ g_warning ("player-controller.vala:86: Failed to launch app %s with error message:" \
+" %s", self->priv->_name, _error_->message);
+ _g_error_free0 (_error_);
+ }
+ }
+ __finally0:
+ if (_inner_error_ != NULL) {
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+}
+
+
+static void player_controller_establish_mpris_connection (PlayerController* self) {
+ g_return_if_fail (self != NULL);
+ if (self->current_state != PLAYER_CONTROLLER_STATE_READY) {
+ g_debug ("player-controller.vala:93: establish_mpris_connection - Not ready to c" \
+"onnect");
+ return;
+ }
+ if (_vala_strcmp0 (self->priv->_name, "Vlc") == 0) {
+ MprisController* _tmp0_;
+ g_debug ("player-controller.vala:98: establishing a vlc mpris controller");
+ self->mpris_adaptor = (_tmp0_ = mpris_controller_new (self, "org.mpris.MediaPlayer.Player"), _g_object_unref0 (self->mpris_adaptor), _tmp0_);
+ } else {
+ MprisController* _tmp1_;
+ self->mpris_adaptor = (_tmp1_ = mpris_controller_new (self, "org.freedesktop.MediaPlayer"), _g_object_unref0 (self->mpris_adaptor), _tmp1_);
+ }
+ if (mpris_controller_connected (self->mpris_adaptor) == TRUE) {
+ g_debug ("player-controller.vala:106: yup I'm connected");
+ player_controller_update_state (self, PLAYER_CONTROLLER_STATE_CONNECTED);
+ } else {
+ player_controller_update_state (self, PLAYER_CONTROLLER_STATE_DISCONNECTED);
+ }
+ player_controller_update_layout (self);
+}
+
+
+void player_controller_vanish (PlayerController* self) {
+ g_return_if_fail (self != NULL);
+ {
+ GeeIterator* _item_it;
+ _item_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) self->custom_items);
+ while (TRUE) {
+ DbusmenuMenuitem* item;
+ if (!gee_iterator_next (_item_it)) {
+ break;
+ }
+ item = (DbusmenuMenuitem*) ((PlayerItem*) gee_iterator_get (_item_it));
+ dbusmenu_menuitem_child_delete (self->priv->root_menu, item);
+ _g_object_unref0 (item);
+ }
+ _g_object_unref0 (_item_it);
+ }
+}
+
+
+static char* bool_to_string (gboolean self) {
+ char* result = NULL;
+ if (self) {
+ result = g_strdup ("true");
+ return result;
+ } else {
+ result = g_strdup ("false");
+ return result;
+ }
+}
+
+
+static void player_controller_update_layout (PlayerController* self) {
+ gboolean visibility;
+ char* _tmp0_;
+ PlayerItem* _tmp1_;
+ PlayerItem* _tmp2_;
+ g_return_if_fail (self != NULL);
+ visibility = TRUE;
+ if (self->current_state != PLAYER_CONTROLLER_STATE_CONNECTED) {
+ visibility = FALSE;
+ }
+ g_debug ("player-controller.vala:128: about the set the visibility on both the t" \
+"ransport and metadata widget to %s", _tmp0_ = bool_to_string (visibility));
+ _g_free0 (_tmp0_);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp1_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, PLAYER_CONTROLLER_TRANSPORT)), DBUSMENU_MENUITEM_PROP_VISIBLE, visibility);
+ _g_object_unref0 (_tmp1_);
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, PLAYER_CONTROLLER_METADATA)), DBUSMENU_MENUITEM_PROP_VISIBLE, visibility);
+ _g_object_unref0 (_tmp2_);
+ if (self->mpris_adaptor == NULL) {
+ g_warning ("player-controller.vala:133: Why is the mpris object null");
+ }
+}
+
+
+static void player_controller_construct_widgets (PlayerController* self) {
+ PlayerItem* _tmp0_;
+ TitleMenuitem* title_menu_item;
+ MetadataMenuitem* metadata_item;
+ TransportMenuitem* transport_item;
+ g_return_if_fail (self != NULL);
+ gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, _tmp0_ = player_item_new (DBUSMENU_CLIENT_TYPES_SEPARATOR));
+ _g_object_unref0 (_tmp0_);
+ title_menu_item = title_menuitem_new (self);
+ gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) title_menu_item);
+ metadata_item = metadata_menuitem_new ();
+ gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) metadata_item);
+ transport_item = transport_menuitem_new (self);
+ gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) transport_item);
+ {
+ GeeIterator* _item_it;
+ _item_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) self->custom_items);
+ while (TRUE) {
+ PlayerItem* item;
+ if (!gee_iterator_next (_item_it)) {
+ break;
+ }
+ item = (PlayerItem*) gee_iterator_get (_item_it);
+ dbusmenu_menuitem_child_add_position (self->priv->root_menu, (DbusmenuMenuitem*) item, (guint) (self->priv->_menu_offset + gee_abstract_list_index_of ((GeeAbstractList*) self->custom_items, item)));
+ _g_object_unref0 (item);
+ }
+ _g_object_unref0 (_item_it);
+ }
+ _g_object_unref0 (title_menu_item);
+ _g_object_unref0 (metadata_item);
+ _g_object_unref0 (transport_item);
+}
+
+
+static char* string_slice (const char* self, glong start, glong end) {
+ char* result = NULL;
+ glong string_length;
+ gboolean _tmp0_ = FALSE;
+ gboolean _tmp1_ = FALSE;
+ const char* start_string;
+ g_return_val_if_fail (self != NULL, NULL);
+ string_length = g_utf8_strlen (self, -1);
+ if (start < 0) {
+ start = string_length + start;
+ }
+ if (end < 0) {
+ end = string_length + end;
+ }
+ if (start >= 0) {
+ _tmp0_ = start <= string_length;
+ } else {
+ _tmp0_ = FALSE;
+ }
+ g_return_val_if_fail (_tmp0_, NULL);
+ if (end >= 0) {
+ _tmp1_ = end <= string_length;
+ } else {
+ _tmp1_ = FALSE;
+ }
+ g_return_val_if_fail (_tmp1_, NULL);
+ g_return_val_if_fail (start <= end, NULL);
+ start_string = g_utf8_offset_to_pointer (self, start);
+ result = g_strndup (start_string, ((gchar*) g_utf8_offset_to_pointer (start_string, end - start)) - ((gchar*) start_string));
+ return result;
+}
+
+
+static char* player_controller_format_client_name (const char* client_name) {
+ char* result = NULL;
+ char* formatted;
+ g_return_val_if_fail (client_name != NULL, NULL);
+ formatted = g_strdup (client_name);
+ if (g_utf8_strlen (formatted, -1) > 1) {
+ char* _tmp2_;
+ char* _tmp1_;
+ char* _tmp0_;
+ formatted = (_tmp2_ = g_strconcat (_tmp0_ = g_utf8_strup (client_name, (gssize) 1), _tmp1_ = string_slice (client_name, (glong) 1, g_utf8_strlen (client_name, -1)), NULL), _g_free0 (formatted), _tmp2_);
+ _g_free0 (_tmp1_);
+ _g_free0 (_tmp0_);
+ g_debug ("player-controller.vala:165: PlayerController->format_client_name - : %" \
+"s", formatted);
+ }
+ result = formatted;
+ return result;
+}
+
+
+const char* player_controller_get_name (PlayerController* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_name;
+ return result;
+}
+
+
+void player_controller_set_name (PlayerController* self, const char* value) {
+ char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ self->priv->_name = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_name), _tmp0_);
+ g_object_notify ((GObject *) self, "name");
+}
+
+
+GAppInfo* player_controller_get_app_info (PlayerController* self) {
+ GAppInfo* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_app_info;
+ return result;
+}
+
+
+void player_controller_set_app_info (PlayerController* self, GAppInfo* value) {
+ GAppInfo* _tmp0_;
+ g_return_if_fail (self != NULL);
+ self->priv->_app_info = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_app_info), _tmp0_);
+ g_object_notify ((GObject *) self, "app-info");
+}
+
+
+gint player_controller_get_menu_offset (PlayerController* self) {
+ gint result;
+ g_return_val_if_fail (self != NULL, 0);
+ result = self->priv->_menu_offset;
+ return result;
+}
+
+
+void player_controller_set_menu_offset (PlayerController* self, gint value) {
+ g_return_if_fail (self != NULL);
+ self->priv->_menu_offset = value;
+ g_object_notify ((GObject *) self, "menu-offset");
+}
+
+
+static void player_controller_class_init (PlayerControllerClass * klass) {
+ player_controller_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (PlayerControllerPrivate));
+ G_OBJECT_CLASS (klass)->get_property = player_controller_get_property;
+ G_OBJECT_CLASS (klass)->set_property = player_controller_set_property;
+ G_OBJECT_CLASS (klass)->finalize = player_controller_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_APP_INFO, g_param_spec_object ("app-info", "app-info", "app-info", G_TYPE_APP_INFO, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_CONTROLLER_MENU_OFFSET, g_param_spec_int ("menu-offset", "menu-offset", "menu-offset", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
+}
+
+
+static void player_controller_instance_init (PlayerController * self) {
+ self->priv = PLAYER_CONTROLLER_GET_PRIVATE (self);
+ self->current_state = (gint) PLAYER_CONTROLLER_STATE_OFFLINE;
+}
+
+
+static void player_controller_finalize (GObject* obj) {
+ PlayerController * self;
+ self = PLAYER_CONTROLLER (obj);
+ _g_object_unref0 (self->priv->root_menu);
+ _g_free0 (self->priv->_name);
+ _g_object_unref0 (self->custom_items);
+ _g_object_unref0 (self->mpris_adaptor);
+ _g_object_unref0 (self->priv->_app_info);
+ G_OBJECT_CLASS (player_controller_parent_class)->finalize (obj);
+}
+
+
+GType player_controller_get_type (void) {
+ static volatile gsize player_controller_type_id__volatile = 0;
+ if (g_once_init_enter (&player_controller_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (PlayerControllerClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) player_controller_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlayerController), 0, (GInstanceInitFunc) player_controller_instance_init, NULL };
+ GType player_controller_type_id;
+ player_controller_type_id = g_type_register_static (G_TYPE_OBJECT, "PlayerController", &g_define_type_info, 0);
+ g_once_init_leave (&player_controller_type_id__volatile, player_controller_type_id);
+ }
+ return player_controller_type_id__volatile;
+}
+
+
+static void player_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ PlayerController * self;
+ self = PLAYER_CONTROLLER (object);
+ switch (property_id) {
+ case PLAYER_CONTROLLER_NAME:
+ g_value_set_string (value, player_controller_get_name (self));
+ break;
+ case PLAYER_CONTROLLER_APP_INFO:
+ g_value_set_object (value, player_controller_get_app_info (self));
+ break;
+ case PLAYER_CONTROLLER_MENU_OFFSET:
+ g_value_set_int (value, player_controller_get_menu_offset (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void player_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+ PlayerController * self;
+ self = PLAYER_CONTROLLER (object);
+ switch (property_id) {
+ case PLAYER_CONTROLLER_NAME:
+ player_controller_set_name (self, g_value_get_string (value));
+ break;
+ case PLAYER_CONTROLLER_APP_INFO:
+ player_controller_set_app_info (self, g_value_get_object (value));
+ break;
+ case PLAYER_CONTROLLER_MENU_OFFSET:
+ player_controller_set_menu_offset (self, g_value_get_int (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static int _vala_strcmp0 (const char * str1, const char * str2) {
+ if (str1 == NULL) {
+ return -(str1 != str2);
+ }
+ if (str2 == NULL) {
+ return str1 != str2;
+ }
+ return strcmp (str1, str2);
+}
+
+
+
+
diff --git a/src/player-item.c b/src/player-item.c
new file mode 100644
index 0000000..2ef44a8
--- /dev/null
+++ b/src/player-item.c
@@ -0,0 +1,446 @@
+/* player-item.c generated by valac, the Vala compiler
+ * generated from player-item.vala, do not modify */
+
+/*
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gee.h>
+
+
+#define TYPE_PLAYER_ITEM (player_item_get_type ())
+#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
+#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
+#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
+#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
+#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
+
+typedef struct _PlayerItem PlayerItem;
+typedef struct _PlayerItemClass PlayerItemClass;
+typedef struct _PlayerItemPrivate PlayerItemPrivate;
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+#define _g_free0(var) (var = (g_free (var), NULL))
+#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
+
+struct _PlayerItem {
+ DbusmenuMenuitem parent_instance;
+ PlayerItemPrivate * priv;
+};
+
+struct _PlayerItemClass {
+ DbusmenuMenuitemClass parent_class;
+};
+
+struct _PlayerItemPrivate {
+ PlayerController* _owner;
+ char* _item_type;
+};
+
+
+static gpointer player_item_parent_class = NULL;
+
+GType player_item_get_type (void);
+GType player_controller_get_type (void);
+#define PLAYER_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLAYER_ITEM, PlayerItemPrivate))
+enum {
+ PLAYER_ITEM_DUMMY_PROPERTY,
+ PLAYER_ITEM_OWNER,
+ PLAYER_ITEM_ITEM_TYPE
+};
+PlayerItem* player_item_new (const char* type);
+PlayerItem* player_item_construct (GType object_type, const char* type);
+void player_item_reset (PlayerItem* self, GeeHashSet* attrs);
+static gboolean player_item_ensure_valid_updates (GHashTable* data, GeeHashSet* attributes);
+static GValue* _g_value_dup (GValue* self);
+void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes);
+PlayerController* player_item_get_owner (PlayerItem* self);
+static void player_item_set_owner (PlayerItem* self, PlayerController* value);
+const char* player_item_get_item_type (PlayerItem* self);
+static void player_item_set_item_type (PlayerItem* self, const char* value);
+static GObject * player_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
+static void player_item_finalize (GObject* obj);
+static void player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
+static void player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
+static gint _vala_array_length (gpointer array);
+
+
+
+PlayerItem* player_item_construct (GType object_type, const char* type) {
+ PlayerItem * self;
+ g_return_val_if_fail (type != NULL, NULL);
+ self = (PlayerItem*) g_object_new (object_type, "item-type", type, NULL);
+ return self;
+}
+
+
+PlayerItem* player_item_new (const char* type) {
+ return player_item_construct (TYPE_PLAYER_ITEM, type);
+}
+
+
+void player_item_reset (PlayerItem* self, GeeHashSet* attrs) {
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (attrs != NULL);
+ {
+ GeeIterator* _s_it;
+ _s_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs);
+ while (TRUE) {
+ char* s;
+ if (!gee_iterator_next (_s_it)) {
+ break;
+ }
+ s = (char*) gee_iterator_get (_s_it);
+ g_debug ("player-item.vala:39: attempting to set prop %s to null", s);
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, s, NULL);
+ _g_free0 (s);
+ }
+ _g_object_unref0 (_s_it);
+ }
+}
+
+
+static GValue* _g_value_dup (GValue* self) {
+ return g_boxed_copy (G_TYPE_VALUE, self);
+}
+
+
+static gpointer __g_value_dup0 (gpointer self) {
+ return self ? _g_value_dup (self) : NULL;
+}
+
+
+static char* string_strip (const char* self) {
+ char* result = NULL;
+ char* _result_;
+ g_return_val_if_fail (self != NULL, NULL);
+ _result_ = g_strdup (self);
+ g_strstrip (_result_);
+ result = _result_;
+ return result;
+}
+
+
+static gboolean string_contains (const char* self, const char* needle) {
+ gboolean result = FALSE;
+ g_return_val_if_fail (self != NULL, FALSE);
+ g_return_val_if_fail (needle != NULL, FALSE);
+ result = strstr (self, needle) != NULL;
+ return result;
+}
+
+
+void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes) {
+ GError * _inner_error_;
+ g_return_if_fail (self != NULL);
+ g_return_if_fail (data != NULL);
+ g_return_if_fail (attributes != NULL);
+ _inner_error_ = NULL;
+ g_debug ("player-item.vala:46: PlayerItem::update()");
+ if (player_item_ensure_valid_updates (data, attributes) == FALSE) {
+ g_debug ("player-item.vala:48: PlayerItem::Update -> The hashtable update does n" \
+"ot contain what we were expecting - just leave it!");
+ return;
+ }
+ {
+ GeeIterator* _property_it;
+ _property_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) attributes);
+ while (TRUE) {
+ char* property;
+ char** _tmp1_;
+ gint _input_keys_size_;
+ gint input_keys_length1;
+ char** _tmp0_;
+ char** input_keys;
+ char** _tmp3_ = NULL;
+ gint _tmp2_;
+ char* search_key;
+ GValue* v;
+ if (!gee_iterator_next (_property_it)) {
+ break;
+ }
+ property = (char*) gee_iterator_get (_property_it);
+ input_keys = (_tmp1_ = _tmp0_ = g_strsplit (property, "-", 0), input_keys_length1 = _vala_array_length (_tmp0_), _input_keys_size_ = input_keys_length1, _tmp1_);
+ search_key = g_strdup ((_tmp3_ = input_keys + (input_keys_length1 - 1), _tmp2_ = input_keys_length1 - (input_keys_length1 - 1), _tmp3_)[0]);
+ g_debug ("player-item.vala:54: search key = %s", search_key);
+ v = __g_value_dup0 ((GValue*) g_hash_table_lookup (data, search_key));
+ if (G_VALUE_HOLDS (v, G_TYPE_STRING)) {
+ char* update;
+ update = string_strip (g_value_get_string (v));
+ g_debug ("player-item.vala:59: with value : %s", update);
+ if (string_contains (property, "arturl")) {
+ {
+ char* _tmp4_;
+ char* _tmp5_;
+ char* _tmp6_;
+ char* _tmp7_;
+ _tmp6_ = (_tmp5_ = g_filename_from_uri (_tmp4_ = string_strip (update), NULL, &_inner_error_), _g_free0 (_tmp4_), _tmp5_);
+ if (_inner_error_ != NULL) {
+ if (_inner_error_->domain == G_CONVERT_ERROR) {
+ goto __catch2_g_convert_error;
+ }
+ _g_free0 (update);
+ _g_free0 (property);
+ input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (search_key);
+ _g_free0 (v);
+ _g_object_unref0 (_property_it);
+ g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ update = (_tmp7_ = _tmp6_, _g_free0 (update), _tmp7_);
+ }
+ goto __finally2;
+ __catch2_g_convert_error:
+ {
+ GError * e;
+ e = _inner_error_;
+ _inner_error_ = NULL;
+ {
+ g_warning ("player-item.vala:65: Problem converting URI %s to file path", update);
+ _g_error_free0 (e);
+ }
+ }
+ __finally2:
+ if (_inner_error_ != NULL) {
+ _g_free0 (update);
+ _g_free0 (property);
+ input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (search_key);
+ _g_free0 (v);
+ _g_object_unref0 (_property_it);
+ g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
+ g_clear_error (&_inner_error_);
+ return;
+ }
+ }
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, property, update);
+ _g_free0 (update);
+ } else {
+ if (G_VALUE_HOLDS (v, G_TYPE_INT)) {
+ g_debug ("player-item.vala:71: with value : %i", g_value_get_int (v));
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, property, g_value_get_int (v));
+ } else {
+ if (G_VALUE_HOLDS (v, G_TYPE_BOOLEAN)) {
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, property, g_value_get_boolean (v));
+ }
+ }
+ }
+ _g_free0 (property);
+ input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL);
+ _g_free0 (search_key);
+ _g_free0 (v);
+ }
+ _g_object_unref0 (_property_it);
+ }
+}
+
+
+static gboolean player_item_ensure_valid_updates (GHashTable* data, GeeHashSet* attributes) {
+ gboolean result = FALSE;
+ g_return_val_if_fail (data != NULL, FALSE);
+ g_return_val_if_fail (attributes != NULL, FALSE);
+ if (data == NULL) {
+ result = FALSE;
+ return result;
+ }
+ if (g_hash_table_size (data) < gee_collection_get_size ((GeeCollection*) attributes)) {
+ g_warning ("player-item.vala:86: update hash was too small for the target");
+ result = FALSE;
+ return result;
+ }
+ result = TRUE;
+ return result;
+}
+
+
+PlayerController* player_item_get_owner (PlayerItem* self) {
+ PlayerController* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_owner;
+ return result;
+}
+
+
+static gpointer _g_object_ref0 (gpointer self) {
+ return self ? g_object_ref (self) : NULL;
+}
+
+
+static void player_item_set_owner (PlayerItem* self, PlayerController* value) {
+ PlayerController* _tmp0_;
+ g_return_if_fail (self != NULL);
+ self->priv->_owner = (_tmp0_ = _g_object_ref0 (value), _g_object_unref0 (self->priv->_owner), _tmp0_);
+ g_object_notify ((GObject *) self, "owner");
+}
+
+
+const char* player_item_get_item_type (PlayerItem* self) {
+ const char* result;
+ g_return_val_if_fail (self != NULL, NULL);
+ result = self->priv->_item_type;
+ return result;
+}
+
+
+static void player_item_set_item_type (PlayerItem* self, const char* value) {
+ char* _tmp0_;
+ g_return_if_fail (self != NULL);
+ self->priv->_item_type = (_tmp0_ = g_strdup (value), _g_free0 (self->priv->_item_type), _tmp0_);
+ g_object_notify ((GObject *) self, "item-type");
+}
+
+
+static GObject * player_item_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ GObject * obj;
+ GObjectClass * parent_class;
+ PlayerItem * self;
+ parent_class = G_OBJECT_CLASS (player_item_parent_class);
+ obj = parent_class->constructor (type, n_construct_properties, construct_properties);
+ self = PLAYER_ITEM (obj);
+ {
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_TYPE, self->priv->_item_type);
+ }
+ return obj;
+}
+
+
+static void player_item_class_init (PlayerItemClass * klass) {
+ player_item_parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (klass, sizeof (PlayerItemPrivate));
+ G_OBJECT_CLASS (klass)->get_property = player_item_get_property;
+ G_OBJECT_CLASS (klass)->set_property = player_item_set_property;
+ G_OBJECT_CLASS (klass)->constructor = player_item_constructor;
+ G_OBJECT_CLASS (klass)->finalize = player_item_finalize;
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_ITEM_OWNER, g_param_spec_object ("owner", "owner", "owner", TYPE_PLAYER_CONTROLLER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), PLAYER_ITEM_ITEM_TYPE, g_param_spec_string ("item-type", "item-type", "item-type", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
+}
+
+
+static void player_item_instance_init (PlayerItem * self) {
+ self->priv = PLAYER_ITEM_GET_PRIVATE (self);
+}
+
+
+static void player_item_finalize (GObject* obj) {
+ PlayerItem * self;
+ self = PLAYER_ITEM (obj);
+ _g_object_unref0 (self->priv->_owner);
+ _g_free0 (self->priv->_item_type);
+ G_OBJECT_CLASS (player_item_parent_class)->finalize (obj);
+}
+
+
+GType player_item_get_type (void) {
+ static volatile gsize player_item_type_id__volatile = 0;
+ if (g_once_init_enter (&player_item_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (PlayerItemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) player_item_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PlayerItem), 0, (GInstanceInitFunc) player_item_instance_init, NULL };
+ GType player_item_type_id;
+ player_item_type_id = g_type_register_static (DBUSMENU_TYPE_MENUITEM, "PlayerItem", &g_define_type_info, 0);
+ g_once_init_leave (&player_item_type_id__volatile, player_item_type_id);
+ }
+ return player_item_type_id__volatile;
+}
+
+
+static void player_item_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
+ PlayerItem * self;
+ self = PLAYER_ITEM (object);
+ switch (property_id) {
+ case PLAYER_ITEM_OWNER:
+ g_value_set_object (value, player_item_get_owner (self));
+ break;
+ case PLAYER_ITEM_ITEM_TYPE:
+ g_value_set_string (value, player_item_get_item_type (self));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void player_item_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
+ PlayerItem * self;
+ self = PLAYER_ITEM (object);
+ switch (property_id) {
+ case PLAYER_ITEM_OWNER:
+ player_item_set_owner (self, g_value_get_object (value));
+ break;
+ case PLAYER_ITEM_ITEM_TYPE:
+ player_item_set_item_type (self, g_value_get_string (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+
+static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ if ((array != NULL) && (destroy_func != NULL)) {
+ int i;
+ for (i = 0; i < array_length; i = i + 1) {
+ if (((gpointer*) array)[i] != NULL) {
+ destroy_func (((gpointer*) array)[i]);
+ }
+ }
+ }
+}
+
+
+static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
+ _vala_array_destroy (array, array_length, destroy_func);
+ g_free (array);
+}
+
+
+static gint _vala_array_length (gpointer array) {
+ int length;
+ length = 0;
+ if (array) {
+ while (((gpointer*) array)[length]) {
+ length++;
+ }
+ }
+ return length;
+}
+
+
+
+
diff --git a/src/sound-service-client.h b/src/sound-service-client.h
new file mode 100644
index 0000000..b3d50da
--- /dev/null
+++ b/src/sound-service-client.h
@@ -0,0 +1,177 @@
+/* Generated by dbus-binding-tool; do not edit! */
+
+#include <glib.h>
+#include <dbus/dbus-glib.h>
+
+G_BEGIN_DECLS
+
+#ifndef _DBUS_GLIB_ASYNC_DATA_FREE
+#define _DBUS_GLIB_ASYNC_DATA_FREE
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+void
+_dbus_glib_async_data_free (gpointer stuff)
+{
+ g_slice_free (DBusGAsyncData, stuff);
+}
+#endif
+
+#ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_ayatana_indicator_sound
+#define DBUS_GLIB_CLIENT_WRAPPERS_org_ayatana_indicator_sound
+
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+gboolean
+org_ayatana_indicator_sound_set_sink_volume (DBusGProxy *proxy, const guint IN_volume_percent, GError **error)
+
+{
+ return dbus_g_proxy_call (proxy, "SetSinkVolume", error, G_TYPE_UINT, IN_volume_percent, G_TYPE_INVALID, G_TYPE_INVALID);
+}
+
+typedef void (*org_ayatana_indicator_sound_set_sink_volume_reply) (DBusGProxy *proxy, GError *error, gpointer userdata);
+
+static void
+org_ayatana_indicator_sound_set_sink_volume_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+{
+ DBusGAsyncData *data = (DBusGAsyncData*) user_data;
+ GError *error = NULL;
+ dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
+ (*(org_ayatana_indicator_sound_set_sink_volume_reply)data->cb) (proxy, error, data->userdata);
+ return;
+}
+
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+DBusGProxyCall*
+org_ayatana_indicator_sound_set_sink_volume_async (DBusGProxy *proxy, const guint IN_volume_percent, org_ayatana_indicator_sound_set_sink_volume_reply callback, gpointer userdata)
+
+{
+ DBusGAsyncData *stuff;
+ stuff = g_slice_new (DBusGAsyncData);
+ stuff->cb = G_CALLBACK (callback);
+ stuff->userdata = userdata;
+ return dbus_g_proxy_begin_call (proxy, "SetSinkVolume", org_ayatana_indicator_sound_set_sink_volume_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_UINT, IN_volume_percent, G_TYPE_INVALID);
+}
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+gboolean
+org_ayatana_indicator_sound_get_sink_volume (DBusGProxy *proxy, gdouble* OUT_volume_percent_input, GError **error)
+
+{
+ return dbus_g_proxy_call (proxy, "GetSinkVolume", error, G_TYPE_INVALID, G_TYPE_DOUBLE, OUT_volume_percent_input, G_TYPE_INVALID);
+}
+
+typedef void (*org_ayatana_indicator_sound_get_sink_volume_reply) (DBusGProxy *proxy, gdouble OUT_volume_percent_input, GError *error, gpointer userdata);
+
+static void
+org_ayatana_indicator_sound_get_sink_volume_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+{
+ DBusGAsyncData *data = (DBusGAsyncData*) user_data;
+ GError *error = NULL;
+ gdouble OUT_volume_percent_input;
+ dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_DOUBLE, &OUT_volume_percent_input, G_TYPE_INVALID);
+ (*(org_ayatana_indicator_sound_get_sink_volume_reply)data->cb) (proxy, OUT_volume_percent_input, error, data->userdata);
+ return;
+}
+
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+DBusGProxyCall*
+org_ayatana_indicator_sound_get_sink_volume_async (DBusGProxy *proxy, org_ayatana_indicator_sound_get_sink_volume_reply callback, gpointer userdata)
+
+{
+ DBusGAsyncData *stuff;
+ stuff = g_slice_new (DBusGAsyncData);
+ stuff->cb = G_CALLBACK (callback);
+ stuff->userdata = userdata;
+ return dbus_g_proxy_begin_call (proxy, "GetSinkVolume", org_ayatana_indicator_sound_get_sink_volume_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID);
+}
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+gboolean
+org_ayatana_indicator_sound_get_sink_mute (DBusGProxy *proxy, gboolean* OUT_mute_input, GError **error)
+
+{
+ return dbus_g_proxy_call (proxy, "GetSinkMute", error, G_TYPE_INVALID, G_TYPE_BOOLEAN, OUT_mute_input, G_TYPE_INVALID);
+}
+
+typedef void (*org_ayatana_indicator_sound_get_sink_mute_reply) (DBusGProxy *proxy, gboolean OUT_mute_input, GError *error, gpointer userdata);
+
+static void
+org_ayatana_indicator_sound_get_sink_mute_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+{
+ DBusGAsyncData *data = (DBusGAsyncData*) user_data;
+ GError *error = NULL;
+ gboolean OUT_mute_input;
+ dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_BOOLEAN, &OUT_mute_input, G_TYPE_INVALID);
+ (*(org_ayatana_indicator_sound_get_sink_mute_reply)data->cb) (proxy, OUT_mute_input, error, data->userdata);
+ return;
+}
+
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+DBusGProxyCall*
+org_ayatana_indicator_sound_get_sink_mute_async (DBusGProxy *proxy, org_ayatana_indicator_sound_get_sink_mute_reply callback, gpointer userdata)
+
+{
+ DBusGAsyncData *stuff;
+ stuff = g_slice_new (DBusGAsyncData);
+ stuff->cb = G_CALLBACK (callback);
+ stuff->userdata = userdata;
+ return dbus_g_proxy_begin_call (proxy, "GetSinkMute", org_ayatana_indicator_sound_get_sink_mute_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID);
+}
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+gboolean
+org_ayatana_indicator_sound_get_sink_availability (DBusGProxy *proxy, gboolean* OUT_availability_input, GError **error)
+
+{
+ return dbus_g_proxy_call (proxy, "GetSinkAvailability", error, G_TYPE_INVALID, G_TYPE_BOOLEAN, OUT_availability_input, G_TYPE_INVALID);
+}
+
+typedef void (*org_ayatana_indicator_sound_get_sink_availability_reply) (DBusGProxy *proxy, gboolean OUT_availability_input, GError *error, gpointer userdata);
+
+static void
+org_ayatana_indicator_sound_get_sink_availability_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
+{
+ DBusGAsyncData *data = (DBusGAsyncData*) user_data;
+ GError *error = NULL;
+ gboolean OUT_availability_input;
+ dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_BOOLEAN, &OUT_availability_input, G_TYPE_INVALID);
+ (*(org_ayatana_indicator_sound_get_sink_availability_reply)data->cb) (proxy, OUT_availability_input, error, data->userdata);
+ return;
+}
+
+static
+#ifdef G_HAVE_INLINE
+inline
+#endif
+DBusGProxyCall*
+org_ayatana_indicator_sound_get_sink_availability_async (DBusGProxy *proxy, org_ayatana_indicator_sound_get_sink_availability_reply callback, gpointer userdata)
+
+{
+ DBusGAsyncData *stuff;
+ stuff = g_slice_new (DBusGAsyncData);
+ stuff->cb = G_CALLBACK (callback);
+ stuff->userdata = userdata;
+ return dbus_g_proxy_begin_call (proxy, "GetSinkAvailability", org_ayatana_indicator_sound_get_sink_availability_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID);
+}
+#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_ayatana_indicator_sound */
+
+G_END_DECLS
diff --git a/src/sound-service-server.h b/src/sound-service-server.h
new file mode 100644
index 0000000..2773619
--- /dev/null
+++ b/src/sound-service-server.h
@@ -0,0 +1,170 @@
+/* Generated by dbus-binding-tool; do not edit! */
+
+
+#ifndef __dbus_glib_marshal__sound_service_server_MARSHAL_H__
+#define __dbus_glib_marshal__sound_service_server_MARSHAL_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#ifdef G_ENABLE_DEBUG
+#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
+#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
+#define g_marshal_value_peek_int(v) g_value_get_int (v)
+#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
+#define g_marshal_value_peek_long(v) g_value_get_long (v)
+#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
+#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
+#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
+#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
+#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
+#define g_marshal_value_peek_float(v) g_value_get_float (v)
+#define g_marshal_value_peek_double(v) g_value_get_double (v)
+#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
+#define g_marshal_value_peek_param(v) g_value_get_param (v)
+#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
+#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
+#define g_marshal_value_peek_object(v) g_value_get_object (v)
+#else /* !G_ENABLE_DEBUG */
+/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
+ * Do not access GValues directly in your code. Instead, use the
+ * g_value_get_*() functions
+ */
+#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
+#define g_marshal_value_peek_char(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_int(v) (v)->data[0].v_int
+#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
+#define g_marshal_value_peek_long(v) (v)->data[0].v_long
+#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
+#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
+#define g_marshal_value_peek_enum(v) (v)->data[0].v_long
+#define g_marshal_value_peek_flags(v) (v)->data[0].v_ulong
+#define g_marshal_value_peek_float(v) (v)->data[0].v_float
+#define g_marshal_value_peek_double(v) (v)->data[0].v_double
+#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
+#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
+#endif /* !G_ENABLE_DEBUG */
+
+
+/* BOOLEAN:UINT,POINTER */
+extern void dbus_glib_marshal__sound_service_server_BOOLEAN__UINT_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+void
+dbus_glib_marshal__sound_service_server_BOOLEAN__UINT_POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gboolean (*GMarshalFunc_BOOLEAN__UINT_POINTER) (gpointer data1,
+ guint arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__UINT_POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gboolean v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_BOOLEAN__UINT_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_uint (param_values + 1),
+ g_marshal_value_peek_pointer (param_values + 2),
+ data2);
+
+ g_value_set_boolean (return_value, v_return);
+}
+
+/* BOOLEAN:POINTER,POINTER */
+extern void dbus_glib_marshal__sound_service_server_BOOLEAN__POINTER_POINTER (GClosure *closure,
+ GValue *return_value,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint,
+ gpointer marshal_data);
+void
+dbus_glib_marshal__sound_service_server_BOOLEAN__POINTER_POINTER (GClosure *closure,
+ GValue *return_value G_GNUC_UNUSED,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer invocation_hint G_GNUC_UNUSED,
+ gpointer marshal_data)
+{
+ typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_POINTER) (gpointer data1,
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
+ register GMarshalFunc_BOOLEAN__POINTER_POINTER callback;
+ register GCClosure *cc = (GCClosure*) closure;
+ register gpointer data1, data2;
+ gboolean v_return;
+
+ g_return_if_fail (return_value != NULL);
+ g_return_if_fail (n_param_values == 3);
+
+ if (G_CCLOSURE_SWAP_DATA (closure))
+ {
+ data1 = closure->data;
+ data2 = g_value_peek_pointer (param_values + 0);
+ }
+ else
+ {
+ data1 = g_value_peek_pointer (param_values + 0);
+ data2 = closure->data;
+ }
+ callback = (GMarshalFunc_BOOLEAN__POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
+
+ v_return = callback (data1,
+ g_marshal_value_peek_pointer (param_values + 1),
+ g_marshal_value_peek_pointer (param_values + 2),
+ data2);
+
+ g_value_set_boolean (return_value, v_return);
+}
+
+G_END_DECLS
+
+#endif /* __dbus_glib_marshal__sound_service_server_MARSHAL_H__ */
+
+#include <dbus/dbus-glib.h>
+static const DBusGMethodInfo dbus_glib__sound_service_server_methods[] = {
+ { (GCallback) sound_service_dbus_set_sink_volume, dbus_glib_marshal__sound_service_server_BOOLEAN__UINT_POINTER, 0 },
+ { (GCallback) sound_service_dbus_get_sink_volume, dbus_glib_marshal__sound_service_server_BOOLEAN__POINTER_POINTER, 64 },
+ { (GCallback) sound_service_dbus_get_sink_mute, dbus_glib_marshal__sound_service_server_BOOLEAN__POINTER_POINTER, 138 },
+ { (GCallback) sound_service_dbus_get_sink_availability, dbus_glib_marshal__sound_service_server_BOOLEAN__POINTER_POINTER, 200 },
+};
+
+const DBusGObjectInfo dbus_glib__sound_service_server_object_info = {
+ 0,
+ dbus_glib__sound_service_server_methods,
+ 4,
+"org.ayatana.indicator.sound\0SetSinkVolume\0S\0volume_percent\0I\0u\0\0org.ayatana.indicator.sound\0GetSinkVolume\0S\0volume_percent_input\0O\0F\0N\0d\0\0org.ayatana.indicator.sound\0GetSinkMute\0S\0mute_input\0O\0F\0N\0b\0\0org.ayatana.indicator.sound\0GetSinkAvailability\0S\0availability_input\0O\0F\0N\0b\0\0\0",
+"org.ayatana.indicator.sound\0SinkInputWhileMuted\0org.ayatana.indicator.sound\0SinkVolumeUpdate\0org.ayatana.indicator.sound\0SinkMuteUpdate\0org.ayatana.indicator.sound\0SinkAvailableUpdate\0\0",
+"\0"
+};
+
diff --git a/src/title-menu-item.c b/src/title-menu-item.c
new file mode 100644
index 0000000..20d0aa4
--- /dev/null
+++ b/src/title-menu-item.c
@@ -0,0 +1,199 @@
+/* title-menu-item.c generated by valac, the Vala compiler
+ * generated from title-menu-item.vala, do not modify */
+
+/*
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+#include <common-defs.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gee.h>
+
+
+#define TYPE_PLAYER_ITEM (player_item_get_type ())
+#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
+#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
+#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
+#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
+#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
+
+typedef struct _PlayerItem PlayerItem;
+typedef struct _PlayerItemClass PlayerItemClass;
+typedef struct _PlayerItemPrivate PlayerItemPrivate;
+
+#define TYPE_TITLE_MENUITEM (title_menuitem_get_type ())
+#define TITLE_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TITLE_MENUITEM, TitleMenuitem))
+#define TITLE_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TITLE_MENUITEM, TitleMenuitemClass))
+#define IS_TITLE_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TITLE_MENUITEM))
+#define IS_TITLE_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TITLE_MENUITEM))
+#define TITLE_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TITLE_MENUITEM, TitleMenuitemClass))
+
+typedef struct _TitleMenuitem TitleMenuitem;
+typedef struct _TitleMenuitemClass TitleMenuitemClass;
+typedef struct _TitleMenuitemPrivate TitleMenuitemPrivate;
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+typedef struct _PlayerControllerPrivate PlayerControllerPrivate;
+
+#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ())
+#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController))
+#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER))
+#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER))
+#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+
+typedef struct _MprisController MprisController;
+typedef struct _MprisControllerClass MprisControllerClass;
+
+#define PLAYER_CONTROLLER_TYPE_STATE (player_controller_state_get_type ())
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+struct _PlayerItem {
+ DbusmenuMenuitem parent_instance;
+ PlayerItemPrivate * priv;
+};
+
+struct _PlayerItemClass {
+ DbusmenuMenuitemClass parent_class;
+};
+
+struct _TitleMenuitem {
+ PlayerItem parent_instance;
+ TitleMenuitemPrivate * priv;
+};
+
+struct _TitleMenuitemClass {
+ PlayerItemClass parent_class;
+};
+
+struct _PlayerController {
+ GObject parent_instance;
+ PlayerControllerPrivate * priv;
+ gint current_state;
+ GeeArrayList* custom_items;
+ MprisController* mpris_adaptor;
+};
+
+struct _PlayerControllerClass {
+ GObjectClass parent_class;
+};
+
+typedef enum {
+ PLAYER_CONTROLLER_STATE_OFFLINE,
+ PLAYER_CONTROLLER_STATE_INSTANTIATING,
+ PLAYER_CONTROLLER_STATE_READY,
+ PLAYER_CONTROLLER_STATE_CONNECTED,
+ PLAYER_CONTROLLER_STATE_DISCONNECTED
+} PlayerControllerstate;
+
+
+static gpointer title_menuitem_parent_class = NULL;
+
+GType player_item_get_type (void);
+GType title_menuitem_get_type (void);
+enum {
+ TITLE_MENUITEM_DUMMY_PROPERTY
+};
+GType player_controller_get_type (void);
+const char* player_controller_get_name (PlayerController* self);
+TitleMenuitem* title_menuitem_new (PlayerController* parent);
+TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent);
+PlayerController* player_item_get_owner (PlayerItem* self);
+GType mpris_controller_get_type (void);
+GType player_controller_state_get_type (void);
+void player_controller_instantiate (PlayerController* self);
+static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp);
+GeeHashSet* title_menuitem_attributes_format (void);
+
+
+
+TitleMenuitem* title_menuitem_construct (GType object_type, PlayerController* parent) {
+ TitleMenuitem * self;
+ g_return_val_if_fail (parent != NULL, NULL);
+ self = (TitleMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TITLE_MENUITEM_TYPE, "owner", parent, NULL);
+ dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) self, DBUSMENU_TITLE_MENUITEM_TEXT_NAME, player_controller_get_name (parent));
+ return self;
+}
+
+
+TitleMenuitem* title_menuitem_new (PlayerController* parent) {
+ return title_menuitem_construct (TYPE_TITLE_MENUITEM, parent);
+}
+
+
+static void title_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp) {
+ TitleMenuitem * self;
+ self = (TitleMenuitem*) base;
+ g_return_if_fail (name != NULL);
+ g_debug ("title-menu-item.vala:34: handle_event for owner %s with owner state = " \
+"%i and title menu name %s", player_controller_get_name (player_item_get_owner ((PlayerItem*) self)), player_item_get_owner ((PlayerItem*) self)->current_state, dbusmenu_menuitem_property_get ((DbusmenuMenuitem*) self, DBUSMENU_TITLE_MENUITEM_TEXT_NAME));
+ if (player_item_get_owner ((PlayerItem*) self)->current_state == PLAYER_CONTROLLER_STATE_OFFLINE) {
+ player_controller_instantiate (player_item_get_owner ((PlayerItem*) self));
+ }
+}
+
+
+GeeHashSet* title_menuitem_attributes_format (void) {
+ GeeHashSet* result = NULL;
+ GeeHashSet* attrs;
+ attrs = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_TITLE_MENUITEM_TEXT_NAME);
+ result = attrs;
+ return result;
+}
+
+
+static void title_menuitem_class_init (TitleMenuitemClass * klass) {
+ title_menuitem_parent_class = g_type_class_peek_parent (klass);
+ DBUSMENU_MENUITEM_CLASS (klass)->handle_event = title_menuitem_real_handle_event;
+}
+
+
+static void title_menuitem_instance_init (TitleMenuitem * self) {
+}
+
+
+GType title_menuitem_get_type (void) {
+ static volatile gsize title_menuitem_type_id__volatile = 0;
+ if (g_once_init_enter (&title_menuitem_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (TitleMenuitemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) title_menuitem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TitleMenuitem), 0, (GInstanceInitFunc) title_menuitem_instance_init, NULL };
+ GType title_menuitem_type_id;
+ title_menuitem_type_id = g_type_register_static (TYPE_PLAYER_ITEM, "TitleMenuitem", &g_define_type_info, 0);
+ g_once_init_leave (&title_menuitem_type_id__volatile, title_menuitem_type_id);
+ }
+ return title_menuitem_type_id__volatile;
+}
+
+
+
+
diff --git a/src/transport-menu-item.c b/src/transport-menu-item.c
new file mode 100644
index 0000000..0734a97
--- /dev/null
+++ b/src/transport-menu-item.c
@@ -0,0 +1,218 @@
+/* transport-menu-item.c generated by valac, the Vala compiler
+ * generated from transport-menu-item.vala, do not modify */
+
+/*
+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/>.
+*/
+
+#include <glib.h>
+#include <glib-object.h>
+#include <libdbusmenu-glib/client.h>
+#include <libdbusmenu-glib/menuitem-proxy.h>
+#include <libdbusmenu-glib/menuitem.h>
+#include <libdbusmenu-glib/server.h>
+#include <common-defs.h>
+#include <stdlib.h>
+#include <string.h>
+#include <gee.h>
+
+
+#define TYPE_PLAYER_ITEM (player_item_get_type ())
+#define PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_ITEM, PlayerItem))
+#define PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_ITEM, PlayerItemClass))
+#define IS_PLAYER_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_ITEM))
+#define IS_PLAYER_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_ITEM))
+#define PLAYER_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_ITEM, PlayerItemClass))
+
+typedef struct _PlayerItem PlayerItem;
+typedef struct _PlayerItemClass PlayerItemClass;
+typedef struct _PlayerItemPrivate PlayerItemPrivate;
+
+#define TYPE_TRANSPORT_MENUITEM (transport_menuitem_get_type ())
+#define TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitem))
+#define TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+#define IS_TRANSPORT_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TRANSPORT_MENUITEM))
+#define IS_TRANSPORT_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TRANSPORT_MENUITEM))
+#define TRANSPORT_MENUITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TRANSPORT_MENUITEM, TransportMenuitemClass))
+
+typedef struct _TransportMenuitem TransportMenuitem;
+typedef struct _TransportMenuitemClass TransportMenuitemClass;
+typedef struct _TransportMenuitemPrivate TransportMenuitemPrivate;
+
+#define TRANSPORT_MENUITEM_TYPE_ACTION (transport_menuitem_action_get_type ())
+
+#define TYPE_PLAYER_CONTROLLER (player_controller_get_type ())
+#define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController))
+#define PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+#define IS_PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLAYER_CONTROLLER))
+#define IS_PLAYER_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLAYER_CONTROLLER))
+#define PLAYER_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLAYER_CONTROLLER, PlayerControllerClass))
+
+typedef struct _PlayerController PlayerController;
+typedef struct _PlayerControllerClass PlayerControllerClass;
+#define _g_free0(var) (var = (g_free (var), NULL))
+typedef struct _PlayerControllerPrivate PlayerControllerPrivate;
+
+#define TYPE_MPRIS_CONTROLLER (mpris_controller_get_type ())
+#define MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MPRIS_CONTROLLER, MprisController))
+#define MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+#define IS_MPRIS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MPRIS_CONTROLLER))
+#define IS_MPRIS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MPRIS_CONTROLLER))
+#define MPRIS_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MPRIS_CONTROLLER, MprisControllerClass))
+
+typedef struct _MprisController MprisController;
+typedef struct _MprisControllerClass MprisControllerClass;
+#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
+
+struct _PlayerItem {
+ DbusmenuMenuitem parent_instance;
+ PlayerItemPrivate * priv;
+};
+
+struct _PlayerItemClass {
+ DbusmenuMenuitemClass parent_class;
+};
+
+struct _TransportMenuitem {
+ PlayerItem parent_instance;
+ TransportMenuitemPrivate * priv;
+};
+
+struct _TransportMenuitemClass {
+ PlayerItemClass parent_class;
+};
+
+typedef enum {
+ TRANSPORT_MENUITEM_ACTION_PREVIOUS,
+ TRANSPORT_MENUITEM_ACTION_PLAY_PAUSE,
+ TRANSPORT_MENUITEM_ACTION_NEXT
+} TransportMenuitemaction;
+
+struct _PlayerController {
+ GObject parent_instance;
+ PlayerControllerPrivate * priv;
+ gint current_state;
+ GeeArrayList* custom_items;
+ MprisController* mpris_adaptor;
+};
+
+struct _PlayerControllerClass {
+ GObjectClass parent_class;
+};
+
+
+static gpointer transport_menuitem_parent_class = NULL;
+
+GType player_item_get_type (void);
+GType transport_menuitem_get_type (void);
+enum {
+ TRANSPORT_MENUITEM_DUMMY_PROPERTY
+};
+GType transport_menuitem_action_get_type (void);
+GType player_controller_get_type (void);
+TransportMenuitem* transport_menuitem_new (PlayerController* parent);
+TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent);
+void transport_menuitem_change_play_state (TransportMenuitem* self, gint state);
+PlayerController* player_item_get_owner (PlayerItem* self);
+const char* player_controller_get_name (PlayerController* self);
+GType mpris_controller_get_type (void);
+void mpris_controller_transport_event (MprisController* self, TransportMenuitemaction command);
+static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp);
+GeeHashSet* transport_menuitem_attributes_format (void);
+
+
+
+GType transport_menuitem_action_get_type (void) {
+ static volatile gsize transport_menuitem_action_type_id__volatile = 0;
+ if (g_once_init_enter (&transport_menuitem_action_type_id__volatile)) {
+ static const GEnumValue values[] = {{TRANSPORT_MENUITEM_ACTION_PREVIOUS, "TRANSPORT_MENUITEM_ACTION_PREVIOUS", "previous"}, {TRANSPORT_MENUITEM_ACTION_PLAY_PAUSE, "TRANSPORT_MENUITEM_ACTION_PLAY_PAUSE", "play-pause"}, {TRANSPORT_MENUITEM_ACTION_NEXT, "TRANSPORT_MENUITEM_ACTION_NEXT", "next"}, {0, NULL, NULL}};
+ GType transport_menuitem_action_type_id;
+ transport_menuitem_action_type_id = g_enum_register_static ("TransportMenuitemaction", values);
+ g_once_init_leave (&transport_menuitem_action_type_id__volatile, transport_menuitem_action_type_id);
+ }
+ return transport_menuitem_action_type_id__volatile;
+}
+
+
+TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent) {
+ TransportMenuitem * self;
+ g_return_val_if_fail (parent != NULL, NULL);
+ self = (TransportMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_TRANSPORT_MENUITEM_TYPE, "owner", parent, NULL);
+ return self;
+}
+
+
+TransportMenuitem* transport_menuitem_new (PlayerController* parent) {
+ return transport_menuitem_construct (TYPE_TRANSPORT_MENUITEM, parent);
+}
+
+
+void transport_menuitem_change_play_state (TransportMenuitem* self, gint state) {
+ g_return_if_fail (self != NULL);
+ dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, state);
+}
+
+
+static void transport_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp) {
+ TransportMenuitem * self;
+ gint input;
+ char* _tmp0_;
+ self = (TransportMenuitem*) base;
+ g_return_if_fail (name != NULL);
+ input = g_value_get_int (input_value);
+ g_debug ("transport-menu-item.vala:45: handle_event with value %s", _tmp0_ = g_strdup_printf ("%i", input));
+ _g_free0 (_tmp0_);
+ g_debug ("transport-menu-item.vala:46: transport owner name = %s", player_controller_get_name (player_item_get_owner ((PlayerItem*) self)));
+ mpris_controller_transport_event (player_item_get_owner ((PlayerItem*) self)->mpris_adaptor, (TransportMenuitemaction) input);
+}
+
+
+GeeHashSet* transport_menuitem_attributes_format (void) {
+ GeeHashSet* result = NULL;
+ GeeHashSet* attrs;
+ attrs = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
+ gee_abstract_collection_add ((GeeAbstractCollection*) attrs, DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE);
+ result = attrs;
+ return result;
+}
+
+
+static void transport_menuitem_class_init (TransportMenuitemClass * klass) {
+ transport_menuitem_parent_class = g_type_class_peek_parent (klass);
+ DBUSMENU_MENUITEM_CLASS (klass)->handle_event = transport_menuitem_real_handle_event;
+}
+
+
+static void transport_menuitem_instance_init (TransportMenuitem * self) {
+}
+
+
+GType transport_menuitem_get_type (void) {
+ static volatile gsize transport_menuitem_type_id__volatile = 0;
+ if (g_once_init_enter (&transport_menuitem_type_id__volatile)) {
+ static const GTypeInfo g_define_type_info = { sizeof (TransportMenuitemClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) transport_menuitem_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TransportMenuitem), 0, (GInstanceInitFunc) transport_menuitem_instance_init, NULL };
+ GType transport_menuitem_type_id;
+ transport_menuitem_type_id = g_type_register_static (TYPE_PLAYER_ITEM, "TransportMenuitem", &g_define_type_info, 0);
+ g_once_init_leave (&transport_menuitem_type_id__volatile, transport_menuitem_type_id);
+ }
+ return transport_menuitem_type_id__volatile;
+}
+
+
+
+