Mercurial > hg > svcore
comparison plugin/DSSIPluginInstance.h @ 1527:710e6250a401 zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:14 +0100 |
parents | 48e9f538e6e9 |
children | c01cbe41aeb5 |
comparison
equal
deleted
inserted
replaced
1324:d4a28d1479a8 | 1527:710e6250a401 |
---|---|
66 virtual float getParameter(std::string) const; | 66 virtual float getParameter(std::string) const; |
67 virtual void setParameter(std::string, float); | 67 virtual void setParameter(std::string, float); |
68 | 68 |
69 virtual std::string configure(std::string key, std::string value); | 69 virtual std::string configure(std::string key, std::string value); |
70 virtual void sendEvent(const RealTime &eventTime, | 70 virtual void sendEvent(const RealTime &eventTime, |
71 const void *event); | 71 const void *event); |
72 virtual void clearEvents(); | 72 virtual void clearEvents(); |
73 | 73 |
74 virtual int getBufferSize() const { return m_blockSize; } | 74 virtual int getBufferSize() const { return m_blockSize; } |
75 virtual int getAudioInputCount() const { return (int)m_audioPortsIn.size(); } | 75 virtual int getAudioInputCount() const { return (int)m_audioPortsIn.size(); } |
76 virtual int getAudioOutputCount() const { return m_idealChannelCount; } | 76 virtual int getAudioOutputCount() const { return m_idealChannelCount; } |
105 friend class DSSIPluginFactory; | 105 friend class DSSIPluginFactory; |
106 | 106 |
107 // Constructor that creates the buffers internally | 107 // Constructor that creates the buffers internally |
108 // | 108 // |
109 DSSIPluginInstance(RealTimePluginFactory *factory, | 109 DSSIPluginInstance(RealTimePluginFactory *factory, |
110 int client, | 110 int client, |
111 QString identifier, | 111 QString identifier, |
112 int position, | 112 int position, |
113 sv_samplerate_t sampleRate, | 113 sv_samplerate_t sampleRate, |
114 int blockSize, | 114 int blockSize, |
115 int idealChannelCount, | 115 int idealChannelCount, |
116 const DSSI_Descriptor* descriptor); | 116 const DSSI_Descriptor* descriptor); |
117 | 117 |
118 void init(); | 118 void init(); |
119 void instantiate(sv_samplerate_t sampleRate); | 119 void instantiate(sv_samplerate_t sampleRate); |
120 void cleanup(); | 120 void cleanup(); |
121 void activate(); | 121 void activate(); |
130 void initialiseGroupMembership(); | 130 void initialiseGroupMembership(); |
131 void runGrouped(const RealTime &); | 131 void runGrouped(const RealTime &); |
132 | 132 |
133 // For use in DSSIPluginFactory (set in the DSSI_Host_Descriptor): | 133 // For use in DSSIPluginFactory (set in the DSSI_Host_Descriptor): |
134 static int requestMidiSend(LADSPA_Handle instance, | 134 static int requestMidiSend(LADSPA_Handle instance, |
135 unsigned char ports, | 135 unsigned char ports, |
136 unsigned char channels); | 136 unsigned char channels); |
137 static void midiSend(LADSPA_Handle instance, | 137 static void midiSend(LADSPA_Handle instance, |
138 snd_seq_event_t *events, | 138 snd_seq_event_t *events, |
139 unsigned long eventCount); | 139 unsigned long eventCount); |
140 static int requestNonRTThread(LADSPA_Handle instance, | 140 static int requestNonRTThread(LADSPA_Handle instance, |
141 void (*runFunction)(LADSPA_Handle)); | 141 void (*runFunction)(LADSPA_Handle)); |
142 | 142 |
143 int m_client; | 143 int m_client; |
144 int m_position; | 144 int m_position; |
145 LADSPA_Handle m_instanceHandle; | 145 LADSPA_Handle m_instanceHandle; |
146 const DSSI_Descriptor *m_descriptor; | 146 const DSSI_Descriptor *m_descriptor; |
154 | 154 |
155 std::vector<int> m_audioPortsIn; | 155 std::vector<int> m_audioPortsIn; |
156 std::vector<int> m_audioPortsOut; | 156 std::vector<int> m_audioPortsOut; |
157 | 157 |
158 struct ProgramControl { | 158 struct ProgramControl { |
159 int msb; | 159 int msb; |
160 int lsb; | 160 int lsb; |
161 int program; | 161 int program; |
162 }; | 162 }; |
163 ProgramControl m_pending; | 163 ProgramControl m_pending; |
164 | 164 |
165 struct ProgramDescriptor { | 165 struct ProgramDescriptor { |
166 int bank; | 166 int bank; |
167 int program; | 167 int program; |
168 std::string name; | 168 std::string name; |
169 }; | 169 }; |
170 mutable std::vector<ProgramDescriptor> m_cachedPrograms; | 170 mutable std::vector<ProgramDescriptor> m_cachedPrograms; |
171 mutable bool m_programCacheValid; | 171 mutable bool m_programCacheValid; |
172 | 172 |
173 RingBuffer<snd_seq_event_t> m_eventBuffer; | 173 RingBuffer<snd_seq_event_t> m_eventBuffer; |
201 static Scavenger<ScavengerArrayWrapper<snd_seq_event_t *> > m_bufferScavenger; | 201 static Scavenger<ScavengerArrayWrapper<snd_seq_event_t *> > m_bufferScavenger; |
202 | 202 |
203 class NonRTPluginThread : public Thread | 203 class NonRTPluginThread : public Thread |
204 { | 204 { |
205 public: | 205 public: |
206 NonRTPluginThread(LADSPA_Handle handle, | 206 NonRTPluginThread(LADSPA_Handle handle, |
207 void (*runFunction)(LADSPA_Handle)) : | 207 void (*runFunction)(LADSPA_Handle)) : |
208 m_handle(handle), | 208 m_handle(handle), |
209 m_runFunction(runFunction), | 209 m_runFunction(runFunction), |
210 m_exiting(false) { } | 210 m_exiting(false) { } |
211 | 211 |
212 virtual void run(); | 212 virtual void run(); |
213 void setExiting() { m_exiting = true; } | 213 void setExiting() { m_exiting = true; } |
214 | 214 |
215 protected: | 215 protected: |
216 LADSPA_Handle m_handle; | 216 LADSPA_Handle m_handle; |
217 void (*m_runFunction)(LADSPA_Handle); | 217 void (*m_runFunction)(LADSPA_Handle); |
218 bool m_exiting; | 218 bool m_exiting; |
219 }; | 219 }; |
220 static std::map<LADSPA_Handle, std::set<NonRTPluginThread *> > m_threads; | 220 static std::map<LADSPA_Handle, std::set<NonRTPluginThread *> > m_threads; |
221 }; | 221 }; |
222 | 222 |
223 #endif // _DSSIPLUGININSTANCE_H_ | 223 #endif // _DSSIPLUGININSTANCE_H_ |