annotate base/Model.cpp @ 48:b1d51d0521c3

* update TODO, some tidying
author Chris Cannam
date Mon, 20 Mar 2006 11:37:45 +0000
parents b8aae4f883b7
children 39ae3dee27b9
rev   line source
Chris@3 1 /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */
Chris@3 2
Chris@3 3 /*
Chris@3 4 A waveform viewer and audio annotation editor.
Chris@3 5 Chris Cannam, Queen Mary University of London, 2005-2006
Chris@3 6
Chris@3 7 This is experimental software. Not for distribution.
Chris@3 8 */
Chris@0 9
Chris@0 10 #include "Model.h"
Chris@30 11 #include "PlayParameterRepository.h"
Chris@0 12
Chris@43 13 #include <iostream>
Chris@43 14
Chris@0 15 const int Model::COMPLETION_UNKNOWN = -1;
Chris@0 16
Chris@30 17 Model::~Model()
Chris@30 18 {
Chris@43 19 std::cerr << "Model::~Model(" << this << ")" << std::endl;
Chris@43 20
Chris@30 21 // Subclasses have to handle adding themselves to the repository,
Chris@30 22 // if they want to be played. We can't do it from here because
Chris@30 23 // the repository would be unable to tell whether we were playable
Chris@30 24 // or not (because dynamic_cast won't work from the base class ctor)
Chris@30 25 PlayParameterRepository::instance()->removeModel(this);
Chris@30 26 }
Chris@30 27
Chris@3 28 QString
Chris@3 29 Model::toXmlString(QString indent, QString extraAttributes) const
Chris@3 30 {
Chris@3 31 QString s;
Chris@3 32
Chris@3 33 s += indent;
Chris@3 34
Chris@4 35 s += QString("<model id=\"%1\" name=\"%2\" sampleRate=\"%3\" start=\"%4\" end=\"%5\" %6/>\n")
Chris@4 36 .arg(getObjectExportId(this))
Chris@3 37 .arg(objectName())
Chris@4 38 .arg(getSampleRate())
Chris@4 39 .arg(getStartFrame())
Chris@4 40 .arg(getEndFrame())
Chris@3 41 .arg(extraAttributes);
Chris@3 42
Chris@3 43 return s;
Chris@3 44 }
Chris@3 45
Chris@0 46 #ifdef INCLUDE_MOCFILES
Chris@0 47 #ifdef INCLUDE_MOCFILES
Chris@0 48 #include "Model.moc.cpp"
Chris@0 49 #endif
Chris@0 50 #endif
Chris@0 51