Mercurial > hg > svcore
annotate base/Model.cpp @ 30:a6ef94ecbe74
* As previous commit
author | Chris Cannam |
---|---|
date | Fri, 17 Feb 2006 18:11:08 +0000 |
parents | 149bb02a41ba |
children | b8aae4f883b7 |
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@0 | 13 const int Model::COMPLETION_UNKNOWN = -1; |
Chris@0 | 14 |
Chris@30 | 15 Model::~Model() |
Chris@30 | 16 { |
Chris@30 | 17 // Subclasses have to handle adding themselves to the repository, |
Chris@30 | 18 // if they want to be played. We can't do it from here because |
Chris@30 | 19 // the repository would be unable to tell whether we were playable |
Chris@30 | 20 // or not (because dynamic_cast won't work from the base class ctor) |
Chris@30 | 21 PlayParameterRepository::instance()->removeModel(this); |
Chris@30 | 22 } |
Chris@30 | 23 |
Chris@3 | 24 QString |
Chris@3 | 25 Model::toXmlString(QString indent, QString extraAttributes) const |
Chris@3 | 26 { |
Chris@3 | 27 QString s; |
Chris@3 | 28 |
Chris@3 | 29 s += indent; |
Chris@3 | 30 |
Chris@4 | 31 s += QString("<model id=\"%1\" name=\"%2\" sampleRate=\"%3\" start=\"%4\" end=\"%5\" %6/>\n") |
Chris@4 | 32 .arg(getObjectExportId(this)) |
Chris@3 | 33 .arg(objectName()) |
Chris@4 | 34 .arg(getSampleRate()) |
Chris@4 | 35 .arg(getStartFrame()) |
Chris@4 | 36 .arg(getEndFrame()) |
Chris@3 | 37 .arg(extraAttributes); |
Chris@3 | 38 |
Chris@3 | 39 return s; |
Chris@3 | 40 } |
Chris@3 | 41 |
Chris@0 | 42 #ifdef INCLUDE_MOCFILES |
Chris@0 | 43 #ifdef INCLUDE_MOCFILES |
Chris@0 | 44 #include "Model.moc.cpp" |
Chris@0 | 45 #endif |
Chris@0 | 46 #endif |
Chris@0 | 47 |