comparison audioio/AudioGenerator.h @ 305:9716c75499ef tonioni

Toward using a sample mixer (with arbitrary frequency target) instead of dssi player plugin
author Chris Cannam
date Tue, 07 Jan 2014 10:58:10 +0000
parents ae1eedd6951f
children 6eb15c3aee0a
comparison
equal deleted inserted replaced
303:b6358ba5ebc6 305:9716c75499ef
19 class Model; 19 class Model;
20 class NoteModel; 20 class NoteModel;
21 class FlexiNoteModel; 21 class FlexiNoteModel;
22 class DenseTimeValueModel; 22 class DenseTimeValueModel;
23 class SparseOneDimensionalModel; 23 class SparseOneDimensionalModel;
24 class RealTimePluginInstance;
25 class Playable; 24 class Playable;
26 25
27 #include <QObject> 26 #include <QObject>
28 #include <QMutex> 27 #include <QMutex>
29 28
56 * Remove all models. 55 * Remove all models.
57 */ 56 */
58 virtual void clearModels(); 57 virtual void clearModels();
59 58
60 /** 59 /**
61 * Reset playback, clearing plugins and the like. 60 * Reset playback, clearing buffers and the like.
62 */ 61 */
63 virtual void reset(); 62 virtual void reset();
64 63
65 /** 64 /**
66 * Set the target channel count. The buffer parameter to mixModel 65 * Set the target channel count. The buffer parameter to mixModel
91 * muted). 90 * muted).
92 */ 91 */
93 virtual void clearSoloModelSet(); 92 virtual void clearSoloModelSet();
94 93
95 protected slots: 94 protected slots:
96 void playPluginIdChanged(const Playable *, QString); 95 void playSampleIdChanged(const Playable *, QString);
97 void playPluginConfigurationChanged(const Playable *, QString);
98 96
99 protected: 97 protected:
100 size_t m_sourceSampleRate; 98 size_t m_sourceSampleRate;
101 size_t m_targetChannelCount; 99 size_t m_targetChannelCount;
102 100
103 bool m_soloing; 101 bool m_soloing;
104 std::set<Model *> m_soloModelSet; 102 std::set<Model *> m_soloModelSet;
105 103
106 struct NoteOff { 104 struct NoteOff {
115 return n1.frame < n2.frame; 113 return n1.frame < n2.frame;
116 } 114 }
117 }; 115 };
118 }; 116 };
119 117
120 typedef std::map<const Model *, RealTimePluginInstance *> PluginMap; 118 //!!! typedef std::map<const Model *, RealTimePluginInstance *> PluginMap;
121 119
122 typedef std::multiset<NoteOff, NoteOff::Comparator> NoteOffSet; 120 typedef std::multiset<NoteOff, NoteOff::Comparator> NoteOffSet;
123 typedef std::map<const Model *, NoteOffSet> NoteOffMap; 121 typedef std::map<const Model *, NoteOffSet> NoteOffMap;
124 122
125 QMutex m_mutex; 123 QMutex m_mutex;
126 PluginMap m_synthMap; 124 //!!! PluginMap m_synthMap;
127 NoteOffMap m_noteOffs; 125 NoteOffMap m_noteOffs;
128 static QString m_sampleDir; 126 static QString m_sampleDir;
129 127
128 /*!!!
130 virtual RealTimePluginInstance *loadPluginFor(const Model *model); 129 virtual RealTimePluginInstance *loadPluginFor(const Model *model);
131 virtual RealTimePluginInstance *loadPlugin(QString id, QString program); 130 virtual RealTimePluginInstance *loadPlugin(QString id, QString program);
131 */
132 static void initialiseSampleDir(); 132 static void initialiseSampleDir();
133 static void setSampleDir(RealTimePluginInstance *plugin); 133 //!!! static void setSampleDir(RealTimePluginInstance *plugin);
134 134
135 virtual size_t mixDenseTimeValueModel 135 virtual size_t mixDenseTimeValueModel
136 (DenseTimeValueModel *model, size_t startFrame, size_t frameCount, 136 (DenseTimeValueModel *model, size_t startFrame, size_t frameCount,
137 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut); 137 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut);
138 138
139 virtual size_t mixSyntheticNoteModel 139 virtual size_t mixSyntheticNoteModel
140 (Model *model, size_t startFrame, size_t frameCount, 140 (Model *model, size_t startFrame, size_t frameCount,
141 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut); 141 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut);
142 142
143 static const size_t m_pluginBlockSize; 143 static const size_t m_processingBlockSize;
144 }; 144 };
145 145
146 #endif 146 #endif
147 147