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