diff --git a/README.md b/README.md index c7a87d0..c9f5419 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ Luppp - OpenAV Productions =============================== -Link to official page: http://openavproductions.com/Luppp +Official page: http://openavproductions.com/Luppp This is the repository of Luppp, the live looping tool. - ![screenshot](https://raw.github.com/harryhaaren/openAV-Luppp/master/resources/screenshots/1.0.png "Luppp 1.0 Screenshot") Intro diff --git a/buildTest/compile.sh b/buildTest/compile.sh index 4a8fad8..7fa0784 100755 --- a/buildTest/compile.sh +++ b/buildTest/compile.sh @@ -13,9 +13,11 @@ set -e # setup environment: Copy material for tests to /tmp cp -r ../src/tests/lupppTestMaterial /tmp -cmake -DBUILD_TESTS=1 ../ +rm CMakeCache.txt -make -j 2 +scan-build cmake -DBUILD_TESTS=1 ../ + +scan-build make -j 2 lcov --zerocounters --directory . diff --git a/src/controllerupdater.cxx b/src/controllerupdater.cxx index d63b333..d759185 100644 --- a/src/controllerupdater.cxx +++ b/src/controllerupdater.cxx @@ -29,14 +29,16 @@ ControllerUpdater::ControllerUpdater() void ControllerUpdater::registerController( Controller* controller ) { if (!controller) + { LUPPP_ERROR("Register Controller passed NULL controller!"); + return; + } //LUPPP_NOTE("Registering controller %s", controller->getName().c_str() ); // store the controller instance c.push_back( controller ); - // and tell it to register itself (MidiObserver / AudioObserver etc) controller->registerComponents(); } diff --git a/src/diskreader.cxx b/src/diskreader.cxx index 2df38d0..eb4c6b8 100644 --- a/src/diskreader.cxx +++ b/src/diskreader.cxx @@ -205,8 +205,10 @@ int DiskReader::loadSample( int track, int scene, string path ) // resample quality taken from config file, int ret = src_simple ( &data, q, 1 ); - - LUPPP_NOTE("%s%i%s%i", "Resampling finished, from ", data.input_frames_used, " to ", data.output_frames_gen ); + if ( ret == 0 ) + LUPPP_NOTE("%s%i%s%i", "Resampling finished, from ", data.input_frames_used, " to ", data.output_frames_gen ); + else + LUPPP_ERROR("%s%i%s%i", "Resampling finished, from ", data.input_frames_used, " to ", data.output_frames_gen ); /// exchange buffers, so buf contains the resampled audio buf.swap( resampled ); @@ -294,7 +296,7 @@ int DiskReader::loadSample( int track, int scene, string path ) } cJSON_Delete( audioJson ); - free ( sampleString ); + delete[] sampleString; free ( tmp ); } else @@ -392,9 +394,11 @@ int DiskReader::readSession( std::string path ) int mr = readMaster(); + if( tr == mr ){}; + // cleanup cJSON_Delete( sessionJson ); - free ( sessionString ); + delete[] sessionString; return LUPPP_RETURN_OK; } diff --git a/src/eventhandler.hxx b/src/eventhandler.hxx index ab0a802..e35d9aa 100644 --- a/src/eventhandler.hxx +++ b/src/eventhandler.hxx @@ -22,8 +22,8 @@ #include "event.hxx" #include -extern char* processDspMem; -extern char* processGuiMem; +extern EventBase* processDspMem; +extern EventBase* processGuiMem; extern jack_ringbuffer_t* rbToDsp; extern jack_ringbuffer_t* rbToGui; diff --git a/src/gmastertrack.cxx b/src/gmastertrack.cxx index a310332..14f2f78 100644 --- a/src/gmastertrack.cxx +++ b/src/gmastertrack.cxx @@ -294,8 +294,6 @@ void GMasterTrack::setBarBeat(int b, int beat) bar = bar % 4 + 1; } - int num = (beat % 4) + 1; - // turn all off for( int i = 0; i < 4; i++) beatLights[i]->value( 0 ); diff --git a/src/main.cxx b/src/main.cxx index 86132fb..eb33f29 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -32,8 +32,8 @@ int signalHanlderInt = 0; -char* processDspMem = 0; -char* processGuiMem = 0; +EventBase* processDspMem = 0; +EventBase* processGuiMem = 0; jack_ringbuffer_t* rbToDsp = 0; jack_ringbuffer_t* rbToGui = 0; @@ -62,7 +62,7 @@ int main(int argc, char** argv) { LUPPP_NOTE("Git: %s", GIT_VERSION ); - bool runTests; + bool runTests = false; if ( runTests ){} // remove unused warning if not built with BUILD_TESTS for(int i = 0; i < argc; i++) @@ -83,8 +83,8 @@ int main(int argc, char** argv) signal(SIGTERM, signalHanlder); // allocate data to read from - processDspMem = (char*)malloc( sizeof(EventBase) ); - processGuiMem = (char*)malloc( sizeof(EventBase) ); + processDspMem = (EventBase*)malloc( sizeof(EventBase) ); + processGuiMem = (EventBase*)malloc( sizeof(EventBase) ); rbToDsp = jack_ringbuffer_create( 5000 * sizeof(EventBase)); rbToGui = jack_ringbuffer_create( 5000 * sizeof(EventBase)); @@ -98,8 +98,8 @@ int main(int argc, char** argv) int testResult = 0; // setup the testing Gui / JACK: Jack first, then GUI - Jack::setup("LupppTEST"); gui = new Gui( argv[0] ); + Jack::setup("LupppTEST"); // test offline functionality testResult += gui->getDiskReader()->runTests();