zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit cba10d31bffe4a9155131ada856d2a7b632a63a5
parent 3bfcdbbf2b805b420974cfb3f20028255286762d
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Fri, 16 Oct 2015 11:53:22 -0400

main.cpp: Fix Desync Caused By -l/-L arguments

Middleware assumes that it knows what kits are initialized and
what the pointers are for various non-realtime objects.
By loading something to an existing master instance without informing
middleware a desync can be caused.
This commit fixes one such desync caused in the standalone's main()

Diffstat:
Msrc/main.cpp | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp @@ -392,7 +392,9 @@ int main(int argc, char *argv[]) initprogram(std::move(synth), &config, prefered_port); + bool altered_master = false; if(!loadfile.empty()) { + altered_master = true; const char *filename = loadfile.c_str(); int tmp = master->loadXML(filename); if(tmp < 0) { @@ -409,6 +411,7 @@ int main(int argc, char *argv[]) } if(!loadinstrument.empty()) { + altered_master = true; int loadtopart = 0; int tmp = master->part[loadtopart]->loadXMLinstrument( loadinstrument.c_str()); @@ -424,6 +427,9 @@ int main(int argc, char *argv[]) } } + if(altered_master) + middleware->updateResources(master); + //Run the Nio system bool ioGood = Nio::start();