comparison data/model/SparseModel.h @ 1060:57633d605547 tonioni

Add data export options (not all implemented yet)
author Chris Cannam
date Mon, 30 Mar 2015 17:27:25 +0100
parents a1cd5abcb38b
children c9fdd9921146
comparison
equal deleted inserted replaced
1059:7598a78cf915 1060:57633d605547
146 146
147 virtual void toXml(QTextStream &out, 147 virtual void toXml(QTextStream &out,
148 QString indent = "", 148 QString indent = "",
149 QString extraAttributes = "") const; 149 QString extraAttributes = "") const;
150 150
151 virtual QString toDelimitedDataString(QString delimiter) const 151 virtual QString toDelimitedDataString(QString delimiter) const {
152 { 152 return toDelimitedDataStringWithOptions(delimiter, DataExportDefaults);
153 }
154
155 virtual QString toDelimitedDataStringWithOptions(QString delimiter,
156 DataExportOptions opts) const {
153 QString s; 157 QString s;
154 for (PointListConstIterator i = m_points.begin(); i != m_points.end(); ++i) { 158 for (PointListConstIterator i = m_points.begin(); i != m_points.end(); ++i) {
155 s += i->toDelimitedDataString(delimiter, m_sampleRate) + "\n"; 159 s += i->toDelimitedDataString(delimiter, opts, m_sampleRate) + "\n";
156 } 160 }
157 return s; 161 return s;
158 } 162 }
159 163
160 virtual QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const 164 virtual QString toDelimitedDataStringSubset(QString delimiter, sv_frame_t f0, sv_frame_t f1) const {
161 { 165 return toDelimitedDataStringSubsetWithOptions(delimiter, DataExportDefaults, f0, f1);
166 }
167
168 virtual QString toDelimitedDataStringSubsetWithOptions(QString delimiter, DataExportOptions opts, sv_frame_t f0, sv_frame_t f1) const {
162 QString s; 169 QString s;
163 for (PointListConstIterator i = m_points.begin(); i != m_points.end(); ++i) { 170 for (PointListConstIterator i = m_points.begin(); i != m_points.end(); ++i) {
164 if (i->frame >= f0 && i->frame < f1) { 171 if (i->frame >= f0 && i->frame < f1) {
165 s += i->toDelimitedDataString(delimiter, m_sampleRate) + "\n"; 172 s += i->toDelimitedDataString(delimiter, opts, m_sampleRate) + "\n";
166 } 173 }
167 } 174 }
168 return s; 175 return s;
169 } 176 }
170 177