[gsharp-cvs] CVS gsharp
crhodes
crhodes at common-lisp.net
Sun Jun 10 08:15:29 UTC 2007
Update of /project/gsharp/cvsroot/gsharp
In directory clnet:/tmp/cvs-serv21208
Modified Files:
gui.lisp modes.lisp
Log Message:
select-layer-by-layout commands and keybindings (C-down and C-up for
now)
--- /project/gsharp/cvsroot/gsharp/gui.lisp 2007/06/07 09:26:04 1.75
+++ /project/gsharp/cvsroot/gsharp/gui.lisp 2007/06/10 08:15:28 1.76
@@ -1108,6 +1108,38 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
+;;; selecting layers based on layout (next/previous staff)
+
+;;; FIXME: numeric argument handling again
+(define-gsharp-command (com-previous-staff :name t)
+ ()
+ (let ((staff (car (staves (layer (current-cursor))))))
+ (loop for (prev curr) on (staves (current-buffer))
+ if (eq curr staff)
+ do (let ((layers (layers (segment (current-cursor)))))
+ (dolist (layer layers)
+ (when (member prev (staves layer))
+ (select-layer (current-cursor) layer)
+ (do ()
+ ((eq prev (car (staves layer))))
+ (com-rotate-staves))
+ (return-from com-previous-staff)))))))
+(define-gsharp-command (com-next-staff :name t)
+ ()
+ (let ((staff (car (staves (layer (current-cursor))))))
+ (loop for (curr next) on (staves (current-buffer))
+ if (eq curr staff)
+ do (let ((layers (layers (segment (current-cursor)))))
+ (dolist (layer layers)
+ (when (member next (staves layer))
+ (select-layer (current-cursor) layer)
+ (do ()
+ ((eq next (car (staves layer))))
+ (com-rotate-staves))
+ (return-from com-next-staff)))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
;;; delete commands
(defun go-to-beginning-of-bar (cursor)
--- /project/gsharp/cvsroot/gsharp/modes.lisp 2007/06/07 09:26:05 1.22
+++ /project/gsharp/cvsroot/gsharp/modes.lisp 2007/06/10 08:15:29 1.23
@@ -17,6 +17,10 @@
(set-key 'com-end-of-line 'global-gsharp-table '((#\e :control)))
(set-key 'com-beginning-of-line 'global-gsharp-table '((#\a :control)))
+;;; FIXME: implement numeric arg handling
+(set-key 'com-previous-staff 'global-gsharp-table '((:up :control)))
+(set-key 'com-next-staff 'global-gsharp-table '((:down :control)))
+
(set-key 'com-insert-barline 'global-gsharp-table '(#\|))
(set-key 'com-end-of-score 'global-gsharp-table '((#\> :shift :meta)))
More information about the Gsharp-cvs
mailing list