Package: xmms2-client-cli
Version: 0.6DrMattDestruction-6
Severity: wishlist
Tags: patch

Please consider distributing attached script in the -cli (and
-nycli) package's examples directory (or xmms2-core). It's trivial
but makes for nice listening, especially in combination with
libapache2-mod-musicindex. Playlists can

- replace the currently playing music (starts immediately)
- be inserted to be played next before the rest of the existing
  playlist
- queued at the end of the current playlist
- queued to be played next, replacing the existing playlist

The script requires gxmessage, but could probably be rewritten to
use something better/nicer.

Thanks,

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xmms2-client-cli depends on:
ii  libc6             2.10.1-7               GNU C Library: Shared libraries
ii  libglib2.0-0      2.22.2-2               The GLib library of C routines
ii  libxmmsclient-gli 0.6DrMattDestruction-6 XMMS2 - glib client library
ii  libxmmsclient5    0.6DrMattDestruction-6 XMMS2 - client library

xmms2-client-cli recommends no packages.

Versions of packages xmms2-client-cli suggests:
ii  xmms2-core        0.6DrMattDestruction-6 XMMS2 - core package

-- no debconf information


-- 
 .''`.   martin f. krafft <[email protected]>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
#!/bin/sh
#
# plshandler -- interactive handler for m3u/pls files to be fed to xmms2
#
# Copyright © 2004-9 martin f. krafft <[email protected]>
# Released under the terms of the Artistic Licence 2.0
#
set -eu

VERSION=2009.11.25.1305

gxmessage -buttons '_Replace:103,_Queue:102,_Insert:101,_Play 
next:100,_Cancel:1' \
          -default '_Play next' \
          -nearmouse -name 'Play stream' \
          "What should I do with the selected tunes?" || ret=$?

add_command=add

case ${ret:-0} in
  0|1) exit 0;;
  100) 
        # Play next, so we just clear the playlist and leave add_command as add
        # since xmms2 will play the current song to its end and then start from 0
        xmms2 clear
        ;;
  101) 
        # Insert, this is tricky since we need to find the position to use to 
insert
        # and keep incrementing it on every insert, since otherwise the new 
entries
        # will end up in reverse order.
        position="$(xmms2 list | sed -rne 's,^->\[([[:digit:]]+)/.+,\1,p')"
        if [ -n "$position" ]; then
                # executed on evaluation.
                add_command='insert $((position = position+1))'
        fi
        ;;
  102) 
        # Queue, which is the default behaviour for 'add', so we do nothing
        :
        ;;
  103) 
        # Replace, more or less like Play next, except we have to stop xmms2 to
        # also kill the current song
        xmms2 stop
        xmms2 clear
        ;;
esac

sed -e '/^#/d;s/^File[[:digit:]]*=//' "$@" | \
        while read url; do
                eval xmms2 $add_command "\"$url\""
        done

exec xmms2 play

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)

--
_______________________________________________
Xmms2-devel mailing list
[email protected]
http://lists.xmms.se/cgi-bin/mailman/listinfo/xmms2-devel

Reply via email to