-
Notifications
You must be signed in to change notification settings - Fork 0
/
emms-vlc-config.el
109 lines (91 loc) · 3.43 KB
/
emms-vlc-config.el
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
;;; emms-vlc-config.el --- config for emms using vlc.
;;; Code:
(setq emms-score-file "~/.emacs.d/emms/scores")
(setq emms-stream-bookmarks-file "~/.emacs.d/emms/emms-streams")
(setq emms-history-file "~/.emacs.d/emms/emms-history")
(setq emms-cache-file "~/.emacs.d/emms/emms-cache")
(setq emms-source-file-default-directory "/home/thierry/Musique")
(when (require 'emms-setup nil t)
(require 'emms-player-simple)
(require 'emms-source-file)
(require 'emms-source-playlist)
(require 'emms-streams)
(require 'emms-info)
(emms-devel)
(emms-default-players)
(require 'emms-mode-line)
(require 'emms-player-vlc))
(setq emms-player-list '(emms-player-vlc-playlist
emms-player-vlc
emms-player-mplayer
emms-player-mpg321
emms-player-ogg123))
;; «enable-emms-scoring» (to ".enable-emms-scoring")
(setq emms-score-enabled-p t)
;; «Start-browser-with-album» (to ".Start-browser-with-album")
(setq emms-browser-default-browse-type 'info-album)
;; «default-action-for-bookmark-streams» (to ".default-action-for-bookmark-streams")
(setq emms-stream-default-action "play")
;; «Mode-line» (to ".Mode-line")
(setq emms-mode-line-icon-color "Gold1")
(setq emms-mode-line-icon-before-format "[")
(setq emms-mode-line-format " %s")
(setq emms-playing-time-display-format " %s]")
(defun emms-mode-line-playlist-current ()
"Format the currently playing song."
(format emms-mode-line-format
(propertize "Emms playing"
'help-echo
(emms-track-description
(emms-playlist-current-selected-track)))))
(defun tv-emms-mode-line-icon-function ()
(setq emms-mode-line-icon-image-cache
`(image :type xpm :ascent center :data ,(concat "/* XPM */
static char *note[] = {
/* width height num_colors chars_per_pixel */
\" 10 11 2 1\",
/* colors */
\". c " emms-mode-line-icon-color "\",
\"# c None s None\",
/* pixels */
\"###...####\",
\"###.#...##\",
\"###.###...\",
\"###.#####.\",
\"###.#####.\",
\"#...#####.\",
\"....#####.\",
\"#..######.\",
\"#######...\",
\"######....\",
\"#######..#\"};")))
(concat " "
emms-mode-line-icon-before-format
(emms-propertize "NP:" 'display emms-mode-line-icon-image-cache)
(emms-mode-line-playlist-current)))
(setq emms-mode-line-mode-line-function 'tv-emms-mode-line-icon-function)
(emms-mode-line 1)
;; «Bindings» (to ".Bindings")
(global-set-key (kbd "<f6> r") 'emms-streams)
(global-set-key (kbd "<f6> +") 'emms-volume-raise)
(global-set-key (kbd "<f6> -") 'emms-volume-lower)
(global-set-key (kbd "<f6> b") 'emms-smart-browse)
(global-set-key (kbd "<f6> t") 'emms-player-mpd-show)
(global-set-key (kbd "<f6> s") 'emms-stop)
(global-set-key (kbd "<f6> RET")'emms-start)
(global-set-key (kbd "<f6> c") 'emms-browser-clear-playlist)
(global-set-key (kbd "<f6> p") 'emms-pause)
(global-set-key (kbd "<f6> >") 'emms-next)
(global-set-key (kbd "<f6> <") 'emms-previous)
(global-set-key (kbd "<f6> m") 'emms-mode-line-toggle)
;; «Update-mpd-directory» (to ".Update-mpd-directory")
(defun tv-emms-update-and-clean-cache ()
(interactive)
(and emms-cache-db
(clrhash emms-cache-db))
(ignore-errors
(delete-file "~/.emacs.d/emms/emms-cache")
(delete-file "~/.emacs.d/emms/emms-history"))
(emms-add-directory-tree "~/Musique/"))
(provide 'emms-vlc-config)
;;; emms-vlc-config.el ends here