diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-07-29 11:26:41 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-07-29 11:26:41 -0400 |
commit | 986fc648fc6544aaa3bb40a17e1345e0247a4b57 (patch) | |
tree | da2904b0c642c44d65629a9657b550c2c26a7b08 | |
parent | 1777ee4291dc792ca3d4df087c8af23cd8458961 (diff) | |
parent | 859c48c87009fb12e0acc15fdeb8d69e42247176 (diff) | |
download | ayatana-indicator-sound-986fc648fc6544aaa3bb40a17e1345e0247a4b57.tar.gz ayatana-indicator-sound-986fc648fc6544aaa3bb40a17e1345e0247a4b57.tar.bz2 ayatana-indicator-sound-986fc648fc6544aaa3bb40a17e1345e0247a4b57.zip |
Import upstream version 0.3.9
-rw-r--r-- | Makefile.in | 2 | ||||
-rw-r--r-- | aclocal.m4 | 60 | ||||
-rwxr-xr-x | config.guess | 149 | ||||
-rwxr-xr-x | config.sub | 47 | ||||
-rwxr-xr-x | configure | 234 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | data/Makefile.in | 2 | ||||
-rw-r--r-- | src/Makefile.in | 2 | ||||
-rw-r--r-- | src/common-defs.h | 23 | ||||
-rw-r--r-- | src/familiar-players-db.c | 26 | ||||
-rw-r--r-- | src/metadata-menu-item.c | 37 | ||||
-rw-r--r-- | src/metadata-menu-item.vala | 7 | ||||
-rw-r--r-- | src/metadata-widget.c | 10 | ||||
-rw-r--r-- | src/mpris-controller-v2.c | 6 | ||||
-rw-r--r-- | src/mpris-controller.c | 39 | ||||
-rw-r--r-- | src/music-player-bridge.c | 14 | ||||
-rw-r--r-- | src/music-player-bridge.h | 33 | ||||
-rw-r--r-- | src/play-button.c | 100 | ||||
-rw-r--r-- | src/player-controller.c | 171 | ||||
-rw-r--r-- | src/player-controller.vala | 75 | ||||
-rw-r--r-- | src/player-item.c | 71 | ||||
-rw-r--r-- | src/player-item.vala | 34 | ||||
-rw-r--r-- | src/scrub-menu-item.c | 20 | ||||
-rw-r--r-- | src/scrub-menu-item.vala | 1 | ||||
-rw-r--r-- | src/scrub-widget.c | 86 | ||||
-rw-r--r-- | src/sound-service-server.h | 2 | ||||
-rw-r--r-- | src/title-menu-item.c | 10 | ||||
-rw-r--r-- | src/transport-menu-item.c | 10 | ||||
-rw-r--r-- | src/transport-widget.c | 17 | ||||
-rw-r--r-- | tests/Makefile.in | 2 |
30 files changed, 714 insertions, 581 deletions
diff --git a/Makefile.in b/Makefile.in index 5c1809c..9d62c4a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -192,6 +192,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ @@ -648,7 +648,7 @@ IT_PO_SUBDIR([po]) AC_DEFUN([IT_PO_SUBDIR], [AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS. dnl -dnl The following CONFIG_COMMANDS should be exetuted at the very end +dnl The following CONFIG_COMMANDS should be executed at the very end dnl of config.status. AC_CONFIG_COMMANDS_PRE([ AC_CONFIG_COMMANDS([$1/stamp-it], [ @@ -8690,6 +8690,7 @@ AC_DEFUN([AM_NLS], ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant <scott@netsplit.com>. # @@ -8717,7 +8718,10 @@ AC_DEFUN([AM_NLS], AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi @@ -8730,7 +8734,6 @@ if test -n "$PKG_CONFIG"; then AC_MSG_RESULT([no]) PKG_CONFIG="" fi - fi[]dnl ])# PKG_PROG_PKG_CONFIG @@ -8739,34 +8742,31 @@ fi[]dnl # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) + m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) - # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried fi[]dnl ])# _PKG_CONFIG @@ -8808,16 +8808,17 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - ifelse([$4], , [AC_MSG_ERROR(dnl + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -8825,25 +8826,24 @@ $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) +_PKG_TEXT])dnl + ]) elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], - [$4]) +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl + ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) + $3 fi[]dnl ])# PKG_CHECK_MODULES diff --git a/config.guess b/config.guess index e3a2116..c2246a4 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-06-10' +timestamp='2009-12-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2009-06-10' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner <per@bothner.com>. -# Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to <config-patches@gnu.org> and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -333,6 +334,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" @@ -807,12 +811,12 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) + *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd | genuineintel) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -854,6 +858,20 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -876,6 +894,17 @@ EOF frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; @@ -901,39 +930,18 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -942,8 +950,11 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux @@ -966,58 +977,6 @@ EOF xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <features.h> - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1247,6 +1206,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-06-11' +timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2009-06-11' # Please send patches to <config-patches@gnu.org>. Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -72,8 +75,9 @@ Report bugs and patches to <config-patches@gnu.org>." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +153,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; @@ -284,6 +288,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -291,13 +296,14 @@ case $basic_machine in | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -340,7 +346,7 @@ case $basic_machine in | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -368,15 +374,17 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ + | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ @@ -726,6 +734,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -1076,6 +1087,11 @@ case $basic_machine in basic_machine=tic6x-unknown os=-coff ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; tile*) basic_machine=tile-unknown os=-linux-gnu @@ -1247,6 +1263,9 @@ case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1268,8 +1287,8 @@ case $os in # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -kopensolaris* \ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1290,7 +1309,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1423,6 +1442,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for indicator-sound 0.3.8. +# Generated by GNU Autoconf 2.65 for indicator-sound 0.3.9. # # Report bugs to <conor.curran@canonical.com>. # @@ -761,8 +761,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='indicator-sound' PACKAGE_TARNAME='indicator-sound' -PACKAGE_VERSION='0.3.8' -PACKAGE_STRING='indicator-sound 0.3.8' +PACKAGE_VERSION='0.3.9' +PACKAGE_STRING='indicator-sound 0.3.9' PACKAGE_BUGREPORT='conor.curran@canonical.com' PACKAGE_URL='' @@ -836,6 +836,8 @@ PULSEAUDIO_LIBS PULSEAUDIO_CFLAGS APPLET_LIBS APPLET_CFLAGS +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH PKG_CONFIG AM_BACKSLASH AM_DEFAULT_VERBOSITY @@ -1006,6 +1008,8 @@ LIBS CPPFLAGS CPP PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR APPLET_CFLAGS APPLET_LIBS PULSEAUDIO_CFLAGS @@ -1555,7 +1559,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures indicator-sound 0.3.8 to adapt to many kinds of systems. +\`configure' configures indicator-sound 0.3.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1625,7 +1629,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of indicator-sound 0.3.8:";; + short | recursive ) echo "Configuration of indicator-sound 0.3.9:";; esac cat <<\_ACEOF @@ -1671,6 +1675,10 @@ Some influential environment variables: you have headers in a nonstandard directory <include dir> CPP C preprocessor PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path APPLET_CFLAGS C compiler flags for APPLET, overriding pkg-config APPLET_LIBS linker flags for APPLET, overriding pkg-config @@ -1752,7 +1760,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -indicator-sound configure 0.3.8 +indicator-sound configure 0.3.9 generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. @@ -2123,7 +2131,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by indicator-sound $as_me 0.3.8, which was +It was created by indicator-sound $as_me 0.3.9, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -2936,7 +2944,7 @@ fi # Define the identity of the package. PACKAGE=indicator-sound - VERSION=0.3.8 + VERSION=0.3.9 cat >>confdefs.h <<_ACEOF @@ -4612,7 +4620,6 @@ if test -z "$VALAC"; then : as_fn_error "\"No valac compiler found.\"" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5 $as_echo_n "checking for library containing strerror... " >&6; } if test "${ac_cv_search_strerror+set}" = set; then : @@ -6392,13 +6399,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:6395: $ac_compile\"" >&5) + (eval echo "\"\$as_me:6402: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:6398: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:6405: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:6401: output\"" >&5) + (eval echo "\"\$as_me:6408: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7603,7 +7610,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7606 "configure"' > conftest.$ac_ext + echo '#line 7613 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8879,11 +8886,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8882: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8889: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8886: \$? = $ac_status" >&5 + echo "$as_me:8893: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9218,11 +9225,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9221: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9228: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:9225: \$? = $ac_status" >&5 + echo "$as_me:9232: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -9323,11 +9330,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9326: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9333: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9330: \$? = $ac_status" >&5 + echo "$as_me:9337: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9378,11 +9385,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:9381: $lt_compile\"" >&5) + (eval echo "\"\$as_me:9388: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:9385: \$? = $ac_status" >&5 + echo "$as_me:9392: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11762,7 +11769,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11765 "configure" +#line 11772 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11858,7 +11865,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11861 "configure" +#line 11868 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12117,6 +12124,10 @@ DBUSMENUGLIB_REQUIRED_VERSION=0.3.1 + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -12229,18 +12240,16 @@ $as_echo "yes" >&6; } $as_echo "no" >&6; } PKG_CONFIG="" fi - fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPLET" >&5 $as_echo_n "checking for APPLET... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$APPLET_CFLAGS"; then - pkg_cv_APPLET_CFLAGS="$APPLET_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$APPLET_CFLAGS"; then + pkg_cv_APPLET_CFLAGS="$APPLET_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED_VERSION indicator >= \$INDICATOR_REQUIRED_VERSION dbusmenu-gtk >= \$DBUSMENUGTK_REQUIRED_VERSION @@ -12259,15 +12268,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$APPLET_LIBS"; then - pkg_cv_APPLET_LIBS="$APPLET_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$APPLET_LIBS"; then + pkg_cv_APPLET_LIBS="$APPLET_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED_VERSION indicator >= \$INDICATOR_REQUIRED_VERSION dbusmenu-gtk >= \$DBUSMENUGTK_REQUIRED_VERSION @@ -12286,14 +12293,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12301,15 +12309,15 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - APPLET_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK_REQUIRED_VERSION + APPLET_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION - libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS"` + libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS" 2>&1` else - APPLET_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= $GTK_REQUIRED_VERSION + APPLET_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION - libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS"` + libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$APPLET_PKG_ERRORS" >&5 @@ -12326,9 +12334,10 @@ installed software in a non-standard prefix. Alternatively, you may set the environment variables APPLET_CFLAGS and APPLET_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "The pkg-config script could not be found or is too old. Make sure it @@ -12346,7 +12355,7 @@ else APPLET_LIBS=$pkg_cv_APPLET_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : + fi @@ -12358,11 +12367,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PULSEAUDIO" >&5 $as_echo_n "checking for PULSEAUDIO... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$PULSEAUDIO_CFLAGS"; then - pkg_cv_PULSEAUDIO_CFLAGS="$PULSEAUDIO_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$PULSEAUDIO_CFLAGS"; then + pkg_cv_PULSEAUDIO_CFLAGS="$PULSEAUDIO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-mainloop-glib >= \$PULSE_AUDIO_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION") 2>&5 ac_status=$? @@ -12372,15 +12380,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$PULSEAUDIO_LIBS"; then - pkg_cv_PULSEAUDIO_LIBS="$PULSEAUDIO_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$PULSEAUDIO_LIBS"; then + pkg_cv_PULSEAUDIO_LIBS="$PULSEAUDIO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libpulse-mainloop-glib >= \$PULSE_AUDIO_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION") 2>&5 ac_status=$? @@ -12390,14 +12396,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12405,9 +12412,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION"` + PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION" 2>&1` else - PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION"` + PULSEAUDIO_PKG_ERRORS=`$PKG_CONFIG --print-errors "libpulse-mainloop-glib >= $PULSE_AUDIO_REQUIRED_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PULSEAUDIO_PKG_ERRORS" >&5 @@ -12421,9 +12428,10 @@ installed software in a non-standard prefix. Alternatively, you may set the environment variables PULSEAUDIO_CFLAGS and PULSEAUDIO_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "The pkg-config script could not be found or is too old. Make sure it @@ -12441,7 +12449,7 @@ else PULSEAUDIO_LIBS=$pkg_cv_PULSEAUDIO_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : + fi @@ -12451,11 +12459,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOUNDSERVICE" >&5 $as_echo_n "checking for SOUNDSERVICE... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$SOUNDSERVICE_CFLAGS"; then - pkg_cv_SOUNDSERVICE_CFLAGS="$SOUNDSERVICE_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SOUNDSERVICE_CFLAGS"; then + pkg_cv_SOUNDSERVICE_CFLAGS="$SOUNDSERVICE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbusmenu-glib >= \$DBUSMENUGLIB_REQUIRED_VERSION indicator >= \$INDICATOR_REQUIRED_VERSION indicate >= \$INDICATE_REQUIRED_VERSION @@ -12474,15 +12481,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$SOUNDSERVICE_LIBS"; then - pkg_cv_SOUNDSERVICE_LIBS="$SOUNDSERVICE_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$SOUNDSERVICE_LIBS"; then + pkg_cv_SOUNDSERVICE_LIBS="$SOUNDSERVICE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dbusmenu-glib >= \$DBUSMENUGLIB_REQUIRED_VERSION indicator >= \$INDICATOR_REQUIRED_VERSION indicate >= \$INDICATE_REQUIRED_VERSION @@ -12501,14 +12506,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12516,15 +12522,15 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - SOUNDSERVICE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION + SOUNDSERVICE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION indicate >= $INDICATE_REQUIRED_VERSION - gee-1.0"` + gee-1.0" 2>&1` else - SOUNDSERVICE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION + SOUNDSERVICE_PKG_ERRORS=`$PKG_CONFIG --print-errors "dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION indicate >= $INDICATE_REQUIRED_VERSION - gee-1.0"` + gee-1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$SOUNDSERVICE_PKG_ERRORS" >&5 @@ -12541,9 +12547,10 @@ installed software in a non-standard prefix. Alternatively, you may set the environment variables SOUNDSERVICE_CFLAGS and SOUNDSERVICE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "The pkg-config script could not be found or is too old. Make sure it @@ -12561,7 +12568,7 @@ else SOUNDSERVICE_LIBS=$pkg_cv_SOUNDSERVICE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : + fi @@ -12664,11 +12671,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCONF" >&5 $as_echo_n "checking for GCONF... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$GCONF_CFLAGS"; then - pkg_cv_GCONF_CFLAGS="$GCONF_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$GCONF_CFLAGS"; then + pkg_cv_GCONF_CFLAGS="$GCONF_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gconf-2.0 >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gconf-2.0 >= 2.0") 2>&5 ac_status=$? @@ -12678,15 +12684,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$GCONF_LIBS"; then - pkg_cv_GCONF_LIBS="$GCONF_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$GCONF_LIBS"; then + pkg_cv_GCONF_LIBS="$GCONF_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gconf-2.0 >= 2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gconf-2.0 >= 2.0") 2>&5 ac_status=$? @@ -12696,14 +12700,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -12711,9 +12716,9 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GCONF_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "gconf-2.0 >= 2.0"` + GCONF_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gconf-2.0 >= 2.0" 2>&1` else - GCONF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gconf-2.0 >= 2.0"` + GCONF_PKG_ERRORS=`$PKG_CONFIG --print-errors "gconf-2.0 >= 2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GCONF_PKG_ERRORS" >&5 @@ -12727,9 +12732,10 @@ installed software in a non-standard prefix. Alternatively, you may set the environment variables GCONF_CFLAGS and GCONF_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "The pkg-config script could not be found or is too old. Make sure it @@ -12747,7 +12753,7 @@ else GCONF_LIBS=$pkg_cv_GCONF_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : + fi @@ -14069,7 +14075,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by indicator-sound $as_me 0.3.8, which was +This file was extended by indicator-sound $as_me 0.3.9, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14135,7 +14141,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -indicator-sound config.status 0.3.8 +indicator-sound config.status 0.3.9 configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 8dcaaea..75ebf6b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,10 @@ -AC_INIT(indicator-sound, 0.3.8, conor.curran@canonical.com) +AC_INIT(indicator-sound, 0.3.9, conor.curran@canonical.com) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-sound, 0.3.8) +AM_INIT_AUTOMAKE(indicator-sound, 0.3.9) AM_MAINTAINER_MODE @@ -12,7 +12,6 @@ IT_PROG_INTLTOOL([0.35.0]) AM_PROG_VALAC([0.7.8]) AS_IF([test -z "$VALAC"], [AC_MSG_ERROR(["No valac compiler found."])]) - AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_C_O diff --git a/data/Makefile.in b/data/Makefile.in index 3431a31..4d71c3e 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -161,6 +161,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ diff --git a/src/Makefile.in b/src/Makefile.in index b60a421..164eee4 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -229,6 +229,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ diff --git a/src/common-defs.h b/src/common-defs.h index 208c8cb..46ff520 100644 --- a/src/common-defs.h +++ b/src/common-defs.h @@ -19,26 +19,29 @@ with this program. If not, see <http://www.gnu.org/licenses/>. /* constants used for signals on the dbus. This file is shared between client and server implementation */ -#define SIGNAL_SINK_INPUT_WHILE_MUTED "SinkInputWhileMuted" -#define SIGNAL_SINK_VOLUME_UPDATE "SinkVolumeUpdate" -#define SIGNAL_SINK_MUTE_UPDATE "SinkMuteUpdate" -#define SIGNAL_SINK_AVAILABLE_UPDATE "SinkAvailableUpdate" +#define SIGNAL_SINK_INPUT_WHILE_MUTED "SinkInputWhileMuted" +#define SIGNAL_SINK_VOLUME_UPDATE "SinkVolumeUpdate" +#define SIGNAL_SINK_MUTE_UPDATE "SinkMuteUpdate" +#define SIGNAL_SINK_AVAILABLE_UPDATE "SinkAvailableUpdate" + +#define DBUSMENU_PROPERTY_EMPTY -1 /* DBUS Custom Items */ -#define DBUSMENU_SLIDER_MENUITEM_TYPE "x-canonical-ido-slider-item" -#define DBUSMENU_TRANSPORT_MENUITEM_TYPE "x-canonical-transport-bar" -#define DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE "x-canonical-transport-play-state" +#define DBUSMENU_SLIDER_MENUITEM_TYPE "x-canonical-ido-slider-type" + +#define DBUSMENU_TRANSPORT_MENUITEM_TYPE "x-canonical-sound-menu-player-transport-type" +#define DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE "x-canonical-sound-menu-player-transport-state" -#define DBUSMENU_METADATA_MENUITEM_TYPE "x-canonical-sound-menu-player-metadata-menu-item" +#define DBUSMENU_METADATA_MENUITEM_TYPE "x-canonical-sound-menu-player-metadata-type" #define DBUSMENU_METADATA_MENUITEM_ARTIST "x-canonical-sound-menu-player-metadata-artist" #define DBUSMENU_METADATA_MENUITEM_TITLE "x-canonical-sound-menu-player-metadata-title" #define DBUSMENU_METADATA_MENUITEM_ALBUM "x-canonical-sound-menu-player-metadata-album" #define DBUSMENU_METADATA_MENUITEM_ARTURL "x-canonical-sound-menu-player-metadata-arturl" -#define DBUSMENU_TITLE_MENUITEM_TYPE "x-canonical-sound-menu-player-title-menu-item" +#define DBUSMENU_TITLE_MENUITEM_TYPE "x-canonical-sound-menu-player-title-type" #define DBUSMENU_TITLE_MENUITEM_NAME "x-canonical-sound-menu-player-title-name" -#define DBUSMENU_SCRUB_MENUITEM_TYPE "x-canonical-sound-menu-player-scrub-menu-item" +#define DBUSMENU_SCRUB_MENUITEM_TYPE "x-canonical-sound-menu-player-scrub-type" #define DBUSMENU_SCRUB_MENUITEM_DURATION "x-canonical-sound-menu-player-scrub-time" #define DBUSMENU_SCRUB_MENUITEM_POSITION "x-canonical-sound-menu-player-scrub-position" #define DBUSMENU_SCRUB_MENUITEM_PLAY_STATE "x-canonical-sound-menu-player-scrub-play-state" diff --git a/src/familiar-players-db.c b/src/familiar-players-db.c index 059bf5a..c7bfda3 100644 --- a/src/familiar-players-db.c +++ b/src/familiar-players-db.c @@ -63,7 +63,7 @@ struct _FamiliarPlayersDBPrivate { static gpointer familiar_players_db_parent_class = NULL; -GType familiar_players_db_get_type (void); +GType familiar_players_db_get_type (void) G_GNUC_CONST; #define FAMILIAR_PLAYERS_DB_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_FAMILIAR_PLAYERS_DB, FamiliarPlayersDBPrivate)) enum { FAMILIAR_PLAYERS_DB_DUMMY_PROPERTY @@ -352,17 +352,17 @@ static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) { g_warning ("familiar-players-db.vala:114: 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); + desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL); + _g_key_file_free0 (keyfile); 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); + desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL); + _g_key_file_free0 (keyfile); 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; @@ -370,9 +370,9 @@ static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) { if (g_mkdir_with_parents (self->priv->dir_name, 0700) != 0) { g_warning ("familiar-players-db.vala:119: 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); + desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL); + _g_key_file_free0 (keyfile); return result; } { @@ -382,9 +382,9 @@ static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) { 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); + desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL); + _g_key_file_free0 (keyfile); 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; @@ -406,17 +406,17 @@ static gboolean familiar_players_db_write_db (FamiliarPlayersDB* self) { } __finally7: if (_inner_error_ != NULL) { - _g_key_file_free0 (keyfile); - desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL); _g_free0 (data); + desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL); + _g_key_file_free0 (keyfile); 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); + desktops = (_vala_array_free (desktops, desktops_length1, (GDestroyNotify) g_free), NULL); + _g_key_file_free0 (keyfile); return result; } diff --git a/src/metadata-menu-item.c b/src/metadata-menu-item.c index 792b638..aadaf2c 100644 --- a/src/metadata-menu-item.c +++ b/src/metadata-menu-item.c @@ -76,22 +76,24 @@ struct _MetadataMenuitemClass { static gpointer metadata_menuitem_parent_class = NULL; -GType player_item_get_type (void); -GType metadata_menuitem_get_type (void); +GType player_item_get_type (void) G_GNUC_CONST; +GType metadata_menuitem_get_type (void) G_GNUC_CONST; enum { METADATA_MENUITEM_DUMMY_PROPERTY }; +void player_item_reset (PlayerItem* self, GeeHashSet* attrs); +GeeHashSet* metadata_menuitem_attributes_format (void); MetadataMenuitem* metadata_menuitem_new (void); MetadataMenuitem* metadata_menuitem_construct (GType object_type); -GeeHashSet* metadata_menuitem_attributes_format (void); -gboolean metadata_menuitem_not_populated (MetadataMenuitem* self); -static int _vala_strcmp0 (const char * str1, const char * str2); MetadataMenuitem* metadata_menuitem_construct (GType object_type) { MetadataMenuitem * self; + GeeHashSet* _tmp0_; self = (MetadataMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_METADATA_MENUITEM_TYPE, NULL); + player_item_reset ((PlayerItem*) self, _tmp0_ = metadata_menuitem_attributes_format ()); + _g_object_unref0 (_tmp0_); return self; } @@ -114,20 +116,6 @@ GeeHashSet* metadata_menuitem_attributes_format (void) { } -gboolean metadata_menuitem_not_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_TITLE) == NULL) { - _tmp0_ = _vala_strcmp0 (dbusmenu_menuitem_property_get ((DbusmenuMenuitem*) self, DBUSMENU_METADATA_MENUITEM_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); } @@ -149,16 +137,5 @@ GType metadata_menuitem_get_type (void) { } -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/metadata-menu-item.vala b/src/metadata-menu-item.vala index 388ef81..3818b1c 100644 --- a/src/metadata-menu-item.vala +++ b/src/metadata-menu-item.vala @@ -26,6 +26,7 @@ public class MetadataMenuitem : PlayerItem public MetadataMenuitem() { Object(item_type: MENUITEM_TYPE); + reset(attributes_format()); } public static HashSet<string> attributes_format() @@ -37,11 +38,5 @@ public class MetadataMenuitem : PlayerItem attrs.add(MENUITEM_ARTURL); return attrs; } - - public bool not_populated() - { - return (this.property_get(MENUITEM_TITLE) == null && - this.property_get(MENUITEM_TITLE) == ""); - } }
\ No newline at end of file diff --git a/src/metadata-widget.c b/src/metadata-widget.c index dce9226..670d983 100644 --- a/src/metadata-widget.c +++ b/src/metadata-widget.c @@ -199,6 +199,16 @@ metadata_widget_property_update(DbusmenuMenuitem* item, gchar* property, { g_return_if_fail (IS_METADATA_WIDGET (userdata)); + if(g_value_get_int(value) == DBUSMENU_PROPERTY_EMPTY){ + g_debug("Metadata widget: property update - reset"); + gchar* empty = ""; + GValue new_value = {0}; + g_value_init(&new_value, G_TYPE_STRING); + g_value_set_string(&new_value, g_strdup("")); + //g_free(empty); + value = &new_value; + } + MetadataWidget* mitem = METADATA_WIDGET(userdata); MetadataWidgetPrivate * priv = METADATA_WIDGET_GET_PRIVATE(mitem); diff --git a/src/mpris-controller-v2.c b/src/mpris-controller-v2.c index 40fe3da..03665a5 100644 --- a/src/mpris-controller-v2.c +++ b/src/mpris-controller-v2.c @@ -80,12 +80,12 @@ struct _MprisControllerV2Class { static gpointer mpris_controller_v2_parent_class = NULL; -GType mpris_controller_get_type (void); -GType mpris_controller_v2_get_type (void); +GType mpris_controller_get_type (void) G_GNUC_CONST; +GType mpris_controller_v2_get_type (void) G_GNUC_CONST; enum { MPRIS_CONTROLLER_V2_DUMMY_PROPERTY }; -GType player_controller_get_type (void); +GType player_controller_get_type (void) G_GNUC_CONST; MprisControllerV2* mpris_controller_v2_new (PlayerController* ctrl, const char* inter); MprisControllerV2* mpris_controller_v2_construct (GType object_type, PlayerController* ctrl, const char* inter); diff --git a/src/mpris-controller.c b/src/mpris-controller.c index 4131b5f..14a462b 100644 --- a/src/mpris-controller.c +++ b/src/mpris-controller.c @@ -140,7 +140,8 @@ typedef enum { PLAYER_CONTROLLER_WIDGET_ORDER_TITLE, PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB, - PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT + PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, + PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLIST } PlayerControllerwidget_order; typedef enum { @@ -152,8 +153,8 @@ typedef enum { static gpointer mpris_controller_parent_class = NULL; -GType mpris_controller_get_type (void); -GType player_controller_get_type (void); +GType mpris_controller_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; #define MPRIS_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MPRIS_CONTROLLER, MprisControllerPrivate)) enum { MPRIS_CONTROLLER_DUMMY_PROPERTY, @@ -164,25 +165,25 @@ enum { MprisController* mpris_controller_new (PlayerController* ctrl, const char* inter); MprisController* mpris_controller_construct (GType object_type, PlayerController* ctrl, const char* inter); DBusGProxy* mpris_controller_get_mpris_player (MprisController* self); -static GType mpris_controller_status_get_type (void) G_GNUC_UNUSED; +static GType mpris_controller_status_get_type (void) G_GNUC_CONST 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); PlayerController* mpris_controller_get_owner (MprisController* self); -GType player_item_get_type (void); -GType player_controller_widget_order_get_type (void); -GType transport_menuitem_get_type (void); +GType player_item_get_type (void) G_GNUC_CONST; +GType player_controller_widget_order_get_type (void) G_GNUC_CONST; +GType transport_menuitem_get_type (void) G_GNUC_CONST; void transport_menuitem_change_play_state (TransportMenuitem* self, gint state); static GHashTable* _dynamic_GetMetadata1 (DBusGProxy* self, GError** error); void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attributes); GeeHashSet* metadata_menuitem_attributes_format (void); static GHashTable* _dynamic_GetMetadata2 (DBusGProxy* self, GError** error); GeeHashSet* scrub_menuitem_attributes_format (void); -GType scrub_menuitem_get_type (void); +GType scrub_menuitem_get_type (void) G_GNUC_CONST; static gint32 _dynamic_PositionGet3 (DBusGProxy* self, GError** error); void scrub_menuitem_update_position (ScrubMenuitem* self, gint32 new_position); static void mpris_controller_initial_update (MprisController* self); -GType transport_menuitem_action_get_type (void); +GType transport_menuitem_action_get_type (void) G_GNUC_CONST; static void _dynamic_Pause4 (DBusGProxy* self, GError** error); static void _dynamic_Prev5 (DBusGProxy* self, GError** error); static void _dynamic_Next6 (DBusGProxy* self, GError** error); @@ -455,8 +456,8 @@ void mpris_controller_set_position (MprisController* self, double position) { if (time_value == NULL) { g_warning ("mpris-controller.vala:92: Can't fetch the duration of the track theref" \ "ore cant set the position"); - _g_hash_table_unref0 (data); _g_free0 (time_value); + _g_hash_table_unref0 (data); return; } total_time = (guint32) g_value_get_uint (time_value); @@ -465,8 +466,8 @@ void mpris_controller_set_position (MprisController* self, double position) { g_debug ("mpris-controller.vala:98: new position = %f", new_time_position * 1000); _dynamic_PositionSet8 (self->priv->_mpris_player, (gint32) new_time_position, &_inner_error_); if (_inner_error_ != NULL) { - _g_hash_table_unref0 (data); _g_free0 (time_value); + _g_hash_table_unref0 (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; @@ -474,17 +475,17 @@ void mpris_controller_set_position (MprisController* self, double position) { scrub = (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB), IS_SCRUB_MENUITEM (_tmp0_) ? ((ScrubMenuitem*) _tmp0_) : NULL); _tmp1_ = _dynamic_PositionGet9 (self->priv->_mpris_player, &_inner_error_); if (_inner_error_ != NULL) { - _g_hash_table_unref0 (data); - _g_free0 (time_value); _g_object_unref0 (scrub); + _g_free0 (time_value); + _g_hash_table_unref0 (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; } scrub_menuitem_update_position (scrub, _tmp1_); - _g_hash_table_unref0 (data); - _g_free0 (time_value); _g_object_unref0 (scrub); + _g_free0 (time_value); + _g_hash_table_unref0 (data); } @@ -513,7 +514,7 @@ static void mpris_controller_onStatusChange (MprisController* self, DBusGProxy* 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); + ht = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); 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)); @@ -523,8 +524,8 @@ static void mpris_controller_onStatusChange (MprisController* self, DBusGProxy* player_item_update (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->priv->_owner->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB), ht, _tmp3_ = scrub_menuitem_attributes_format ()); _g_object_unref0 (_tmp3_); _g_object_unref0 (_tmp2_); - _g_hash_table_unref0 (ht); G_IS_VALUE (&v) ? (g_value_unset (&v), NULL) : NULL; + _g_hash_table_unref0 (ht); } @@ -663,7 +664,7 @@ static void _mpris_controller_onTrackChange_dynamic_TrackChange0_ (DBusGProxy* _ 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); + dbus_g_proxy_connect_signal (obj, "TrackChange", handler, data, NULL); } @@ -675,7 +676,7 @@ static void _mpris_controller_onStatusChange_dynamic_StatusChange2_ (DBusGProxy* 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_INT, G_TYPE_INT, 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_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INVALID), G_TYPE_INVALID); - dbus_g_proxy_connect_signal (obj, signal_name, handler, data, NULL); + dbus_g_proxy_connect_signal (obj, "StatusChange", handler, data, NULL); } diff --git a/src/music-player-bridge.c b/src/music-player-bridge.c index aa4e5dd..6579e17 100644 --- a/src/music-player-bridge.c +++ b/src/music-player-bridge.c @@ -100,9 +100,9 @@ typedef enum { 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); +GType music_player_bridge_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; +GType familiar_players_db_get_type (void) G_GNUC_CONST; #define MUSIC_PLAYER_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_MUSIC_PLAYER_BRIDGE, MusicPlayerBridgePrivate)) enum { MUSIC_PLAYER_BRIDGE_DUMMY_PROPERTY @@ -125,11 +125,11 @@ 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); +GType player_controller_state_get_type (void) G_GNUC_CONST; 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); -#define PLAYER_CONTROLLER_WIDGET_QUANTITY 5 +#define PLAYER_CONTROLLER_WIDGET_QUANTITY 6 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); @@ -266,9 +266,9 @@ static void music_player_bridge_try_to_add_inactive_familiar_clients (MusicPlaye _g_free0 (_tmp6_); _g_free0 (_tmp5_); count = count + 1; - _g_object_unref0 (info); - _g_object_unref0 (app_info); _g_object_unref0 (ctrl); + _g_object_unref0 (app_info); + _g_object_unref0 (info); } _g_free0 (app); break; diff --git a/src/music-player-bridge.h b/src/music-player-bridge.h index 03c8831..6f08b8e 100644 --- a/src/music-player-bridge.h +++ b/src/music-player-bridge.h @@ -220,7 +220,8 @@ typedef enum { PLAYER_CONTROLLER_WIDGET_ORDER_TITLE, PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB, - PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT + PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, + PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLIST } PlayerControllerwidget_order; typedef enum { @@ -259,7 +260,7 @@ struct _FamiliarPlayersDBClass { }; -GType music_player_bridge_get_type (void); +GType music_player_bridge_get_type (void) G_GNUC_CONST; 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); @@ -270,32 +271,31 @@ void music_player_bridge_on_indicator_added (MusicPlayerBridge* self, IndicateLi 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); +GType player_item_get_type (void) G_GNUC_CONST; +GType transport_menuitem_get_type (void) G_GNUC_CONST; +GType transport_menuitem_action_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; 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); +GType metadata_menuitem_get_type (void) G_GNUC_CONST; MetadataMenuitem* metadata_menuitem_new (void); MetadataMenuitem* metadata_menuitem_construct (GType object_type); GeeHashSet* metadata_menuitem_attributes_format (void); -gboolean metadata_menuitem_not_populated (MetadataMenuitem* self); -GType scrub_menuitem_get_type (void); +GType scrub_menuitem_get_type (void) G_GNUC_CONST; ScrubMenuitem* scrub_menuitem_new (PlayerController* parent); ScrubMenuitem* scrub_menuitem_construct (GType object_type, PlayerController* parent); void scrub_menuitem_update_position (ScrubMenuitem* self, gint32 new_position); GeeHashSet* scrub_menuitem_attributes_format (void); -GType title_menuitem_get_type (void); +GType title_menuitem_get_type (void) G_GNUC_CONST; 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_widget_order_get_type (void); -GType player_controller_state_get_type (void); -#define PLAYER_CONTROLLER_WIDGET_QUANTITY 5 +GType mpris_controller_get_type (void) G_GNUC_CONST; +GType player_controller_widget_order_get_type (void) G_GNUC_CONST; +GType player_controller_state_get_type (void) G_GNUC_CONST; +#define PLAYER_CONTROLLER_WIDGET_QUANTITY 6 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); @@ -309,7 +309,7 @@ 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); +GType mpris_controller_v2_get_type (void) G_GNUC_CONST; 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); @@ -324,9 +324,10 @@ 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); +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs); PlayerController* player_item_get_owner (PlayerItem* self); const char* player_item_get_item_type (PlayerItem* self); -GType familiar_players_db_get_type (void); +GType familiar_players_db_get_type (void) G_GNUC_CONST; FamiliarPlayersDB* familiar_players_db_new (void); FamiliarPlayersDB* familiar_players_db_construct (GType object_type); void familiar_players_db_insert (FamiliarPlayersDB* self, const char* desktop); diff --git a/src/play-button.c b/src/play-button.c index 1aeff12..e4382c1 100644 --- a/src/play-button.c +++ b/src/play-button.c @@ -28,12 +28,12 @@ Uses code from ctk #include "play-button.h" #define RECT_WIDTH 130.0f -#define Y 15.0f +#define Y 5.0f #define X 37.0f #define INNER_RADIUS 12.5 #define MIDDLE_RADIUS 13.5f #define OUTER_RADIUS 14.5f -#define CIRCLE_RADIUS 19.0f +#define CIRCLE_RADIUS 21.0f #define PREV_WIDTH 25.0f #define PREV_HEIGHT 17.0f #define NEXT_WIDTH 25.0f //PREV_WIDTH @@ -42,16 +42,16 @@ Uses code from ctk #define TRI_HEIGHT 13.0f #define TRI_OFFSET 6.0f #define PREV_X 35.0f -#define PREV_Y 21.0f +#define PREV_Y 11.0f #define NEXT_X 113.0f -#define NEXT_Y 21.0f //prev_y +#define NEXT_Y 11.0f //prev_y #define PAUSE_WIDTH 21.0f #define PAUSE_HEIGHT 27.0f #define BAR_WIDTH 4.5f #define BAR_HEIGHT 24.0f #define BAR_OFFSET 10.0f -#define PAUSE_X 77.0f -#define PAUSE_Y 15.0f +#define PAUSE_X 78.0f +#define PAUSE_Y 5.0f #define PLAY_WIDTH 28.0f #define PLAY_HEIGHT 29.0f #define PLAY_PADDING 5.0f @@ -85,16 +85,6 @@ G_DEFINE_TYPE (PlayButton, play_button, GTK_TYPE_DRAWING_AREA); /// internal helper functions ////////////////////////////////////////////////// -/*static double -_align (double val) -{ - double fract = val - (int) val; - - if (fract != 0.5f) - return (double) ((int) val + 0.5f); - else - return val; -}*/ static inline void _blurinner (guchar* pixel, @@ -331,7 +321,7 @@ play_button_init (PlayButton *self) (GDestroyNotify)g_list_free); GList* previous_list = NULL; previous_list = g_list_insert(previous_list, GINT_TO_POINTER(15), 0); - previous_list = g_list_insert(previous_list, GINT_TO_POINTER(10), 1); + previous_list = g_list_insert(previous_list, GINT_TO_POINTER(5), 1); previous_list = g_list_insert(previous_list, GINT_TO_POINTER(60), 2); previous_list = g_list_insert(previous_list, GINT_TO_POINTER(34), 3); @@ -340,10 +330,10 @@ play_button_init (PlayButton *self) previous_list); GList* play_list = NULL; - play_list = g_list_insert(play_list, GINT_TO_POINTER(60), 0); - play_list = g_list_insert(play_list, GINT_TO_POINTER(10), 1); - play_list = g_list_insert(play_list, GINT_TO_POINTER(45), 2); - play_list = g_list_insert(play_list, GINT_TO_POINTER(40), 3); + play_list = g_list_insert(play_list, GINT_TO_POINTER(58), 0); + play_list = g_list_insert(play_list, GINT_TO_POINTER(0), 1); + play_list = g_list_insert(play_list, GINT_TO_POINTER(50), 2); + play_list = g_list_insert(play_list, GINT_TO_POINTER(43), 3); g_hash_table_insert(priv->command_coordinates, GINT_TO_POINTER(TRANSPORT_PLAY_PAUSE), @@ -351,7 +341,7 @@ play_button_init (PlayButton *self) GList* next_list = NULL; next_list = g_list_insert(next_list, GINT_TO_POINTER(100), 0); - next_list = g_list_insert(next_list, GINT_TO_POINTER(10), 1); + next_list = g_list_insert(next_list, GINT_TO_POINTER(5), 1); next_list = g_list_insert(next_list, GINT_TO_POINTER(60), 2); next_list = g_list_insert(next_list, GINT_TO_POINTER(34), 3); @@ -359,7 +349,7 @@ play_button_init (PlayButton *self) GINT_TO_POINTER(TRANSPORT_NEXT), next_list); - gtk_widget_set_size_request(GTK_WIDGET(self), 200, 80); + gtk_widget_set_size_request(GTK_WIDGET(self), 200, 50); } static void @@ -399,15 +389,15 @@ determine_button_event(GtkWidget* button, GdkEventButton* event) PlayButtonEvent button_event = TRANSPORT_NADA; // For now very simple rectangular collision detection if(event->x > 55 && event->x < 95 - && event->y > 22 && event->y < 46){ + && event->y > 12 && event->y < 40){ button_event = TRANSPORT_PREVIOUS; } - else if(event->x > 101 && event->x < 133 - && event->y > 20 && event->y < 47){ + else if(event->x > 99 && event->x < 136 + && event->y > 5 && event->y < 47){ button_event = TRANSPORT_PLAY_PAUSE; } else if(event->x > 137 && event->x < 179 - && event->y > 22 && event->y < 46){ + && event->y > 12 && event->y < 40){ button_event = TRANSPORT_NEXT; } return button_event; @@ -464,8 +454,29 @@ void play_button_toggle_play_pause(GtkWidget* button, PlayButtonState update) { PlayButtonPrivate* priv = PLAY_BUTTON_GET_PRIVATE(button); + gboolean changed = priv->current_state != update; priv->current_state = update; g_debug("PlayButton::toggle play state : %i", priv->current_state); + + if(changed == TRUE){ + g_debug("Toggle play pause - changed of state detected - redraw button"); + cairo_t *cr; + + cr = gdk_cairo_create (button->window); + + GList* list = g_hash_table_lookup(priv->command_coordinates, + GINT_TO_POINTER(TRANSPORT_PLAY_PAUSE)); + + cairo_rectangle(cr, + GPOINTER_TO_INT(g_list_nth_data(list, 0)), + GPOINTER_TO_INT(g_list_nth_data(list, 1)), + GPOINTER_TO_INT(g_list_nth_data(list, 2)), + GPOINTER_TO_INT(g_list_nth_data(list, 3))); + + cairo_clip(cr); + draw (button, cr); + cairo_destroy (cr); + } } @@ -785,33 +796,34 @@ draw (GtkWidget* button, cairo_t *cr) // play/pause-background draw_circle (cr, - X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 4.5f, + X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f, Y - ((CIRCLE_RADIUS - OUTER_RADIUS)), CIRCLE_RADIUS, OUTER_START, OUTER_END); draw_circle (cr, - X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 4.5f + 1.0f, - Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.0f, - CIRCLE_RADIUS - 1, + X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 0.5f, + Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 0.5f, + CIRCLE_RADIUS - 0.75f, MIDDLE_START, MIDDLE_END); - draw_circle (cr, - X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 4.5f + 2.0f, - Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 2.0f, - CIRCLE_RADIUS - 2.0f, - INNER_START, - INNER_END); + if(priv->current_command == TRANSPORT_PLAY_PAUSE){ draw_circle (cr, - X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 4.5f + 2.0f, - Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 2.0f, - CIRCLE_RADIUS - 2.0f, + X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 1.5f, + Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.5f, + CIRCLE_RADIUS - 1.5f, INNER_COMPRESSED_START, INNER_COMPRESSED_END); } - - + else{ + draw_circle (cr, + X + RECT_WIDTH / 2.0f - 2.0f * OUTER_RADIUS - 5.5f + 1.5f, + Y - ((CIRCLE_RADIUS - OUTER_RADIUS)) + 1.5f, + CIRCLE_RADIUS - 1.5f, + INNER_START, + INNER_END); + } // draw previous-button drop-shadow _setup (&cr_surf, &surf, PREV_WIDTH, PREV_HEIGHT); _mask_prev (cr_surf, @@ -940,7 +952,7 @@ draw (GtkWidget* button, cairo_t *cr) BUTTON_SHADOW, FALSE); _surface_blur (surf, 1); - _finalize (cr, &cr_surf, &surf, PAUSE_X, PAUSE_Y + 1.0f); + _finalize (cr, &cr_surf, &surf, PAUSE_X-0.75f, PAUSE_Y + 1.0f); // draw play-button _setup (&cr_surf, &surf, PLAY_WIDTH, PLAY_HEIGHT); cairo_set_line_width (cr, 10.5); @@ -959,7 +971,7 @@ draw (GtkWidget* button, cairo_t *cr) BUTTON_START, BUTTON_END, FALSE); - _finalize (cr, &cr_surf, &surf, PAUSE_X, PAUSE_Y); + _finalize (cr, &cr_surf, &surf, PAUSE_X-0.5f, PAUSE_Y); } } diff --git a/src/player-controller.c b/src/player-controller.c index acb2da2..55b097f 100644 --- a/src/player-controller.c +++ b/src/player-controller.c @@ -71,16 +71,6 @@ typedef struct _MprisControllerClass MprisControllerClass; #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_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_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)) @@ -91,6 +81,16 @@ typedef struct _MetadataMenuitemClass MetadataMenuitemClass; 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_SCRUB_MENUITEM (scrub_menuitem_get_type ()) #define SCRUB_MENUITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_SCRUB_MENUITEM, ScrubMenuitem)) #define SCRUB_MENUITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_SCRUB_MENUITEM, ScrubMenuitemClass)) @@ -135,7 +135,8 @@ typedef enum { PLAYER_CONTROLLER_WIDGET_ORDER_TITLE, PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB, - PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT + PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, + PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLIST } PlayerControllerwidget_order; typedef enum { @@ -149,9 +150,9 @@ typedef enum { 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); +GType player_controller_get_type (void) G_GNUC_CONST; +GType player_item_get_type (void) G_GNUC_CONST; +GType mpris_controller_get_type (void) G_GNUC_CONST; #define PLAYER_CONTROLLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TYPE_PLAYER_CONTROLLER, PlayerControllerPrivate)) enum { PLAYER_CONTROLLER_DUMMY_PROPERTY, @@ -159,12 +160,11 @@ enum { PLAYER_CONTROLLER_APP_INFO, PLAYER_CONTROLLER_MENU_OFFSET }; -GType player_controller_widget_order_get_type (void); -GType player_controller_state_get_type (void); -#define PLAYER_CONTROLLER_WIDGET_QUANTITY 5 +GType player_controller_widget_order_get_type (void) G_GNUC_CONST; +GType player_controller_state_get_type (void) G_GNUC_CONST; +#define PLAYER_CONTROLLER_WIDGET_QUANTITY 6 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); @@ -172,6 +172,7 @@ 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_update_state (PlayerController* self, PlayerControllerstate new_state); void player_controller_activate (PlayerController* self); GAppInfo* player_controller_get_app_info (PlayerController* self); void player_controller_instantiate (PlayerController* self); @@ -179,20 +180,24 @@ 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); -GType metadata_menuitem_get_type (void); +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs); +GeeHashSet* metadata_menuitem_attributes_format (void); +GeeHashSet* scrub_menuitem_attributes_format (void); 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); +GType title_menuitem_get_type (void) G_GNUC_CONST; MetadataMenuitem* metadata_menuitem_new (void); MetadataMenuitem* metadata_menuitem_construct (GType object_type); +GType metadata_menuitem_get_type (void) G_GNUC_CONST; ScrubMenuitem* scrub_menuitem_new (PlayerController* parent); ScrubMenuitem* scrub_menuitem_construct (GType object_type, PlayerController* parent); -GType scrub_menuitem_get_type (void); +GType scrub_menuitem_get_type (void) G_GNUC_CONST; TransportMenuitem* transport_menuitem_new (PlayerController* parent); TransportMenuitem* transport_menuitem_construct (GType object_type, PlayerController* parent); -GType transport_menuitem_get_type (void); +GType transport_menuitem_get_type (void) G_GNUC_CONST; +static PlayerItem* player_controller_create_playlist (PlayerController* self); 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); @@ -205,7 +210,7 @@ static int _vala_strcmp0 (const char * str1, const char * str2); GType player_controller_widget_order_get_type (void) { static volatile gsize player_controller_widget_order_type_id__volatile = 0; if (g_once_init_enter (&player_controller_widget_order_type_id__volatile)) { - static const GEnumValue values[] = {{PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR, "PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR", "separator"}, {PLAYER_CONTROLLER_WIDGET_ORDER_TITLE, "PLAYER_CONTROLLER_WIDGET_ORDER_TITLE", "title"}, {PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, "PLAYER_CONTROLLER_WIDGET_ORDER_METADATA", "metadata"}, {PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB, "PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB", "scrub"}, {PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, "PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT", "transport"}, {0, NULL, NULL}}; + static const GEnumValue values[] = {{PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR, "PLAYER_CONTROLLER_WIDGET_ORDER_SEPARATOR", "separator"}, {PLAYER_CONTROLLER_WIDGET_ORDER_TITLE, "PLAYER_CONTROLLER_WIDGET_ORDER_TITLE", "title"}, {PLAYER_CONTROLLER_WIDGET_ORDER_METADATA, "PLAYER_CONTROLLER_WIDGET_ORDER_METADATA", "metadata"}, {PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB, "PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB", "scrub"}, {PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT, "PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT", "transport"}, {PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLIST, "PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLIST", "playlist"}, {0, NULL, NULL}}; GType player_controller_widget_order_type_id; player_controller_widget_order_type_id = g_enum_register_static ("PlayerControllerwidget_order", values); g_once_init_leave (&player_controller_widget_order_type_id__volatile, player_controller_widget_order_type_id); @@ -256,7 +261,7 @@ PlayerController* player_controller_construct (GType object_type, DbusmenuMenuit _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); + self->current_state = (gint) initial_state; player_controller_set_menu_offset (self, offset); player_controller_construct_widgets (self); player_controller_establish_mpris_connection (self); @@ -272,9 +277,10 @@ PlayerController* player_controller_new (DbusmenuMenuitem* root, const char* cli void player_controller_update_state (PlayerController* self, PlayerControllerstate new_state) { g_return_if_fail (self != NULL); - g_debug ("player-controller.vala:68: update_state - player controller %s : new s" \ + g_debug ("player-controller.vala:69: update_state - player controller %s : new s" \ "tate %i", self->priv->_name, (gint) new_state); self->current_state = (gint) new_state; + player_controller_update_layout (self); } @@ -291,7 +297,7 @@ void player_controller_instantiate (PlayerController* self) { GError * _inner_error_; g_return_if_fail (self != NULL); _inner_error_ = NULL; - g_debug ("player-controller.vala:87: instantiate in player controller for %s", self->priv->_name); + g_debug ("player-controller.vala:88: 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) { @@ -306,7 +312,7 @@ void player_controller_instantiate (PlayerController* self) { _error_ = _inner_error_; _inner_error_ = NULL; { - g_warning ("player-controller.vala:93: Failed to launch app %s with error message:" \ + g_warning ("player-controller.vala:94: Failed to launch app %s with error message:" \ " %s", self->priv->_name, _error_->message); _g_error_free0 (_error_); } @@ -323,25 +329,24 @@ void player_controller_instantiate (PlayerController* self) { 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:100: establish_mpris_connection - Not ready to " \ + g_debug ("player-controller.vala:101: establish_mpris_connection - Not ready to " \ "connect"); return; } if (_vala_strcmp0 (self->priv->_name, "Vlc") == 0) { MprisController* _tmp0_; - g_debug ("player-controller.vala:105: establishing a vlc mpris controller"); + g_debug ("player-controller.vala:106: 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:113: yup I'm connected"); + g_debug ("player-controller.vala:114: 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); } @@ -377,33 +382,56 @@ static char* bool_to_string (gboolean self) { void player_controller_update_layout (PlayerController* self) { - gboolean visibility; - PlayerItem* _tmp0_; - MetadataMenuitem* meta_item; - char* _tmp1_; - PlayerItem* _tmp2_; - PlayerItem* _tmp3_; + char* _tmp6_; + GeeHashSet* _tmp5_; PlayerItem* _tmp4_; + GeeHashSet* _tmp9_; + PlayerItem* _tmp8_; + PlayerItem* _tmp7_; + char* _tmp12_; + GeeHashSet* _tmp11_; + PlayerItem* _tmp10_; + GeeHashSet* _tmp15_; + PlayerItem* _tmp14_; + PlayerItem* _tmp13_; + PlayerItem* _tmp16_; + PlayerItem* _tmp17_; g_return_if_fail (self != NULL); - visibility = TRUE; - meta_item = (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA), IS_METADATA_MENUITEM (_tmp0_) ? ((MetadataMenuitem*) _tmp0_) : NULL); if (self->current_state != PLAYER_CONTROLLER_STATE_CONNECTED) { - visibility = FALSE; + PlayerItem* _tmp0_; + PlayerItem* _tmp1_; + PlayerItem* _tmp2_; + PlayerItem* _tmp3_; + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp0_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT)), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + _g_object_unref0 (_tmp0_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp1_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB)), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + _g_object_unref0 (_tmp1_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA)), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + _g_object_unref0 (_tmp2_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp3_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLIST)), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); + _g_object_unref0 (_tmp3_); + return; } - g_debug ("player-controller.vala:137: about the set the visibility on both the t" \ -"ransport and metadata widget to %s", _tmp1_ = bool_to_string (visibility)); - _g_free0 (_tmp1_); - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp2_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT)), DBUSMENU_MENUITEM_PROP_VISIBLE, visibility); - _g_object_unref0 (_tmp2_); - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp3_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB)), DBUSMENU_MENUITEM_PROP_VISIBLE, visibility); - _g_object_unref0 (_tmp3_); - dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp4_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA)), DBUSMENU_MENUITEM_PROP_VISIBLE, visibility); + g_debug ("player-controller.vala:143: update layout - metadata %s", _tmp6_ = bool_to_string (player_item_populated (_tmp4_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA), _tmp5_ = metadata_menuitem_attributes_format ()))); + _g_free0 (_tmp6_); + _g_object_unref0 (_tmp5_); _g_object_unref0 (_tmp4_); - if (visibility == FALSE) { - g_warning ("player-controller.vala:143: Update layout of client %s is setting widg" \ -"ets to invisibile!", self->priv->_name); - } - _g_object_unref0 (meta_item); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp7_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA)), DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (_tmp8_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_METADATA), _tmp9_ = metadata_menuitem_attributes_format ())); + _g_object_unref0 (_tmp9_); + _g_object_unref0 (_tmp8_); + _g_object_unref0 (_tmp7_); + g_debug ("player-controller.vala:146: update layout - scrub %s", _tmp12_ = bool_to_string (player_item_populated (_tmp10_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB), _tmp11_ = scrub_menuitem_attributes_format ()))); + _g_free0 (_tmp12_); + _g_object_unref0 (_tmp11_); + _g_object_unref0 (_tmp10_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp13_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB)), DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (_tmp14_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_SCRUB), _tmp15_ = scrub_menuitem_attributes_format ())); + _g_object_unref0 (_tmp15_); + _g_object_unref0 (_tmp14_); + _g_object_unref0 (_tmp13_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp16_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_TRANSPORT)), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + _g_object_unref0 (_tmp16_); + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) (_tmp17_ = (PlayerItem*) gee_abstract_list_get ((GeeAbstractList*) self->custom_items, (gint) PLAYER_CONTROLLER_WIDGET_ORDER_PLAYLIST)), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + _g_object_unref0 (_tmp17_); } @@ -413,6 +441,7 @@ static void player_controller_construct_widgets (PlayerController* self) { MetadataMenuitem* metadata_item; ScrubMenuitem* scrub_item; TransportMenuitem* transport_item; + PlayerItem* _tmp1_; 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_); @@ -424,6 +453,8 @@ static void player_controller_construct_widgets (PlayerController* self) { gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) scrub_item); transport_item = transport_menuitem_new (self); gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, (PlayerItem*) transport_item); + gee_abstract_collection_add ((GeeAbstractCollection*) self->custom_items, _tmp1_ = player_controller_create_playlist (self)); + _g_object_unref0 (_tmp1_); { GeeIterator* _item_it; _item_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) self->custom_items); @@ -438,10 +469,36 @@ static void player_controller_construct_widgets (PlayerController* self) { } _g_object_unref0 (_item_it); } - _g_object_unref0 (title_menu_item); - _g_object_unref0 (metadata_item); - _g_object_unref0 (scrub_item); _g_object_unref0 (transport_item); + _g_object_unref0 (scrub_item); + _g_object_unref0 (metadata_item); + _g_object_unref0 (title_menu_item); +} + + +static PlayerItem* player_controller_create_playlist (PlayerController* self) { + PlayerItem* result = NULL; + PlayerItem* playlist_root; + PlayerItem* subentry_1; + PlayerItem* subentry_2; + PlayerItem* subentry_3; + g_return_val_if_fail (self != NULL, NULL); + playlist_root = player_item_new (DBUSMENU_CLIENT_TYPES_DEFAULT); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) playlist_root, DBUSMENU_MENUITEM_PROP_LABEL, "Choose Playlist"); + subentry_1 = player_item_new (DBUSMENU_CLIENT_TYPES_DEFAULT); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) subentry_1, DBUSMENU_MENUITEM_PROP_LABEL, "Raster-noton selection"); + subentry_2 = player_item_new (DBUSMENU_CLIENT_TYPES_DEFAULT); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) subentry_2, DBUSMENU_MENUITEM_PROP_LABEL, "Rune Grammofon selection"); + subentry_3 = player_item_new (DBUSMENU_CLIENT_TYPES_DEFAULT); + dbusmenu_menuitem_property_set ((DbusmenuMenuitem*) subentry_3, DBUSMENU_MENUITEM_PROP_LABEL, "Kranky selection"); + dbusmenu_menuitem_child_append ((DbusmenuMenuitem*) playlist_root, (DbusmenuMenuitem*) subentry_1); + dbusmenu_menuitem_child_append ((DbusmenuMenuitem*) playlist_root, (DbusmenuMenuitem*) subentry_2); + dbusmenu_menuitem_child_append ((DbusmenuMenuitem*) playlist_root, (DbusmenuMenuitem*) subentry_3); + result = playlist_root; + _g_object_unref0 (subentry_3); + _g_object_unref0 (subentry_2); + _g_object_unref0 (subentry_1); + return result; } @@ -490,7 +547,7 @@ static char* player_controller_format_client_name (const char* client_name) { 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:179: PlayerController->format_client_name - : %" \ + g_debug ("player-controller.vala:212: PlayerController->format_client_name - : %" \ "s", formatted); } result = formatted; diff --git a/src/player-controller.vala b/src/player-controller.vala index f824d6f..fc5ca9b 100644 --- a/src/player-controller.vala +++ b/src/player-controller.vala @@ -23,14 +23,15 @@ using Gee; public class PlayerController : GLib.Object { - public const int WIDGET_QUANTITY = 5; + public const int WIDGET_QUANTITY = 6; public static enum widget_order{ SEPARATOR, TITLE, METADATA, SCRUB, - TRANSPORT + TRANSPORT, + PLAYLIST } public enum state{ @@ -56,7 +57,7 @@ public class PlayerController : GLib.Object this.root_menu = root; this.name = format_client_name(client_name.strip()); this.custom_items = new ArrayList<PlayerItem>(); - this.update_state(initial_state); + this.current_state = initial_state; this.menu_offset = offset; construct_widgets(); establish_mpris_connection(); @@ -67,7 +68,7 @@ public class PlayerController : GLib.Object { debug("update_state - player controller %s : new state %i", this.name, new_state); this.current_state = new_state; - //this.update_layout(); + this.update_layout(); } public void activate() @@ -108,7 +109,7 @@ public class PlayerController : GLib.Object else{ this.mpris_adaptor = new MprisController(this); } - + // TODO refactor if(this.mpris_adaptor.connected() == true){ debug("yup I'm connected"); this.update_state(state.CONNECTED); @@ -116,7 +117,6 @@ public class PlayerController : GLib.Object else{ this.update_state(state.DISCONNECTED); } - this.update_layout(); } public void vanish() @@ -127,21 +127,32 @@ public class PlayerController : GLib.Object } public void update_layout() - { - bool visibility = true; - MetadataMenuitem meta_item = this.custom_items[widget_order.METADATA] as MetadataMenuitem; - if(this.current_state != state.CONNECTED /*|| - meta_item.not_populated()*/){ - visibility = false; - } - debug("about the set the visibility on both the transport and metadata widget to %s", visibility.to_string()); - this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); - this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); - this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, visibility); - // DEBUG - if(visibility == false){ - warning("Update layout of client %s is setting widgets to invisibile!", this.name); + { + if(this.current_state != state.CONNECTED){ + this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, + false); + this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE, + false); + this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, + false); + this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE, + false); + return; } + + debug("update layout - metadata %s", this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format()).to_string()); + this.custom_items[widget_order.METADATA].property_set_bool(MENUITEM_PROP_VISIBLE, + this.custom_items[widget_order.METADATA].populated(MetadataMenuitem.attributes_format())); + debug("update layout - scrub %s", this.custom_items[widget_order.SCRUB].populated(ScrubMenuitem.attributes_format()).to_string()); + this.custom_items[widget_order.SCRUB].property_set_bool(MENUITEM_PROP_VISIBLE, + this.custom_items[widget_order.SCRUB].populated(ScrubMenuitem.attributes_format())); + + + this.custom_items[widget_order.TRANSPORT].property_set_bool(MENUITEM_PROP_VISIBLE, + true); + + this.custom_items[widget_order.PLAYLIST].property_set_bool(MENUITEM_PROP_VISIBLE, + true); } private void construct_widgets() @@ -164,12 +175,34 @@ public class PlayerController : GLib.Object // Transport item TransportMenuitem transport_item = new TransportMenuitem(this); this.custom_items.add(transport_item); - + + this.custom_items.add(create_playlist()); foreach(PlayerItem item in this.custom_items){ root_menu.child_add_position(item, this.menu_offset + this.custom_items.index_of(item)); } } + + private PlayerItem create_playlist() + { + PlayerItem playlist_root = new PlayerItem(CLIENT_TYPES_DEFAULT); + playlist_root.property_set(MENUITEM_PROP_LABEL, "Choose Playlist"); + + PlayerItem subentry_1 = new PlayerItem(CLIENT_TYPES_DEFAULT); + subentry_1.property_set(MENUITEM_PROP_LABEL, "Raster-noton selection"); + + PlayerItem subentry_2 = new PlayerItem(CLIENT_TYPES_DEFAULT); + subentry_2.property_set(MENUITEM_PROP_LABEL, "Rune Grammofon selection"); + + PlayerItem subentry_3 = new PlayerItem(CLIENT_TYPES_DEFAULT); + subentry_3.property_set(MENUITEM_PROP_LABEL, "Kranky selection"); + + playlist_root.child_append(subentry_1); + playlist_root.child_append(subentry_2); + playlist_root.child_append(subentry_3); + + return playlist_root; + } private static string format_client_name(string client_name) { diff --git a/src/player-item.c b/src/player-item.c index 7546ca2..301fb33 100644 --- a/src/player-item.c +++ b/src/player-item.c @@ -72,20 +72,21 @@ struct _PlayerItemPrivate { static gpointer player_item_parent_class = NULL; -GType player_item_get_type (void); -GType player_controller_get_type (void); +GType player_item_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; #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 }; +#define PLAYER_ITEM_EMPTY (-1) 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); +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs); 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); @@ -125,9 +126,8 @@ void player_item_reset (PlayerItem* self, GeeHashSet* attrs) { 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); - dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, s, 0); + g_debug ("player-item.vala:40: attempting to set prop %s to EMPTY", s); + dbusmenu_menuitem_property_set_int ((DbusmenuMenuitem*) self, s, PLAYER_ITEM_EMPTY); _g_free0 (s); } _g_object_unref0 (_s_it); @@ -172,9 +172,9 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu g_return_if_fail (attributes != NULL); _inner_error_ = NULL; g_debug ("player-item.vala:47: PlayerItem::update()"); - if (player_item_ensure_valid_updates (data, attributes) == FALSE) { - g_debug ("player-item.vala:49: PlayerItem::Update -> The hashtable update does n" \ -"ot contain what we were expecting - just leave it!"); + if (data == NULL) { + g_debug ("player-item.vala:49: PlayerItem::Update -> The hashtable was null - ju" \ +"st leave it!"); return; } { @@ -215,10 +215,10 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu 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_free0 (search_key); + input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL); + _g_free0 (property); _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_); @@ -240,10 +240,10 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu __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_free0 (search_key); + input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL); + _g_free0 (property); _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_); @@ -267,25 +267,46 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu } } } - _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_free0 (search_key); + input_keys = (_vala_array_free (input_keys, input_keys_length1, (GDestroyNotify) g_free), NULL); + _g_free0 (property); } _g_object_unref0 (_property_it); } + if (dbusmenu_menuitem_property_get_bool ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_VISIBLE) == FALSE) { + dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); + } } -static gboolean player_item_ensure_valid_updates (GHashTable* data, GeeHashSet* attributes) { +gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) { 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; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (attrs != NULL, FALSE); + { + GeeIterator* _prop_it; + _prop_it = gee_abstract_collection_iterator ((GeeAbstractCollection*) attrs); + while (TRUE) { + char* prop; + gint value_int; + if (!gee_iterator_next (_prop_it)) { + break; + } + prop = (char*) gee_iterator_get (_prop_it); + value_int = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop); + g_debug ("player-item.vala:94: populate - prop %s and value %i", prop, value_int); + if (dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop) != PLAYER_ITEM_EMPTY) { + result = TRUE; + _g_free0 (prop); + _g_object_unref0 (_prop_it); + return result; + } + _g_free0 (prop); + } + _g_object_unref0 (_prop_it); } - result = TRUE; + result = FALSE; return result; } diff --git a/src/player-item.vala b/src/player-item.vala index 2952f71..288ac47 100644 --- a/src/player-item.vala +++ b/src/player-item.vala @@ -24,7 +24,8 @@ public class PlayerItem : Dbusmenu.Menuitem { public PlayerController owner {get; construct;} public string item_type { get; construct; } - + private const int EMPTY = -1; + public PlayerItem(string type) { Object(item_type: type); @@ -36,17 +37,16 @@ public class PlayerItem : Dbusmenu.Menuitem public void reset(HashSet<string> attrs){ foreach(string s in attrs){ - debug("attempting to set prop %s to null", s); - this.property_set(s, null); - this.property_set_int(s, 0); + debug("attempting to set prop %s to EMPTY", s); + this.property_set_int(s, EMPTY); } } public void update(HashTable<string, Value?> data, HashSet<string> attributes) { debug("PlayerItem::update()"); - if(ensure_valid_updates(data, attributes) == false){ - debug("PlayerItem::Update -> The hashtable update does not contain what we were expecting - just leave it!"); + if(data == null){ + debug("PlayerItem::Update -> The hashtable was null - just leave it!"); return; } @@ -82,19 +82,21 @@ public class PlayerItem : Dbusmenu.Menuitem this.property_set_bool(property, v.get_boolean()); } } + if(this.property_get_bool(MENUITEM_PROP_VISIBLE) == false){ + this.property_set_bool(MENUITEM_PROP_VISIBLE, true); + } } - - private static bool ensure_valid_updates(HashTable<string, Value?> data, HashSet<string> attributes) + + public bool populated(HashSet<string> attrs) { - if(data == null){ - return false; + foreach(string prop in attrs){ + int value_int = property_get_int(prop); + debug("populate - prop %s and value %i", prop, value_int); + if(property_get_int(prop) != EMPTY){ + return true; + } } - /*if(data.size() < attributes.size){ - warning("update hash was too small for the target"); - return false; - }*/ - return true; + return false; } - } diff --git a/src/scrub-menu-item.c b/src/scrub-menu-item.c index 24b10e3..4cb0f02 100644 --- a/src/scrub-menu-item.c +++ b/src/scrub-menu-item.c @@ -27,9 +27,9 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libdbusmenu-glib/menuitem.h> #include <libdbusmenu-glib/server.h> #include <common-defs.h> +#include <gee.h> #include <stdlib.h> #include <string.h> -#include <gee.h> #include <float.h> #include <math.h> @@ -55,6 +55,7 @@ typedef struct _PlayerItemPrivate PlayerItemPrivate; typedef struct _ScrubMenuitem ScrubMenuitem; typedef struct _ScrubMenuitemClass ScrubMenuitemClass; typedef struct _ScrubMenuitemPrivate ScrubMenuitemPrivate; +#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL))) #define TYPE_PLAYER_CONTROLLER (player_controller_get_type ()) #define PLAYER_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLAYER_CONTROLLER, PlayerController)) @@ -76,7 +77,6 @@ typedef struct _PlayerControllerPrivate PlayerControllerPrivate; 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; @@ -111,28 +111,32 @@ struct _PlayerControllerClass { static gpointer scrub_menuitem_parent_class = NULL; -GType player_item_get_type (void); -GType scrub_menuitem_get_type (void); +GType player_item_get_type (void) G_GNUC_CONST; +GType scrub_menuitem_get_type (void) G_GNUC_CONST; enum { SCRUB_MENUITEM_DUMMY_PROPERTY }; -GType player_controller_get_type (void); +void player_item_reset (PlayerItem* self, GeeHashSet* attrs); +GeeHashSet* scrub_menuitem_attributes_format (void); +GType player_controller_get_type (void) G_GNUC_CONST; ScrubMenuitem* scrub_menuitem_new (PlayerController* parent); ScrubMenuitem* scrub_menuitem_construct (GType object_type, PlayerController* parent); PlayerController* player_item_get_owner (PlayerItem* self); const char* player_controller_get_name (PlayerController* self); -GType mpris_controller_get_type (void); +GType mpris_controller_get_type (void) G_GNUC_CONST; void mpris_controller_set_position (MprisController* self, double position); static void scrub_menuitem_real_handle_event (DbusmenuMenuitem* base, const char* name, GValue* input_value, guint timestamp); void scrub_menuitem_update_position (ScrubMenuitem* self, gint32 new_position); -GeeHashSet* scrub_menuitem_attributes_format (void); ScrubMenuitem* scrub_menuitem_construct (GType object_type, PlayerController* parent) { ScrubMenuitem * self; + GeeHashSet* _tmp0_; g_return_val_if_fail (parent != NULL, NULL); self = (ScrubMenuitem*) g_object_new (object_type, "item-type", DBUSMENU_SCRUB_MENUITEM_TYPE, "owner", parent, NULL); + player_item_reset ((PlayerItem*) self, _tmp0_ = scrub_menuitem_attributes_format ()); + _g_object_unref0 (_tmp0_); return self; } @@ -146,7 +150,7 @@ static void scrub_menuitem_real_handle_event (DbusmenuMenuitem* base, const char ScrubMenuitem * self; self = (ScrubMenuitem*) base; g_return_if_fail (name != NULL); - g_debug ("scrub-menu-item.vala:33: handle_event for owner %s with value: %f", player_controller_get_name (player_item_get_owner ((PlayerItem*) self)), g_value_get_double (input_value)); + g_debug ("scrub-menu-item.vala:34: handle_event for owner %s with value: %f", player_controller_get_name (player_item_get_owner ((PlayerItem*) self)), g_value_get_double (input_value)); mpris_controller_set_position (player_item_get_owner ((PlayerItem*) self)->mpris_adaptor, g_value_get_double (input_value)); } diff --git a/src/scrub-menu-item.vala b/src/scrub-menu-item.vala index 29fa903..ca81c38 100644 --- a/src/scrub-menu-item.vala +++ b/src/scrub-menu-item.vala @@ -26,6 +26,7 @@ public class ScrubMenuitem : PlayerItem public ScrubMenuitem(PlayerController parent) { Object(item_type: MENUITEM_TYPE, owner: parent); + reset(attributes_format()); } public override void handle_event(string name, GLib.Value input_value, uint timestamp) diff --git a/src/scrub-widget.c b/src/scrub-widget.c index fa290e0..52d7b83 100644 --- a/src/scrub-widget.c +++ b/src/scrub-widget.c @@ -93,10 +93,13 @@ scrub_widget_init (ScrubWidget *self) priv->ido_scrub_bar = ido_scale_menu_item_new_with_range ("Scrub", IDO_RANGE_STYLE_SMALL, 0, 0, 100, 1); priv->time_line = ido_timeline_new(0); - ido_scale_menu_item_set_style (IDO_SCALE_MENU_ITEM(priv->ido_scrub_bar), IDO_SCALE_MENU_ITEM_STYLE_LABEL); + ido_scale_menu_item_set_style (IDO_SCALE_MENU_ITEM(priv->ido_scrub_bar), IDO_SCALE_MENU_ITEM_STYLE_LABEL); + g_object_set(priv->ido_scrub_bar, "reverse-scroll-events", TRUE, NULL); priv->scrubbing = FALSE; - + + gtk_widget_set_size_request(GTK_WIDGET(priv->ido_scrub_bar), 100, 25); + // register slider changes listening on the range GtkWidget* scrub_widget = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_scrub_bar); g_signal_connect(scrub_widget, "change-value", G_CALLBACK(scrub_widget_change_value_cb), self); @@ -105,6 +108,7 @@ scrub_widget_init (ScrubWidget *self) g_signal_connect(priv->time_line, "finished", G_CALLBACK(scrub_widget_timeline_finished_cb), self); g_signal_connect(priv->ido_scrub_bar, "slider-grabbed", G_CALLBACK(scrub_widget_slider_grabbed), self); g_signal_connect(priv->ido_scrub_bar, "slider-released", G_CALLBACK(scrub_widget_slider_released), self); + } static void @@ -131,14 +135,15 @@ scrub_widget_property_update(DbusmenuMenuitem* item, gchar* property, if(g_ascii_strcasecmp(DBUSMENU_SCRUB_MENUITEM_DURATION, property) == 0){ g_debug("scrub-widget::update length = %i", g_value_get_int(value)); - ido_scale_menu_item_set_secondary_label(IDO_SCALE_MENU_ITEM(priv->ido_scrub_bar), + + ido_scale_menu_item_set_secondary_label(IDO_SCALE_MENU_ITEM(priv->ido_scrub_bar), scrub_widget_format_time(g_value_get_int(value))); - + ido_timeline_set_duration(priv->time_line, g_value_get_int(value) * 1000); ido_timeline_rewind(priv->time_line); scrub_widget_check_play_state(mitem); - g_debug("timeline is running: %i", (gint)ido_timeline_is_running(priv->time_line)); - g_debug("timeline duration = %i", ido_timeline_get_duration(priv->time_line)); + //g_debug("timeline is running: %i", (gint)ido_timeline_is_running(priv->time_line)); + //g_debug("timeline duration = %i", ido_timeline_get_duration(priv->time_line)); scrub_widget_set_ido_position(mitem, dbusmenu_menuitem_property_get_int(priv->twin_item, DBUSMENU_SCRUB_MENUITEM_POSITION)/1000, @@ -149,12 +154,14 @@ scrub_widget_property_update(DbusmenuMenuitem* item, gchar* property, ido_timeline_pause(priv->time_line); ido_scale_menu_item_set_primary_label(IDO_SCALE_MENU_ITEM(priv->ido_scrub_bar), scrub_widget_format_time(g_value_get_int(value)/1000)); + + g_debug("scrub-widget::update progress = %f", scrub_widget_calculate_progress(mitem)*100); - ido_timeline_set_progress(priv->time_line, scrub_widget_calculate_progress(mitem)*1000); + ido_timeline_set_progress(priv->time_line, scrub_widget_calculate_progress(mitem)); scrub_widget_set_ido_position(mitem, g_value_get_int(value)/1000, dbusmenu_menuitem_property_get_int(priv->twin_item, DBUSMENU_SCRUB_MENUITEM_DURATION)); - ido_timeline_start(priv->time_line); + scrub_widget_check_play_state(mitem); } else if(g_ascii_strcasecmp(DBUSMENU_SCRUB_MENUITEM_PLAY_STATE, property) == 0){ scrub_widget_check_play_state(mitem); @@ -188,7 +195,8 @@ scrub_widget_set_twin_item(ScrubWidget* self, g_signal_connect(G_OBJECT(twin_item), "property-changed", G_CALLBACK(scrub_widget_property_update), self); - gchar* left_text = scrub_widget_format_time(dbusmenu_menuitem_property_get_int(priv->twin_item, DBUSMENU_SCRUB_MENUITEM_POSITION)/1000); + gchar* left_text = scrub_widget_format_time(dbusmenu_menuitem_property_get_int(priv->twin_item, + DBUSMENU_SCRUB_MENUITEM_POSITION)/1000); gchar* right_text = scrub_widget_format_time(dbusmenu_menuitem_property_get_int(priv->twin_item, DBUSMENU_SCRUB_MENUITEM_DURATION)); scrub_widget_set_ido_position(self, @@ -207,22 +215,20 @@ scrub_widget_change_value_cb (GtkRange *range, gdouble new_value, gpointer user_data) { - /*g_return_val_if_fail (IS_SCRUB_WIDGET (user_data), FALSE); + g_return_val_if_fail (IS_SCRUB_WIDGET (user_data), FALSE); ScrubWidget* mitem = SCRUB_WIDGET(user_data); ScrubWidgetPrivate * priv = SCRUB_WIDGET_GET_PRIVATE(mitem); + // Don't bother when the slider is grabbed + if(priv->scrubbing == TRUE) + return FALSE; + GValue value = {0}; g_value_init(&value, G_TYPE_DOUBLE); gdouble clamped = CLAMP(new_value, 0, 100); g_value_set_double(&value, clamped); - //g_debug("scrub-widget-change-value callback - = %f", clamped); - if(priv->scrubbing == FALSE){ - dbusmenu_menuitem_handle_event (priv->twin_item, "scrubbing", &value, 0); - } - else{ - g_debug("blocking scrubbing because the slider is still grabbed" - }*/ - return FALSE; + dbusmenu_menuitem_handle_event (priv->twin_item, "scrubbing", &value, 0); + return TRUE; } GtkWidget* @@ -235,18 +241,27 @@ scrub_widget_get_ido_bar(ScrubWidget* self) static gchar* scrub_widget_format_time(gint time) { - // Assuming its in seconds for now ... - gint minutes = time/60; - gint seconds = time % 60; - gchar* prefix="0"; - gchar* seconds_prefix="0"; - if(minutes > 9) - prefix=""; - if(seconds > 9) - seconds_prefix=""; - return g_strdup_printf("%s%i:%s%i", prefix, minutes, seconds_prefix, seconds); +// Assuming its in seconds for now ... + gchar* prefix = "-"; + gchar* seconds_prefix = "-"; + + if(time != DBUSMENU_PROPERTY_EMPTY){ + gint minutes = time/60; + gint seconds = time % 60; + prefix="0"; + seconds_prefix="0"; + if(minutes > 9) + prefix=""; + if(seconds > 9) + seconds_prefix=""; + return g_strdup_printf("%s%i:%s%i", prefix, minutes, seconds_prefix, seconds); + + } + else{ + return g_strdup_printf("%s-:%s-", prefix, seconds_prefix); + } } - + static void scrub_widget_set_ido_position(ScrubWidget* self, gint position, @@ -289,7 +304,7 @@ scrub_widget_timeline_frame_cb( IdoTimeline *timeline, ScrubWidgetPrivate * priv = SCRUB_WIDGET_GET_PRIVATE(mitem); if(priv->scrubbing == TRUE) { - //g_debug("don't update the slider or timeline, slider is being scrubbed"); + g_debug("don't update the slider or timeline, slider is being scrubbed"); return; } gint position = progress * dbusmenu_menuitem_property_get_int(priv->twin_item, @@ -298,12 +313,12 @@ scrub_widget_timeline_frame_cb( IdoTimeline *timeline, ido_scale_menu_item_set_primary_label(IDO_SCALE_MENU_ITEM(priv->ido_scrub_bar), left_text); GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_scrub_bar); GtkRange *range = (GtkRange*)slider; - gtk_range_set_value(range, progress * 100); - + gtk_range_set_value(range, progress * 100); /*g_debug("position in seconds %i and in words %s", position, left_text); g_debug("timeline is running: %i", (gint)ido_timeline_is_running(priv->time_line)); g_debug("timeline duration = %i", ido_timeline_get_duration(priv->time_line)); */ + //g_debug("timeline-update - progress = %f", progress); g_free(left_text); } @@ -329,8 +344,7 @@ scrub_widget_slider_grabbed(GtkWidget *widget, gpointer user_data) { ScrubWidget* mitem = SCRUB_WIDGET(user_data); ScrubWidgetPrivate * priv = SCRUB_WIDGET_GET_PRIVATE(mitem); - priv->scrubbing = TRUE; - + priv->scrubbing = TRUE; } static void @@ -345,10 +359,6 @@ scrub_widget_timeline_finished_cb(IdoTimeline *timeline, gpointer user_data) { g_debug("Timeline Finished!"); - /*g_return_if_fail (IS_SCRUB_WIDGET (user_data)); - ScrubWidget* mitem = SCRUB_WIDGET(user_data); - ScrubWidgetPrivate * priv = SCRUB_WIDGET_GET_PRIVATE(mitem); - ido_timeline_rewind(priv->time_line);*/ } /** diff --git a/src/sound-service-server.h b/src/sound-service-server.h index 2773619..e889c2d 100644 --- a/src/sound-service-server.h +++ b/src/sound-service-server.h @@ -27,6 +27,7 @@ G_BEGIN_DECLS #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) +#define g_marshal_value_peek_variant(v) g_value_get_variant (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 @@ -50,6 +51,7 @@ G_BEGIN_DECLS #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 +#define g_marshal_value_peek_variant(v) (v)->data[0].v_pointer #endif /* !G_ENABLE_DEBUG */ diff --git a/src/title-menu-item.c b/src/title-menu-item.c index 9dab15f..70ddc74 100644 --- a/src/title-menu-item.c +++ b/src/title-menu-item.c @@ -119,18 +119,18 @@ typedef enum { static gpointer title_menuitem_parent_class = NULL; -GType player_item_get_type (void); -GType title_menuitem_get_type (void); +GType player_item_get_type (void) G_GNUC_CONST; +GType title_menuitem_get_type (void) G_GNUC_CONST; enum { TITLE_MENUITEM_DUMMY_PROPERTY }; -GType player_controller_get_type (void); +GType player_controller_get_type (void) G_GNUC_CONST; 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); +GType mpris_controller_get_type (void) G_GNUC_CONST; +GType player_controller_state_get_type (void) G_GNUC_CONST; 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); diff --git a/src/transport-menu-item.c b/src/transport-menu-item.c index bbe5a4d..50d166b 100644 --- a/src/transport-menu-item.c +++ b/src/transport-menu-item.c @@ -118,19 +118,19 @@ struct _PlayerControllerClass { static gpointer transport_menuitem_parent_class = NULL; -GType player_item_get_type (void); -GType transport_menuitem_get_type (void); +GType player_item_get_type (void) G_GNUC_CONST; +GType transport_menuitem_get_type (void) G_GNUC_CONST; enum { TRANSPORT_MENUITEM_DUMMY_PROPERTY }; -GType transport_menuitem_action_get_type (void); -GType player_controller_get_type (void); +GType transport_menuitem_action_get_type (void) G_GNUC_CONST; +GType player_controller_get_type (void) G_GNUC_CONST; 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); +GType mpris_controller_get_type (void) G_GNUC_CONST; 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); diff --git a/src/transport-widget.c b/src/transport-widget.c index c616fff..702b472 100644 --- a/src/transport-widget.c +++ b/src/transport-widget.c @@ -118,8 +118,6 @@ transport_widget_finalize (GObject *object) static gboolean transport_widget_expose_event(GtkWidget* widget, GdkEventExpose* event) { - //TransportWidgetPrivate * priv = TRANSPORT_WIDGET_GET_PRIVATE(widget); - //gtk_container_propagate_expose(GTK_CONTAINER(widget),priv->play_button, event); return TRUE; } @@ -152,8 +150,8 @@ transport_widget_button_press_event (GtkWidget *menuitem, g_value_init(&value, G_TYPE_INT); g_debug("TransportWidget::menu_press_event - going to send value %i", (int)result); g_value_set_int(&value, (int)result); - dbusmenu_menuitem_handle_event (priv->twin_item, "Transport state change", &value, 0); play_button_react_to_button_press(priv->play_button, result); + dbusmenu_menuitem_handle_event (priv->twin_item, "Transport state change", &value, 0); } return TRUE; } @@ -182,11 +180,14 @@ transport_widget_property_update(DbusmenuMenuitem* item, gchar* property, g_debug("transport_widget_update_state - with property %s", property); TransportWidget* bar = (TransportWidget*)userdata; g_return_if_fail(IS_TRANSPORT_WIDGET(bar)); - - TransportWidgetPrivate *priv = TRANSPORT_WIDGET_GET_PRIVATE(bar); - int update_value = g_value_get_int(value); - g_debug("transport_widget_update_state - with value %i", update_value); - play_button_toggle_play_pause(priv->play_button, (PlayButtonState)update_value); + + if(g_ascii_strcasecmp(DBUSMENU_TRANSPORT_MENUITEM_PLAY_STATE, property) == 0) + { + TransportWidgetPrivate *priv = TRANSPORT_WIDGET_GET_PRIVATE(bar); + int update_value = g_value_get_int(value); + g_debug("transport_widget_update_state - with value %i", update_value); + play_button_toggle_play_pause(priv->play_button, (PlayButtonState)update_value); + } } /** diff --git a/tests/Makefile.in b/tests/Makefile.in index 78c6a86..c82797d 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -234,6 +234,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POFILES = @POFILES@ POSUB = @POSUB@ PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@ |