diff data/model/WritableWaveFileModel.cpp @ 1742:52705a328b34 by-id

Rejig ById so as to put everything in a single pool, so that at the core you can go from numeric id (untyped) to anything the object can be dynamic_cast to. Useful for building other abstractions like PlayParameter-type registrations that don't know about e.g. Models. Probably some more tweaking needed. Also add tests
author Chris Cannam
date Fri, 28 Jun 2019 17:36:30 +0100
parents 601851995f4b
children 77543124651b
line wrap: on
line diff
--- a/data/model/WritableWaveFileModel.cpp	Thu Jun 27 13:08:10 2019 +0100
+++ b/data/model/WritableWaveFileModel.cpp	Fri Jun 28 17:36:30 2019 +0100
@@ -97,7 +97,7 @@
             // model ID should be ok
             QDir dir(TempDirectory::getInstance()->getPath());
             path = dir.filePath(QString("written_%1.wav")
-                                .arg(getId().toString()));
+                                .arg(getId().untyped));
         } catch (const DirectoryCreationFailed &f) {
             SVCERR << "WritableWaveFileModel: Failed to create temporary directory" << endl;
             return;
@@ -128,7 +128,7 @@
         // the filename only needs to be unique within that
         QDir dir(TempDirectory::getInstance()->getPath());
         m_temporaryPath = dir.filePath(QString("prenorm_%1.wav")
-                                       .arg(getId().toString()));
+                                       .arg(getId().untyped));
 
         m_temporaryWriter = new WavFileWriter
             (m_temporaryPath, m_sampleRate, m_channels,