Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 118:b4110b17bca8
* Fix #1672407 confused by plugin-named files in cwd (or home?)
* Fix #1491848 crash when loading new file while transform plugin runs
* Fix #1502287 Background remains black after spectrogram layer deleted
* Fix #1604477 Replacing the main audio file silences secondary audio file
* Fix failure to initialise property box layout to last preference on startup
* Fix resample/wrong-rate display in Pane, ensure that right rate is chosen
if all current models have an acceptable rate even if previous main model
had a different one
* Fix "global zoom" broken in previous commit
* Some fixes to spectrogram cache area updating (makes spectrogram appear
more quickly, previously it had a tendency to refresh with empty space)
* Fixes to colour 3d plot normalization
author | Chris Cannam |
---|---|
date | Thu, 08 Mar 2007 16:53:08 +0000 |
parents | 8089a394829a |
children | 3fff180a254b |
comparison
equal
deleted
inserted
replaced
117:8089a394829a | 118:b4110b17bca8 |
---|---|
284 newSession(); | 284 newSession(); |
285 } | 285 } |
286 | 286 |
287 MainWindow::~MainWindow() | 287 MainWindow::~MainWindow() |
288 { | 288 { |
289 std::cerr << "MainWindow::~MainWindow()" << std::endl; | |
290 | |
289 if (!m_abandoning) { | 291 if (!m_abandoning) { |
290 closeSession(); | 292 closeSession(); |
291 } | 293 } |
292 delete m_playTarget; | 294 delete m_playTarget; |
293 delete m_playSource; | 295 delete m_playSource; |
2332 } | 2334 } |
2333 | 2335 |
2334 if (setAsMain) { | 2336 if (setAsMain) { |
2335 | 2337 |
2336 Model *prevMain = getMainModel(); | 2338 Model *prevMain = getMainModel(); |
2337 if (prevMain) m_playSource->removeModel(prevMain); | 2339 if (prevMain) { |
2338 | 2340 m_playSource->removeModel(prevMain); |
2339 PlayParameterRepository::getInstance()->clear(); | 2341 PlayParameterRepository::getInstance()->removeModel(prevMain); |
2340 | 2342 } |
2341 // The clear() call will have removed the parameters for the | 2343 |
2342 // main model. Re-add them with the new one. | 2344 PlayParameterRepository::getInstance()->addModel(newModel); |
2343 PlayParameterRepository::getInstance()->addModel(newModel); | |
2344 | 2345 |
2345 m_document->setMainModel(newModel); | 2346 m_document->setMainModel(newModel); |
2346 setupMenus(); | 2347 setupMenus(); |
2347 | 2348 |
2348 if (m_sessionFile == "") { | 2349 if (m_sessionFile == "") { |
2785 } | 2786 } |
2786 | 2787 |
2787 void | 2788 void |
2788 MainWindow::closeEvent(QCloseEvent *e) | 2789 MainWindow::closeEvent(QCloseEvent *e) |
2789 { | 2790 { |
2791 std::cerr << "MainWindow::closeEvent" << std::endl; | |
2792 | |
2790 if (!m_abandoning && !checkSaveModified()) { | 2793 if (!m_abandoning && !checkSaveModified()) { |
2794 std::cerr << "Ignoring close event" << std::endl; | |
2791 e->ignore(); | 2795 e->ignore(); |
2792 return; | 2796 return; |
2793 } | 2797 } |
2794 | 2798 |
2795 QSettings settings; | 2799 QSettings settings; |
3769 { | 3773 { |
3770 if (!willResample) { | 3774 if (!willResample) { |
3771 //!!! more helpful message needed | 3775 //!!! more helpful message needed |
3772 QMessageBox::information | 3776 QMessageBox::information |
3773 (this, tr("Sample rate mismatch"), | 3777 (this, tr("Sample rate mismatch"), |
3774 tr("The sample rate of this audio file (%1 Hz) does not match\nthe current playback rate (%2 Hz).\n\nThe file will play at the wrong speed.") | 3778 tr("The sample rate of this audio file (%1 Hz) does not match\nthe current playback rate (%2 Hz).\n\nThe file will play at the wrong speed and pitch.") |
3775 .arg(requested).arg(actual)); | 3779 .arg(requested).arg(actual)); |
3776 } | 3780 } |
3777 | |
3778 /*!!! Let's not do this for now, and see how we go -- now that we're putting | |
3779 sample rate information in the status bar | |
3780 | |
3781 QMessageBox::information | |
3782 (this, tr("Sample rate mismatch"), | |
3783 tr("The sample rate of this audio file (%1 Hz) does not match\nthat of the output audio device (%2 Hz).\n\nThe file will be resampled automatically during playback.") | |
3784 .arg(requested).arg(actual)); | |
3785 */ | |
3786 | 3781 |
3787 updateDescriptionLabel(); | 3782 updateDescriptionLabel(); |
3788 } | 3783 } |
3789 | 3784 |
3790 void | 3785 void |