aboutsummaryrefslogtreecommitdiffhomepage
path: root/midimonster.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2017-06-08 02:33:18 +0200
committercbdev <cb@cbcdn.com>2017-06-08 02:33:18 +0200
commitaed37425605d73ac22ec1f8c3145486d0ec79bb3 (patch)
treee99c68f889e3cd5fd23d00b3e6a81b50b36360b5 /midimonster.c
parent804b5c3b3abbac7b95d79bf84fabbb78d94e2c39 (diff)
downloadmidimonster-aed37425605d73ac22ec1f8c3145486d0ec79bb3.tar.gz
midimonster-aed37425605d73ac22ec1f8c3145486d0ec79bb3.tar.bz2
midimonster-aed37425605d73ac22ec1f8c3145486d0ec79bb3.zip
Move to dynamically loading backends
Diffstat (limited to 'midimonster.c')
-rw-r--r--midimonster.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/midimonster.c b/midimonster.c
index b1c14e2..03b2699 100644
--- a/midimonster.c
+++ b/midimonster.c
@@ -6,11 +6,7 @@
#include "midimonster.h"
#include "config.h"
#include "backend.h"
-
-//temporary prototypes
-int artnet_init();
-int midi_init();
-int osc_init();
+#include "plugin.h"
static size_t mappings = 0;
static channel_mapping* map = NULL;
@@ -196,7 +192,7 @@ int main(int argc, char** argv){
fd_set all_fds, read_fds;
struct timeval tv;
size_t u, n;
- managed_fd* signaled_fds;
+ managed_fd* signaled_fds = NULL;
int rv = EXIT_FAILURE, error, maxfd = -1;
char* cfg_file = DEFAULT_CFG;
if(argc > 1){
@@ -204,8 +200,7 @@ int main(int argc, char** argv){
}
//initialize backends
- //TODO replace this with loading shared objects
- if(artnet_init() || midi_init() /* || osc_init()*/){
+ if(plugins_load(PLUGINS)){
fprintf(stderr, "Failed to initialize a backend\n");
goto bail;
}
@@ -218,6 +213,7 @@ int main(int argc, char** argv){
instances_free();
map_free();
fds_free();
+ plugins_close();
return usage(argv[0]);
}
@@ -291,6 +287,7 @@ bail:
map_free();
fds_free();
event_free();
+ plugins_close();
return rv;
}