comparison data/model/WaveFileModel.cpp @ 211:e2bbb58e6df6

Several changes related to referring to remote URLs for sessions and files: * Pull file dialog wrapper functions out from MainWindow into FileFinder * If a file referred to in a session is not found at its expected location, try a few other alternatives (same location as the session file or same location as the last audio file) before asking the user to locate it * Allow user to give a URL when locating an audio file, not just locate on the filesystem * Make wave file models remember the "original" location (e.g. URL) of the audio file, not just the actual location from which the data was loaded (e.g. local copy of that URL) -- when saving a session, use the original location so as not to refer to a temporary file * Clean up incompletely-downloaded local copies of files
author Chris Cannam
date Thu, 11 Jan 2007 13:29:58 +0000
parents 91fdc752e540
children 185454896a76
comparison
equal deleted inserted replaced
210:a06afefe45ee 211:e2bbb58e6df6
44 m_lastFillExtent(0), 44 m_lastFillExtent(0),
45 m_exiting(false) 45 m_exiting(false)
46 { 46 {
47 m_reader = AudioFileReaderFactory::createReader(path); 47 m_reader = AudioFileReaderFactory::createReader(path);
48 setObjectName(QFileInfo(path).fileName()); 48 setObjectName(QFileInfo(path).fileName());
49 if (isOK()) fillCache();
50 }
51
52 WaveFileModel::WaveFileModel(QString path, QString originalLocation) :
53 m_path(originalLocation),
54 m_myReader(true),
55 m_fillThread(0),
56 m_updateTimer(0),
57 m_lastFillExtent(0),
58 m_exiting(false)
59 {
60 m_reader = AudioFileReaderFactory::createReader(path);
61 setObjectName(QFileInfo(originalLocation).fileName());
49 if (isOK()) fillCache(); 62 if (isOK()) fillCache();
50 } 63 }
51 64
52 WaveFileModel::WaveFileModel(QString path, AudioFileReader *reader) : 65 WaveFileModel::WaveFileModel(QString path, AudioFileReader *reader) :
53 m_path(path), 66 m_path(path),