Mercurial > hg > svapp
comparison audioio/AudioGenerator.h @ 108:e25e8f5d785b
* Fix #1628781 changes to layer visibility and mute should use a command
* Also use a command for changes to layer playback pan, gain, plugin settings
* Refactor PlayParameterRepository to remove dependency on audioio from base
* Fix failure to save play parameters for main model in session file
author | Chris Cannam |
---|---|
date | Thu, 13 Mar 2008 14:06:03 +0000 |
parents | 3c5756fb6a68 |
children | e81c1ea227ee |
comparison
equal
deleted
inserted
replaced
107:52af71802ffd | 108:e25e8f5d785b |
---|---|
19 class Model; | 19 class Model; |
20 class NoteModel; | 20 class NoteModel; |
21 class DenseTimeValueModel; | 21 class DenseTimeValueModel; |
22 class SparseOneDimensionalModel; | 22 class SparseOneDimensionalModel; |
23 class RealTimePluginInstance; | 23 class RealTimePluginInstance; |
24 class Playable; | |
24 | 25 |
25 #include <QObject> | 26 #include <QObject> |
26 #include <QMutex> | 27 #include <QMutex> |
27 | 28 |
28 #include <set> | 29 #include <set> |
35 public: | 36 public: |
36 AudioGenerator(); | 37 AudioGenerator(); |
37 virtual ~AudioGenerator(); | 38 virtual ~AudioGenerator(); |
38 | 39 |
39 /** | 40 /** |
40 * Return true if the given model is of a type that we generally | |
41 * know how to play. This doesn't guarantee that a specific | |
42 * AudioGenerator will actually produce sounds for it (for | |
43 * example, it may turn out that a vital plugin is missing). | |
44 */ | |
45 static bool canPlay(const Model *model); | |
46 | |
47 static QString getDefaultPlayPluginId(const Model *model); | |
48 static QString getDefaultPlayPluginConfiguration(const Model *model); | |
49 | |
50 /** | |
51 * Add a data model to be played from and initialise any necessary | 41 * Add a data model to be played from and initialise any necessary |
52 * audio generation code. Returns true if the model will be | 42 * audio generation code. Returns true if the model will be |
53 * played. (The return value test here is stricter than that for | 43 * played. The model will be added regardless of the return |
54 * canPlay, above.) The model will be added regardless of the | 44 * value. |
55 * return value. | |
56 */ | 45 */ |
57 virtual bool addModel(Model *model); | 46 virtual bool addModel(Model *model); |
58 | 47 |
59 /** | 48 /** |
60 * Remove a model. | 49 * Remove a model. |
100 * muted). | 89 * muted). |
101 */ | 90 */ |
102 virtual void clearSoloModelSet(); | 91 virtual void clearSoloModelSet(); |
103 | 92 |
104 protected slots: | 93 protected slots: |
105 void playPluginIdChanged(const Model *, QString); | 94 void playPluginIdChanged(const Playable *, QString); |
106 void playPluginConfigurationChanged(const Model *, QString); | 95 void playPluginConfigurationChanged(const Playable *, QString); |
107 | 96 |
108 protected: | 97 protected: |
109 size_t m_sourceSampleRate; | 98 size_t m_sourceSampleRate; |
110 size_t m_targetChannelCount; | 99 size_t m_targetChannelCount; |
111 | 100 |
134 NoteOffMap m_noteOffs; | 123 NoteOffMap m_noteOffs; |
135 static QString m_sampleDir; | 124 static QString m_sampleDir; |
136 | 125 |
137 virtual RealTimePluginInstance *loadPluginFor(const Model *model); | 126 virtual RealTimePluginInstance *loadPluginFor(const Model *model); |
138 virtual RealTimePluginInstance *loadPlugin(QString id, QString program); | 127 virtual RealTimePluginInstance *loadPlugin(QString id, QString program); |
139 static QString getSampleDir(); | 128 static void initialiseSampleDir(); |
140 static void setSampleDir(RealTimePluginInstance *plugin); | 129 static void setSampleDir(RealTimePluginInstance *plugin); |
141 | 130 |
142 virtual size_t mixDenseTimeValueModel | 131 virtual size_t mixDenseTimeValueModel |
143 (DenseTimeValueModel *model, size_t startFrame, size_t frameCount, | 132 (DenseTimeValueModel *model, size_t startFrame, size_t frameCount, |
144 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut); | 133 float **buffer, float gain, float pan, size_t fadeIn, size_t fadeOut); |