1 ;;; --------------------------------------------------------------------------
2 ;;; CLFSWM - FullScreen Window Manager
4 ;;; --------------------------------------------------------------------------
5 ;;; Documentation: Music Player Daemon (MPD) interface
6 ;;; --------------------------------------------------------------------------
8 ;;; (C) 2015 Philippe Brochard <pbrochard@common-lisp.net>
10 ;;; This program is free software; you can redistribute it and/or modify
11 ;;; it under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or
13 ;;; (at your option) any later version.
15 ;;; This program is distributed in the hope that it will be useful,
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with this program; if not, write to the Free Software
22 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 ;;; Documentation: Handle the CD player
25 ;;; This code needs pcd (http://hocwp.free.fr/pcd.html).
26 ;; If you want to use this file, just add this line in
27 ;;; your configuration file:
29 ;;; (load-contrib "cd-player.lisp")
31 ;;; --------------------------------------------------------------------------
35 (format t
"Loading CDPLAYER code... ")
37 (defun cdplayer-menu ()
38 "Open the CDPLAYER menu"
39 (open-menu (find-menu 'cdplayer-menu
)))
41 (defun cdplayer-play ()
43 (do-shell "pcd play"))
45 (defun cdplayer-stop ()
47 (do-shell "pcd stop"))
49 (defun cdplayer-pause ()
51 (do-shell "pcd toggle"))
53 (defun show-cdplayer-status ()
54 "Show the current CD status"
55 (info-on-shell "CDPLAYER status:" "pcd info")
58 (defun show-cdplayer-playlist ()
59 "Show the current CD playlist"
60 (info-on-shell "CDPLAYER:" "pcd more_info")
63 (defun cdplayer-next-track ()
64 "Play the next CD track"
68 (defun cdplayer-previous-track ()
69 "Play the previous CD track"
70 (do-shell "pcd previous")
73 (defun cdplayer-eject ()
75 (do-shell "pcd eject"))
77 (defun cdplayer-close ()
79 (do-shell "pcd close"))
81 (unless (find-menu 'cdplayer-menu
)
82 (add-sub-menu 'help-menu
"i" 'cdplayer-menu
"CDPLAYER menu")
84 (add-menu-key 'cdplayer-menu
"y" 'cdplayer-play
)
85 (add-menu-key 'cdplayer-menu
"k" 'cdplayer-stop
)
86 (add-menu-key 'cdplayer-menu
"t" 'cdplayer-pause
)
87 (add-menu-key 'cdplayer-menu
"s" 'show-cdplayer-status
)
88 (add-menu-key 'cdplayer-menu
"l" 'show-cdplayer-playlist
)
89 (add-menu-key 'cdplayer-menu
"n" 'cdplayer-next-track
)
90 (add-menu-key 'cdplayer-menu
"p" 'cdplayer-previous-track
)
91 (add-menu-key 'cdplayer-menu
"e" 'cdplayer-eject
)
92 (add-menu-key 'cdplayer-menu
"c" 'cdplayer-close
))