README.plaiter 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. README for Plaiter v 1.4.2
  2. ==========================
  3. 0. Introduction
  4. ---------------
  5. Plaiter (pronounced "player") is a command line front end to command
  6. line music players. It uses shell scripting to try to create the
  7. command line music player that Plait would have used if it already
  8. existed. It complements Plait but is also quite useful on its own,
  9. especially if you already use mpg123 or similar programs and find
  10. yourself wanting more features.
  11. What does Plaiter do that mpg123 can't already? It queues tracks,
  12. first of all. Secondly, it understands commands like play, plause,
  13. stop, next and prev. Finally, unlike most of the command line music
  14. players out there, Plaiter can handle a play list with more than one
  15. type of audio file, selecting the proper helper app to handle each
  16. type of file you throw at it.
  17. Plaiter will automatically configure itself to use ogg123, mpg123,
  18. and/or mpg321, if they are installed on your system. If you have a
  19. helper application that plays other types of audio, Plaiter can be
  20. configured to use it as well.
  21. Like many of us, Plaiter is part daemon and part controller. The
  22. controller builds a play list from the files you provide on the
  23. command line and forwards commands to the daemon. The daemon reads
  24. commands and executes them by running helper applications.
  25. 0.1. What's new
  26. ---------------
  27. Release 1.4.2 fixes a security flaw related to temp files. Upgrading
  28. is highly recommended.
  29. 1. Playing music
  30. ----------------
  31. The simplest way to use Plaiter is to invoke it with a list of music
  32. you want to play, for example
  33. plaiter foo.mp3 bar.ogg baz.flac
  34. or
  35. plaiter http://205.234.188.20:80/
  36. Plaiter also understands directories as arguments, in which case it
  37. tries to play every file in the directory. If some of the files are
  38. not music files, that's all right because Plaiter will discover it
  39. doesn't have a helper application for that type of file and skip it.
  40. An example would be
  41. plaiter "/music/Disco Hits of the 70s"
  42. Plaiter also understands play lists, for example,
  43. plaiter list.m3u
  44. It is the .m3u extension which identifies a file as a play list and
  45. nothing else will be treated as a play list. Plaiter does not
  46. currently understand directories of play lists, but you can use shell
  47. globbing to get the same effect, for example
  48. plaiter /music/partylists/*.m3u
  49. The shell will expand this to a list of play lists, which Plaiter
  50. *does* understand. You can also use globbing to expand a directory
  51. that contains a combination of play lists and music files.
  52. When you invoke Plaiter in this way it runs in controller mode, which
  53. is not capable of actually playing music. Behind the scenes the
  54. controller will start another instance of Plaiter in daemon mode, if
  55. one is not running already, and forward commands to it.
  56. 2. Sending commands
  57. -------------------
  58. A variety of commands are available to control the daemon. You
  59. specify a command as a two dash option, for example
  60. plaiter --play
  61. The seven basic commands are: play, pause, stop, next, prev, reset and
  62. quit. They do pretty much what you would expect. Reset sets the
  63. current track to 1 and starts playing. It is the command that Plaiter
  64. sends automatically whenever it creates a new play list.
  65. Next and prev take optional numeric arguments that specify how many
  66. tracks to skip, counting the current track. The default is one.
  67. There is a search command that provides a search-in-playlist feature.
  68. For example,
  69. plaiter --search fly
  70. looks for a track that contains the string "fly" and plays it if
  71. found. Search proceeds forwards from the current track until the
  72. first match is found, wrapping at the end of the playlist. If no
  73. match is found the current track continues playing. The search string
  74. can be a regular expression.
  75. There is also an rsearch command that does reverse search. It
  76. proceeds backwards from the current track until the first match is
  77. found, wrapping at the beginning of the list. For example,
  78. plaiter --rsearch one
  79. The loop command toggles or sets loop mode. When loop mode is on
  80. and the end of the playlist is reached, play continues on the first
  81. track. When loop mode is off and the end of the playlist is reached,
  82. play stops. Loop mode also affects the behavior of the next and prev
  83. commands. The loop command looks like this:
  84. plaiter --loop
  85. plaiter --loop on
  86. plaiter --loop off
  87. The latch command toggles or sets a latch which will cause playback to
  88. stop when the current track ends. The latch command looks like this:
  89. plaiter --latch
  90. plaiter --latch on
  91. plaiter --latch off
  92. 3. Options
  93. ----------
  94. ### --status.
  95. This option just prints basic information about what Plaiter is doing:
  96. the number of tracks in the playlist, the current track, and whether
  97. Plaiter is playing, paused, or stopped.
  98. ### --list
  99. This option displays the playlist.
  100. ### --random
  101. The --random option shuffles the playlist as it is added. Thus if you
  102. use it with the --queue option, only the new tracks are shuffled.
  103. ### --queue, -q, --enqueue
  104. The --queue option causes tracks to be queued on an existing playlist
  105. rather than replacing it. --enqueue is for compatibility with players
  106. like BMP, amaroK, and XMMS.
  107. ### --daemon, -d
  108. The --daemon option selects daemon mode. See the next section.
  109. ### --help
  110. This option shows brief help.
  111. ### --version
  112. This option shows information about the version, the license, and the
  113. author.
  114. ### --play, --pause, --stop, --next, --prev, --reset, --quit
  115. These commands are forwarded to the daemon.
  116. ### --loop, --search, --rsearch, --latch
  117. These commands are forwarded to the daemon.
  118. ### --install
  119. This option rewrites the helper file. See Section 5.
  120. 4. Daemon mode
  121. --------------
  122. The Plaiter daemon will be started for you automatically if necessary,
  123. but there are times when you may want to start it manually. Why is
  124. that? Well, the Plaiter daemon (and the helper applications it calls)
  125. tend to be quite verbose, so the controller discards their output. If
  126. you want to see the output, you can dedicate a separate console to
  127. this purpose. This gives you a nice clean command line interface to
  128. Plaiter in the main console, with complete information, including the
  129. current track, in the daemon console.
  130. You start Plaiter in daemon mode by typing
  131. plaiter --daemon
  132. The proper way to kill the daemon is to send it the command "quit" or
  133. type Ctrl-c in its console. If you `kill -9` it, the daemon will not
  134. get a chance to clean up after itself. You can do this manually by
  135. typing
  136. rm -f ~/.plait/pdaemon
  137. If you don't, Plaiter will try to clean up the next time it runs.
  138. 5. Helper applications
  139. ----------------------
  140. Plaiter stores a list of file types and associated helper applications
  141. in ~/.plait/helpers. This file will be created automatically the
  142. first time Plaiter is run, but you can edit it to select the helper
  143. applications you prefer. If you don't edit it, Plaiter will look for
  144. ogg123, mpg123-esd, mpg123, and mpg321. If it is present on your
  145. system, ogg123 will be associated with ogg files, flac files, and ogg
  146. streams. For mp3 files, mp3 streams, and all streams whose type can't
  147. be identified from the URL, mpg123-esd will be chosen if present, then
  148. mpg123, then mpg321.
  149. Each line of ~/.plait/helpers consists of a "key" and a helper,
  150. separated by a colon, for example
  151. mp3:mpg123-esd
  152. The key corresponding to a file is just the file suffix. For http
  153. streams it's a little more complicated. A URL with no particular file
  154. suffix, like http://192.168.1.2:80, will have the key "http". Plaiter
  155. assumes that streams like this can be played by mpg123. If the URL
  156. has an mp3 or ogg suffix, that is included in the key, so the key for
  157. http://192.168.1.2:80/stream.ogg would be "httpogg". Plaiter assumes
  158. that ogg123 can play a stream like this.
  159. Adding your own helper applications is just a matter of following
  160. these rules to create an appropriate key, followed by a colon,
  161. followed by the command line required to play that type of file.
  162. If you want Plaiter to configure itself automatically, you should
  163. install the helper applications before running it for the first time.
  164. If you didn't do that, you can run
  165. plaiter --install
  166. to force Plaiter to detect helper applications and write the helper
  167. file again.
  168. 6. Odds and ends
  169. ----------------
  170. Plaiter requires Bash. It uses standard versions of basic commands
  171. including find, awk and sed and should be compatible with most
  172. versions of Unix. It requires a wake up call when the signal SIGCHLD
  173. is received, which seems to rule out Cygwin for now. That's all right
  174. because Cygwin users have Winamp.
  175. 7. What's next
  176. --------------
  177. It's not known at this time what features will be in the next release.
  178. Copyright (c) 2005, 2006 by Stephen Jungels