* CLAP UI class. */
| 197 | * CLAP UI class. |
| 198 | */ |
| 199 | class ClapUI : public DGL_NAMESPACE::IdleCallback |
| 200 | { |
| 201 | public: |
| 202 | ClapUI(PluginExporter& plugin, |
| 203 | ClapEventQueue* const eventQueue, |
| 204 | const clap_host_t* const host, |
| 205 | const clap_host_gui_t* const hostGui, |
| 206 | #if DPF_CLAP_USING_HOST_TIMER |
| 207 | const clap_host_timer_support_t* const hostTimer, |
| 208 | #endif |
| 209 | const bool isFloating) |
| 210 | : fPlugin(plugin), |
| 211 | #if DISTRHO_PLUGIN_WANT_STATE |
| 212 | fPluginEventQueue(eventQueue), |
| 213 | #endif |
| 214 | fEventQueue(eventQueue->fEventQueue), |
| 215 | fCachedParameters(eventQueue->fCachedParameters), |
| 216 | #if DISTRHO_PLUGIN_WANT_PROGRAMS |
| 217 | fCurrentProgram(eventQueue->fCurrentProgram), |
| 218 | #endif |
| 219 | #if DISTRHO_PLUGIN_WANT_STATE |
| 220 | fStateMap(eventQueue->fStateMap), |
| 221 | #endif |
| 222 | fHost(host), |
| 223 | fHostGui(hostGui), |
| 224 | #if DPF_CLAP_USING_HOST_TIMER |
| 225 | fTimerId(0), |
| 226 | fHostTimer(hostTimer), |
| 227 | #else |
| 228 | fCallbackRegistered(false), |
| 229 | #endif |
| 230 | fIsFloating(isFloating), |
| 231 | fScaleFactor(0.0), |
| 232 | fParentWindow(0), |
| 233 | fTransientWindow(0) |
| 234 | { |
| 235 | #if DISTRHO_PLUGIN_WANT_MIDI_INPUT |
| 236 | fNotesRingBuffer.setRingBuffer(&eventQueue->fNotesBuffer, false); |
| 237 | #endif |
| 238 | } |
| 239 | |
| 240 | ~ClapUI() override |
| 241 | { |
| 242 | #if DPF_CLAP_USING_HOST_TIMER |
| 243 | if (fTimerId != 0) |
| 244 | fHostTimer->unregister_timer(fHost, fTimerId); |
| 245 | #else |
| 246 | if (fCallbackRegistered && fUI != nullptr) |
| 247 | fUI->removeIdleCallbackForNativeIdle(this); |
| 248 | #endif |
| 249 | } |
| 250 | |
| 251 | #ifndef DISTRHO_OS_MAC |
| 252 | bool setScaleFactor(const double scaleFactor) |
| 253 | { |
| 254 | if (d_isEqual(fScaleFactor, scaleFactor)) |
| 255 | return true; |
| 256 |
nothing calls this directly
no outgoing calls
no test coverage detected