File: README.plaiter

package info (click to toggle)
plait 1.6.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 280 kB
  • sloc: sh: 2,010; awk: 709; makefile: 10
file content (265 lines) | stat: -rwxr-xr-x 8,822 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
README for Plaiter v 1.4.2
==========================


0. Introduction
---------------

Plaiter (pronounced "player") is a command line front end to command
line music players.  It uses shell scripting to try to create the
command line music player that Plait would have used if it already
existed.  It complements Plait but is also quite useful on its own,
especially if you already use mpg123 or similar programs and find
yourself wanting more features.

What does Plaiter do that mpg123 can't already?  It queues tracks,
first of all.  Secondly, it understands commands like play, plause,
stop, next and prev.  Finally, unlike most of the command line music
players out there, Plaiter can handle a play list with more than one
type of audio file, selecting the proper helper app to handle each
type of file you throw at it.

Plaiter will automatically configure itself to use ogg123, mpg123,
and/or mpg321, if they are installed on your system.  If you have a
helper application that plays other types of audio, Plaiter can be
configured to use it as well.

Like many of us, Plaiter is part daemon and part controller.  The
controller builds a play list from the files you provide on the
command line and forwards commands to the daemon.  The daemon reads
commands and executes them by running helper applications.


0.1. What's new
---------------

Release 1.4.2 fixes a security flaw related to temp files.  Upgrading
is highly recommended.


1. Playing music
----------------

The simplest way to use Plaiter is to invoke it with a list of music
you want to play, for example

    plaiter foo.mp3 bar.ogg baz.flac

or

    plaiter http://205.234.188.20:80/

Plaiter also understands directories as arguments, in which case it
tries to play every file in the directory.  If some of the files are
not music files, that's all right because Plaiter will discover it
doesn't have a helper application for that type of file and skip it.
An example would be

    plaiter "/music/Disco Hits of the 70s"

Plaiter also understands play lists, for example,

    plaiter list.m3u

It is the .m3u extension which identifies a file as a play list and
nothing else will be treated as a play list.  Plaiter does not
currently understand directories of play lists, but you can use shell
globbing to get the same effect, for example

    plaiter /music/partylists/*.m3u 

The shell will expand this to a list of play lists, which Plaiter
*does* understand.  You can also use globbing to expand a directory
that contains a combination of play lists and music files.

When you invoke Plaiter in this way it runs in controller mode, which
is not capable of actually playing music.  Behind the scenes the
controller will start another instance of Plaiter in daemon mode, if
one is not running already, and forward commands to it.


2. Sending commands
-------------------

A variety of commands are available to control the daemon.  You
specify a command as a two dash option, for example

    plaiter --play

The seven basic commands are: play, pause, stop, next, prev, reset and
quit.  They do pretty much what you would expect.  Reset sets the
current track to 1 and starts playing.  It is the command that Plaiter
sends automatically whenever it creates a new play list.

Next and prev take optional numeric arguments that specify how many
tracks to skip, counting the current track.  The default is one.

There is a search command that provides a search-in-playlist feature.
For example,

    plaiter --search fly

looks for a track that contains the string "fly" and plays it if
found.  Search proceeds forwards from the current track until the
first match is found, wrapping at the end of the playlist.  If no
match is found the current track continues playing.  The search string
can be a regular expression.

There is also an rsearch command that does reverse search.  It
proceeds backwards from the current track until the first match is
found, wrapping at the beginning of the list.  For example,

    plaiter --rsearch one

The loop command toggles or sets loop mode.  When loop mode is on
and the end of the playlist is reached, play continues on the first
track.  When loop mode is off and the end of the playlist is reached,
play stops.  Loop mode also affects the behavior of the next and prev
commands.  The loop command looks like this:

    plaiter --loop
    plaiter --loop on
    plaiter --loop off

The latch command toggles or sets a latch which will cause playback to
stop when the current track ends.  The latch command looks like this:

    plaiter --latch
    plaiter --latch on
    plaiter --latch off


3. Options
----------


### --status.  

This option just prints basic information about what Plaiter is doing:
the number of tracks in the playlist, the current track, and whether
Plaiter is playing, paused, or stopped.

### --list

This option displays the playlist.

### --random

The --random option shuffles the playlist as it is added.  Thus if you
use it with the --queue option, only the new tracks are shuffled.

### --queue, -q, --enqueue

The --queue option causes tracks to be queued on an existing playlist
rather than replacing it.  --enqueue is for compatibility with players
like BMP, amaroK, and XMMS.

### --daemon, -d

The --daemon option selects daemon mode.  See the next section.

### --help

This option shows brief help.

### --version

This option shows information about the version, the license, and the
author. 

### --play, --pause, --stop, --next, --prev, --reset, --quit

These commands are forwarded to the daemon.

### --loop, --search, --rsearch, --latch

These commands are forwarded to the daemon.

### --install

This option rewrites the helper file.  See Section 5.


4. Daemon mode
--------------

The Plaiter daemon will be started for you automatically if necessary,
but there are times when you may want to start it manually.  Why is
that?  Well, the Plaiter daemon (and the helper applications it calls)
tend to be quite verbose, so the controller discards their output.  If
you want to see the output, you can dedicate a separate console to
this purpose.  This gives you a nice clean command line interface to
Plaiter in the main console, with complete information, including the
current track, in the daemon console.

You start Plaiter in daemon mode by typing

    plaiter --daemon

The proper way to kill the daemon is to send it the command "quit" or
type Ctrl-c in its console.  If you `kill -9` it, the daemon will not
get a chance to clean up after itself.  You can do this manually by
typing 

    rm -f ~/.plait/pdaemon

If you don't, Plaiter will try to clean up the next time it runs.


5. Helper applications
----------------------

Plaiter stores a list of file types and associated helper applications
in ~/.plait/helpers.  This file will be created automatically the
first time Plaiter is run, but you can edit it to select the helper
applications you prefer.  If you don't edit it, Plaiter will look for
ogg123, mpg123-esd, mpg123, and mpg321.  If it is present on your
system, ogg123 will be associated with ogg files, flac files, and ogg
streams.  For mp3 files, mp3 streams, and all streams whose type can't
be identified from the URL, mpg123-esd will be chosen if present, then
mpg123, then mpg321.

Each line of ~/.plait/helpers consists of a "key" and a helper,
separated by a colon, for example

    mp3:mpg123-esd

The key corresponding to a file is just the file suffix.  For http
streams it's a little more complicated.  A URL with no particular file
suffix, like http://192.168.1.2:80, will have the key "http".  Plaiter
assumes that streams like this can be played by mpg123.  If the URL
has an mp3 or ogg suffix, that is included in the key, so the key for
http://192.168.1.2:80/stream.ogg would be "httpogg".  Plaiter assumes
that ogg123 can play a stream like this.

Adding your own helper applications is just a matter of following
these rules to create an appropriate key, followed by a colon,
followed by the command line required to play that type of file.

If you want Plaiter to configure itself automatically, you should
install the helper applications before running it for the first time.
If you didn't do that, you can run

    plaiter --install

to force Plaiter to detect helper applications and write the helper
file again.


6. Odds and ends
----------------

Plaiter requires Bash.  It uses standard versions of basic commands
including find, awk and sed and should be compatible with most
versions of Unix.  It requires a wake up call when the signal SIGCHLD
is received, which seems to rule out Cygwin for now.  That's all right
because Cygwin users have Winamp.


7. What's next
--------------

It's not known at this time what features will be in the next release.


Copyright (c) 2005, 2006 by Stephen Jungels