# HG changeset patch # User Chris Cannam # Date 1434356155 -3600 # Node ID 74d575708e0649208824471f9c8318cfa7c17a19 # Parent d9d132c0e240a03d189acdc7b1efc779057e724f# Parent ea30a8c4cb93d8f57373466832dba95dec9ce7e1 Branch to test simple FFT model code diff -r d9d132c0e240 -r 74d575708e06 audioio/AudioCallbackPlaySource.cpp --- a/audioio/AudioCallbackPlaySource.cpp Mon Apr 20 09:21:32 2015 +0100 +++ b/audioio/AudioCallbackPlaySource.cpp Mon Jun 15 09:15:55 2015 +0100 @@ -422,6 +422,9 @@ SVDEBUG << startFrame << endl; } else { + if (startFrame < 0) { + startFrame = 0; + } if (startFrame >= m_lastModelEndFrame) { startFrame = 0; } diff -r d9d132c0e240 -r 74d575708e06 audioio/AudioGenerator.cpp --- a/audioio/AudioGenerator.cpp Mon Apr 20 09:21:32 2015 +0100 +++ b/audioio/AudioGenerator.cpp Mon Jun 15 09:15:55 2015 +0100 @@ -439,10 +439,10 @@ sv_frame_t got = 0; if (startFrame >= fadeIn/2) { - got = dtvm->getData(0, modelChannels - 1, - startFrame - fadeIn/2, - frames + fadeOut/2 + fadeIn/2, - m_channelBuffer); + got = dtvm->getMultiChannelData(0, modelChannels - 1, + startFrame - fadeIn/2, + frames + fadeOut/2 + fadeIn/2, + m_channelBuffer); } else { sv_frame_t missing = fadeIn/2 - startFrame; @@ -457,10 +457,10 @@ << ", missing = " << missing << endl; } - got = dtvm->getData(0, modelChannels - 1, - startFrame, - frames + fadeOut/2, - m_channelBuffer); + got = dtvm->getMultiChannelData(0, modelChannels - 1, + startFrame, + frames + fadeOut/2, + m_channelBuffer); for (int c = 0; c < modelChannels; ++c) { m_channelBuffer[c] -= missing; diff -r d9d132c0e240 -r 74d575708e06 framework/Document.cpp --- a/framework/Document.cpp Mon Apr 20 09:21:32 2015 +0100 +++ b/framework/Document.cpp Mon Jun 15 09:15:55 2015 +0100 @@ -52,10 +52,16 @@ m_autoAlignment(false), m_align(new Align()) { - connect(this, SIGNAL(modelAboutToBeDeleted(Model *)), + connect(this, + SIGNAL(modelAboutToBeDeleted(Model *)), ModelTransformerFactory::getInstance(), SLOT(modelAboutToBeDeleted(Model *))); + connect(ModelTransformerFactory::getInstance(), + SIGNAL(transformFailed(QString, QString)), + this, + SIGNAL(modelGenerationFailed(QString, QString))); + connect(m_align, SIGNAL(alignmentComplete(AlignmentModel *)), this, SIGNAL(alignmentComplete(AlignmentModel *))); } diff -r d9d132c0e240 -r 74d575708e06 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Mon Apr 20 09:21:32 2015 +0100 +++ b/framework/MainWindowBase.cpp Mon Jun 15 09:15:55 2015 +0100 @@ -60,8 +60,6 @@ #include "data/fileio/AudioFileReaderFactory.h" #include "rdf/RDFImporter.h" -#include "data/fft/FFTDataServer.h" - #include "base/RecentFiles.h" #include "base/PlayParameterRepository.h" @@ -165,6 +163,8 @@ XSetErrorHandler(handle_x11_error); #endif + connect(this, SIGNAL(hideSplash()), this, SLOT(emitHideSplash())); + connect(CommandHistory::getInstance(), SIGNAL(commandExecuted()), this, SLOT(documentModified())); connect(CommandHistory::getInstance(), SIGNAL(documentRestored()), @@ -260,6 +260,8 @@ if (withMIDIInput) { m_midiInput = new MIDIInput(QApplication::applicationName(), this); } + + QTimer::singleShot(1500, this, SIGNAL(hideSplash())); } MainWindowBase::~MainWindowBase() @@ -276,6 +278,12 @@ } void +MainWindowBase::emitHideSplash() +{ + emit hideSplash(this); +} + +void MainWindowBase::finaliseMenus() { delete m_menuShortcutMapper; @@ -588,8 +596,8 @@ emit canMeasureLayer(haveCurrentLayer); emit canSelect(haveMainModel && haveCurrentPane); emit canPlay(haveMainModel && havePlayTarget); - emit canFfwd(true); - emit canRewind(true); + emit canFfwd(haveMainModel); + emit canRewind(haveMainModel); emit canPaste(haveClipboardContents); emit canInsertInstant(haveCurrentPane); emit canInsertInstantsAtBoundaries(haveCurrentPane && haveSelection); @@ -3377,7 +3385,6 @@ m_viewManager->setPlaybackModel(0); } m_playSource->removeModel(model); - FFTDataServer::modelAboutToBeDeleted(model); } void diff -r d9d132c0e240 -r 74d575708e06 framework/MainWindowBase.h --- a/framework/MainWindowBase.h Mon Apr 20 09:21:32 2015 +0100 +++ b/framework/MainWindowBase.h Mon Jun 15 09:15:55 2015 +0100 @@ -162,6 +162,7 @@ void canSave(bool); void canSaveAs(bool); void hideSplash(); + void hideSplash(QWidget *); void sessionLoaded(); void audioFileLoaded(); void replacedDocument(); @@ -293,6 +294,8 @@ virtual void closeSession() = 0; + virtual void emitHideSplash(); + virtual void newerVersionAvailable(QString) { } virtual void menuActionMapperInvoked(QObject *); diff -r d9d132c0e240 -r 74d575708e06 framework/SVFileReader.cpp --- a/framework/SVFileReader.cpp Mon Apr 20 09:21:32 2015 +0100 +++ b/framework/SVFileReader.cpp Mon Jun 15 09:15:55 2015 +0100 @@ -886,12 +886,14 @@ } else { cerr << "WARNING: SV-XML: Unknown model id " << modelId << " in layer definition" << endl; - - // Don't add a layer with an unknown model id - m_document->deleteLayer(layer); - m_layers[id] = layer = 0; - return false; - } + if (!layer->canExistWithoutModel()) { + // Don't add a layer with an unknown model id + // unless it explicitly supports this state + m_document->deleteLayer(layer); + m_layers[id] = layer = 0; + return false; + } + } } if (layer) layer->setProperties(attributes);