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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
|
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename emms.info
@settitle The Emms Manual
@c %**end of header
@c History: The Emms manual was almost entirely rewritten for the
@c release of Emms version 2.
@c As a rule, modules which are stable enough to be included into the
@c `emms-all' setup level should be documented.
@c FIXME: Stuff slated for addition to the manual:
@c emms-mode-line
@c FIXME: Should emms-playlist-mode-save-buffer be a part of
@c emms-playlist-mode? Probably not. This should be raised in the
@c forum of our quaint and sleepy mailing list.
@dircategory Emacs
@direntry
* Emms: (emms). The Emacs Multimedia System
@end direntry
@copying
@copyright{} (c) 2004, 2005
Yoni Rabkin, Jorgen Schaefer, Mario Domgoergen
@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A
copy of the license is included in the section entitled "GNU Free
Documentation License".
@end quotation
@end copying
@c For printed material
@titlepage
@title The Emms Manual
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@c END For printed material
@ifnottex
@node Top, Copying, (dir), (dir)
@top Emms Manual
This is the Manual for the Emacs Multimedia System
@menu
* Copying:: The GNU General Public License gives you permission to
redistribute Emms on certain terms; it also explains
that there is no warranty.
* The GNU FDL:: The license for this documentation.
Starting out
* Introduction:: Introduction to Emms.
* Installation:: How to install Emms on your System.
* Simple Setup:: Quick, basic default Emms setup.
* Configuration:: More detailed setup and configuration.
Emms basics
* Basic Commands:: How to control Emms with ease.
* The Core File:: The inner core of Emms.
* Sources:: Sources for playlists-creation.
* Simple Players:: Some simple players.
* Playlists:: How Emms organizes media
Advanced Features
* Track Information:: More narrative track descriptions.
* Interactive Playlists:: Interactive Playlists.
* Extending Emms:: How to define new players and modules.
* Streaming Audio:: Interface to streaming audio.
Indices
* Concept Index::
* Function Index::
* Variable Index::
* Keybinding Index::
@detailmenu
--- The Detailed Node Listing ---
Here are some other nodes which are really inferiors of the ones
already listed, mentioned here so you can get to them in one step:
Installation
* Compiling Emms:: Compiling Emms into Byte-Code
The Core File
* User Variables:: Variables for the user to tweak.
* Hooks:: Hooks for important Emms functions.
* Core Functions:: Providing the basic functionality of Emms.
Track Information
* Defining Info Methods:: Defining new info methods
Extending Emms
* New Player:: How to define a new player
* Simple Player for @command{play}:: Example player using @command{play}
* More Complex Player:: Example of a complex player using @command{mpg321}
@end detailmenu
@end menu
@end ifnottex
@c including the relevant licenses
@include gpl.texi
@include fdl.texi
@node Introduction
@chapter Introduction
@cindex introduction
Emms is the Emacs Multi-Media System. It tries to be a clean and small
application to play multimedia files from Emacs using external
players. Many of its ideas are derived from
@uref{http://www.nongnu.org/mp3player, MpthreePlayer}, but it tries to
be more general and more clean.
The basic functionality of Emms consists of three parts: The core, the
sources, and the players.
The core resides in @file{emms.el}, and provides a simple playlist and the
basic functionality to use all the other features of Emms. It provides
the common user commands and interfaces for other parts. It thinks in
tracks, where a track is the combination of a type and a name - e.g.
the track type 'file has a name that is the file name. Other track
types are possible.
To get to tracks, the core needs sources. The file @file{emms-source-file.el}
provides simple sources to interact with the file system.
When Emms finally has the sources in the playlist, it needs a player
to play them. @file{emms-player-simple.el} defines a few useful players, and
allows you to define your own in a very simple way.
The way Emms works is easy to customize with your own code or by using
`M-x customize'.
@node Installation
@chapter Installation
@cindex installation
You need to put all the .el files of emms in a directory in your
load-path. For example, if you put all those files into ~/elisp/emms/,
then in your ~/.emacs, you should do:
@lisp
(add-to-list 'load-path "~/elisp/emms/")
@end lisp
@noindent
@menu
* Compiling Emms:: Compiling Emms into Byte-Code
@end menu
@node Compiling Emms
@section Compiling Emms
@cindex compiling
You can byte-compile Emms by first entering the directory containing the
Emms source code, followed by invoking:
@command{make}
Which will byte compile Emms. You can then invoke:
@command{make install}
Which will install Emms into your Emacs directories (provided you have
the appropriate permissions to do so on your system).
Note that Emms is a light-weight and agile program, you can therefore
run Emms just fine without byte compiling it.
@node Simple Setup
@chapter Simple Setup
@cindex simple setup
@cindex setting up Emms
@cindex quick setup
After adding the location of the Emms code to the @var{load-path}
variable, see @xref{Installation}. we invoke the following using the
`emms-setup' feature which allows for quick and simple Emms setup.
@lisp
(require 'emms-setup)
(emms-standard)
(emms-default-players)
@end lisp
After which Emms is set-up and ready to go!
The above will setup Emms with standard features (interactive
playlists, audio track tag reading etc.) and a default list of players
(ogg, mp3, mplayer etc.).
The `emms-setup' feature is provided by the file
@file{emms-setup.el}. It is essentially a collection of shortcuts for
setting up Emms quickly and simply. Everything you can do with
`emms-setup' can also be done manually.
We use `emms-setup' by calling one of the setup functions. Each of the
functions sets up Emms to include a number of features.
@defun emms-minimalistic
An Emms setup script.
Invisible playlists and all the basics for playing media.
@end defun
@defun emms-standard
An Emms setup script.
Everything included in the @code{emms-minimalistic} setup, the Emms
interactive playlist mode and reading information from tagged
audio files.
@end defun
@defun emms-all
An Emms setup script.
Everything included in the @code{emms-standard} setup and adds all the
stable features which come with the Emms distribution.
@end defun
@defun emms-devel
An Emms setup script.
Everything included in the @code{emms-all} setup and adds all of the
features which come with the Emms distribution regardless of if they
are considered stable or not. Use this if you like living on the
edge.
@end defun
`emms-setup' also comes with a convenience function to set a default
list of media players.
@defun emms-default-players
Set @var{emms-player-list} to @var{emms-setup-default-player-list}.
@end defun
It is also worth noting that you can write your own Emms setup
functions like the above by looking at the existing function
definitions in @file{emms-setup.el}.
@node Configuration
@chapter Configuration
@cindex Configuration
This chapter discusses the configuration of Emms in more detail.
The following code fragment provides a minimal Emms setup without
using the layer of `emms-setup'. It can maybe be used to better
understand the internals of Emms. You can see how Emms needs to know
about players (these are defined in `emms-player-simple') and about
sources for tracks (trivial file system based sources, such as this
`emms-directory-tree', are defined in `emms-source-file').
@lisp
(require 'emms-player-simple)
(require 'emms-source-file)
(setq emms-player-list '(emms-player-mpg321
emms-player-ogg123
emms-player-mplayer))
@end lisp
For a discussion on how to define additional players, see @xref{Simple
Players}.
Much of the behaviour of Emms can be changed by setting
variables. For example:
@lisp
(setq emms-info-asynchronously nil)
(setq emms-playlist-buffer-name "*Music*")
@end lisp
The first @code{setq} turns off the asynchronous updating of info tags. The
second sets the default name of the Emms playlist buffer.
Another way to change Emms variables is to use the M-x
@command{customize} mechanism provided by Emacs.
@node Basic Commands
@chapter Basic Commands
@cindex basic commands
@cindex commands, basic
Before you can use the interface commands, you need a playlist to
start with. The following commands allow you to add to the current
playlist from different sources:
Note that the commands with the ``emms-add-'' prefix add the source to
the playlist but do not start playing it immediately. Conversely, the
commands with the ``emms-play-'' prefix begin playing the track
immediately.
@defun emms-play-file file
A source for a single file - either @var{file}, or queried from the
user.
@end defun
@defun emms-add-file file
A source for a single file - either @var{file}, or queried from
the user.
@end defun
@defun emms-play-directory dir
A source for a whole directory tree - either @var{dir}, or queried
from the user.
@end defun
@defun emms-add-directory dir
A source for a whole directory tree - either @var{dir}, or queried
from the user.
@end defun
@defun emms-play-directory-tree dir
A source for multiple directory trees - either @var{dir}, or the
value of @var{emms-source-file-default-directory}.
@end defun
@defun emms-add-directory-tree dir
A source for multiple directory trees - either @var{dir}, or the
value of @var{emms-source-file-default-directory}.
@end defun
@defun emms-play-url url
A source for an @var{url} - for example, for streaming.
@end defun
@defun emms-add-url url
A source for an @var{url} - for example, for streaming.
@end defun
@defun emms-play-m3u-playlist playlist
A source for the M3u playlist format from the file @var{playlist}.
@end defun
@defun emms-add-m3u-playlist playlist
A source for the M3u playlist format from the file @var{playlist}.
@end defun
@defun emms-play-find dir regexp
A source that will find files in @var{dir} or
@var{emms-source-file-default-directory} which match @var{regexp}.
@end defun
@defun emms-add-find dir regexp
A source that will find files in @var{dir} or
@var{emms-source-file-default-directory} which match @var{regexp}.
@end defun
The basic functionality of Emms is just to play music without being
noticed. It provides a few commands to skip the current track and
such, but other than that it doesn't show up. Emms provides the
following basic user commands (which you might want to bind to
keystrokes):
@defun emms-start
Start playing the current playlist
@end defun
@defun emms-stop
Stop playing
@end defun
@defun emms-next
Start playing the next track in the playlist
@end defun
@defun emms-previous
Start playing previous track in the playlist
@end defun
@defun emms-shuffle
Shuffle the current playlist. This uses
@var{emms-playlist-shuffle-function}.
@end defun
@defun emms-sort
Sort the current playlist. This uses
@var{emms-playlist-sort-function}.
@end defun
@defun emms-show &optional insertp
Describe the current Emms track in the minibuffer. If @var{insertp} is
non-nil, insert the description into the current buffer instead. This
function uses @var{emms-show-format} to format the current track.
@end defun
@node The Core File
@chapter The Core File
@cindex core file
@cindex heart of Emms
@cindex primitive functions
The core file @file{emms.el} provides the all basic functions for
playing music, generating playlists and defining players.
@menu
* User Variables:: Variables for the user to tweak.
* Hooks:: Hooks for important Emms functions.
* Core Functions:: Providing the basic functionality of Emms.
@end menu
@node User Variables
@section User Variables
@cindex user variables
@cindex options
The core file defines a number of user variables.
@defopt emms-player-list
A list of players Emms can use. You need to set this in order to use
Emms to play media.
@end defopt
@defopt emms-show-format
The format to use for @command{emms-show}. Any "%s" is replaced by
what @var{emms-track-description-function} returns for the currently
playing track.
@end defopt
@defopt emms-repeat-playlist
Non-nil if the Emms playlist should automatically repeat the playlist.
If nil, playback will stop when the last track finishes playing.
@end defopt
@defopt emms-track-description-function
Function for describing an Emms track in a user-friendly way.
@end defopt
@defopt emms-sort-lessp-function
A function that compares two tracks, and returns non-nil if the first
track should be sorted before the second (see also @code{sort}).
@end defopt
@node Hooks
@section Hooks
@cindex hooks
@cindex adding functionality
The core file provides hook variables for the basic functionality of
Emms.
@defopt emms-player-started-hook
A hook run when an Emms player started playing.
@end defopt
@defopt emms-player-stopped-hook
A hook run when an Emms player stopped playing. See also
@var{emms-player-finished-hook}.
@end defopt
@defopt emms-playlist-source-inserted-hook
Hook run when a source got inserted into the playlist. The buffer is
narrowed to the new tracks.
@end defopt
@defopt emms-playlist-selection-changed-hook
Hook run after another track is selected in the Emms playlist.
@end defopt
@defopt emms-playlist-cleared-hook
Hook run after the current Emms playlist is cleared. This happens both
when the playlist is cleared and when a new buffer is created for it.
@end defopt
@defopt emms-player-finished-hook
Hook run when an Emms player finishes playing a track. Please pay
attention to the differences between @var{emms-player-finished-hook}
and @var{emms-player-stopped-hook}. The former is called only when the
player is stopped interactively; the latter, only when the player
actually finishes playing a track.
@end defopt
@defopt emms-player-paused-hook
Hook run when a player is paused or resumed. Use
@var{emms-player-paused-p} to find the current state.
@end defopt
@node Core Functions
@section Core Functions
@cindex core functions
@cindex basic functions
The core file also defines all the functions important to the basic
use of Emms.
There are functions which deal with movement in the playlist.
@defun emms-next-noerror
Start playing the next track in the Emms playlist. Unlike
@code{emms-next}, this function doesn't signal an error when called at
the end of the playlist. This function should only be called when no
player is playing. This is a good function to put in
@code{emms-player-finished-hook}.
@end defun
@defun emms-playlist-next
Move to the previous track in the current buffer.
@end defun
@defun emms-playlist-previous
Move to the previous track in the current buffer.
@end defun
@defun emms-random
Jump to a random track.
@end defun
@defun emms-toggle-repeat-playlist
Toggle whether emms repeats the playlist after it is done. See
@var{emms-repeat-playlist}.
@end defun
@defun emms-toggle-repeat-track
Toggle whether emms repeats the current track. See
@var{emms-repeat-track}.
@end defun
Some functions deal with the getting and setting track information.
@defun emms-track type name
Create a track with type @var{type} and name @var{name}.
@end defun
@defun emms-track-type track
Return the type of @var{track}.
@end defun
@defun emms-track-name track
Return the name of @var{track}.
@end defun
@defun emms-track-get name track &optional inexistent
Return the value of @var{name} for @var{track}. If there is no value,
return @var{default} (or nil, if not given).
@end defun
@defun emms-track-set track name value
Set the value of @var{name} for @var{track} to @var{value}.
@end defun
@defun emms-track-description track
Return a description of @var{track}. This function uses
@var{emms-track-description-function}.
@end defun
@defun emms-player-for track
Return an Emms player capable of playing @var{track}. This will be the
first player whose PLAYABLEP function returns non-nil, or nil if no
such player exists.
@end defun
@defun emms-playlist-current-selected-track
Return the currently selected track in the current playlist.
@end defun
There are also functions which deal with the playing itself.
@defun emms-player-start track
Start playing @var{track}.
@end defun
@defun emms-player-stop
Stop the currently playing player.
@end defun
@defun emms-player-stopped
Declare that the current Emms player is finished.
This should only be done by the current player itself.
@end defun
@defun emms-seek seconds
Seek the current player @var{seconds} seconds. This can be a floating
point number for sub-second fractions. It can also be negative to
seek backwards.
@end defun
@defun emms-seek-forward
Seek ten seconds forward.
@end defun
@defun emms-seek-backward
Seek ten seconds backward.
@end defun
For more basic commands defined in the core file see @xref{Basic
Commands}.
@node Sources
@chapter Sources
@cindex Sources
Sources allow Emms to add and play tracks. Emms comes with a number of
sources of its own. Sources are designed so that creating new ones
will be easy.
For examples of Emms sources for files and directories see
@file{emms-source-file.el}.
@defopt emms-source-file-default-directory
The default directory to look for media files.
@end defopt
@defun emms-play-find
Play all files in @var{emms-source-file-default-directory} that match
a specific regular expression.
@end defun
@defun emms-source-file &optional file
An Emms source for a single file - either @var{file}, or queried from the
user.
@end defun
@defun emms-source-files files
An Emms source for a list of @var{files}.
@end defun
@defun emms-source-directory &optional dir
An Emms source for a whole directory tree - either @var{dir}, or queried
from the user
@end defun
@defun emms-source-directory-tree & optional dir
An Emms source for multiple directory trees - either @var{dir}, or the
value of @var{emms-source-file-default-directory}.
@end defun
@defun emms-source-find &optional dir regex
An Emms source that will find files in @var{dir} or
@var{emms-source-file-default-directory} that match @var{regexp}.
@end defun
@defun emms-source-file-directory-tree &optional dir
Return a list of all files under @var{dir} which match @var{regex}.
@end defun
@defun emms-source-dired
Play all marked files of a dired buffer
@end defun
@defun emms-source-file-regex
Return a regexp that matches everything any player (that supports
files) can play.
@end defun
@defun emms-locate regexp
Search for @var{regexp} and display the results in a locate buffer
@end defun
@node Simple Players
@chapter Simple Players
@cindex players, simple
@defmac define-emms-simple-player name types regex command &rest args
Define a simple player with the use of `emms-define-player'.
@var{name} is used to construct the name of the function like
emms-player-@var{name}. @var{types} is a list of track types
understood by this player. @var{regex} must be a regexp that matches
the filenames the player can play. @var{command} specifies the command
line argument to call the player and @var{args} are the command line
arguments.
@end defmac
For a discussion on how to define new players see @xref{New Player}.
@defun emms-player-simple-stop
Stop the currently playing process, if indeed there is one.
@end defun
@defun emms-player-simple-start filename cmdname params
Starts a process playing @var{filename} using the specified @var{cmdname} with
the specified @var{params}.
@end defun
@defun emms-player-simple-sentinel proc str
Sentinel for determining the end of process for the process @var{proc}
and the sentinel string @var{str}.
@end defun
@node Playlists
@chapter Playlists
@cindex organizing tracks and media
Emms uses Emacs buffers to store the media tracks for playing. We call
one such buffer a ``playlist buffer'' or an ``Emms playlist
buffer''. Emms then proceeds to play the media tracks in the buffer
from top to bottom until the end of the playlist.
The name of the playlist buffer is defined in the variable
@var{emms-playlist-buffer-name} and is set to be an invisible Emacs
buffer by default. You can change to any name you want. For an example
configuration see @xref{Configuration}.
You can create any number of playlist buffers you wish. At any time
Emms has a single ``current'' buffer through which it proceeds track
by track.
@defun emms-playlist-new &optional name
Create a new playlist buffer.
The buffer is named @var{name}, but made unique. @var{name} defaults
to `emms-playlist-buffer-name'. If called interactively, the new
buffer is also selected.
@end defun
The current Emms playlist buffer is stored in the variable
@var{emms-playlist-buffer}.
@node Track Information
@chapter Track Information
@cindex track information
@cindex info tags
Emms is distributed with two predefined methods for retrieving info,
provided by @file{emms-info-mp3info.el} and
@file{emms-info-ogginfo.el}. Both packages are front-ends for
command-line tools. Ogg track information is retrieved using the
@uref{http://directory.fsf.org/audio/ogg/vorbistools.html, ogginfo}
software. Likewise, mp3 track information is available using
@uref{http://www.ibiblio.org/mp3info/, mp3info}.
Automatic track information retrieval is enabled by default in the
`emms-standard', `emms-all' and `emms-devel' setup levels provided by
@file{emms-setup.el}. For more information about @file{emms-setup.el}
see @xref{Simple Setup}.
If you would like to know how Emms track retreival works and how we
can define new methods for track retrieval see @xref{Defining Info
Methods}.
There are a number of user variables which control the behaviour of
`emms-info'.
@defopt emms-info-auto-update
Non-nil when Emms should update track information if the file changes.
This will cause hard drive activity on track loading. If this is too
annoying for you, set this variable to nil.
@end defopt
@defopt emms-info-asynchronously
Non-nil when track information should be loaded asynchronously. This
requires the feature `later-do' which is provided by the file
@file{later-do.el}, which should come with Emms.
@end defopt
@defopt emms-info-functions
Functions which add information to tracks. Each is called with a
track as argument.
@end defopt
@menu
* Defining Info Methods:: Defining new info methods
@end menu
@node Defining Info Methods
@section Defining Info Methods
@cindex defining info methods
An info method essentially consists of a function which given an Emms
track returns the appropriate info for that track.
We can for example look at the predefined method for retrieving
information about audio tracks in the Ogg format.
The function @command{emms-info-ogginfo} provided by
@file{emms-info-ogginfo.el} accepts an Emms track as a single
argument and returns the appropriate information string.
We then register our info function with Emms by adding it to the
@var{emms-info-functions} list. The function will then be called at
the right time to provide track info.
@lisp
(add-to-list 'emms-info-functions 'emms-info-ogginfo)
@end lisp
@node Interactive Playlists
@chapter Interactive Playlists
@cindex Interactive Playlists
Emms provides a visual, interactive playlist mode as well as the
ability to use playlists without ever looking at then. This visual,
interactive mode is called the `emms-playlist-mode' and is defined in
@file{emms-playlist-mode.el}.
The interactive playlist mode is enabled by default in the
`emms-standard', `emms-all' and `emms-devel' setup levels. For more
information about Emms setup levels see @xref{Simple Setup}.
@defun emms-playlist-mode-go
Switch to the current emms-playlist buffer and use emms-playlist-mode.
@end defun
The interactive playlist buffer shows the tracks in the current Emms
playlist in the order in which they will be played. The current track
will be highlighted.
When in the interactive playlist mode we can perform different actions
on the current playlist.
@table @kbd
@item n
@findex emms-next
Start playing the next track in the playlist.
@item p
@findex emms-next
Start playing the previous track in the playlist.
@item C-x C-s
@findex emms-playlist-mode-save-buffer
Save the current playlist buffer to a file.
@item C-k
@findex emms-playlist-mode-kill-track
Remove the track under point from the playlist buffer. Also available
by pressing the @kbd{d} key.
@item C-y
@findex emms-playlist-mode-yank
Yank the last track killed back into the playlist buffer.
@item s
@findex emms-stop
Stop playing.
@item f
@findex emms-show
Describe the currently playing track in the minibuffer.
@item c
@findex emms-playlist-mode-center-current
Display the current track in the center of the screen.
@item RET
@findex emms-playlist-mode-play-current-track
Start playing the track under point. Note that this is also available
with @kbd{<mouse-2>}.
@item q
@findex bury-buffer
Put the interactive playlist buffer at the end of the list of all
buffers.
@item ?
@findex describe-mode
Describe the mode.
@item M-<
@findex emms-playlist-mode-first
Go to the first track in the playlist. @kbd{M->} completes this
command by going to the last track in the playlist using
@command{emms-playlist-mode-last}.
@item C-n
@findex emms-playlist-mode-select-next
Go to the next track in the playlist. @kbd{C-p} completes this command
by going to the previous track in the playlist using
@command{emms-playlist-mode-select-previous}.
@item r
@findex emms-random
Go to a randomly selected track in the playlist.
@end table
@node Extending Emms
@chapter Extending Emms
@cindex new players
@cindex defining players
@cindex new players, defining
Emms introduces a high abstraction layer for playing music so you can
customise it to your needs.
@menu
* New Player:: How to define a new player
* Simple Player for @command{play}:: An example player using @command{play}
* More Complex Player:: Example of a complex player using @command{mpg321}
@end menu
@node New Player
@section New Player
@cindex new player
@cindex defining new players
The file @file{emms-player-simple.el} defines some easy players to
start with, but it shouldn't be hard to provide a function for your
favourite player. We will start with an easy example that shows how
we can use the @command{play} command under Unix to play our WAV files.
@node Simple Player for @command{play}
@section Simple Player for @command{play}
@cindex simple player
@cindex primitive player
@cindex basic player
Play is a very easy command line player for various format. If you
want your emms to play WAV files just put the following lines in you
@file{.emacs}:
@lisp
(require 'emms-player-simple)
(define-emms-simple-player play '(file) "\\.wav$" "play")
@end lisp
@noindent
Huh! Wasn't that easy?
The macro function @command{define-emms-simple-player} takes a minimum
of three arguments. The first argument (@emph{play} in our example)
defines the name of the player. It's used to name the player
functions. The second is a regexp, that defines which files to play
with our player. @emph{\\.wav$} matches any filename ending with a dot
and the string wav. The last argument is the actual command line
command we use to play our files. You can also add the path but we
just assume that the command is in your path. All arguments you add to
these three are optional. They define the command line arguments you
want to add to your argument. If you want to hear the wav file of
your favourite artist in the most possible volume use the following
line:
@lisp
(require 'emms-player-simple)
(define-emms-simple-player play '(file) "\\artist-*.wav$" "play" "--volume=100")
@end lisp
@noindent
Please notice that you have to add the arguments as strings!
The command line tool you use for @command{define-emms-simple-player}
has to take one song as argument and stop after playing that
particular song. For any other concept you will need to customise
emms a bit more...
@node More Complex Player
@section More Complex Player
@cindex complex player
@cindex advanced player
The most players you use will be simple players so you don't need to
read this chapter. But if you are curious how you can use (almost) every
player in emms read further...
In this chapter we will use mpg321 to construct a player that
actually can pause a track, restart it and show rest time. We won't
implement all of that, but after that chapter you will know how to
define it.
The command @command{define-emms-simple-player} is just a abstraction
layer for @command{define-emms-player}, which is a little bit more
complicated but much more powerful!
@lisp
(define-emms-player "emms-mpg321-remote"
:start 'emms-mpg321-remote-start
:stop 'emms-mpg321-remote-stop
:playablep 'emms-mpg321-remote-playable-p)
@end lisp
@noindent
So, that is almost all! @command{define-emms-player} takes a minimum
of three arguments. The first is the name of the player. The rest are
methods with functions to call. Three methods are required: start,
stop and playable. Start says Emms how to start a track (sic!), stop
how to stop a player and playablep should return non-nil if the player
can play the track.
So we just need these three functions to get our mpg321-remote:
First we code the start function. We will check if there's a open
process and start one otherwise. Then we send a string to the process
with the filename and set a filter.
@lisp
(defun emms-mpg321-remote-start ()
(unless (get-process "mpg321-remote")
(setq emms-mpg321-remote-process
(start-process "mpg321-remote-process"
"*mpg321*" "mpg321" "-R" "abc"))
(process-send-string "mpg321-remote-process"
(concat "l " (emms-track-name track)))
(set-process-filter emms-mpg321-remote-process 'emms-mpg321-remote-filter)))
@end lisp
@noindent
We need the filter, as mpg321-remote won't quit after playing the
track as the simple player do. We wait until the process send the
output ``@@P 0'' (the signal of mpg321 that the song ended) to the
filter and call emms-mpg321-remote-stop.
@lisp
(defun emms-mpg321-remote-filter (process output)
(when (string-match "@@P 0" output)
(emms-mpg321-remote-stop)))
@end lisp
@noindent
@command{emms-mpg321-remote-stop} won't do anything interesting. It
just test if there are other files to play and close the process otherwise.
@lisp
(defun emms-mpg321-remote-stop ()
(unless emms-playlist
(process-send-string "mpg321-remote-process" "Q\n"))
@end lisp
@noindent
And to make that a playable example i also added
@command{emms-mpg321-remote-playablep}, which i just really steal
from @file{emms-player-simple.el}
@lisp
(defun emms-mpg321-remote-playablep (track)
"Return non-nil when we can play this track."
(and (eq 'file (emms-track-type track))
@end lisp
@noindent
Now we have a ready player and we could add commands like
@command{emms-mpg321-remote-pause} for example.
@node Streaming Audio
@chapter Streaming Audio
@cindex streaming audio
@cindex internet radio
Emms provides a friendly interface for managing and playing streaming
audio in addition to the Emms playlist interface. The interface is
defined in the @file{emms-streams.el} package and can be loaded by
invoking:
@lisp
(require 'emms-streams)
@end lisp
The Emms interface for streaming audio is enabled by default in the
`emms-all' and `emms-devel' setup levels. For more information about
Emms setup levels see @xref{Simple Setup}.
Enter the emms-streams interface by invoking @kbd{M-x}
@command{emms-streams}. The emms-streams interface comes with a
built-in, eclectic list of streaming audio channels from throughout the
Web. Emms can of-course play other streams than the ones listed by
default, you are free to remove any or all of them and add your
own.@footnote{If you enjoy a particular streaming audio station on the
Web and think that it belongs in the default list, please send us a
link and we will gladly add it!}
The following is a list of the key-bindings for the emms-streams
interface:
@table @kbd
@item RET
@kindex RET (emms-streams)
@vindex emms-stream-default-action
Perform the default action when you press RET in the Emms Stream
interface. Can be either ``add'' or ``play''. The default is ``add'',
which adds the station under point to the Emms playlist. When
@var{emms-stream-default-action} is ``play'' then Emms will play the
streaming audio channel under point.
@item q
@kindex q (emms-streams)
@findex emms-stream-quit
Quit the emms-streams interface.
@item a
@kindex a (emms-streams)
@findex emms-stream-add-bookmark
Add a bookmark to a streaming audio URL to the list.
@item d
@kindex d (emms-streams)
@findex emms-stream-delete-bookmark
Remove a bookmark to a streaming audio URL from the list.
@item e
@kindex e (emms-streams)
@findex emms-stream-edit-bookmark
Edit the details of the bookmark under point.
@item h
@kindex h (emms-streams)
@findex describe-mode
Describe the emms-streams mode.
@item n
@kindex n (emms-streams)
@findex emms-stream-next-line
Move to the next line in the emms-streams buffer (same as C-n).
@item p
@kindex p (emms-streams)
@findex emms-stream-previous-line
Move to the previous line in the emms-streams buffer (same as C-p).
@item s
@kindex s (emms-streams)
@findex emms-stream-save-bookmarks-file
Save the bookmarks in the emms-streams interface to disk. The
bookmarks will be to the location designated in the variable
@var{emms-stream-bookmarks-file}.
@item i
@kindex i (emms-streams)
@findex emms-stream-info-bookmark
Return information about the streaming audio at the URL of the
bookmark under point. Note that this will only work if the
`emms-stream-info' has already been loaded.
@end table
@node Concept Index
@unnumbered Concept Index
@printindex cp
@node Function Index
@unnumbered Function Index
@printindex fn
@node Variable Index
@unnumbered Variable Index
@printindex vr
@node Keybinding Index
@unnumbered Keybinding Index
@printindex ky
@bye
|