
pretty urgent items
-------------------

- update author name in copyright: \set{"man::author"}{Joost van Baal-Ilić <joostvb-draai@mdcc.cx>}

- remove explicit "ZOEMSEARCHPATH=/usr/share/aephea" from man/Makefile.
  zoem 10-265-1 gives:
   $ zoem -e '\__searchpath__'
   {/usr/share/zoem/mac}
  . Should include /usr/share/aephea.  Have sent patch to upstream.


some items
----------

INSTALL zsh stuff:
compinit niet genoeg; nodig:
joostvb@hille:~% exec zsh --login
move zsh stuff to README


urgent items
------------

- update this todo-list; lots of obsolete stuff is in it.

- bug: on empty/non-playing playlist, "draai draai" chokes

- draai is buggy when volume is set to 100%: skip fails

- README in html, ship .txt too.

- more docs and features for "draai insert": hang deze track net achter de nu spelende
  "insert" is "fileguestlist" (as opposed to "trackguestlist", which is
  "guestlist")
  insert could honor --prio : --prio 2 : after upcoming track.

- revamp:
  help texts in zsh completion stuff, --help and manpage should use ONE
  source. move help stuff to one place; include help/ stuff in configure phase.

  remove help stuff from zsh/_draai.
  remove help stuff from draai.in script

  Think about lists in zoem, use stijn's trick.

  Alternative way to implement this: Run e.g. "draai --raw --help skip",
  "draai --raw help"  "draai --raw --nice help"
  (as of 2008-06, quite some options are only half-implemented)
  .

  Another alternative way to implement this:
  selfdocumenting zoem stuff:
  foo=bar
  : cat <<EOT
  \zoemstart
  \zoem stuff
  \zoemstop
  EOT
  blah=duh

man package, -d roff

zoem stuff
\:{
shell meuk
}
zoem stuff

zou dat werken?

  (We are working on this implementation now:
of echo 'unpause draai' >command/unpause, commit, $(cat command/unpause) ?
option/raw: so:

use help/shortoption


-
ma 26 12:56 < joostvb> mpc update; mpc idle; mpc add foo
ma 26 12:56 < Fruit> ah zo hm
ma 26 12:57 < Fruit> ik denk dat ik mpc add foo; mpc move $(getlast) 
                     $(getcurrent+1) wil
ma 26 12:57 < Fruit> en dan liefst in één atomaire operatie (dat kan binnen het 
                     mpd-protocol namelijk)
ma 26 12:58 < Fruit> en dat moet uiteraard ook goed gaan als je een directory 
                     toevoegt
ma 26 12:58 < Fruit> dus eerst aantal opvragen, dan toevoegen, dan oude aantal 
                     t/m nieuwe aantal moven
ma 26 12:59 < joostvb> yep
ma 26 12:59 < Fruit> in jouw draai watch scriptje wil je trouwens misschien mpc 
                     idle gebruiken ipv sleep 1


----------------------------------------------------------------------------

Date: Sun, 30 Nov 2008 23:05:22 +0100
From: Stijn van Dongen <stijn@micans.org>
To: Joost van Baal <joostvb@mdcc.cx>
Subject: zoem mongering
Message-ID: <20081130220521.GA37144@xs4all.nl>

   Ha Joost,

zie bijgevoegd *en* geciteerd de file 'lscat.azm' die misschien doet wat je wil.
Roep zoem aan als

zoem -i lscat.azm -allow ls:cat -o -


   \: -  lees de namen.
\setx{thefiles}{
         \inspect{
            {mods}{iter-lines,discard-miss}
         }{(.*~.bzz)}{_#1{{\1}}}{\system{ls}}
      }

   \: -  maak key-value paren.
\apply{_#1{\!{\setx{%{\1}}{\system{cat}{\1}}}}}{\thefiles}

   \: -  print een value.
[\%{foo.bzz}]
[\%{bar.bzz}]

   \: -  print alle key-value paren.
\apply{_#1{\!{[\1]-->[\%{\1}]}}}{\thefiles}


In dit voorbeeld worden de file namen gematcht op een .bzz suffix.
Als je dat niet wilt kun je het patroon (.*) gebruiken (maar ik
raad aan een suffix conventie te gebruiken :-).

Als je vervolgens iets voor alle file namen wil doen, kun je
\apply gebruiken zoals hierboven.

Nog iets: je kunt ls aanroepen met argumenten, bijvoorbeeld zo:
\system{ls}{{-r}{-t}}.

En: \apply expandeert beide argumenten (1e argument: de 'subroutine' key die
iteratief gebruikt wordt op de sub-argumenten in het 2e argument). Dat kan soms
een beetje prutsen zijn om ongewenste evaluatie/expansie te voorkomen.  In het
voorbeeld hierboven wordt \!{ } gebruikt om te zorgen dat bepaalde stukken
overgeslagen worden tijden genoemde expansie.  In de documentatie heet \!{ }
'delay scope' omdat het 1 expansie stap overslaat. \!!{ } slaat twee stappen
over.  En \eval{\eval{\!!{\bar}}} is precies hetzelfde als \bar.  Het is de
barre praktijk van macro talen :)

groetjes,
Stijn

----------------------------------------------------------------------------

- fade in/out more aggressive: never silence between tracks.

- implement "draai pick":

draai list | grep Camper  | draai pick

draai --raw list | grep Camper | draai pick

draai pick > Picking from:

 121) Camper van Beethoven - Camper van Beethoven - Lulu Land (2:41)
 157) Camper van Beethoven - Camper van Beethoven - We Saw Jerry's Daughter (2:10)
 158) Camper van Beethoven - Camper van Beethoven - Good Guys and Bad Guys (3:56)
