changeset 169:4a0e15e2829a

identifier becomes composition-identifier. Add constituent-identifier and get-constituents darcs-hash:20080103154317-40ec0-8398433cd150794de77cc9206296c82902df930b.gz
author d.lewis <d.lewis@gold.ac.uk>
date Thu, 03 Jan 2008 15:43:17 +0000
parents f1d0ea63581c
children 5db7ab964f2f
files base/classes.lisp base/generics.lisp base/package.lisp implementations/geerdes/classes.lisp implementations/gsharp/classes.lisp implementations/midi/midifile-import.lisp implementations/mtp/classes.lisp
diffstat 7 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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) ()
--- 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)
--- 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
--- 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)))
--- 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))
--- 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))
--- 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)))