Home > dog

dog

Dog is a project mainly written in Emacs Lisp, it's free.

an emacs music player based on mplayer

smp.el -- simple music player

  • write a music player for emacs :emacs:easy: I really don't like the EMMS interface. ** the list buffer looks like this icons for dir looks like that in speedbar. (clickable and foldable) <+> ~/musics/foo [music icon] foo1.mp3 [music icon] foo2.mp3 <+> /fat32/down/musics/bar [music icon] bar1.mp3 [music icon] bar2.mp3 [music icon] bar3.mp3

** the Lists buffer is for managing mplayer portable play lists it looks like this: current playing list have a different bg face on every file, light green <+> default-list [playing] [loop] <+> ~/musics/foo [music icon] foo1.mp3 [music icon] foo2.mp3 <+> /fat32/down/musics/bar [music icon] bar1.mp3 [music icon] bar2.mp3 [music icon] bar3.mp3 <+> mylist1 [loop] [random] <+> ~/musics/foobar [music icon] foobar1.mp3 [music icon] foobar2.mp3 <+> /fat32/down/musics/foo [music icon] foo.mp3 *** Lists buffer bindings SPC pause playing (for active list) q hide Lists c jump to current list t switch to list buffer

some keys have different behavior from list buffer
g    works for list at point
l    toggle loop for list at point
o    when not at heading, toggle random for list at point
     if you want to toggle that for active list, you can
 switch to active list and do that: c o
 switch to list buffer and do that: t o q
j/k  works on boundaries when moving (require different function)
n    works marked files across lists

when point is at list heading line. (eg. default-list, mylist1)
D    delete list from disk (ask for confirmation)
p    play this list
RET  play this list
e    edit current list in a new text buffer (plain editing)
     the user can do insert, ordering, query-replace, anything.
o    open list (expand list)
     if list is already expanded (including active list of course), toggle
 random.
RET  open list. (no random stuff here)

** list buffer bindings q hide list Q kill list

a add file or dir parameter can be: ~/musics/*.mp3 ~/musics/foo/ add music all files under this dir ~/musics/foo/bar.mp3 d delete file from list D delete file from disk, ask do you want to delete all ref in play lists r rename file from list (so, each file can have a show name.) R rename/mv file (disk) m mark u unmark n make new list from marked file L goto Lists buffer s select file to move; deselect if the file is being selected. j previous line; if there is a selected file, move that file down k next line; if there is a selected file, move that file up l toggle loop list (remember the choice for every list) on by default o toggle random (remember the choice for every list) off by default r is already used, so o for randOm. T toggle show Tags, show filename or mp3 tags (remember the choice for every list) g refresh list (update dir 'file' and pattern 'file') e edit file name in mini-buffer, can be used to replace current file with another one

RET play this file SPC pause, thus mute 9 volume - 0 volume + and other useful mplayer commands

C-x C-s save list to disk. dog also save list when quit list or emacs exit. C-x C-f open list

** command bindings comment-line comment file (file still in list, but will not be played) comment-dwim toggle comment for current file/current region

** speedbar bindings
a add file to current list (current list is currently playing list)

** dired binding ; a add marked file to current list

** DONE global bindings C-c e n next file C-c e p previous file C-c e r repeat this file (play this file again and again, don't go next) use C-c e n to go to next file. C-c e l toggle loop (only valid when playing) C-c e e show list C-c e SPC pause

** implementations :PROPERTIES: :visibility: children :END: *** lists are not expanded when opening Lists buffer lists are stored at ~/.emacs.d/smp/lists/ when Lists buffer is be to show, read all names there.

active list is expanded (copied from active buffer)
other lists only expand after o on list name

show command message for every command, such as "loop: on" "random: on" "loop command ignored: not playing" when add file to list auto insert the new file at the end of the existing dir (if any) or create a new dir item and put it there * playlist object ** different type of dir entries have different options for static dir entry you can order, add, remove file.

 for glob pattern dir entry
 you can remove file. you can not order or add file to that pattern dir.
 you can convert it to a static dir entry.

 when adding new file, if the dir already exists and is a static dir,
 insert new file to that entry.

 when adding new glob pattern, ask the user does he want to add it as a
 pattern entry. if so, first check whether the same glob entry exists, if
 not create a new pattern dir entry. if the user just want to add the
 files, then add files as if the user has not used any pattern.

 when user try to add ~/musics/, add a * at the end automatically.

*** playlist file format: dynamic list patterns and dir are dynamic file in list, they will be expanded each time the list is read from disk. for example,

adding ~/musics/*.mp3 to a list will scan all mp3 files in ~/musics each
time it gets read from disk or refresh by the user.

when editing the list,
if add a new file, store the file name.
if add a new pattern, store the pattern name.
if rm a file from list, store the removed file name.

**** playlist must store loop, random info files in order file name in list (alias in list)

**** playlist must be playable by mplayer using -playlist option. check what does mplayer accept. does it accept only dir name in the list?

*** a better format the list file only record the files: ~/music/.mp3 ~/music/foo/bar.mp3 ~/music/bar/

 the info is recorded using a separate elisp file, just like save-place:
 smp-lists
 '((list-name
    loop-or-not
random-or-not) ...)

 should file alias be global or list specific?
 if global
 smp-file-aliases
 ((file-name . display-name)
  (file-name . display-name) ...)

 if list specific, just put this at end of each element of smp-lists.
 '((list-name
    loop-or-not
random-or-not ((file-name . display-name)
               (file-name . display-name) ...)) ...)

 and this var are written to ~/.emacs.d/smp/smp-lists.el and
 smp-file-aliases.el respectively. just like what save-place did.

**** smp will only use elisp objects for lists the user can do import/export play list. there must already be some library that can parse various play list. just use them to tranlate between smp play list and other format.

**** one probable format

loop

 #random
 #/full/path/to/foo.mp3
 #display name for foo
 #/full/path/to/bar.wma
 #display name for bar
 ##        //marks the end of meta info
 ~/music/*.mp3
 ~/music/foo/bar.mp3
 ~/music/bar/

*** how to operate mplayer from fifo? for the mute, step, back, volume control see how EMMS did it, or did it ever do it.

*** how random works don't ever move the display. I remember one GUI music play does shuffle the displaying play list. that's stupid. (sorry for the author who did this)

just make a random integer of certain range and play file at that line.

*** tags and caching if tags is being used, it should be cached.

*** about undo list buffer should disable undo. I guess.

Previous:css_sort