Mercurial > hg > amuse
comparison base/datasets/datasets-file/methods.lisp @ 251:6a3adca16910
Refactor dataset stuff out of amuse-database-admin, and add midifile-dataset.
author | Jamie Forth <j.forth@gold.ac.uk> |
---|---|
date | Thu, 24 Feb 2011 11:23:18 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
250:b3260d1d2419 | 251:6a3adca16910 |
---|---|
1 (cl:in-package #:amuse-datasets) | |
2 | |
3 (defmethod make-dataset ((identifier midifile-dataset-identifier) | |
4 composition-identifiers &optional | |
5 description) | |
6 (make-instance 'midifile-dataset | |
7 :%data composition-identifiers | |
8 :identifier identifier | |
9 :description description)) | |
10 | |
11 (defmethod get-dataset ((dataset-identifier midifile-dataset-identifier)) | |
12 (let ((midifile-paths | |
13 (append (directory (merge-pathnames (dataset-path | |
14 dataset-identifier) "*.mid*")) | |
15 (directory (merge-pathnames (dataset-path | |
16 dataset-identifier) "*.MID*"))))) | |
17 (unless midifile-paths | |
18 (warn "No midifiles in: ~A" (dataset-path dataset-identifier)) | |
19 (return-from get-dataset nil)) | |
20 (loop for path in midifile-paths | |
21 collect (make-composition-identifier | |
22 (implementation-package dataset-identifier) path) | |
23 into composition-identifiers | |
24 finally (return (make-dataset dataset-identifier | |
25 composition-identifiers))))) | |
26 | |
27 |