DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

timer-support.h (789B)


      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    // [main-thread]
     21    bool(CLAP_ABI *register_timer)(const clap_host_t *host, uint32_t period_ms, clap_id *timer_id);
     22 
     23    // [main-thread]
     24    bool(CLAP_ABI *unregister_timer)(const clap_host_t *host, clap_id timer_id);
     25 } clap_host_timer_support_t;
     26 
     27 #ifdef __cplusplus
     28 }
     29 #endif