1 ;;; --------------------------------------------------------------------------
2 ;;; CLFSWM - FullScreen Window Manager
4 ;;; --------------------------------------------------------------------------
5 ;;; Documentation: MOC - Console audio player - interface
6 ;;; --------------------------------------------------------------------------
8 ;;; (C) 2013 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: If you want to use this file, just add this line in
25 ;;; your configuration file:
27 ;;; (load-contrib "moc.lisp")
29 ;;; --------------------------------------------------------------------------
33 (format t
"Loading MOC code... ")
38 (open-menu (find-menu 'moc-menu
)))
43 (do-shell "xterm -e 'mocp 2> /dev/null'"))
46 (defun show-moc-info ()
47 "Show MOC informations"
48 (info-on-shell "MOC informations:" "mocp --info")
51 (defun moc-previous (&optional
(in-menu t
))
52 "Play the previous song in the current playlist"
53 (do-shell "mocp --previous" nil t
)
57 (defun moc-next (&optional
(in-menu t
))
58 "Play the next song in the current playlist"
59 (do-shell "mocp --next" nil t
)
64 "Toggles Play/Pause, plays if stopped"
65 (do-shell "mocp --toggle-pause"))
69 (do-shell "mocp --play"))
72 "Stop the currently playing playlists"
73 (do-shell "mocp --stop"))
76 (defun moc-seek-+5s
(&optional
(in-menu t
))
80 (do-shell "mocp --seek +5")
82 (do-shell "mocp --seek +5" nil t
)))
84 (defun moc-seek--5s (&optional
(in-menu t
))
88 (do-shell "mocp --seek -5")
90 (do-shell "mocp --seek -5" nil t
)))
92 (unless (find-menu 'moc-menu
)
93 (add-sub-menu 'help-menu
"F3" 'moc-menu
"MOC - Console audio player - menu")
95 (add-menu-key 'moc-menu
"i" 'show-moc-info
)
96 (add-menu-key 'moc-menu
"p" 'moc-previous
)
97 (add-menu-key 'moc-menu
"n" 'moc-next
)
98 (add-menu-key 'moc-menu
"t" 'moc-toggle
)
99 (add-menu-key 'moc-menu
"y" 'moc-play
)
100 (add-menu-key 'moc-menu
"k" 'moc-stop
)
101 (add-menu-key 'moc-menu
"x" 'moc-seek-
+5s
)
102 (add-menu-key 'moc-menu
"w" 'moc-seek--5s
)
103 (add-menu-key 'moc-menu
"m" 'start-mocp
))
106 (defun moc-binding ()
107 (define-main-key ("F3" :alt
) 'moc-menu
))
109 (add-hook *binding-hook
* 'moc-binding
)