commit 068193e5d84b68173ad05b3d993cd403f04f4a2c
parent 6a1a5aed986cdf1f7d6883cb3863ebd902612216
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date: Tue, 8 Jun 2021 00:48:38 +0200
Add helper
Diffstat:
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/examples/glue/clap-plugin.cc b/examples/glue/clap-plugin.cc
@@ -727,6 +727,19 @@ namespace clap {
hostThreadCheck_->is_main_thread;
}
+ bool Plugin::canUseEventLoop() const noexcept {
+ if(!hostEventLoop_)
+ return false;
+
+ auto& x = *hostEventLoop_;
+ if(x.modify_fd && x.register_fd && x.unregister_fd && x.register_timer
+ && x.unregister_timer)
+ return true;
+
+ hostMisbehaving("clap_event_loop is partially implemented");
+ return false;
+ }
+
/////////////////////
// Thread Checking //
/////////////////////
diff --git a/examples/glue/clap-plugin.hh b/examples/glue/clap-plugin.hh
@@ -203,6 +203,7 @@ namespace clap {
bool canUseTrackInfo() const noexcept;
bool canUseState() const noexcept;
bool canChangeAudioPorts() const noexcept;
+ bool canUseEventLoop() const noexcept;
/////////////////////
// Thread Checking //
diff --git a/include/clap/ext/draft/quick-controls.h b/include/clap/ext/draft/quick-controls.h
@@ -22,7 +22,9 @@ typedef struct clap_plugin_quick_controls {
uint32_t (*page_count)(const clap_plugin *plugin);
// [main-thread]
- bool (*page_info)(const clap_plugin *plugin, uint32_t page_index, clap_quick_controls_page *page);
+ bool (*page_info)(const clap_plugin * plugin,
+ uint32_t page_index,
+ clap_quick_controls_page *page);
// [main-thread]
void (*select_page)(const clap_plugin *plugin, clap_id page_id);