[gsharp-cvs] CVS update: gsharp/buffer.lisp gsharp/numbering.lisp

Robert Strandh rstrandh at common-lisp.net
Thu Nov 3 03:40:15 UTC 2005


Update of /project/gsharp/cvsroot/gsharp
In directory common-lisp.net:/tmp/cvs-serv24392

Modified Files:
	buffer.lisp numbering.lisp 
Log Message:
More constructors added.


Date: Thu Nov  3 04:40:14 2005
Author: rstrandh

Index: gsharp/buffer.lisp
diff -u gsharp/buffer.lisp:1.22 gsharp/buffer.lisp:1.23
--- gsharp/buffer.lisp:1.22	Wed Nov  2 20:28:08 2005
+++ gsharp/buffer.lisp	Thu Nov  3 04:40:13 2005
@@ -513,8 +513,10 @@
 (defclass melody-bar (bar)
   ((print-character :allocation :class :initform #\|)))
 
-(defun make-melody-bar ()
-  (make-instance 'melody-bar))
+(defun make-melody-bar (&rest args &key elements)
+  (declare (type list elements)
+	   (ignore elements))
+  (apply #'make-instance 'melody-bar args))
 
 (defun read-melody-bar-v3 (stream char n)
   (declare (ignore char n))
@@ -527,8 +529,10 @@
 (defclass lyrics-bar (bar)
   ((print-character :allocation :class :initform #\C)))
 
-(defun make-lyrics-bar ()
-  (make-instance 'lyrics-bar))
+(defun make-lyrics-bar (&rest args &key elements)
+  (declare (type list elements)
+	   (ignore elements))
+  (apply #'make-instance 'lyrics-bar args))
 
 (defun read-lyrics-bar-v3 (stream char n)
   (declare (ignore char n))
@@ -570,6 +574,11 @@
   (loop for bar in (bars s)
 	do (setf (slice bar) s)))
 
+(defun make-slice (&rest args &key bars)
+  (declare (type list bars)
+	   (ignore bars))
+  (apply #'make-instance 'slice args))
+
 (defmethod print-object :after ((s slice) stream)
   (format stream ":bars ~W " (bars s)))
 
@@ -681,9 +690,7 @@
 
 (defmethod make-layer (name (initial-staff fiveline-staff))
   (flet ((make-initialized-slice ()
-	   (let ((slice (make-instance 'slice)))
-	     (add-bar (make-melody-bar) slice 0)
-	     slice)))
+	   (make-slice :bars (list (make-melody-bar)))))
     (let* ((head (make-initialized-slice))
 	   (body (make-initialized-slice))
 	   (tail (make-initialized-slice))
@@ -710,9 +717,7 @@
 
 (defmethod make-layer (name (initial-staff lyrics-staff))
   (flet ((make-initialized-slice ()
-	   (let ((slice (make-instance 'slice)))
-	     (add-bar (make-lyrics-bar) slice 0)
-	     slice)))
+	   (make-slice :bars (list (make-lyrics-bar)))))
     (let* ((head (make-initialized-slice))
 	   (body (make-initialized-slice))
 	   (tail (make-initialized-slice))


Index: gsharp/numbering.lisp
diff -u gsharp/numbering.lisp:1.4 gsharp/numbering.lisp:1.5
--- gsharp/numbering.lisp:1.4	Sun Aug 15 17:49:41 2004
+++ gsharp/numbering.lisp	Thu Nov  3 04:40:13 2005
@@ -57,6 +57,10 @@
   (number-elements (bars slice))
   (mapc #'number-all (bars slice)))
 
+(defmethod initialize-instance :after ((slice nslice) &rest args)
+  (declare (ignore args))
+  (number-elements (bars slice)))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;
 ;;; Layer




More information about the Gsharp-cvs mailing list