comparison framework/MainWindowBase.cpp @ 347:b3609adae921 tony_integration

Merge from tonioni branch
author Chris Cannam
date Wed, 07 May 2014 15:12:35 +0100
parents 1e3af7f4fa86 4eccff14b4d8
children 1d8cb0d92f4b
comparison
equal deleted inserted replaced
346:0e4332efcc7d 347:b3609adae921
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"
1391 } 1392 }
1392 m_openingAudioFile = false; 1393 m_openingAudioFile = false;
1393 1394
1394 currentPaneChanged(m_paneStack->getCurrentPane()); 1395 currentPaneChanged(m_paneStack->getCurrentPane());
1395 1396
1397 emit audioFileLoaded();
1398
1396 return FileOpenSucceeded; 1399 return FileOpenSucceeded;
1397 } 1400 }
1398 1401
1399 MainWindowBase::FileOpenStatus 1402 MainWindowBase::FileOpenStatus
1400 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode) 1403 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode)
1635 SVDEBUG << "MainWindowBase::openSession(" << source.getLocation() << ")" << endl; 1638 SVDEBUG << "MainWindowBase::openSession(" << source.getLocation() << ")" << endl;
1636 1639
1637 if (!source.isAvailable()) return FileOpenFailed; 1640 if (!source.isAvailable()) return FileOpenFailed;
1638 source.waitForData(); 1641 source.waitForData();
1639 1642
1640 if (source.getExtension().toLower() != "sv") { 1643 QString sessionExt =
1644 InteractiveFileFinder::getInstance()->getApplicationSessionExtension();
1645
1646 if (source.getExtension().toLower() != sessionExt) {
1641 1647
1642 RDFImporter::RDFDocumentType rdfType = 1648 RDFImporter::RDFDocumentType rdfType =
1643 RDFImporter::identifyDocumentType 1649 RDFImporter::identifyDocumentType
1644 (QUrl::fromLocalFile(source.getLocalFilename()).toString()); 1650 (QUrl::fromLocalFile(source.getLocalFilename()).toString());
1645 1651
1666 1672
1667 QXmlInputSource *inputSource = 0; 1673 QXmlInputSource *inputSource = 0;
1668 BZipFileDevice *bzFile = 0; 1674 BZipFileDevice *bzFile = 0;
1669 QFile *rawFile = 0; 1675 QFile *rawFile = 0;
1670 1676
1671 if (source.getExtension().toLower() == "sv") { 1677 if (source.getExtension().toLower() == sessionExt) {
1672 bzFile = new BZipFileDevice(source.getLocalFilename()); 1678 bzFile = new BZipFileDevice(source.getLocalFilename());
1673 if (!bzFile->open(QIODevice::ReadOnly)) { 1679 if (!bzFile->open(QIODevice::ReadOnly)) {
1674 delete bzFile; 1680 delete bzFile;
1675 return FileOpenFailed; 1681 return FileOpenFailed;
1676 } 1682 }
1739 if (!source.isRemote()) { 1745 if (!source.isRemote()) {
1740 // for file dialog 1746 // for file dialog
1741 registerLastOpenedFilePath(FileFinder::SessionFile, 1747 registerLastOpenedFilePath(FileFinder::SessionFile,
1742 source.getLocalFilename()); 1748 source.getLocalFilename());
1743 } 1749 }
1750
1751 emit sessionLoaded();
1744 1752
1745 } else { 1753 } else {
1746 setWindowTitle(QApplication::applicationName()); 1754 setWindowTitle(QApplication::applicationName());
1747 } 1755 }
1748 1756
1822 1830
1823 CommandHistory::getInstance()->clear(); 1831 CommandHistory::getInstance()->clear();
1824 CommandHistory::getInstance()->documentSaved(); 1832 CommandHistory::getInstance()->documentSaved();
1825 m_documentModified = false; 1833 m_documentModified = false;
1826 updateMenuStates(); 1834 updateMenuStates();
1835
1836 emit sessionLoaded();
1827 } 1837 }
1828 1838
1829 return ok ? FileOpenSucceeded : FileOpenFailed; 1839 return ok ? FileOpenSucceeded : FileOpenFailed;
1830 } 1840 }
1831 1841
1852 .arg(QApplication::applicationName()) 1862 .arg(QApplication::applicationName())
1853 .arg(source.getLocation())); 1863 .arg(source.getLocation()));
1854 CommandHistory::getInstance()->clear(); 1864 CommandHistory::getInstance()->clear();
1855 CommandHistory::getInstance()->documentSaved(); 1865 CommandHistory::getInstance()->documentSaved();
1856 m_documentModified = false; 1866 m_documentModified = false;
1867
1868 emit sessionLoaded();
1857 1869
1858 return status; 1870 return status;
1859 } 1871 }
1860 1872
1861 MainWindowBase::FileOpenStatus 1873 MainWindowBase::FileOpenStatus
2207 } 2219 }
2208 2220
2209 Pane * 2221 Pane *
2210 MainWindowBase::addPaneToStack() 2222 MainWindowBase::addPaneToStack()
2211 { 2223 {
2224 cerr << "MainWindowBase::addPaneToStack()" << endl;
2212 AddPaneCommand *command = new AddPaneCommand(this); 2225 AddPaneCommand *command = new AddPaneCommand(this);
2213 CommandHistory::getInstance()->addCommand(command); 2226 CommandHistory::getInstance()->addCommand(command);
2214 Pane *pane = command->getPane(); 2227 Pane *pane = command->getPane();
2215 return pane; 2228 return pane;
2216 } 2229 }