Mercurial > hg > svcore
comparison data/fileio/MatrixFile.cpp @ 548:1469caaa8e67
* Finer locking in fft caches; fix displayed bin ranges in spectrogram
author | Chris Cannam |
---|---|
date | Thu, 05 Feb 2009 12:05:28 +0000 |
parents | 806e3c72b5df |
children | 107d3f3705c9 |
comparison
equal
deleted
inserted
replaced
547:806e3c72b5df | 548:1469caaa8e67 |
---|---|
66 | 66 |
67 #ifdef DEBUG_MATRIX_FILE | 67 #ifdef DEBUG_MATRIX_FILE |
68 std::cerr << "MatrixFile::MatrixFile(" << fileBase.toStdString() << ", " << int(mode) << ", " << cellSize << ", " << width << ", " << height << ")" << std::endl; | 68 std::cerr << "MatrixFile::MatrixFile(" << fileBase.toStdString() << ", " << int(mode) << ", " << cellSize << ", " << width << ", " << height << ")" << std::endl; |
69 #endif | 69 #endif |
70 | 70 |
71 QMutexLocker locker(&m_createMutex); | 71 m_createMutex.lock(); |
72 | 72 |
73 QDir tempDir(TempDirectory::getInstance()->getPath()); | 73 QDir tempDir(TempDirectory::getInstance()->getPath()); |
74 QString fileName(tempDir.filePath(QString("%1.mfc").arg(fileBase))); | 74 QString fileName(tempDir.filePath(QString("%1.mfc").arg(fileBase))); |
75 bool newFile = !QFileInfo(fileName).exists(); | 75 bool newFile = !QFileInfo(fileName).exists(); |
76 | 76 |
110 << fileName.toStdString() << "\""; | 110 << fileName.toStdString() << "\""; |
111 if (m_mode == WriteOnly) std::cerr << " for writing"; | 111 if (m_mode == WriteOnly) std::cerr << " for writing"; |
112 std::cerr << std::endl; | 112 std::cerr << std::endl; |
113 throw FailedToOpenFile(fileName); | 113 throw FailedToOpenFile(fileName); |
114 } | 114 } |
115 | |
116 m_createMutex.unlock(); | |
115 | 117 |
116 #ifdef DEBUG_MATRIX_FILE | 118 #ifdef DEBUG_MATRIX_FILE |
117 std::cerr << "MatrixFile(" << this << ")::MatrixFile: fd is " << m_fd << std::endl; | 119 std::cerr << "MatrixFile(" << this << ")::MatrixFile: fd is " << m_fd << std::endl; |
118 #endif | 120 #endif |
119 | 121 |