clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit d074053509f63ef8ea3ae83b289277dc209231c5
parent 068193e5d84b68173ad05b3d993cd403f04f4a2c
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Tue,  8 Jun 2021 01:16:30 +0200

More work

Diffstat:
Mexamples/glue/clap-plugin.cc | 38++++++++++++++++++++++++++++++--------
Mexamples/glue/clap-plugin.hh | 3++-
2 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/examples/glue/clap-plugin.cc b/examples/glue/clap-plugin.cc @@ -728,16 +728,38 @@ namespace clap { } bool Plugin::canUseEventLoop() const noexcept { - if(!hostEventLoop_) - return false; + 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; - 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; + } + + bool Plugin::canUseParams() const noexcept { + if (!hostParams_) + return false; + + if (hostParams_->adjust && hostParams_->adjust_begin && hostParams_->adjust_end && + hostParams_->rescan) + return true; - hostMisbehaving("clap_event_loop is partially implemented"); - return false; + hostMisbehaving("clap_host_params is partially implemented"); + return false; + } + + bool Plugin::canUseLatency() const noexcept { + if (!hostLatency_) + return false; + + if (hostLatency_->changed) + return true; + + hostMisbehaving("clap_host_latency is partially implemented"); + return false; } ///////////////////// diff --git a/examples/glue/clap-plugin.hh b/examples/glue/clap-plugin.hh @@ -202,8 +202,9 @@ namespace clap { bool canUseThreadCheck() const noexcept; bool canUseTrackInfo() const noexcept; bool canUseState() const noexcept; - bool canChangeAudioPorts() const noexcept; bool canUseEventLoop() const noexcept; + bool canUseParams() const noexcept; + bool canUseLatency() const noexcept; ///////////////////// // Thread Checking //