>159) Camper van Beethoven - Camper van Beethoven - Jo Stalin's Cadillac (2:32)

Pick first matching entry? [Y,2,3...,l,r,q]

(Yes; no, pick 2nd; no, pick 3rd; no, pick last; no, rerun; quit)

Y

You've picked

121) Camper van Beethoven - Camper van Beethoven - Lulu Land (2:41)

Would you like to guestlist this track? [Y,2,3,..,d,u,q]

draai pick> 

Yes; no, schedule as 2nd upcoming track; no, schedule as 3rd upcoming track; delete from playlist; unguestlist; quit

pick should honor --silent

- 'draai osjittisstil' update zsh stuff.

- dr_push: it'd be nice if it would mangle files and pathnames to fit on a
   vfat filesystem.

- dr_umount would be nice

- add stuff to generate playlist "latest"

- draai second 123  =  draai --prio 2 guestlist 123

- make this tool usable for DJ's: more flexible playlist handling, more
  fade-in/fade-out features:
 + draai "peek" should accept an arg
    draai peek noftracks
 + draai draai should do an "insert": insert these songs just after current
    song.  implement as "mpc add; mpc move":

 old curr    old curr             old curr
 old 1       new 4                new 2
 old 2       old 1                new 3
 old 3       old 2       ...      new 4
 new 1       old 3                old 1
 new 2       new 1                old 2
 new 3       new 2                old 3
 new 4       new 3                new 1

- reimplement "tail" using ncurses (or watch(1)?): tail should show "peek" too.
  current song in boldface or reverse video

- document "pause" and "resume|unpause|play" commands (mpc pause, mpc play), add
  zsh completion

- draai draai should not clear current playlist, but remove all pending songs
  but the current one from the current playlist, and append the given
  tracks/playlists.  This makes for more smooth fade in/out.

- add ui for

   mpc search artist Stooges | mpc add
   mpc search artist Hendrix | mpc add

- document extra aliases: init: genesis; next: volgende; unguestlist: unfriend,
  ontvriend; insert: voegin; skip: slaover; fastforward: voorwaarts; tail:
  staart; peek: spiek; play (unpause, resume): ga; quit (exit, stop, pause): ho

items as found while working on eeepc
-------------------------------------

inspect $DISPLAY for draai-init-nox

draai move 34 50 (just like mpc)

draai --terse list
draai --terse --search 'greatest_hits' list  : gives 3 6 12 19

tty12 group tty for draai:
root@hille:/etc/udev/rules.d# vi 93-permissions-local.rules

udev  / dr-mount
     /dev/disk/by-label/PENDRIVE /media/PENDRIVE  vfat user,noauto 0 0

watch(1) "cat -v" !?, see http://mdcc.cx/tmp/watch/

joostvb@hille:~% draai unguestlist $(  draai --raw list | grep Best_Ever | head | while read n r; do echo $n | sed 's/)//'; done )


