comparison data/model/WritableWaveFileModel.cpp @ 1428:87ae75da6527

Convert some cerrs to SVCERRs. Apart from anything else, this makes MSVC2017 happy
author Chris Cannam
date Thu, 01 Mar 2018 14:43:40 +0000
parents 3dcd83595bc8
children 48e9f538e6e9
comparison
equal deleted inserted replaced
1427:622d193a00dc 1428:87ae75da6527
52 try { 52 try {
53 QDir dir(TempDirectory::getInstance()->getPath()); 53 QDir dir(TempDirectory::getInstance()->getPath());
54 path = dir.filePath(QString("written_%1.wav") 54 path = dir.filePath(QString("written_%1.wav")
55 .arg((intptr_t)this)); 55 .arg((intptr_t)this));
56 } catch (DirectoryCreationFailed f) { 56 } catch (DirectoryCreationFailed f) {
57 cerr << "WritableWaveFileModel: Failed to create temporary directory" << endl; 57 SVCERR << "WritableWaveFileModel: Failed to create temporary directory" << endl;
58 return; 58 return;
59 } 59 }
60 } 60 }
61 61
62 // Write directly to the target file, so that we can do 62 // Write directly to the target file, so that we can do
63 // incremental writes and concurrent reads 63 // incremental writes and concurrent reads
64 m_writer = new WavFileWriter(path, sampleRate, channels, 64 m_writer = new WavFileWriter(path, sampleRate, channels,
65 WavFileWriter::WriteToTarget); 65 WavFileWriter::WriteToTarget);
66 if (!m_writer->isOK()) { 66 if (!m_writer->isOK()) {
67 cerr << "WritableWaveFileModel: Error in creating WAV file writer: " << m_writer->getError() << endl; 67 SVCERR << "WritableWaveFileModel: Error in creating WAV file writer: " << m_writer->getError() << endl;
68 delete m_writer; 68 delete m_writer;
69 m_writer = 0; 69 m_writer = 0;
70 return; 70 return;
71 } 71 }
72 72
73 FileSource source(m_writer->getPath()); 73 FileSource source(m_writer->getPath());
74 74
75 m_reader = new WavFileReader(source, true); 75 m_reader = new WavFileReader(source, true);
76 if (!m_reader->getError().isEmpty()) { 76 if (!m_reader->getError().isEmpty()) {
77 cerr << "WritableWaveFileModel: Error in creating wave file reader" << endl; 77 SVCERR << "WritableWaveFileModel: Error in creating wave file reader" << endl;
78 delete m_reader; 78 delete m_reader;
79 m_reader = 0; 79 m_reader = 0;
80 return; 80 return;
81 } 81 }
82 82
83 m_model = new ReadOnlyWaveFileModel(source, m_reader); 83 m_model = new ReadOnlyWaveFileModel(source, m_reader);
84 if (!m_model->isOK()) { 84 if (!m_model->isOK()) {
85 cerr << "WritableWaveFileModel: Error in creating wave file model" << endl; 85 SVCERR << "WritableWaveFileModel: Error in creating wave file model" << endl;
86 delete m_model; 86 delete m_model;
87 m_model = 0; 87 m_model = 0;
88 delete m_reader; 88 delete m_reader;
89 m_reader = 0; 89 m_reader = 0;
90 return; 90 return;