diff options
author | cbdev <cb@cbcdn.com> | 2021-07-02 02:08:26 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2021-07-02 02:08:26 +0200 |
commit | 1654245bf80013a96434cb4c60e6583ab7522f1b (patch) | |
tree | 665ade2185e5eab4f8415462db14ba5eb84777b6 /core/backend.c | |
parent | 6a3f12be67f70f07d3ae93edfd7b14c02c61f68f (diff) | |
download | midimonster-1654245bf80013a96434cb4c60e6583ab7522f1b.tar.gz midimonster-1654245bf80013a96434cb4c60e6583ab7522f1b.tar.bz2 midimonster-1654245bf80013a96434cb4c60e6583ab7522f1b.zip |
Add frontend interval API
Diffstat (limited to 'core/backend.c')
-rw-r--r-- | core/backend.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/backend.c b/core/backend.c index b7c2d9e..93ac8fa 100644 --- a/core/backend.c +++ b/core/backend.c @@ -9,6 +9,8 @@ #include "midimonster.h" #include "backend.h" +static uint32_t default_interval = 1000; + static struct { size_t n; backend* backends; @@ -272,9 +274,15 @@ instance* instance_match(char* name){ return NULL; } +void mm_default_interval(uint32_t interval, uint8_t force){ + if(interval < default_interval || force){ + default_interval = interval; + } +} + struct timeval backend_timeout(){ size_t u; - uint32_t res, secs = 1, msecs = 0; + uint32_t res, secs = default_interval / 1000, msecs = default_interval % 1000; for(u = 0; u < registry.n; u++){ //only call interval if backend has instances |