# HG changeset patch # User d.lewis # Date 1199374997 0 # Node ID 4a0e15e2829ad33cfe1ab3fe161400c0d06b7ff7 # Parent f1d0ea63581c5fe1a555f310881e2c987e1bfda5 identifier becomes composition-identifier. Add constituent-identifier and get-constituents darcs-hash:20080103154317-40ec0-8398433cd150794de77cc9206296c82902df930b.gz diff -r f1d0ea63581c -r 4a0e15e2829a base/classes.lisp --- a/base/classes.lisp Thu Jan 03 13:45:32 2008 +0000 +++ b/base/classes.lisp Thu Jan 03 15:43:17 2008 +0000 @@ -7,9 +7,15 @@ ;; types of information-specifiers (defclass identifier (amuse-object) () - (:documentation "Base class to allow specification of + (:documentation "DEPRECATED: Base class to allow specification of composition to get. Must be subclassed.")) - + +(defclass constituent-identifier (identifier) () + (:documentation "Base class to allow specifiction of constituents")) + +(defclass composition-identifier (constituent-identifier) () + (:documentation "Base class to allow-specification of constituents")) + (defclass moment (amuse-object) () (:documentation "Object indicating a point in time")) (defclass period (amuse-object) () diff -r f1d0ea63581c -r 4a0e15e2829a base/generics.lisp --- a/base/generics.lisp Thu Jan 03 13:45:32 2008 +0000 +++ b/base/generics.lisp Thu Jan 03 15:43:17 2008 +0000 @@ -6,6 +6,11 @@ (:documentation "Returns a composition of type dependant on identifier")) +(defgeneric get-constituents (constituent-identifier) + (:method ((id composition-identifier)) (list (get-composition id))) + (:documentation "Returns a list of constituents matching the + criteria in identifier")) + (defgeneric monody (object) (:documentation "Returns a monody.")) (defgeneric ensure-monody (object) diff -r f1d0ea63581c -r 4a0e15e2829a base/package.lisp --- a/base/package.lisp Thu Jan 03 13:45:32 2008 +0000 +++ b/base/package.lisp Thu Jan 03 15:43:17 2008 +0000 @@ -8,6 +8,8 @@ #:monody #:standard-monody #:identifier + #:composition-identifier + #:constituent-identifier #:moment #:period #:anchored-period @@ -42,6 +44,7 @@ #:standard-tempo #:standard-tempo-period #:get-composition + #:get-constituents #:time-signatures #:tempi #:key-signatures diff -r f1d0ea63581c -r 4a0e15e2829a implementations/geerdes/classes.lisp --- a/implementations/geerdes/classes.lisp Thu Jan 03 13:45:32 2008 +0000 +++ b/implementations/geerdes/classes.lisp Thu Jan 03 15:43:17 2008 +0000 @@ -7,7 +7,7 @@ (defclass geerdes-object (property-list-mixin) ()) -(defclass geerdes-identifier (identifier geerdes-object) ()) +(defclass geerdes-identifier (composition-identifier geerdes-object) ()) (defclass geerdes-identifier-cat-id (geerdes-identifier) ((cat-id :initarg :cat-id :initform 'nil))) diff -r f1d0ea63581c -r 4a0e15e2829a implementations/gsharp/classes.lisp --- a/implementations/gsharp/classes.lisp Thu Jan 03 13:45:32 2008 +0000 +++ b/implementations/gsharp/classes.lisp Thu Jan 03 15:43:17 2008 +0000 @@ -10,7 +10,7 @@ ((note :initarg :note :reader note) (slice-index :initarg :slice-index))) -(defclass gsharp-identifier (identifier gsharp-object) +(defclass gsharp-identifier (composition-identifier gsharp-object) ((pathname :initarg :path :reader %gsharp-identifier-pathname :initform 'nil)) diff -r f1d0ea63581c -r 4a0e15e2829a implementations/midi/midifile-import.lisp --- a/implementations/midi/midifile-import.lisp Thu Jan 03 13:45:32 2008 +0000 +++ b/implementations/midi/midifile-import.lisp Thu Jan 03 15:43:17 2008 +0000 @@ -1,6 +1,6 @@ (cl:in-package #:amuse-midi) -(defclass midifile-identifier (identifier midi-object) +(defclass midifile-identifier (composition-identifier midi-object) ((pathname :initarg :path :reader midifile-identifier-pathname :initform 'nil)) diff -r f1d0ea63581c -r 4a0e15e2829a implementations/mtp/classes.lisp --- a/implementations/mtp/classes.lisp Thu Jan 03 13:45:32 2008 +0000 +++ b/implementations/mtp/classes.lisp Thu Jan 03 15:43:17 2008 +0000 @@ -18,7 +18,7 @@ (defclass mtp-dataset-identifier (identifier mtp-object) ((dataset-id :initarg :dataset-id :accessor dataset-id))) -(defclass mtp-composition-identifier (identifier mtp-object) +(defclass mtp-composition-identifier (composition-identifier mtp-object) ((dataset-id :initarg :dataset-id :accessor dataset-id) (composition-id :initarg :composition-id :accessor composition-id)))