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

Philippe Brochard pbrochard at common-lisp.net
Mon Jun 29 10:48:29 UTC 2009


Author: pbrochard
Date: Mon Jun 29 06:48:28 2009
New Revision: 250

Log:
contrib/xmms.lisp: New file to handle the xmms player.

Added:
   clfswm/contrib/xmms.lisp
Modified:
   clfswm/ChangeLog
   clfswm/TODO
   clfswm/contrib/mpd.lisp
   clfswm/src/clfswm-info.lisp
   clfswm/src/menu-def.lisp
   clfswm/src/xlib-util.lisp

Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog	(original)
+++ clfswm/ChangeLog	Mon Jun 29 06:48:28 2009
@@ -1,3 +1,7 @@
+2009-06-29  Philippe Brochard  <pbrochard at common-lisp.net>
+
+	* contrib/xmms.lisp: New file to handle the xmms player.
+
 2009-06-28  Philippe Brochard  <pbrochard at common-lisp.net>
 
 	* src/clfswm-layout.lisp (set-no-layout-remember-size): New layout:

Modified: clfswm/TODO
==============================================================================
--- clfswm/TODO	(original)
+++ clfswm/TODO	Mon Jun 29 06:48:28 2009
@@ -7,8 +7,6 @@
 ===============
 Should handle these soon.
 
-- Frame layout menu: No layout but frames 'learn' there position/size.
-
 - New: Put CD player / xmms modules in contrib/ ...
 
 - Mouse support in menu

Modified: clfswm/contrib/mpd.lisp
==============================================================================
--- clfswm/contrib/mpd.lisp	(original)
+++ clfswm/contrib/mpd.lisp	Mon Jun 29 06:48:28 2009
@@ -86,18 +86,19 @@
   (info-on-shell "Current MPD playlist:" "mpc playlist")
   (mpd-menu))
 
