;;; -*- Emacs-Lisp -*- ;;; A front-end program to mpg123 ;;; (c)1999-2001 by HIROSE Yuuji [yuuji@gentei.org] ;;; $Id: mpg123.el,v 1.24 2001/02/23 06:54:30 yuuji Exp $ ;;; Last modified Fri Feb 23 15:51:02 2001 on buell ;;; Update count: 857 ;;[News] ;; Key binding to Delete-file is changed from `C-d' to `D'. ;; ;;[Commentary] ;; ;; This package is a front-end program to mpg123 audio player. ;; mpg123¤ÎºÆÀ¸¥Õ¥í¥ó¥È¥¨¥ó¥É¤Ç¤¹¡£ ;; ;;[Requirement] ;; ;; The `mpg123' program version 0.59q or later, and enough CPU ;; power to run it. ;; mpg123 0.59q¤È¤½¤ì¤òÁö¤é¤¹¤Î¤Ë½½Ê¬¤ÊCPU¥Ñ¥ï¡¼¡£ ;; ºÇÄã¤Ç¤âMMX?? ;; ;;[Installation] ;; ;; You have to install mpg123 0.59q or later first, and get it work ;; fine. Check `mpg123 -v' option if it displays the decoding ;; frame number or not. If it looks good, then the preparation has ;; been done. Install this emacs-lisp into your load-path ;; directory. And put the expression below into your ~/.emacs. ;; ;; [~/.emacs] ;; (autoload 'mpg123 "mpg123" "A Front-end to mpg123" t) ;; ;; ¤Þ¤º¡¢mpg123¤ÎÀµ¾ïÆ°ºî¤ò³Îǧ¤·¤Æ¤«¤é¾å¤Î¹Ô¤ò~/.emacs¤ËÄɲä·¤Þ¤¹¡£ ;; ¤Ê¤ªmpg123¤Ï0.59q°Ê¾å¤Ç¤Ê¤¤¤ÈÀµ¾ï¤ËÆ°ºî¤·¤Ê¤¤²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹(¤â¤Ã ;; ¤È¿·¤·¤¤¤Î¤¬½Ð¤¿¤é¤Þ¤¿²ø¤·¤¤¤«¤â¤·¤ì¤ó¡Ä)¡£mpg123 ¤Ë -v ¥ª¥×¥·¥ç ;; ¥ó¤ò¤Ä¤±¤Æµ¯Æ°¤·²»³Ú¤ÎºÆÀ¸¤È¤È¤â¤Ë¥Ç¥³¡¼¥ÉÃæ¤Î¥Õ¥ì¡¼¥àÈֹ椬²èÌÌ ;; ¤Ëɽ¼¨¤µ¤ì¤ë¤«¤É¤¦¤«³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤¬¤¦¤Þ¤¯¹Ô¤«¤Ê¤¤¤È¤³¤Î ;; ¥×¥í¥°¥é¥à¤â¤¦¤Þ¤¯Æ°¤¤Þ¤»¤ó¡£ ;; ;;[How to Play the music] ;; ;; It is assumed that you already have MPEG1 audio LayerI/II/III ;; files - you might be only familiar with MPEG1 Layer III aka mp3 ;; - in the certain directory. This program plays all music in A ;; direcotry. If you want to listen, exec Emacs and type: ;; ;; M-x mpg123 RET ;; SomeMP3DirectoryName (or playlist file) RET ;; ;; Then you will get the music list in the directory. Type SPC to ;; start the music. All key bindings are shown at the bottom of ;; music list buffer. Please take a look at it. ;; ;; ´û¤Ë MPEG1 audio Layer I/II/III ¥Õ¥¡¥¤¥ë¤Ï»ý¤Ã¤Æ¤ë¤â¤Î¤È¤·¤ÆÀâÌÀ ;; ¤·¤Þ¤¹(¤¿¤Ö¤ó¤¤¤ï¤æ¤ëMP3¤·¤«»ý¤Ã¤Æ¤Ê¤¤¤È»×¤¦¤±¤Éµ¤¤Ë¤·¤Ê¤¤¤ï¤·¤â ;; Layer2¤È3¤Ïºî¤Ã¤¿¤³¤È¤¹¤é¤Ê¤¤)¡£¤Ç¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ï¤¤Ã¤È¤É¤³¤«¤Î ;; ¥Ç¥£¥ì¥¯¥È¥ê¤ËÀ°Íý¤·¤Æ¤ª¤¤¤Æ¤¢¤ë¤È»×¤¦¤Î¤Ç¡¢²»³Ú¤òʹ¤¤¿¤¯¤Ê¤Ã¤¿ ;; ¤é¡¢¤Þ¤ºEmacs¤òµ¯Æ°¤·¡¢ ;; ;; M-x mpg123 ¤Ú¤· ;; ¥Ç¥£¥ì¥¯¥È¥ê̾ (¤Þ¤¿¤Ï¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë̾) ¤Ú¤· ;; ;; ¤ÈÂǤÁ¤Þ¤¹¡£¤È¡¢¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë²»³Ú¥Õ¥¡¥¤¥ë°ìÍ÷¤¬½Ð¤ÆÍè¤ë ;; ¤Î¤Ç¡¢Ê¹¤¤¿¤¤¶Ê¤Ë¹ç¤ï¤»¤ÆSPC¤òÂǤĤȱéÁÕ¤¬»Ï¤Þ¤ê¤Þ¤¹¡£¤½¤Î¾¤Î ;; ¥¡¼¥³¥Þ¥ó¥É¤Ï²»³Ú°ìÍ÷¥Ð¥Ã¥Õ¥¡¤ÎËöÈø¤Ëɽ¼¨¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¤½¤Ã¤Á¤ò ;; ¸«¤Æ¤¯¤À¤µ¤¤¡£ ;; ;;[Playlist] ;; ;; If you give `M-x mpg123' a simple file which consists of file ;; name list; one file name per line, mpg123.el assumes it as a ;; playlist file. All of mp3 files listed in playlist file are ;; incorporated in *mpg123* playing buffer. If a line in playlist ;; points to another playlist file, file is parsed recursively. ;; There are mainly two ways to create a playlist file. ;; ;; * Typing `S' in *mpg123* buffer ;; * Create directly on the shell; ;; Ex. % ls */*.mp3 > playlist ;; ;; Because a playlist is very simple, you can edit it manually to ;; arrange the order of music list. ;; ;; M-x mpg123 ¤Î¤¢¤È¤Ë¡¢°ì¹Ô¤Ë°ì¤ÄMP3¥Õ¥¡¥¤¥ë¤Î̾Á°¤¬½ñ¤«¤ì¤¿ÉáÄ̤Π;; ¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤Èmpg123.el¤Ï¤½¤ì¤ò¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë¤À¤È¤ß ;; ¤Ê¤·¡¢¤½¤³¤Ë½ñ¤«¤ì¤Æ¤¤¤ëMP3¥Õ¥¡¥¤¥ë·²¤ò *mpg123* ²»³Ú°ìÍ÷¥Ð¥Ã¥Õ¥¡ ;; ¤ËÁ´¤Æ¼è¤ê¹þ¤ß¤Þ¤¹¡£¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë¤òºî¤ë¤Ë¤ÏÆó¤Ä¤ÎÊýË¡¤¬¤¢ ;; ¤ê¤Þ¤¹¡£ ;; ;; * ²»³Ú°ìÍ÷(*mpg123*)¥Ð¥Ã¥Õ¥¡¤Ç S ¤ò²¡¤¹ ;; * ¥·¥§¥ë¤Î¾å¤ÇľÀܺî¤ë ;; ¡ÚÎã¡Û % ls */*.mp3 > playlist ;; ;; ¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ë¤Ï¤È¤Æ¤âñ½ã¤Ê¤Î¤Ç¡¢Ä¾ÀÜÊÔ½¸¤·¤Æ¹¥¤¤Ê¶Ê½ç¤ò ;; ¥ê¥¹¥È¤òºî¤ë¤Î¤Ï´Êñ¤Ç¤·¤ç¤¦¡£¥×¥ì¥¤¥ê¥¹¥È¥Õ¥¡¥¤¥ëÃæ¤ËÊ̤Υץ쥤 ;; ¥ê¥¹¥È¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤¤Þ¤¹¡£ ;; ;;[Configuration] ;; ;; Here are the variables for your customization. ;; ;; [Variable] [Default value/Meaning] ;; mpg123-command "mpg123" ;; Command name of mpg123 ;; mpg123-command-args nil ;; Argument list to pass mpg123 command ;; mpg123-mixer-command "mixer" ;; Command name of mixer(FreeBSD) ;; mpg123-preserve-playtime t ;; If you want to mpg123 to play all music ;; from the beginning even if the last ;; played time is shown in the buffer, set ;; this variable to `nil'. ;; mpg123-startup-volume 30 ;; Initialize sound volume with this value. ;; mpg123-default-repeat 0 ;; Default number of repetition ;; mpg123-show-help t ;; Whether show help under the music list ;; or not ;; mpg123-omit-id3-artist nil ;; Whether omit the artist name in ID3 ;; mpg123-lazy-check nil ;; Check sound file or not by filename ;; ;; mpg123-face-playing '("yellow" . "#004080") ;; Cons of default playing cursor color ;; '(FGCOLOR . BGCOLOR) ;; mpg123-face-slider '("black" . "yellow") ;; Cons of default playing position slider color ;; mpg123-need-slider t on color display, else nil ;; Whether the playing position slider is ;; needed or not ;; ;; ¤Û¤Ü mpg123 0.59q ¤Ë·è¤áÂǤÁ¤È¤¤¤¦É÷¾ð¤Ê¤Î¤Ç¡¢¤¢¤Þ¤ê¤¤¤¸¤ì¤ë¤È¤³ ;; ¤í̵¤¤¤±¤É¡¢¾å¤Ë½ñ¤¤¤Æ¤¢¤ëÊÑ¿ô¤¬¤¤¤¸¤ì¤Þ¤¹¡£ ;; ;; ¤Ê¤ªLinux¤Ç¤Ï²»ÎÌÄ´Àᥳ¥Þ¥ó¥É¤È¤·¤Æ aumix -w ¤ÎÍøÍѤòÁ°Äó¤È¤·¤Þ¤¹¡£ ;; ¤³¤Î¥×¥í¥°¥é¥à¤Ç²»Î̤ò¤¤¤¸¤ê¤¿¤¤¤È¤¤Ï aumix ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª ;; ¤¤Þ¤·¤ç¤¦¡£ ;; ;;[More comfortable] ;; ;; Yes, Emacs is the editor. Even though you are listening to the ;; music, you have to edit something!! :) ;; ;; This program occupies one Emacs window. Using this program ;; without any window manager is hard job. Please use this with ;; windows.el - The Window Manager for Emacs - which can be ;; obtained from http://www.gentei.org/~yuuji/software/. With ;; windows.el, you can listen the music which is run in other ;; frame. Or if you use emacs -nw, you can run mpg123.el in the ;; background window and can switch from and to mpg123 buffer ;; alternatively. Of course, I'm writing this document while ;; mpg123.el is running in the background window. ;; ;; Emacs»È¤Ã¤Æ¤ë¤ó¤À¤«¤éʹ¤¯¤Ð¤Ã¤«¤ê¤¸¤ã¤Ê¤¯¤ÆÊÔ½¸¤·¤Ê¤µ¤¤! ¤Æ¤³¤È ;; ¤Ç¡¢Á´¥Õ¥ì¡¼¥à¤ò¾ÃÈñ¤¹¤ëmpg123.el¤òÁǤÎEmacs¤Ç»È¤Ã¤Æ¤¿¤éÂçÊÑ¡£¤¿ ;; ¤á¤·¤Ë windows.el ¤È°ì½ï¤Ë¤Ä¤³¤Æ¤ß¤Æ¤Í¡£¥Õ¥ì¡¼¥à¤ò»È¤Ã¤Æ¤ë¤È¤¤Ï ;; Ê̥ե졼¥à¤Ç¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥ÉºÆÀ¸¡¢-nw ¤Çµ¯Æ°¤·¤Æ¤¤¤ë¤È¤¤Ï΢¥¦¥£ ;; ¥ó¥É¥¦¤Ç¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥ÉºÆÀ¸¤Ç¤¤Æ¡¢¤½¤Î΢¥¦¥£¥ó¥É¥¦¤È¤¤¤¯¤Ä¤«¤Î ;; ÊÔ½¸¥¦¥£¥ó¥É¥¦¤òÀÚÂؤ¨¤Æ»È¤¦¤Ê¤ó¤Æ»ö¤â²Äǽ¡£¤â¤Á¤í¤ó¤³¤Îʸ¾Ï¤â΢ ;; ¤ËȾʬ±£¤ì¤Æ¤ë¥Õ¥ì¡¼¥à¤Çmpg123¤òÁö¤é¤»¤Ê¤¬¤é½ñ¤¤¤Æ¤Þ¤¹¡£ ;; windows.el ¤Ï http://www.gentei.org/~yuuji/software/ ¤«¤é¤É¤¦¤¾¡£ ;; ;;[Bugs] ;; ;; It is perhaps only on my system that sometimes mpg123 command ;; gets confused to decode and ticks playing time very slowly. In ;; such case, mpg123.el cannot detect that condition. If you come ;; to see such behavior, please pause and restart player by SPC key. ;; ;; ¤¿¤Þ¤Ëmpg123¥³¥Þ¥ó¥É¤¬Æ°¤¤¤Æ¤Ï¤¤¤ë¤â¤Î¤Î²»¤ò½Ð¤µ¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¦ ;; ¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¤è¤¦¤ÊµóÆ°¤òmpg123.el¤Ï¸¡½Ð¤Ç¤¤Ê¤¤¤Î¤Ç¡¢¤½ ;; ¤¦¤Ê¤Ã¤¿¤éSPC¤Ç°ìö»ß¤á¤ÆÆ°¤«¤·Ä¾¤·¤Æ¤¯¤À¤µ¤¤¡£Emacs19¥Ù¡¼¥¹¤Î ;; Mule¤Ç¤ÏÊ£»¨¤ÊÍýͳ¤Ë¤è¤êÊ̥ե졼¥à¤Ç±éÁÕÃæ¤Ë¼¡¤Î¶Ê¤Ë¿Ê¤à¤È¡¢¼¡¤Î ;; ¶Ê¤Ë°Ü¤Ã¤¿Ä¾¸å¤Î¥¡¼¤ò±éÁÕÍѥХåե¡¤Ë¼è¤é¤ì¤Æ¤·¤Þ¤¤¡¢¤Ê¤ª¤«¤Ä±é ;; ÁÕ»þ´Ö¤Î¹¹¿·¤¬(¤ß¤«¤±¾å)¼¡¤Ë¥¡¼ÆþÎϤ¹¤ë¤Þ¤Ç»ß¤Þ¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ;; ¤½¤¦¤Ê¤Ã¤Æ¤·¤Þ¤¦³ÎΨ¤¬²¼¤¬¤ë¤è¤¦¤Ê¹©ÉפϤ·¤Æ¤ß¤Þ¤·¤¿¤¬º¬ËÜŪ²ò·è ;; ¤Ë¤Ï»ê¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£ ;; ;; Play/Stop control against the music in the stack buffer doesn't ;; work. Although it is feasible, the feature isn't actually ;; usefull and ends in self-satisfaction. So, no plan to make it. ;; ;;[No Warranty] ;; ;; This program is free software and comes with absolutely NO ;; WARRANTY. The author is not responsible for any possible ;; defects caused by this software. You can freely modify this ;; program for your convenience. But if you want to publish ;; modified program, please tell me before announcement. Take it ;; easy to write me comments and bug-reports. ;; yuuji@gentei.org ;; ;; ¤³¤Î¥×¥í¥°¥é¥à¤Ï¥Õ¥ê¡¼¥½¥Õ¥È¥¦¥§¥¢¤È¤·¤ÆÇÛÉÛ¤·¤Þ¤¹¡£¤³¤Î¥×¥í¥°¥é ;; ¥à¤ÎÍøÍѤˤè¤Ã¤ÆÀ¸¤¸¤¿¤¤¤«¤Ê¤ë·ë²Ì¤ËÂФ·¤Æ¤âºî¼Ô¤ÏÀÕǤ¤òÉ餤¤Þ¤» ;; ¤ó¡£¥³¥á¥ó¥È¤ä¥Ð¥°¥ì¥Ý¡¼¥È¤Ï¤ª¤ª¤¤¤Ë´¿·Þ¤·¤Þ¤¹¤Î¤Ç¸æµ¤·Ú¤Ë¸æÏ¢Íí ;; ¤¯¤À¤µ¤¤¡£¤Þ¤¿¥×¥í¥°¥é¥à¤ËÂФ¹¤ë¸Ä¿ÍŪ¤Ê½¤Àµ¤Ï¼«Í³¤Ë¤·¤Æ夤¤Æ¹½ ;; ¤¤¤Þ¤»¤ó¤¬¡¢¤½¤ì¤ò¸ø³«¤·¤¿¤¤¾ì¹ç¤Ï»ä¤Þ¤Ç¸æÏ¢Íí¤¯¤À¤µ¤¤¡£Ï¢Íí¤Ï°Ê ;; ²¼¤Î¥¢¥É¥ì¥¹¤Þ¤Ç¤ª´ê¤¤¤·¤Þ¤¹(2000/12¸½ºß)¡£ ;; yuuji@gentei.org ;;[Acknowledgements] ;; ;; Tijs van Bakel, <smoke@casema.net> ;; Reported mpg123 termination problem on mpg123 0.59r on ;; linux 2.2.10. ;; sen_ml@eccosys.com ;; Reported problem at playing music more than 100. ;; Kenichi OKADA, <okada@opaopa.org> ;; Sent a patch of setting sound volume on Solaris/sparc. ;; Takuro Horikawa <takuroho@tky3.3web.ne.jp> ;; Reported running on WinNT. ;; Port `mixer command' to Windows. ;; (See http://www3.tky.3web.ne.jp/~takuroho/mpg123.html) ;; TAOKA Satoshi <taoka@infonets.hiroshima-u.ac.jp> ;; Put mpg123.el into FreeBSD ports collection ;; T. V. Raman <ramantv@earthlink.net> ;; Made emacspeak-mpg123.el. Many comments. ;; Per Weijnitz <Per.Weijnitz@etl.ericsson.se> ;; Sent a patch to enable mixer command on NT4 ;; Takayuki TSUKAGOSHI <tsuka@soft.ics.keio.ac.jp> ;; Sent a patch for mule2@19.34. ;; Ryuichi Arafune <arafune@debian.org> ;; Put mpg123.el to Debian package. ;; Laurent Martelli <martelli@iie.cnam.fr> ;; Sent a patch of passing optional arguments to mpg123. ;; Volume control for Linux. ;; T. Amano <tomoo@cheri.sh> ;; Reported running on Linux. ;; OHTAKI Naoto <ohtaki@wig.nu> ;; Reported running on Windows98 ;; MOROHOSHI Akihiko <moro@nii.ac.jp> ;; Sent a patch on coding-system detection for XEmacs+emu.el ;; Alex Shinn <foof@debian.org> ;; Patch to handle mp3 files in multiple directories. ;; Implemented `playlist'. ;; Seiichi Namba <sn@asahi-net.email.ne.jp> ;; Many collaboration codes for working with dired-dd. ;; Made dired-dd-mpg123. ;; Serge Arsenault <boggles@openface.ca> ;; Sent information on OpenBSD. ;; Toni Ronkko <tronkko@hytti.uku.fi> ;; Many suggestions. ;; ;; ;;[History] ;; $Log: mpg123.el,v $ ;; Revision 1.24 2001/02/23 06:54:30 yuuji ;; Only `>' obeys repetition count. ;; ;; Revision 1.23 2001/02/23 05:39:26 yuuji ;; Delete-file key-binding is changed from `C-d' to `D' for trivial reason.. ;; ;; Revision 1.22 2001/02/23 05:20:12 yuuji ;; `>' at the end of music list obeys the repetition counter. ;; Music list in a stack doesn't appear in the result of shuffle any more. ;; Shuffle preserves highlighted line any time. ;; Now nil for mpg123-preserve-playtime plays a music from the beginning. ;; ;; Revision 1.21 2001/02/21 03:41:10 yuuji ;; Support for OpenBSD is confirmed. ;; ;; Revision 1.20 2001/01/30 03:35:54 yuuji ;; (Win)convert music filename to dos file name for music over shared folder ;; ;; Revision 1.19 2001/01/19 04:41:37 yuuji ;; Fix the invalid 'cond form. ;; ;; Revision 1.18 2000/12/23 07:41:23 yuuji ;; Slider stays wrong position when music list added. Fixed ;; ;; Revision 1.17 2000/12/08 00:54:09 yuuji ;; Variable mpg123-face-playing specifies the color of cursor for playing music. ;; Variable mpg123-face-slider specifies the color of slider of playing position. ;; Variable mpg123-need-slider specifies wheter the slider is needed or not. ;; Mouse-2 selects directly a music on the mouse pointer(in music list) or ;; playing position(in delimiter line). ;; RET(M-x mpg123-play) on the delimiter line move the playing position ;; according to the proportion of the window width from left side. ;; ;; Revision 1.16 2000/11/24 15:09:22 yuuji ;; Support emacs-21.0.9x (in mpg123:mp3-p) ;; ;; Revision 1.15 2000/10/20 14:43:06 yuuji ;; (if (featurep 'xemacs) (require 'overlay)) ;; ;; Revision 1.14 2000/10/16 08:52:44 yuuji ;; 'mpg123*cur-face renamed to 'mpg123-cur-face (For XEmacs) ;; ;; Revision 1.13 2000/08/06 03:56:37 yuuji ;; Support volume setting on NetBSD(mixerctl) ;; ;; Revision 1.12 2000/08/06 02:27:58 yuuji ;; Set it default to use hilighting. ;; ;; Revision 1.11 2000/08/05 15:40:57 yuuji ;; Revise document. ;; ;; Revision 1.10 2000/08/05 15:37:50 yuuji ;; Handle mp3 files in multiple directories. ;; Playlist support. ;; ;; Revision 1.9 2000/06/25 14:38:17 yuuji ;; Fix for XEmacs+emu.el ;; ;; Revision 1.8 2000/02/09 04:15:31 yuuji ;; Fix for mule2 (mpg123:sound-p). ;; ;; Revision 1.7 1999/09/25 07:09:44 yuuji ;; mpg123-delete-file can delete music only from the list, not on the disk. ;; Shuffle after mpg123-delete-file now works correctly. ;; ;; Revision 1.6 1999/09/10 02:09:02 yuuji ;; mpg123-mp3-scan-bytes ;; defmacro changed to defsubst ;; ;; Revision 1.5 1999/07/24 03:58:52 yuuji ;; mule2¤Ç¤Ê¤ë¤Ù¤¯¶ÊÏ¢·¸¤¬ÅÓÀÚ¤ì¤Ê¤¤¤è¤¦¤Ë¹©É×(´°àú¤Ç¤Ï¤Ê¤¤)¡£ ;; ;; Revision 1.4 1999/07/05 09:00:19 yuuji ;; ÆüËܸì¥Õ¥¡¥¤¥ë̾Âбþ(¤¿¤Ö¤ó) ;; \C-d (mpg123-delete-file) ;;