clap

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

timer-support.h (851B)


      1 #pragma once
      2 
      3 #include "../plugin.h"
      4 
      5 static CLAP_CONSTEXPR const char CLAP_EXT_TIMER_SUPPORT[] = "clap.timer-support";
      6 
      7 #ifdef __cplusplus
      8 extern "C" {
      9 #endif
     10 
     11 typedef struct clap_plugin_timer_support {
     12    // [main-thread]
     13    void(CLAP_ABI *on_timer)(const clap_plugin_t *plugin, clap_id timer_id);
     14 } clap_plugin_timer_support_t;
     15 
     16 typedef struct clap_host_timer_support {
     17    // Registers a periodic timer.
     18    // The host may adjust the period if it is under a certain threshold.
     19    // 30 Hz should be allowed.
     20    // Returns true on success.
     21    // [main-thread]
     22    bool(CLAP_ABI *register_timer)(const clap_host_t *host, uint32_t period_ms, clap_id *timer_id);
     23 
     24    // Returns true on success.
     25    // [main-thread]
     26    bool(CLAP_ABI *unregister_timer)(const clap_host_t *host, clap_id timer_id);
     27 } clap_host_timer_support_t;
     28 
     29 #ifdef __cplusplus
     30 }
     31 #endif