# HG changeset patch # User Chris Cannam # Date 1536057169 -3600 # Node ID e98a42e94d90120247dd368b30e1d37ad382ec61 # Parent 755fc02a1565bed08c5a60f475a615475bac2572# Parent 7d3a6357ce64783a1146c9effe8d45e350507628 Merge from branch avoid-pointer-keys diff -r 755fc02a1565 -r e98a42e94d90 audio/AudioGenerator.cpp --- a/audio/AudioGenerator.cpp Mon Aug 13 14:13:38 2018 +0100 +++ b/audio/AudioGenerator.cpp Tue Sep 04 11:32:49 2018 +0100 @@ -141,7 +141,7 @@ ClipMixer *mixer = makeClipMixerFor(model); if (mixer) { QMutexLocker locker(&m_mutex); - m_clipMixerMap[model] = mixer; + m_clipMixerMap[model->getId()] = mixer; return willPlay; } } @@ -150,7 +150,7 @@ ContinuousSynth *synth = makeSynthFor(model); if (synth) { QMutexLocker locker(&m_mutex); - m_continuousSynthMap[model] = synth; + m_continuousSynthMap[model->getId()] = synth; return willPlay; } } @@ -169,12 +169,14 @@ return; } - if (m_clipMixerMap.find(model) == m_clipMixerMap.end()) return; + if (m_clipMixerMap.find(model->getId()) == m_clipMixerMap.end()) { + return; + } ClipMixer *mixer = makeClipMixerFor(model); if (mixer) { QMutexLocker locker(&m_mutex); - m_clipMixerMap[model] = mixer; + m_clipMixerMap[model->getId()] = mixer; } } @@ -279,10 +281,12 @@ QMutexLocker locker(&m_mutex); - if (m_clipMixerMap.find(sodm) == m_clipMixerMap.end()) return; + if (m_clipMixerMap.find(sodm->getId()) == m_clipMixerMap.end()) { + return; + } - ClipMixer *mixer = m_clipMixerMap[sodm]; - m_clipMixerMap.erase(sodm); + ClipMixer *mixer = m_clipMixerMap[sodm->getId()]; + m_clipMixerMap.erase(sodm->getId()); delete mixer; } @@ -307,7 +311,8 @@ cerr << "AudioGenerator::reset()" << endl; #endif - for (ClipMixerMap::iterator i = m_clipMixerMap.begin(); i != m_clipMixerMap.end(); ++i) { + for (ClipMixerMap::iterator i = m_clipMixerMap.begin(); + i != m_clipMixerMap.end(); ++i) { if (i->second) { i->second->reset(); } @@ -522,7 +527,7 @@ sv_frame_t startFrame, sv_frame_t frames, float **buffer, float gain, float pan) { - ClipMixer *clipMixer = m_clipMixerMap[model]; + ClipMixer *clipMixer = m_clipMixerMap[model->getId()]; if (!clipMixer) return 0; int blocks = int(frames / m_processingBlockSize); @@ -550,7 +555,7 @@ ClipMixer::NoteStart on; ClipMixer::NoteEnd off; - NoteOffSet ¬eOffs = m_noteOffs[model]; + NoteOffSet ¬eOffs = m_noteOffs[model->getId()]; float **bufferIndexes = new float *[m_targetChannelCount]; @@ -681,7 +686,7 @@ float gain, float pan) { - ContinuousSynth *synth = m_continuousSynthMap[model]; + ContinuousSynth *synth = m_continuousSynthMap[model->getId()]; if (!synth) return 0; // only type we support here at the moment diff -r 755fc02a1565 -r e98a42e94d90 audio/AudioGenerator.h --- a/audio/AudioGenerator.h Mon Aug 13 14:13:38 2018 +0100 +++ b/audio/AudioGenerator.h Tue Sep 04 11:32:49 2018 +0100 @@ -13,10 +13,9 @@ COPYING included with this distribution for more information. */ -#ifndef _AUDIO_GENERATOR_H_ -#define _AUDIO_GENERATOR_H_ +#ifndef SV_AUDIO_GENERATOR_H +#define SV_AUDIO_GENERATOR_H -class Model; class NoteModel; class FlexiNoteModel; class DenseTimeValueModel; @@ -33,6 +32,7 @@ #include #include "base/BaseTypes.h" +#include "data/model/Model.h" class AudioGenerator : public QObject { @@ -140,12 +140,12 @@ }; - typedef std::map ClipMixerMap; + typedef std::map ClipMixerMap; typedef std::multiset NoteOffSet; - typedef std::map NoteOffMap; + typedef std::map NoteOffMap; - typedef std::map ContinuousSynthMap; + typedef std::map ContinuousSynthMap; QMutex m_mutex; diff -r 755fc02a1565 -r e98a42e94d90 framework/Document.h --- a/framework/Document.h Mon Aug 13 14:13:38 2018 +0100 +++ b/framework/Document.h Tue Sep 04 11:32:49 2018 +0100 @@ -13,8 +13,8 @@ COPYING included with this distribution for more information. */ -#ifndef _DOCUMENT_H_ -#define _DOCUMENT_H_ +#ifndef SV_DOCUMENT_H +#define SV_DOCUMENT_H #include "layer/LayerFactory.h" #include "transform/Transform.h"