changeset 617:e98a42e94d90

Merge from branch avoid-pointer-keys
author Chris Cannam
date Tue, 04 Sep 2018 11:32:49 +0100
parents 755fc02a1565 (current diff) 7d3a6357ce64 (diff)
children 636a5908cf81 9e15607531b2
files
diffstat 3 files changed, 24 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- 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 &noteOffs = m_noteOffs[model];
+    NoteOffSet &noteOffs = 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
--- 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 <vector>
 
 #include "base/BaseTypes.h"
+#include "data/model/Model.h"
 
 class AudioGenerator : public QObject
 {
@@ -140,12 +140,12 @@
     };
 
 
-    typedef std::map<const Model *, ClipMixer *> ClipMixerMap;
+    typedef std::map<const ModelId, ClipMixer *> ClipMixerMap;
 
     typedef std::multiset<NoteOff, NoteOff::Comparator> NoteOffSet;
-    typedef std::map<const Model *, NoteOffSet> NoteOffMap;
+    typedef std::map<const ModelId, NoteOffSet> NoteOffMap;
 
-    typedef std::map<const Model *, ContinuousSynth *> ContinuousSynthMap;
+    typedef std::map<const ModelId, ContinuousSynth *> ContinuousSynthMap;
 
     QMutex m_mutex;
 
--- 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"