File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 9
9
#include "midimonster.h"
10
10
#include "backend.h"
11
11
12
+ static uint32_t default_interval = 1000 ;
13
+
12
14
static struct {
13
15
size_t n ;
14
16
backend * backends ;
@@ -272,9 +274,15 @@ instance* instance_match(char* name){
272
274
return NULL ;
273
275
}
274
276
277
+ void mm_default_interval (uint32_t interval , uint8_t force ){
278
+ if (interval < default_interval || force ){
279
+ default_interval = interval ;
280
+ }
281
+ }
282
+
275
283
struct timeval backend_timeout (){
276
284
size_t u ;
277
- uint32_t res , secs = 1 , msecs = 0 ;
285
+ uint32_t res , secs = default_interval / 1000 , msecs = default_interval % 1000 ;
278
286
279
287
for (u = 0 ; u < registry .n ; u ++ ){
280
288
//only call interval if backend has instances
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ int backends_start();
10
10
int backends_stop ();
11
11
instance * mm_instance (backend * b );
12
12
13
+ /* Frontend API */
14
+ void mm_default_interval (uint32_t interval , uint8_t force );
15
+
13
16
/* Public backend API */
14
17
MM_API channel * mm_channel (instance * inst , uint64_t ident , uint8_t create );
15
18
MM_API void mm_channel_update (channel * chan , uint64_t ident );
Original file line number Diff line number Diff line change 20
20
#include "config.h"
21
21
22
22
static struct {
23
- //static size_t fds = 0;
24
23
size_t n ;
25
24
int max ;
26
25
managed_fd * fd ;
You can’t perform that action at this time.
0 commit comments