comparison main/MainWindow.cpp @ 2025:262c656ec78f zoom

Merge from default branch
author Chris Cannam
date Mon, 01 Oct 2018 15:49:32 +0100
parents b184e71f880d 2ec57b30fffe
children 4db75d584e5a
comparison
equal deleted inserted replaced
2021:4c7f91c81ba9 2025:262c656ec78f
1281 LayerFactory::Spectrogram, 1281 LayerFactory::Spectrogram,
1282 LayerFactory::MelodicRangeSpectrogram, 1282 LayerFactory::MelodicRangeSpectrogram,
1283 LayerFactory::PeakFrequencySpectrogram, 1283 LayerFactory::PeakFrequencySpectrogram,
1284 LayerFactory::Spectrum 1284 LayerFactory::Spectrum
1285 }; 1285 };
1286 int backgroundTypeCount = int(sizeof(backgroundTypes) /
1287 sizeof(backgroundTypes[0]));
1286 1288
1287 std::vector<Model *> models; 1289 std::vector<Model *> models;
1288 if (m_document) models = m_document->getTransformInputModels(); 1290 if (m_document) models = m_document->getTransformInputModels();
1289 bool plural = (models.size() > 1); 1291 bool plural = (models.size() > 1);
1290 if (models.empty()) { 1292 if (models.empty()) {
1291 models.push_back(getMainModel()); // probably 0 1293 models.push_back(getMainModel()); // probably 0
1292 } 1294 }
1293 1295
1294 for (unsigned int i = 0; 1296 for (int i = 0; i < backgroundTypeCount; ++i) {
1295 i < sizeof(backgroundTypes)/sizeof(backgroundTypes[0]); ++i) {
1296 1297
1297 const int paneMenuType = 0, layerMenuType = 1; 1298 const int paneMenuType = 0, layerMenuType = 1;
1298 1299
1299 for (int menuType = paneMenuType; menuType <= layerMenuType; ++menuType) { 1300 for (int menuType = paneMenuType; menuType <= layerMenuType; ++menuType) {
1300 1301
1762 // Names should only be duplicated here if they have the same 1763 // Names should only be duplicated here if they have the same
1763 // plugin name, output name and maker but are in different library 1764 // plugin name, output name and maker but are in different library
1764 // .so names -- that won't happen often I hope 1765 // .so names -- that won't happen often I hope
1765 std::map<QString, QString> idNameSonameMap; 1766 std::map<QString, QString> idNameSonameMap;
1766 std::set<QString> seenNames, duplicateNames; 1767 std::set<QString> seenNames, duplicateNames;
1767 for (unsigned int i = 0; i < transforms.size(); ++i) { 1768 for (int i = 0; in_range_for(transforms, i); ++i) {
1768 QString name = transforms[i].name; 1769 QString name = transforms[i].name;
1769 if (seenNames.find(name) != seenNames.end()) { 1770 if (seenNames.find(name) != seenNames.end()) {
1770 duplicateNames.insert(name); 1771 duplicateNames.insert(name);
1771 } else { 1772 } else {
1772 seenNames.insert(name); 1773 seenNames.insert(name);
1773 } 1774 }
1774 } 1775 }
1775 1776
1776 for (unsigned int i = 0; i < transforms.size(); ++i) { 1777 for (int i = 0; in_range_for(transforms, i); ++i) {
1777 1778
1778 QString name = transforms[i].name; 1779 QString name = transforms[i].name;
1779 if (name == "") name = transforms[i].identifier; 1780 if (name == "") name = transforms[i].identifier;
1780 1781
1781 // cerr << "Plugin Name: " << name << endl; 1782 // cerr << "Plugin Name: " << name << endl;