Mercurial > hg > easaier-soundaccess
comparison data/model/WaveFileModel.cpp @ 33:c14ebd0217af
add a busy cursor and statusBar information during the decompression and loading of an audio file.
author | lbajardsilogic |
---|---|
date | Tue, 15 May 2007 07:35:43 +0000 |
parents | fc9323a41f5a |
children | 61681a2bc1e6 |
comparison
equal
deleted
inserted
replaced
32:50d04702da36 | 33:c14ebd0217af |
---|---|
30 | 30 |
31 #include <cassert> | 31 #include <cassert> |
32 | 32 |
33 //#define DEBUG_WAVE_FILE_MODEL 1 | 33 //#define DEBUG_WAVE_FILE_MODEL 1 |
34 | 34 |
35 #include "main/MainWindow.h" | |
36 | |
35 using std::cerr; | 37 using std::cerr; |
36 using std::endl; | 38 using std::endl; |
37 | 39 |
38 PowerOfSqrtTwoZoomConstraint | 40 PowerOfSqrtTwoZoomConstraint |
39 WaveFileModel::m_zoomConstraint; | 41 WaveFileModel::m_zoomConstraint; |
44 m_fillThread(0), | 46 m_fillThread(0), |
45 m_updateTimer(0), | 47 m_updateTimer(0), |
46 m_lastFillExtent(0), | 48 m_lastFillExtent(0), |
47 m_exiting(false) | 49 m_exiting(false) |
48 { | 50 { |
51 MainWindow::instance()->setCursor(Qt::BusyCursor); | |
52 MainWindow::instance()->statusBar()->showMessage(tr("Opening audio file...")); | |
49 m_reader = AudioFileReaderFactory::createReader(path); | 53 m_reader = AudioFileReaderFactory::createReader(path); |
50 setObjectName(QFileInfo(path).fileName()); | 54 setObjectName(QFileInfo(path).fileName()); |
51 if (isOK()) fillCache(); | 55 if (isOK()) fillCache(); |
52 } | 56 } |
53 | 57 |
432 } | 436 } |
433 | 437 |
434 void | 438 void |
435 WaveFileModel::cacheFilled() | 439 WaveFileModel::cacheFilled() |
436 { | 440 { |
441 MainWindow::instance()->setCursor(Qt::ArrowCursor); | |
442 MainWindow::instance()->statusBar()->clearMessage(); | |
437 m_mutex.lock(); | 443 m_mutex.lock(); |
438 delete m_fillThread; | 444 delete m_fillThread; |
439 m_fillThread = 0; | 445 m_fillThread = 0; |
440 delete m_updateTimer; | 446 delete m_updateTimer; |
441 m_updateTimer = 0; | 447 m_updateTimer = 0; |