-(add-sub-menu 'help-menu "F2" 'mpd-menu "Music Player Daemon (MPD) menu")
+(unless (find-menu 'mpd-menu)
+  (add-sub-menu 'help-menu "F2" 'mpd-menu "Music Player Daemon (MPD) menu")
 
-(add-menu-key 'mpd-menu "i" 'show-mpd-info)
-(add-menu-key 'mpd-menu "p" 'mpd-previous)
-(add-menu-key 'mpd-menu "n" 'mpd-next)
-(add-menu-key 'mpd-menu "t" 'mpd-toggle)
-(add-menu-key 'mpd-menu "y" 'mpd-play)
-(add-menu-key 'mpd-menu "k" 'mpd-stop)
-(add-menu-key 'mpd-menu "x" 'mpd-seek-+5%)
-(add-menu-key 'mpd-menu "w" 'mpd-seek--5%)
-(add-menu-key 'mpd-menu "l" 'show-mpd-playlist)
-(add-menu-key 'mpd-menu "s" 'start-sonata)
+  (add-menu-key 'mpd-menu "i" 'show-mpd-info)
+  (add-menu-key 'mpd-menu "p" 'mpd-previous)
+  (add-menu-key 'mpd-menu "n" 'mpd-next)
+  (add-menu-key 'mpd-menu "t" 'mpd-toggle)
+  (add-menu-key 'mpd-menu "y" 'mpd-play)
+  (add-menu-key 'mpd-menu "k" 'mpd-stop)
+  (add-menu-key 'mpd-menu "x" 'mpd-seek-+5%)
+  (add-menu-key 'mpd-menu "w" 'mpd-seek--5%)
+  (add-menu-key 'mpd-menu "l" 'show-mpd-playlist)
+  (add-menu-key 'mpd-menu "s" 'start-sonata))
 
 
 (defun mpd-binding ()

Added: clfswm/contrib/xmms.lisp
==============================================================================
--- (empty file)
+++ clfswm/contrib/xmms.lisp	Mon Jun 29 06:48:28 2009
@@ -0,0 +1,77 @@
+;;; --------------------------------------------------------------------------
+;;; 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: If you want to use this file, just add this line in
+;;; your configuration file:
+;;;
+;;;   (load-contrib "xmms.lisp")
+;;;
+;;; --------------------------------------------------------------------------
+
+(in-package :clfswm)
+
+(format t "Loading XMMS code... ")
+
+(defun xmms-menu ()
+  "Open the XMMS menu"
+  (open-menu (find-menu 'xmms-menu)))
+
+(defun launch-xmms ()
+  "Lanch XMMS"
+  (do-shell "xmmsctrl launch"))
+
+(defun show-xmms-status ()
+  "Show the current xmms status"
+  (info-on-shell "XMMS status:" "xmmsctrl cur"))
+
+(defun show-xmms-playlist ()
+  "Show the current xmms playlist"
+  (info-on-shell "XMMS Playlist:" "xmmsctrl playlist"))
+
+(defun xmms-next-track ()
+  "Play the next XMMS track"
+  (do-shell "xmmsctrl next")
+  (show-xmms-status)
+  (xmms-menu))
+
+(defun xmms-previous-track ()
+  "Play the previous XMMS track"
+  (do-shell "xmmsctrl previous")
+  (show-xmms-status)
+  (xmms-menu))
+
+(defun xmms-load-file ()
+  "open xmms \"Load file(s)\" dialog window."
+  (do-shell "xmmsctrl eject"))
+
+(unless (find-menu 'xmms-menu)
+  (add-sub-menu 'help-menu "x" 'xmms-menu "XMMS menu")
+
+  (add-menu-key 'xmms-menu "r" 'launch-xmms)
+  (add-menu-key 'xmms-menu "s" 'show-xmms-status)
+  (add-menu-key 'xmms-menu "l" 'show-xmms-playlist)
+  (add-menu-key 'xmms-menu "n" 'xmms-next-track)
+  (add-menu-key 'xmms-menu "p" 'xmms-previous-track)
+  (add-menu-key 'xmms-menu "e" 'xmms-load-file))
+
+(format t "done~%")

Modified: clfswm/src/clfswm-info.lisp
==============================================================================
--- clfswm/src/clfswm-info.lisp	(original)
+++ clfswm/src/clfswm-info.lisp	Mon Jun 29 06:48:28 2009
@@ -272,7 +272,6 @@
 
 
 
-
 (defun info-mode-menu (item-list &key (width nil) (height nil))
   "Open an info help menu.
 Item-list is: '((key function) separator (key function))
@@ -449,16 +448,6 @@
   (info-on-shell "Current processes sorted by MEMORY usage:"
 		 "ps --cols=1000 --sort='-vsz,uid,pgid,ppid,pid' -e -o user,pid,stime,pcpu,pmem,args"))
 
-(defun show-xmms-status ()
-  "Show the current xmms status"
-  (info-on-shell "XMMS status:" "xmms-shell -e status"))
-
-(defun show-xmms-playlist ()
-  "Show the current xmms playlist"
-  (info-on-shell "XMMS Playlist:" "xmms-shell -e list"))
-
-
-
 
 (defun show-cd-info ()
   "Show the current CD track"

Modified: clfswm/src/menu-def.lisp
==============================================================================
--- clfswm/src/menu-def.lisp	(original)
+++ clfswm/src/menu-def.lisp	Mon Jun 29 06:48:28 2009
@@ -69,15 +69,12 @@
 (add-menu-key 'help-menu "d" 'show-date)
 (add-menu-key 'help-menu "p" 'show-cpu-proc)
 (add-menu-key 'help-menu "m" 'show-mem-proc)
-(add-sub-menu 'help-menu "x" 'xmms-info-menu "XMMS menu")
 (add-menu-key 'help-menu "v" 'show-version)
-(add-sub-menu 'help-menu "i" 'info-on-cd-menu "CD info menu")
 
-(add-menu-key 'xmms-info-menu "s" 'show-xmms-status)
-(add-menu-key 'xmms-info-menu "l" 'show-xmms-playlist)
-
-(add-menu-key 'info-on-cd-menu "i" 'show-cd-info)
-(add-menu-key 'info-on-cd-menu "l" 'show-cd-playlist)
+;;(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)

Modified: clfswm/src/xlib-util.lisp
==============================================================================
--- clfswm/src/xlib-util.lisp	(original)
+++ clfswm/src/xlib-util.lisp	Mon Jun 29 06:48:28 2009
@@ -704,21 +704,21 @@
 (defun wait-no-key-or-button-press ()
   (with-grab-keyboard-and-pointer (66 67 66 67)
     (loop
-     (let ((key (loop for k across (xlib:query-keymap *display*)
-		      for code from 0
-		      when (and (plusp k) (not (modifier-p code))) return t))
-	   (button (loop for b in (xlib:make-state-keys (nth-value 4 (xlib:query-pointer *root*)))
-			 when (member b '(:button-1 :button-2 :button-3 :button-4 :button-5))
-			 return t)))
-       (when (and (not key) (not button))
-	 (loop while (xlib:event-case (*display* :discard-p t :peek-p nil :timeout 0)
-		       (:motion-notify () t)
-		       (:key-press () t)
-		       (:key-release () t)
-		       (:button-press () t)
-		       (:button-release () t)
-		       (t nil)))
-	 (return))))))
+       (let ((key (loop for k across (xlib:query-keymap *display*)
+		     for code from 0
+		     when (and (plusp k) (not (modifier-p code))) return t))
+	     (button (loop for b in (xlib:make-state-keys (nth-value 4 (xlib:query-pointer *root*)))
+			when (member b '(:button-1 :button-2 :button-3 :button-4 :button-5))
+			return t)))
+	 (when (and (not key) (not button))
+	   (loop while (xlib:event-case (*display* :discard-p t :peek-p nil :timeout 0)
+			 (:motion-notify () t)
+			 (:key-press () t)
+			 (:key-release () t)
+			 (:button-press () t)
+			 (:button-release () t)
+			 (t nil)))
+	   (return))))))
 
 
 (defun wait-a-key-or-button-press ()




More information about the clfswm-cvs mailing list