aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/ola.cpp
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-12-11 23:24:23 +0100
committercbdev <cb@cbcdn.com>2019-12-11 23:24:23 +0100
commit9624d46436576b415c639ea7390012cdd95c88f7 (patch)
treefb3aadbaf01fcee5da8ecdb8355ff191341b666d /backends/ola.cpp
parent48e12201f5c57cda581bc0c713d99da6524c49a8 (diff)
parentf6d6eefe9bb9934f4fa3e665734d746f02471cdb (diff)
downloadmidimonster-9624d46436576b415c639ea7390012cdd95c88f7.tar.gz
midimonster-9624d46436576b415c639ea7390012cdd95c88f7.tar.bz2
midimonster-9624d46436576b415c639ea7390012cdd95c88f7.zip
Merge branch 'master' into rtpmidi
Diffstat (limited to 'backends/ola.cpp')
-rw-r--r--backends/ola.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/backends/ola.cpp b/backends/ola.cpp
index c13e8f9..fd121a0 100644
--- a/backends/ola.cpp
+++ b/backends/ola.cpp
@@ -220,9 +220,8 @@ static void ola_register_callback(const std::string &error) {
}
}
-static int ola_start(){
- size_t n, u, p;
- instance** inst = NULL;
+static int ola_start(size_t n, instance** inst){
+ size_t u, p;
ola_instance_data* data = NULL;
ola_select = new ola::io::SelectServer();
@@ -249,18 +248,6 @@ static int ola_start(){
ola_client->SetDmxCallback(ola::NewCallback(&ola_data_receive));
- //fetch all defined instances
- if(mm_backend_instances(BACKEND_NAME, &n, &inst)){
- fprintf(stderr, "Failed to fetch instance list\n");
- goto bail;
- }
-
- //this should not happen anymore (backends without instances are not started anymore)
- if(!n){
- free(inst);
- return 0;
- }
-
for(u = 0; u < n; u++){
data = (ola_instance_data*) inst[u]->impl;
inst[u]->ident = data->universe_id;
@@ -277,10 +264,8 @@ static int ola_start(){
//run the ola select implementation to run all commands
ola_select->RunOnce();
- free(inst);
return 0;
bail:
- free(inst);
delete ola_client;
ola_client = NULL;
delete ola_select;
@@ -288,18 +273,12 @@ bail:
return 1;
}
-static int ola_shutdown(){
- size_t n, p;
- instance** inst = NULL;
- if(mm_backend_instances(BACKEND_NAME, &n, &inst)){
- fprintf(stderr, "Failed to fetch instance list\n");
- return 1;
- }
+static int ola_shutdown(size_t n, instance** inst){
+ size_t p;
for(p = 0; p < n; p++){
free(inst[p]->impl);
}
- free(inst);
if(ola_client){
ola_client->Stop();