comparison framework/SVFileReader.cpp @ 370:a1b8b6a2cdfc tonioni

Merge from branch warnfix_no_size_t
author Chris Cannam
date Wed, 18 Jun 2014 13:42:37 +0100
parents f1cab64363d7
children 6a84102c006a
comparison
equal deleted inserted replaced
363:f5c914661f6f 370:a1b8b6a2cdfc
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 = sampleRate; 476 int rate = sampleRate;
477 477
478 if (Preferences::getInstance()->getFixedSampleRate() != 0) { 478 if (Preferences::getInstance()->getFixedSampleRate() != 0) {
479 rate = Preferences::getInstance()->getFixedSampleRate(); 479 rate = Preferences::getInstance()->getFixedSampleRate();
480 } else if (rate == 0 && 480 } else if (rate == 0 &&
481 !isMainModel && 481 !isMainModel &&
755 755
756 View *view = m_currentPane; 756 View *view = m_currentPane;
757 757
758 // The view properties first 758 // The view properties first
759 759
760 READ_MANDATORY(size_t, centre, toUInt); 760 READ_MANDATORY(int, centre, toInt);
761 READ_MANDATORY(size_t, zoom, toUInt); 761 READ_MANDATORY(int, zoom, toInt);
762 READ_MANDATORY(int, followPan, toInt); 762 READ_MANDATORY(int, followPan, toInt);
763 READ_MANDATORY(int, followZoom, toInt); 763 READ_MANDATORY(int, followZoom, toInt);
764 QString tracking = attributes.value("tracking"); 764 QString tracking = attributes.value("tracking");
765 765
766 // Specify the follow modes before we set the actual values 766 // Specify the follow modes before we set the actual values
1005 1005
1006 if (nm) { 1006 if (nm) {
1007 cerr << "Current dataset is a note model" << endl; 1007 cerr << "Current dataset is a note model" << endl;
1008 float value = 0.0; 1008 float value = 0.0;
1009 value = attributes.value("value").trimmed().toFloat(&ok); 1009 value = attributes.value("value").trimmed().toFloat(&ok);
1010 size_t duration = 0; 1010 int duration = 0;
1011 duration = attributes.value("duration").trimmed().toUInt(&ok); 1011 duration = attributes.value("duration").trimmed().toInt(&ok);
1012 QString label = attributes.value("label"); 1012 QString label = attributes.value("label");
1013 float level = attributes.value("level").trimmed().toFloat(&ok); 1013 float level = attributes.value("level").trimmed().toFloat(&ok);
1014 if (!ok) { // level is optional 1014 if (!ok) { // level is optional
1015 level = 1.f; 1015 level = 1.f;
1016 ok = true; 1016 ok = true;
1023 1023
1024 if (fnm) { 1024 if (fnm) {
1025 cerr << "Current dataset is a flexinote model" << endl; 1025 cerr << "Current dataset is a flexinote model" << endl;
1026 float value = 0.0; 1026 float value = 0.0;
1027 value = attributes.value("value").trimmed().toFloat(&ok); 1027 value = attributes.value("value").trimmed().toFloat(&ok);
1028 size_t duration = 0; 1028 int duration = 0;
1029 duration = attributes.value("duration").trimmed().toUInt(&ok); 1029 duration = attributes.value("duration").trimmed().toInt(&ok);
1030 QString label = attributes.value("label"); 1030 QString label = attributes.value("label");
1031 float level = attributes.value("level").trimmed().toFloat(&ok); 1031 float level = attributes.value("level").trimmed().toFloat(&ok);
1032 if (!ok) { // level is optional 1032 if (!ok) { // level is optional
1033 level = 1.f; 1033 level = 1.f;
1034 ok = true; 1034 ok = true;
1041 1041
1042 if (rm) { 1042 if (rm) {
1043 cerr << "Current dataset is a region model" << endl; 1043 cerr << "Current dataset is a region model" << endl;
1044 float value = 0.0; 1044 float value = 0.0;
1045 value = attributes.value("value").trimmed().toFloat(&ok); 1045 value = attributes.value("value").trimmed().toFloat(&ok);
1046 size_t duration = 0; 1046 int duration = 0;
1047 duration = attributes.value("duration").trimmed().toUInt(&ok); 1047 duration = attributes.value("duration").trimmed().toInt(&ok);
1048 QString label = attributes.value("label"); 1048 QString label = attributes.value("label");
1049 rm->addPoint(RegionModel::Point(frame, value, duration, label)); 1049 rm->addPoint(RegionModel::Point(frame, value, duration, label));
1050 return ok; 1050 return ok;
1051 } 1051 }
1052 1052
1246 if (!m_currentTransformSource) return true; 1246 if (!m_currentTransformSource) return true;
1247 1247
1248 QString startFrameStr = attributes.value("startFrame"); 1248 QString startFrameStr = attributes.value("startFrame");
1249 QString durationStr = attributes.value("duration"); 1249 QString durationStr = attributes.value("duration");
1250 1250
1251 size_t startFrame = 0; 1251 int startFrame = 0;
1252 size_t duration = 0; 1252 int duration = 0;
1253 1253
1254 if (startFrameStr != "") { 1254 if (startFrameStr != "") {
1255 startFrame = startFrameStr.trimmed().toInt(&ok); 1255 startFrame = startFrameStr.trimmed().toInt(&ok);
1256 if (!ok) startFrame = 0; 1256 if (!ok) startFrame = 0;
1257 } 1257 }