annotate implementations/midi-db/methods.lisp @ 330:2fbff655ba47 tip

Removed cpitch-adj and cents SQL columns
author Jeremy Gow <jeremy.gow@gmail.com>
date Mon, 21 Jan 2013 11:08:11 +0000
parents d1ff5dad3f8d
children
rev   line source
j@310 1 (cl:in-package #:amuse-midi-db)
j@310 2
j@314 3 ;;;=====================================================================
j@314 4 ;;; Specialized constructors
j@314 5 ;;;=====================================================================
j@314 6
j@314 7 (defmethod make-composition-identifier ((package (eql *package*))
j@314 8 composition-id)
j@314 9 (make-midi-db-composition-identifier composition-id))
j@314 10
j@314 11
j@314 12
j@314 13 ;;;=====================================================================
j@314 14 ;;; Specialized database-admin methods
j@314 15 ;;;=====================================================================
j@314 16
j@310 17 (defmethod list-collections ((package (eql *package*)) &key
j@310 18 compositions (stream *standard-output*))
j@310 19 "FIXME: better formatting."
j@310 20 (let ((collection-rows (%get-all-collection-headers)))
j@315 21 (flet ((print-separator (&optional (columns 70))
j@315 22 (format stream "~%~A~%"
j@310 23 (make-sequence 'string columns :initial-element #\-))))
j@310 24 (loop for collection-row in collection-rows
j@310 25 do (destructuring-bind (collection-id collection-name description)
j@310 26 collection-row
j@310 27 (format stream "~%Collection-id: ~A~% Name: ~A~% Description: ~A~%"
j@310 28 collection-id collection-name description)
j@310 29 (when compositions
j@310 30 (list-compositions package
j@310 31 :collection-identifier
j@310 32 (make-midi-db-collection-identifier
j@310 33 collection-id))))
j@310 34 do (print-separator)))))
j@310 35
j@310 36 (defmethod list-compositions ((package (eql *package*)) &key
j@310 37 collection-identifier
j@310 38 (stream *standard-output*))
j@310 39 (let ((composition-headers
j@310 40 (if collection-identifier
j@310 41 (%get-all-collection-composition-headers
j@310 42 collection-identifier)
j@310 43 (%get-all-composition-headers))))
j@310 44 (loop for composition-header in composition-headers
j@315 45 do (destructuring-bind (collection-id composition-id filename
j@315 46 timebase start duration owner version creation-timestamp
j@315 47 deletion-timestamp) composition-header
j@315 48 (format stream "~%Collection-id: ~A Composition-id: ~A filename: ~A timebase: ~A start: ~A duration: ~A owner: ~A version: ~A created: ~A deleted: ~A~%"
j@315 49 collection-id composition-id filename timebase
j@315 50 start duration owner version creation-timestamp
j@315 51 deletion-timestamp)))))