comparison framework/MainWindowBase.cpp @ 604:6cdf2afebfd7 import-audio-data

Toward importing audio from CSVs
author Chris Cannam
date Thu, 28 Jun 2018 15:29:26 +0100
parents d4c16eed673d
children 636a5908cf81
comparison
equal deleted inserted replaced
603:d4c16eed673d 604:6cdf2afebfd7
1496 } else { 1496 } else {
1497 return FileOpenFailed; 1497 return FileOpenFailed;
1498 } 1498 }
1499 } 1499 }
1500 1500
1501 // cerr << "mode = " << mode << endl; 1501 return addOpenedAudioModel(source, newModel, mode, templateName, true);
1502 1502 }
1503
1504 MainWindowBase::FileOpenStatus
1505 MainWindowBase::addOpenedAudioModel(FileSource source,
1506 WaveFileModel *newModel,
1507 AudioFileOpenMode mode,
1508 QString templateName,
1509 bool registerSource)
1510 {
1503 if (mode == AskUser) { 1511 if (mode == AskUser) {
1504 if (getMainModel()) { 1512 if (getMainModel()) {
1505 1513
1506 QSettings settings; 1514 QSettings settings;
1507 settings.beginGroup("MainWindow"); 1515 settings.beginGroup("MainWindow");
1633 m_documentModified = false; 1641 m_documentModified = false;
1634 documentModified(); // so as to restore "(modified)" window title 1642 documentModified(); // so as to restore "(modified)" window title
1635 } 1643 }
1636 } 1644 }
1637 1645
1638 if (!source.isRemote()) m_audioFile = source.getLocalFilename(); 1646 if (!source.isRemote() && registerSource) {
1647 m_audioFile = source.getLocalFilename();
1648 }
1639 1649
1640 } else if (mode == CreateAdditionalModel) { 1650 } else if (mode == CreateAdditionalModel) {
1641 1651
1642 SVCERR << "Mode is CreateAdditionalModel" << endl; 1652 SVCERR << "Mode is CreateAdditionalModel" << endl;
1643 1653
1703 CommandHistory::getInstance()->endCompoundOperation(); 1713 CommandHistory::getInstance()->endCompoundOperation();
1704 } 1714 }
1705 1715
1706 updateMenuStates(); 1716 updateMenuStates();
1707 m_recentFiles.addFile(source.getLocation()); 1717 m_recentFiles.addFile(source.getLocation());
1708 if (!source.isRemote()) { 1718 if (!source.isRemote() && registerSource) {
1709 // for file dialog 1719 // for file dialog
1710 registerLastOpenedFilePath(FileFinder::AudioFile, 1720 registerLastOpenedFilePath(FileFinder::AudioFile,
1711 source.getLocalFilename()); 1721 source.getLocalFilename());
1712 } 1722 }
1713 m_openingAudioFile = false; 1723 m_openingAudioFile = false;