> add --match option:
> draai --match greatest_hits delete
> draai --match greatest_hits guestlist
> suggested usage: first run --match with --no-act, to inspect
> what would get matched.


private/local items
-------------------

- radio kink classix: dj@nagy:~% mpg321 http://81.173.3.24/

- see also dj@nagy:etc/zsh/rc.local for radio6 and bbc3


other items
-----------

- add support for smart merging of playlists:

    --playlist=foo,1 --playlist=bar,40  --playlist=duh,7

  --playlist=foo --playlist=bar   is equivalent to
  --playlist=foo,1 --playlist=bar,1

  --playlist=foo,2 --playlist=bar   is equivalent to
  --playlist=foo,2 --playlist=bar,1  is equivalent to
  --playlist=foo --playlist=foo --playlist=bar

 : adding ,N is a shorthand for repeating the arg N times.  playlists get
  truncated to the size of the smallest one.  so, no matter the size of foo
  and bar, --playlist=foo,2 --playlist=bar,1 will give you 2 foo-tracks for
  every bar-track.

- support voor last.fm audioscrobbling erin.  An account at last.fm
  is needed to get any services from them.

- support voor last.fm streaming audio erin.  shell-fm(1)
  shell-fm heeft plugin voor event tijdens wisselen track.
  shell-fm is niet eenvoudig om te bouwen tot mpd client.
  t heeft wel een socket en netwerk-interface

 Wed 27 14:11 <Fruit> http://www.last.fm/user/Fruitje/

  An account at last.fm is needed to get any services from them.

  dj@nagy:~% shell-fm lastfm://artist/Alexander+von+Schlippenbach/similarartists
  dj@nagy:~% shell-fm lastfm://artist/Anthony+Braxton/similarartists

 Perhaps zomg is more interesting: ZOMG is a console-based last.fm submission
 and radio client written in Z-Shell.
 http://hg.debian.org/hg/private/schizo/zomg http://packages.debian.org/zomg

- document (and implement on gelfand): syslog.conf: local? to e.g.
  /var/log/draai

- add to contrib:

root@kovalevskaya:/etc/logcheck/ignore.d.server# cat draai 
#
#
^\w{3} [ :0-9]{11} [._[:alnum:]-]+ draai\[[0-9]+\]: 

