j@310: (cl:in-package #:amuse-midi-db) j@310: j@314: ;;;===================================================================== j@314: ;;; Specialized constructors j@314: ;;;===================================================================== j@314: j@314: (defmethod make-composition-identifier ((package (eql *package*)) j@314: composition-id) j@314: (make-midi-db-composition-identifier composition-id)) j@314: j@314: j@314: j@314: ;;;===================================================================== j@314: ;;; Specialized database-admin methods j@314: ;;;===================================================================== j@314: j@310: (defmethod list-collections ((package (eql *package*)) &key j@310: compositions (stream *standard-output*)) j@310: "FIXME: better formatting." j@310: (let ((collection-rows (%get-all-collection-headers))) j@315: (flet ((print-separator (&optional (columns 70)) j@315: (format stream "~%~A~%" j@310: (make-sequence 'string columns :initial-element #\-)))) j@310: (loop for collection-row in collection-rows j@310: do (destructuring-bind (collection-id collection-name description) j@310: collection-row j@310: (format stream "~%Collection-id: ~A~% Name: ~A~% Description: ~A~%" j@310: collection-id collection-name description) j@310: (when compositions j@310: (list-compositions package j@310: :collection-identifier j@310: (make-midi-db-collection-identifier j@310: collection-id)))) j@310: do (print-separator))))) j@310: j@310: (defmethod list-compositions ((package (eql *package*)) &key j@310: collection-identifier j@310: (stream *standard-output*)) j@310: (let ((composition-headers j@310: (if collection-identifier j@310: (%get-all-collection-composition-headers j@310: collection-identifier) j@310: (%get-all-composition-headers)))) j@310: (loop for composition-header in composition-headers j@315: do (destructuring-bind (collection-id composition-id filename j@315: timebase start duration owner version creation-timestamp j@315: deletion-timestamp) composition-header j@315: (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: collection-id composition-id filename timebase j@315: start duration owner version creation-timestamp j@315: deletion-timestamp)))))