comparison data/model/WritableWaveFileModel.cpp @ 1731:601851995f4b by-id

Introduce Model to ById
author Chris Cannam
date Fri, 21 Jun 2019 13:37:00 +0100
parents 26da177d7266
children 52705a328b34
comparison
equal deleted inserted replaced
1729:abd8b9673028 1731:601851995f4b
94 try { 94 try {
95 // Temp dir is exclusive to this run of the application, 95 // Temp dir is exclusive to this run of the application,
96 // so the filename only needs to be unique within that - 96 // so the filename only needs to be unique within that -
97 // model ID should be ok 97 // model ID should be ok
98 QDir dir(TempDirectory::getInstance()->getPath()); 98 QDir dir(TempDirectory::getInstance()->getPath());
99 path = dir.filePath(QString("written_%1.wav").arg(getId())); 99 path = dir.filePath(QString("written_%1.wav")
100 .arg(getId().toString()));
100 } catch (const DirectoryCreationFailed &f) { 101 } catch (const DirectoryCreationFailed &f) {
101 SVCERR << "WritableWaveFileModel: Failed to create temporary directory" << endl; 102 SVCERR << "WritableWaveFileModel: Failed to create temporary directory" << endl;
102 return; 103 return;
103 } 104 }
104 } 105 }
124 if (m_normalisation != Normalisation::None) { 125 if (m_normalisation != Normalisation::None) {
125 126
126 // Temp dir is exclusive to this run of the application, so 127 // Temp dir is exclusive to this run of the application, so
127 // the filename only needs to be unique within that 128 // the filename only needs to be unique within that
128 QDir dir(TempDirectory::getInstance()->getPath()); 129 QDir dir(TempDirectory::getInstance()->getPath());
129 m_temporaryPath = dir.filePath(QString("prenorm_%1.wav").arg(getId())); 130 m_temporaryPath = dir.filePath(QString("prenorm_%1.wav")
131 .arg(getId().toString()));
130 132
131 m_temporaryWriter = new WavFileWriter 133 m_temporaryWriter = new WavFileWriter
132 (m_temporaryPath, m_sampleRate, m_channels, 134 (m_temporaryPath, m_sampleRate, m_channels,
133 WavFileWriter::WriteToTarget); 135 WavFileWriter::WriteToTarget);
134 136