comparison data/model/Model.h @ 179:0ed2b2e26b44

* Tidy up inheritance hierarchy of model classes -- remove ZoomConstraint as a base class (make it a member instead) and remove virtual inheritances of QObject (no longer necessary).
author Chris Cannam
date Thu, 05 Oct 2006 11:03:06 +0000
parents 4b2ea82fd0ed
children 20028c634494
comparison
equal deleted inserted replaced
178:0e266fa2510f 179:0ed2b2e26b44
21 21
22 #include "base/XmlExportable.h" 22 #include "base/XmlExportable.h"
23 23
24 typedef std::vector<float> SampleBlock; 24 typedef std::vector<float> SampleBlock;
25 25
26 class ZoomConstraint;
27
26 /** 28 /**
27 * Model is the base class for all data models that represent any sort 29 * Model is the base class for all data models that represent any sort
28 * of data on a time scale based on an audio frame rate. 30 * of data on a time scale based on an audio frame rate.
29 */ 31 */
30 32
31 class Model : virtual public QObject, 33 class Model : public QObject,
32 public XmlExportable 34 public XmlExportable
33 { 35 {
34 Q_OBJECT 36 Q_OBJECT
35 37
36 public: 38 public:
91 if (completion) *completion = (ok ? 100 : 0); 93 if (completion) *completion = (ok ? 100 : 0);
92 return ok; 94 return ok;
93 } 95 }
94 static const int COMPLETION_UNKNOWN; 96 static const int COMPLETION_UNKNOWN;
95 97
98 /**
99 * If this model imposes a zoom constraint, i.e. some limit to the
100 * set of resolutions at which its data can meaningfully be
101 * displayed, then return it.
102 */
103 virtual const ZoomConstraint *getZoomConstraint() const {
104 return 0;
105 }
106
96 virtual void toXml(QTextStream &stream, 107 virtual void toXml(QTextStream &stream,
97 QString indent = "", 108 QString indent = "",
98 QString extraAttributes = "") const; 109 QString extraAttributes = "") const;
99 110
100 virtual QString toXmlString(QString indent = "", 111 virtual QString toXmlString(QString indent = "",