comparison framework/MainWindowBase.cpp @ 341:93cf23bfa1cb tonioni

Make session file extension parameterisable, use .ton for Tony
author Chris Cannam
date Wed, 02 Apr 2014 18:22:41 +0100
parents 40bcaf772d78
children 4eccff14b4d8
comparison
equal deleted inserted replaced
339:dd07d48d7d4f 341:93cf23bfa1cb
43 #include "widgets/CommandHistory.h" 43 #include "widgets/CommandHistory.h"
44 #include "widgets/ProgressDialog.h" 44 #include "widgets/ProgressDialog.h"
45 #include "widgets/MIDIFileImportDialog.h" 45 #include "widgets/MIDIFileImportDialog.h"
46 #include "widgets/CSVFormatDialog.h" 46 #include "widgets/CSVFormatDialog.h"
47 #include "widgets/ModelDataTableDialog.h" 47 #include "widgets/ModelDataTableDialog.h"
48 #include "widgets/InteractiveFileFinder.h"
48 49
49 #include "audioio/AudioCallbackPlaySource.h" 50 #include "audioio/AudioCallbackPlaySource.h"
50 #include "audioio/AudioCallbackPlayTarget.h" 51 #include "audioio/AudioCallbackPlayTarget.h"
51 #include "audioio/AudioTargetFactory.h" 52 #include "audioio/AudioTargetFactory.h"
52 #include "audioio/PlaySpeedRangeMapper.h" 53 #include "audioio/PlaySpeedRangeMapper.h"
1633 SVDEBUG << "MainWindowBase::openSession(" << source.getLocation() << ")" << endl; 1634 SVDEBUG << "MainWindowBase::openSession(" << source.getLocation() << ")" << endl;
1634 1635
1635 if (!source.isAvailable()) return FileOpenFailed; 1636 if (!source.isAvailable()) return FileOpenFailed;
1636 source.waitForData(); 1637 source.waitForData();
1637 1638
1638 if (source.getExtension().toLower() != "sv") { 1639 QString sessionExt =
1640 InteractiveFileFinder::getInstance()->getApplicationSessionExtension();
1641
1642 if (source.getExtension().toLower() != sessionExt) {
1639 1643
1640 RDFImporter::RDFDocumentType rdfType = 1644 RDFImporter::RDFDocumentType rdfType =
1641 RDFImporter::identifyDocumentType 1645 RDFImporter::identifyDocumentType
1642 (QUrl::fromLocalFile(source.getLocalFilename()).toString()); 1646 (QUrl::fromLocalFile(source.getLocalFilename()).toString());
1643 1647
1664 1668
1665 QXmlInputSource *inputSource = 0; 1669 QXmlInputSource *inputSource = 0;
1666 BZipFileDevice *bzFile = 0; 1670 BZipFileDevice *bzFile = 0;
1667 QFile *rawFile = 0; 1671 QFile *rawFile = 0;
1668 1672
1669 if (source.getExtension().toLower() == "sv") { 1673 if (source.getExtension().toLower() == sessionExt) {
1670 bzFile = new BZipFileDevice(source.getLocalFilename()); 1674 bzFile = new BZipFileDevice(source.getLocalFilename());
1671 if (!bzFile->open(QIODevice::ReadOnly)) { 1675 if (!bzFile->open(QIODevice::ReadOnly)) {
1672 delete bzFile; 1676 delete bzFile;
1673 return FileOpenFailed; 1677 return FileOpenFailed;
1674 } 1678 }