Add custom function to play radio stations
This commit is contained in:
parent
12543a352b
commit
772ee43c2c
5
init.el
5
init.el
|
@ -1890,7 +1890,7 @@ With given ARG, display files in `db/important-document-path’."
|
||||||
:commands (helm-show-kill-ring)
|
:commands (helm-show-kill-ring)
|
||||||
:diminish helm-mode
|
:diminish helm-mode
|
||||||
:bind (:map helm-command-map
|
:bind (:map helm-command-map
|
||||||
("#" . helm-emms)
|
("#" . db/play-radio-stations)
|
||||||
("P" . helm-pages))
|
("P" . helm-pages))
|
||||||
:init (setq helm-input-idle-delay 0.0
|
:init (setq helm-input-idle-delay 0.0
|
||||||
helm-buffers-fuzzy-matching t
|
helm-buffers-fuzzy-matching t
|
||||||
|
@ -2124,7 +2124,8 @@ With given ARG, display files in `db/important-document-path’."
|
||||||
:commands (db/play-auto-playlist
|
:commands (db/play-auto-playlist
|
||||||
db/playlist-files-from-git-annex-find
|
db/playlist-files-from-git-annex-find
|
||||||
db/play-auto-playlist-from-git-annex-find
|
db/play-auto-playlist-from-git-annex-find
|
||||||
music-control/body))
|
music-control/body
|
||||||
|
db/play-radio-stations))
|
||||||
|
|
||||||
|
|
||||||
;; * Shells and such
|
;; * Shells and such
|
||||||
|
|
|
@ -18,6 +18,9 @@
|
||||||
:group 'convenience
|
:group 'convenience
|
||||||
:tag "db-music")
|
:tag "db-music")
|
||||||
|
|
||||||
|
|
||||||
|
;; Autogeneration of Playlist
|
||||||
|
|
||||||
(defcustom db/auto-playlist-file-function #'db/play-auto-playlist-from-git-annex-find
|
(defcustom db/auto-playlist-file-function #'db/play-auto-playlist-from-git-annex-find
|
||||||
"Function that has to return a list of all music files that
|
"Function that has to return a list of all music files that
|
||||||
should be included in the auto playlist."
|
should be included in the auto playlist."
|
||||||
|
@ -113,6 +116,49 @@ _RET_: ?RET? _M_: ?M?
|
||||||
("P" (db/play-auto-playlist)
|
("P" (db/play-auto-playlist)
|
||||||
"Play automatically generated playlist"))
|
"Play automatically generated playlist"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;; Radio Stations
|
||||||
|
|
||||||
|
(defcustom db/radio-stations
|
||||||
|
'(("RBB RadioEins" .
|
||||||
|
"http://rbb-radioeins-live.cast.addradio.de/rbb/radioeins/live/mp3/48/stream.mp3")
|
||||||
|
("Deutschlandfunk" .
|
||||||
|
"http://st01.dlf.de/dlf/01/64/mp3/stream.mp3")
|
||||||
|
("Deutschlandradio Kultur" .
|
||||||
|
"https://st02.sslstream.dlf.de/dlf/02/64/mp3/stream.mp3")
|
||||||
|
("Deutschlandfunk Nova" .
|
||||||
|
"https://st03.sslstream.dlf.de/dlf/03/64/mp3/stream.mp3")
|
||||||
|
("DR P7" .
|
||||||
|
"http://live-icy.gss.dr.dk/A/A21L.mp3.m3u")
|
||||||
|
("BBC1 -- Mainstream" .
|
||||||
|
"http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p")
|
||||||
|
("BBC2 -- Adult Contemporary" .
|
||||||
|
"http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p")
|
||||||
|
("BBC4 -- Info, Drama, Documentation" .
|
||||||
|
"http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p")
|
||||||
|
("BBC6 -- Music" .
|
||||||
|
"http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p")
|
||||||
|
("BBC World Service" .
|
||||||
|
"http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk")
|
||||||
|
("NDR1 Niedersachsen" .
|
||||||
|
"https://ndr-ndr1niedersachsen-hannover.sslcast.addradio.de/ndr/ndr1niedersachsen/hannover/mp3/128/stream.mp3"))
|
||||||
|
"An alist of radio station names and a corresponding URL."
|
||||||
|
:group 'db-music
|
||||||
|
:type '(alist :key-type (string :tag "Radio Station")
|
||||||
|
:value-type (string :tag "URL")))
|
||||||
|
|
||||||
|
(defun db/play-radio-stations ()
|
||||||
|
"Prompt for radio station and play the corresponding URL using EMMS.
|
||||||
|
Candidates are taken from `db/radio-stations'."
|
||||||
|
(interactive)
|
||||||
|
(-> (completing-read "Station: " db/radio-stations nil t)
|
||||||
|
(assoc db/radio-stations)
|
||||||
|
cdr
|
||||||
|
emms-play-url))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'db-music)
|
(provide 'db-music)
|
||||||
|
|
||||||
;;; db-music ends here
|
;;; db-music ends here
|
||||||
|
|
Loading…
Reference in New Issue