comparison framework/SVFileReader.cpp @ 366:0876ea394902 warnfix_no_size_t

Remove size_t's, fix compiler warnings
author Chris Cannam
date Tue, 17 Jun 2014 16:23:06 +0100
parents a93802543a5a
children f1cab64363d7
comparison
equal deleted inserted replaced
355:e7a3fa8f4eec 366:0876ea394902
298 m_inData = false; 298 m_inData = false;
299 299
300 } else if (name == "derivation") { 300 } else if (name == "derivation") {
301 301
302 if (!m_currentDerivedModel) { 302 if (!m_currentDerivedModel) {
303 if (m_currentDerivedModel < 0) { 303 if (m_currentDerivedModelId < 0) {
304 cerr << "WARNING: SV-XML: Bad derivation output model id " 304 cerr << "WARNING: SV-XML: Bad derivation output model id "
305 << m_currentDerivedModelId << endl; 305 << m_currentDerivedModelId << endl;
306 } else if (haveModel(m_currentDerivedModelId)) { 306 } else if (haveModel(m_currentDerivedModelId)) {
307 cerr << "WARNING: SV-XML: Derivation has existing model " 307 cerr << "WARNING: SV-XML: Derivation has existing model "
308 << m_currentDerivedModelId 308 << m_currentDerivedModelId
471 cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path << "\" for wave file model: Source unavailable" << endl; 471 cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path << "\" for wave file model: Source unavailable" << endl;
472 } else { 472 } else {
473 473
474 file.waitForData(); 474 file.waitForData();
475 475
476 size_t rate = 0; 476 int rate = 0;
477 477
478 if (!mainModel && 478 if (!mainModel &&
479 Preferences::getInstance()->getResampleOnLoad()) { 479 Preferences::getInstance()->getResampleOnLoad()) {
480 WaveFileModel *mm = m_document->getMainModel(); 480 WaveFileModel *mm = m_document->getMainModel();
481 if (mm) rate = mm->getSampleRate(); 481 if (mm) rate = mm->getSampleRate();
752 752
753 View *view = m_currentPane; 753 View *view = m_currentPane;
754 754
755 // The view properties first 755 // The view properties first
756 756
757 READ_MANDATORY(size_t, centre, toUInt); 757 READ_MANDATORY(int, centre, toInt);
758 READ_MANDATORY(size_t, zoom, toUInt); 758 READ_MANDATORY(int, zoom, toInt);
759 READ_MANDATORY(int, followPan, toInt); 759 READ_MANDATORY(int, followPan, toInt);
760 READ_MANDATORY(int, followZoom, toInt); 760 READ_MANDATORY(int, followZoom, toInt);
761 QString tracking = attributes.value("tracking"); 761 QString tracking = attributes.value("tracking");
762 762
763 // Specify the follow modes before we set the actual values 763 // Specify the follow modes before we set the actual values
1002 1002
1003 if (nm) { 1003 if (nm) {
1004 cerr << "Current dataset is a note model" << endl; 1004 cerr << "Current dataset is a note model" << endl;
1005 float value = 0.0; 1005 float value = 0.0;
1006 value = attributes.value("value").trimmed().toFloat(&ok); 1006 value = attributes.value("value").trimmed().toFloat(&ok);
1007 size_t duration = 0; 1007 int duration = 0;
1008 duration = attributes.value("duration").trimmed().toUInt(&ok); 1008 duration = attributes.value("duration").trimmed().toInt(&ok);
1009 QString label = attributes.value("label"); 1009 QString label = attributes.value("label");
1010 float level = attributes.value("level").trimmed().toFloat(&ok); 1010 float level = attributes.value("level").trimmed().toFloat(&ok);
1011 if (!ok) { // level is optional 1011 if (!ok) { // level is optional
1012 level = 1.f; 1012 level = 1.f;
1013 ok = true; 1013 ok = true;
1020 1020
1021 if (fnm) { 1021 if (fnm) {
1022 cerr << "Current dataset is a flexinote model" << endl; 1022 cerr << "Current dataset is a flexinote model" << endl;
1023 float value = 0.0; 1023 float value = 0.0;
1024 value = attributes.value("value").trimmed().toFloat(&ok); 1024 value = attributes.value("value").trimmed().toFloat(&ok);
1025 size_t duration = 0; 1025 int duration = 0;
1026 duration = attributes.value("duration").trimmed().toUInt(&ok); 1026 duration = attributes.value("duration").trimmed().toInt(&ok);
1027 QString label = attributes.value("label"); 1027 QString label = attributes.value("label");
1028 float level = attributes.value("level").trimmed().toFloat(&ok); 1028 float level = attributes.value("level").trimmed().toFloat(&ok);
1029 if (!ok) { // level is optional 1029 if (!ok) { // level is optional
1030 level = 1.f; 1030 level = 1.f;
1031 ok = true; 1031 ok = true;
1038 1038
1039 if (rm) { 1039 if (rm) {
1040 cerr << "Current dataset is a region model" << endl; 1040 cerr << "Current dataset is a region model" << endl;
1041 float value = 0.0; 1041 float value = 0.0;
1042 value = attributes.value("value").trimmed().toFloat(&ok); 1042 value = attributes.value("value").trimmed().toFloat(&ok);
1043 size_t duration = 0; 1043 int duration = 0;
1044 duration = attributes.value("duration").trimmed().toUInt(&ok); 1044 duration = attributes.value("duration").trimmed().toInt(&ok);
1045 QString label = attributes.value("label"); 1045 QString label = attributes.value("label");
1046 rm->addPoint(RegionModel::Point(frame, value, duration, label)); 1046 rm->addPoint(RegionModel::Point(frame, value, duration, label));
1047 return ok; 1047 return ok;
1048 } 1048 }
1049 1049
1243 if (!m_currentTransformSource) return true; 1243 if (!m_currentTransformSource) return true;
1244 1244
1245 QString startFrameStr = attributes.value("startFrame"); 1245 QString startFrameStr = attributes.value("startFrame");
1246 QString durationStr = attributes.value("duration"); 1246 QString durationStr = attributes.value("duration");
1247 1247
1248 size_t startFrame = 0; 1248 int startFrame = 0;
1249 size_t duration = 0; 1249 int duration = 0;
1250 1250
1251 if (startFrameStr != "") { 1251 if (startFrameStr != "") {
1252 startFrame = startFrameStr.trimmed().toInt(&ok); 1252 startFrame = startFrameStr.trimmed().toInt(&ok);
1253 if (!ok) startFrame = 0; 1253 if (!ok) startFrame = 0;
1254 } 1254 }