- Give examples in documentation:

 suggested desktop layout

 .----------------.
 | logtail .------.
 ` ------- | tail |
           |      |
           `------'
           .------.
           | peek |
           |      |
           `------'

and once in a while, press ctrl-alt-F12

startup:
% draai init calls draai tail > /dev/tty12 &    (document: dj is a member of group tty)


dj@gelfand:~/mp3% draai -t +30 quit
dj@gelfand:~/mp3% draai -t 08:30 quit
dj@gelfand:~/mp3% draai -p all draai
dj@gelfand:~/mp3% draai tail  <- in separate window
dj@gelfand:~/mp3% draai skip
dj@gelfand:~/mp3% draai -t 23:01 -p all draai
dj@gelfand:~/mp3% draai peek
dj@nagy:~% draai delete $(seq 3 65)

zsh:   draai delete {12..29}

draai guestlist {50..34}

% repeat 10; do draai skip; done

dj@nagy:~% shell-fm lastfm://artist/This+Heat/similarartists 

  Air
  Biosphere
dj@nagy:~% shell-fm lastfm://artist/Alexander+von+Schlippenbach/similarartists
dj@nagy:~% shell-fm lastfm://artist/Anthony+Braxton/similarartists

- "tail" is buggy:

   2007-03-18 21:54:56       Anvil FX - Brazz-Ill - Miolo de Cabeça (4:28)

  has borken line length: utf-8 issue, probably.

- implement setup uninstall

- don't use help2man, but something "real" for the manpage (see also
  ideas from python era, below)  ReST still (2007-03) doesn't seem to be easily
  transformed to roff.  use zoem? use xml?  have zoem run --help and --version?
  the last trick _is_ used and documented in some zoem example.  zum has e.g.

   \verbatim{\system{../src/zoem}{{-l}{session}}}

  see aangifte-ib and webalizer-stonesteps manpages for roff example.

- document this

   draai draai Lee_Scratch_Perry/Roast_Fish,_Collie_Weed_and_Corn_Bread/ The_Fall/

  works: args don't need to be tracks.  Also,

   draai draai Various/Mind_The_Gap_6{0,1,2}<tab>

  works.


Wishlist items
--------------

- don't do "draai --raw tail" but "draai tail --raw", etc.

- perhaps it'd be nice if we could still play local files too:
   ~$ draai draai /tmp/foo.ogg

- should process .m3u , stdin and command line args;
  cat <<EOT | draai draai blah\ blah.ogg
   track.ogg
   song.mp3
  EOT

- should process audiofiles with " and ' in filename.  (Space is fine, we've
  checked).

- allow for a ~/.draai/rc config file (FHS desktop policy?)

- "tail" could better do:

2007-03-19 07:22:21 Erik Satie - The Early Piano Wor...- Gnossienne No. 1 (5:42)
2007-03-19 07:27:58 Photek - Solaris - Junk                               (5:28)

   instead of:

2007-03-19 07:22:21 Erik Satie - The Early Piano Wor...- Gnossienne No. 1 (5:42)
2007-03-19 07:27:58                               Photek - Solaris - Junk (5:28)

- version, help, license should be commands, not options

- enable command "append": append to current playlist


Old ideas, from the pyton era
-----------------------------

- look at python code examples: in /usr/bin/ :
  - reportbug's (reportbug, querybts),
  - debian-goodies (checkrestart, popbugs)
  - linda (Steve Kowalik),
  - pydoc,
  - tla_load_dirs (John Goerzen)

- document & write manpage
using pydoc
there seems to be no roff output for pydoc: even pydoc's own manpage says:
AUTHOR Moshe Zadka, based on "pydoc ‐‐help"
write a pydoc2zoem thingie?

ReST sucks (am I wrong?), don't use it.

docutils ReST http://docutils.sourceforge.net/ offers a ManPage Writer too.
hrm.  smells unstable.

http://docutils.sourceforge.net/sandbox/cben/make/Makefile.docutils <- nice.
Debian package  python2.4-docutils /usr/share/doc/python-docutils
rest2xml(1)

pydoc /usr/bin/popbugs

joostvb@nagy:~% pydoc ~/arch/draai/draai/modules/draai.py

help2man ? ->
http://sourceforge.net/mailarchive/message.php?msg_id=9285365

        result.append(formatter.format_heading(_("options")))

    def format_usage(self, usage):
        return _("usage: %s\n") % usage

joostvb@nagy:/usr/lib/python2.4% less optparse.py

joostvb@nagy:~/svn/starship.python.net% svn co svn://starship.python.net/optik/trunk optik

r484 | gward | 2005-01-17 03:22:13 +0100 (Mon, 17 Jan 2005) | 2 lines
Always capitalize "Usage" and "Options" in help output for consistency.

latest release as of Fri Mar 25 12:02:04 CET 2005 is optik 1.5 (2004-12-07 02:04)
1.5.1 is yet to be released.

- check for ogg/mp3 interfaces

 python-pyvorbis - A Python interface to the Ogg Vorbis library
   1.3-1 Dec 2003 (upstream is dead, latest upstream)
include (part of) ogg123.py ?  ogg123.py is GPL-ed, since pyvorbis-1.3 is.
ogg123.py --module=lad file.ogg works (somewhat (for me)).  However, it plays
tracks on a much slower pitch...

Use python-id3 and python-pymad for mp3

- make it a mpd client.  probably should use:
python-mpdclient - Python interface to MPD  (source: py-libmpdclient)
(see also: pygmy, pympd, libmpd-dev, libmpd0)
run: ~% pydoc mpdclient2

libmpd-dev: "This package contains the development libraries, headers and documentation."
no it doesn't: no docs there...

try http://www.musicpd.org/ for docs

Peeksheet
---------

joostvb@nagy:~/arch/draai/draai% DIB_V=$(cat VERSION) DIB_P=draai DIB_TARDIR=. debian-install-build 

joostvb@bruhat:~/git/draai% git pull ssh://git/~joostvb/git/draai.git
joostvb@bruhat:~/git/draai/debian% git push ssh://git/~joostvb/git/draai.git joostvb-arch@mdcc.cx--2005-draai,draai--mainline--0.1

