diff 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
line wrap: on
line diff
--- a/data/model/WaveFileModel.cpp	Wed Jan 10 17:26:39 2007 +0000
+++ b/data/model/WaveFileModel.cpp	Thu Jan 11 13:29:58 2007 +0000
@@ -49,6 +49,19 @@
     if (isOK()) fillCache();
 }
 
+WaveFileModel::WaveFileModel(QString path, QString originalLocation) :
+    m_path(originalLocation),
+    m_myReader(true),
+    m_fillThread(0),
+    m_updateTimer(0),
+    m_lastFillExtent(0),
+    m_exiting(false)
+{
+    m_reader = AudioFileReaderFactory::createReader(path);
+    setObjectName(QFileInfo(originalLocation).fileName());
+    if (isOK()) fillCache();
+}
+
 WaveFileModel::WaveFileModel(QString path, AudioFileReader *reader) :
     m_path(path),
     m_myReader(false),