Mercurial > hg > svapp
changeset 644:6fd0ebfd2bbe
Merge from branch fix-static-analysis
author | Chris Cannam |
---|---|
date | Wed, 09 Jan 2019 15:25:09 +0000 |
parents | 713b9a6b284a (diff) 8c5379570f36 (current diff) |
children | 6240788893e7 e19c609a7bec |
files | audio/AudioCallbackRecordTarget.cpp framework/MainWindowBase.cpp |
diffstat | 2 files changed, 35 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/audio/AudioCallbackRecordTarget.cpp Tue Dec 04 13:49:20 2018 +0000 +++ b/audio/AudioCallbackRecordTarget.cpp Wed Jan 09 15:25:09 2019 +0000 @@ -16,6 +16,7 @@ #include "base/ViewManagerBase.h" #include "base/RecordDirectory.h" +#include "base/Debug.h" #include "data/model/WritableWaveFileModel.h" @@ -51,6 +52,10 @@ AudioCallbackRecordTarget::~AudioCallbackRecordTarget() { +#ifdef DEBUG_AUDIO_CALLBACK_RECORD_TARGET + cerr << "AudioCallbackRecordTarget dtor" << endl; +#endif + m_viewManager->setAudioRecordTarget(nullptr); QMutexLocker locker(&m_bufPtrMutex); @@ -169,6 +174,13 @@ cerr << "AudioCallbackRecordTarget::updateModel: have " << nframes << " frames" << endl; #endif + if (!m_model) { +#ifdef DEBUG_AUDIO_CALLBACK_RECORD_TARGET + cerr << "AudioCallbackRecordTarget::updateModel: have no model to update; I am hoping there is a good reason for this" << endl; +#endif + return; + } + float **samples = new float *[m_recordChannelCount]; for (int c = 0; c < m_recordChannelCount; ++c) { samples[c] = new float[nframes]; @@ -217,8 +229,13 @@ AudioCallbackRecordTarget::modelAboutToBeDeleted() { if (sender() == m_model) { +#ifdef DEBUG_AUDIO_CALLBACK_RECORD_TARGET + cerr << "AudioCallbackRecordTarget::modelAboutToBeDeleted: taking note" << endl; +#endif m_model = nullptr; m_recording = false; + } else if (m_model) { + SVCERR << "WARNING: AudioCallbackRecordTarget::modelAboutToBeDeleted: this is not my model!" << endl; } } @@ -263,6 +280,9 @@ return nullptr; } + connect(m_model, SIGNAL(aboutToBeDeleted()), + this, SLOT(modelAboutToBeDeleted())); + m_model->setObjectName(label); m_recording = true;
--- a/framework/MainWindowBase.cpp Tue Dec 04 13:49:20 2018 +0000 +++ b/framework/MainWindowBase.cpp Wed Jan 09 15:25:09 2019 +0000 @@ -277,8 +277,8 @@ connect(m_viewManager, SIGNAL(viewCentreFrameChanged(View *, sv_frame_t)), this, SLOT(viewCentreFrameChanged(View *, sv_frame_t))); - connect(m_viewManager, SIGNAL(viewZoomLevelChanged(View *, int, bool)), - this, SLOT(viewZoomLevelChanged(View *, int, bool))); + connect(m_viewManager, SIGNAL(viewZoomLevelChanged(View *, ZoomLevel, bool)), + this, SLOT(viewZoomLevelChanged(View *, ZoomLevel, bool))); connect(Preferences::getInstance(), SIGNAL(propertyChanged(PropertyContainer::PropertyName)), @@ -328,14 +328,16 @@ delete m_viewManager; delete m_midiInput; - disconnect(m_oscQueueStarter, nullptr, nullptr, nullptr); - m_oscQueueStarter->wait(1000); - if (m_oscQueueStarter->isRunning()) { - m_oscQueueStarter->terminate(); + if (m_oscQueueStarter) { + disconnect(m_oscQueueStarter, nullptr, nullptr, nullptr); m_oscQueueStarter->wait(1000); + if (m_oscQueueStarter->isRunning()) { + m_oscQueueStarter->terminate(); + m_oscQueueStarter->wait(1000); + } + delete m_oscQueueStarter; + delete m_oscQueue; } - delete m_oscQueueStarter; - delete m_oscQueue; Profiles::getInstance()->dump(); } @@ -1884,9 +1886,11 @@ (path, &midiDlg, getMainModel()->getSampleRate()); if (!model) { - CSVFormat format(path); - format.setSampleRate(getMainModel()->getSampleRate()); - CSVFormatDialog *dialog = new CSVFormatDialog(this, format); + CSVFormatDialog *dialog = + new CSVFormatDialog(this, + path, + getMainModel()->getSampleRate(), + 5); if (dialog->exec() == QDialog::Accepted) { model = DataFileReaderFactory::loadCSV (path, dialog->getFormat(),