[clfswm-cvs] r251 - in clfswm: . contrib src

Philippe Brochard pbrochard at common-lisp.net
Mon Jun 29 11:14:47 UTC 2009


Author: pbrochard
Date: Mon Jun 29 07:14:47 2009
New Revision: 251

Log:
contrib/cd-player.lisp: New file to handle the CD player.

Added:
   clfswm/contrib/cd-player.lisp
Modified:
   clfswm/ChangeLog
   clfswm/TODO
   clfswm/contrib/xmms.lisp
   clfswm/src/menu-def.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Mon Jun 29 07:14:47 2009
@@ -1,5 +1,7 @@
 2009-06-29  Philippe Brochard  <pbrochard at common-lisp.net>
 
+	* contrib/cd-player.lisp: New file to handle the CD player.
+
 	* contrib/xmms.lisp: New file to handle the xmms player.
 
 2009-06-28  Philippe Brochard  <pbrochard at common-lisp.net>

Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Mon Jun 29 07:14:47 2009
@@ -7,8 +7,6 @@
 ===============
 Should handle these soon.
 
-- New: Put CD player / xmms modules in contrib/ ...
-
 - Mouse support in menu
 
 - Show config -> list and display documentation for all tweakable global variables. [Philippe]

Added: clfswm/contrib/cd-player.lisp
==============================================================================
--- (empty file)
+++ clfswm/contrib/cd-player.lisp	Mon Jun 29 07:14:47 2009
@@ -0,0 +1,94 @@
+;;; --------------------------------------------------------------------------
+;;; CLFSWM - FullScreen Window Manager
+;;;
+;;; --------------------------------------------------------------------------
+;;; Documentation: Music Player Daemon (MPD) interface
+;;; --------------------------------------------------------------------------
+;;;
+;;; (C) 2009 Philippe Brochard <hocwp at free.fr>
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program; if not, write to the Free Software
+;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+;;;
+;;; Documentation: Handle the CD player
+;;;   This code needs pcd (http://hocwp.free.fr/pcd.html).
+;;    If you want to use this file, just add this line in
+;;;   your configuration file:
+;;;
+;;;     (load-contrib "cd-player.lisp")
+;;;
+;;; --------------------------------------------------------------------------
+
+(in-package :clfswm)
+
+(format t "Loading CDPLAYER code... ")
+
+(defun cdplayer-menu ()
+  "Open the CDPLAYER menu"
+  (open-menu (find-menu 'cdplayer-menu)))
+
+(defun cdplayer-play ()
+  "Start playing CD"
+  (do-shell "pcd play"))
+
+(defun cdplayer-stop ()
+  "Stop playing CD"
+  (do-shell "pcd stop"))
+
+(defun cdplayer-pause ()
+  "Toggle pause"
+  (do-shell "pcd toggle"))
+
+(defun show-cdplayer-status ()
+  "Show the current CD status"
+  (info-on-shell "CDPLAYER status:" "pcd info")
+  (cdplayer-menu))
+
+(defun show-cdplayer-playlist ()
+  "Show the current CD playlist"
+  (info-on-shell "CDPLAYER:" "pcd more_info")
+  (cdplayer-menu))
+
+(defun cdplayer-next-track ()
+  "Play the next CD track"
+  (do-shell "pcd next")
+  (cdplayer-menu))
+
+(defun cdplayer-previous-track ()
+  "Play the previous CD track"
+  (do-shell "pcd previous")
+  (cdplayer-menu))
+
+(defun cdplayer-eject ()
+  "Eject CD"
+  (do-shell "pcd eject"))
+
+(defun cdplayer-close ()
+  "Close CD"
+  (do-shell "pcd close"))
+
+(unless (find-menu 'cdplayer-menu)
+  (add-sub-menu 'help-menu "i" 'cdplayer-menu "CDPLAYER menu")
+
+  (add-menu-key 'cdplayer-menu "y" 'cdplayer-play)
+  (add-menu-key 'cdplayer-menu "k" 'cdplayer-stop)
+  (add-menu-key 'cdplayer-menu "t" 'cdplayer-pause)
+  (add-menu-key 'cdplayer-menu "s" 'show-cdplayer-status)
+  (add-menu-key 'cdplayer-menu "l" 'show-cdplayer-playlist)
+  (add-menu-key 'cdplayer-menu "n" 'cdplayer-next-track)
+  (add-menu-key 'cdplayer-menu "p" 'cdplayer-previous-track)
+  (add-menu-key 'cdplayer-menu "e" 'cdplayer-eject)
+  (add-menu-key 'cdplayer-menu "c" 'cdplayer-close))
+
+(format t "done~%")

Modified: clfswm/contrib/xmms.lisp
==============================================================================
--- clfswm/contrib/xmms.lisp	(original)
+++ clfswm/contrib/xmms.lisp	Mon Jun 29 07:14:47 2009
@@ -21,10 +21,12 @@
 ;;; along with this program; if not, write to the Free Software
 ;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 ;;;
-;;; Documentation: If you want to use this file, just add this line in
-;;; your configuration file:
+;;; Documentation: Handle the XMMS player
+;;;   This code needs xmmsctrl.
+;;    If you want to use this file, just add this line in
+;;;   your configuration file:
 ;;;
-;;;   (load-contrib "xmms.lisp")
+;;;     (load-contrib "xmms.lisp")
 ;;;
 ;;; --------------------------------------------------------------------------
 

Modified: clfswm/src/menu-def.lisp
==============================================================================
--- clfswm/src/menu-def.lisp	(original)
+++ clfswm/src/menu-def.lisp	Mon Jun 29 07:14:47 2009
@@ -71,11 +71,6 @@
 (add-menu-key 'help-menu "m" 'show-mem-proc)
 (add-menu-key 'help-menu "v" 'show-version)
 
-;;(add-sub-menu 'help-menu "i" 'info-on-cd-menu "CD info menu")
-;;
-;;(add-menu-key 'info-on-cd-menu "i" 'show-cd-info)
-;;(add-menu-key 'info-on-cd-menu "l" 'show-cd-playlist)
-
 
 (add-menu-key 'child-menu "r" 'rename-current-child)
 (add-menu-key 'child-menu "e" 'ensure-unique-name)




More information about the clfswm-cvs mailing list