diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d407380..6b552a2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,12 +50,12 @@ add_executable (luppp ${sources} ) # Linking -target_link_libraries( luppp ${JACK_LIBRARIES} ) -target_link_libraries( luppp ${LIBLO_LIBRARIES} ) -target_link_libraries( luppp ${NTK_LIBRARIES} ) -target_link_libraries( luppp ${CAIRO_LIBRARIES} ) -target_link_libraries( luppp ${SNDFILE_LIBRARIES} ) -target_link_libraries(luppp ${SAMPLERATE_LIBRARIES}) +target_link_libraries( luppp ${JACK_LIBRARIES} ) +target_link_libraries( luppp ${LIBLO_LIBRARIES} ) +target_link_libraries( luppp ${NTK_LIBRARIES} ) +target_link_libraries( luppp ${CAIRO_LIBRARIES} ) +target_link_libraries( luppp ${SNDFILE_LIBRARIES} ) +target_link_libraries( luppp ${SAMPLERATE_LIBRARIES} ) # Check build type, linking with gcov for code analysis if needed IF(BUILD_TESTS) diff --git a/src/diskreader.cxx b/src/diskreader.cxx index ed578c3..0036721 100644 --- a/src/diskreader.cxx +++ b/src/diskreader.cxx @@ -34,8 +34,6 @@ int DiskReader::loadPreferences() s << getenv("HOME") << "/.config/openAV/luppp/luppp.prfs"; std::ifstream sampleFile( s.str().c_str(), std::ios_base::in|std::ios_base::ate); - // CRITICAL FIXME: check file_length here, can be 0 causing new[0] causing segfault - long file_length = sampleFile.tellg(); if ( file_length > 0 ) { diff --git a/src/diskwriter.cxx b/src/diskwriter.cxx index ef97f2d..28afbd8 100644 --- a/src/diskwriter.cxx +++ b/src/diskwriter.cxx @@ -103,7 +103,6 @@ int DiskWriter::writeControllerFile(std::string name , cJSON_AddItemToArray( inputBindings, binding ); // add metadata to binding - // FIXME: get action string from Event class: need to move function from GenericMIDI to there const char* actionName = Event::getPrettyName( b.at(i)->action ); if ( actionName ) { @@ -116,6 +115,8 @@ int DiskWriter::writeControllerFile(std::string name , cJSON_AddNumberToObject( binding, "scene" , b.at(i)->scene ); cJSON_AddNumberToObject( binding, "send" , b.at(i)->send ); cJSON_AddNumberToObject( binding, "active", b.at(i)->active ); + + LUPPP_NOTE("Creating Binding: action %i == %s!", b.at(i)->action, actionName ); } else { diff --git a/src/goptions.cxx b/src/goptions.cxx index 498b4cb..5e74f85 100644 --- a/src/goptions.cxx +++ b/src/goptions.cxx @@ -45,7 +45,6 @@ static void addNewController(Fl_Widget* w, void*) } - if ( c->status() == Controller::CONTROLLER_OK ) { EventControllerInstance e(c); diff --git a/src/gui.cxx b/src/gui.cxx index 946e018..1bb9a6e 100644 --- a/src/gui.cxx +++ b/src/gui.cxx @@ -65,6 +65,9 @@ void close_cb(Fl_Widget*o, void*) static void gui_static_read_rb(void* inst) { handleGuiEvents(); + + nsm_check_nowait( gui->getNsm() ); + Fl::repeat_timeout( 1 / 30.f, &gui_static_read_rb, inst); } @@ -228,12 +231,12 @@ static int cb_nsm_open (const char *name, { //printf("nsm open()\n", out_msg[0] ); - LUPPP_NOTE("%s %s","Loading session ", out_msg[0] ); + LUPPP_NOTE("NSM open() loading session"); //gui->getDiskReader()->readSession( fnfc.filename() ); //OSC_REPLY( "OK" ); //OSC_REPLY_P( "/nsm/client/open", "OK" ); - nsm_client_t* nsm = gui->getNsm(); + //nsm_client_t* nsm = gui->getNsm(); //lo_send_from( nsm_addr, losrv, LO_TT_IMMEDIATE, "/reply", "ss", path, "OK" ); @@ -257,7 +260,7 @@ static int cb_nsm_save ( char **out_msg, void *userdata ) -Gui::Gui() : +Gui::Gui(std::string argZero) : samplerate( 0 ), window(1110,650), @@ -356,13 +359,13 @@ Gui::Gui() : { nsm = nsm_new(); - nsm_set_open_callback( nsm, cb_nsm_open, 0 ); - nsm_set_save_callback( nsm, cb_nsm_save, 0 ); + nsm_set_open_callback( nsm, cb_nsm_open, this ); + nsm_set_save_callback( nsm, cb_nsm_save, this ); if ( nsm_init( nsm, nsm_url ) == 0 ) { - nsm_send_announce( nsm, "Luppp", "", "luppp" ); - LUPPP_WARN("Announcing to NSM"); + nsm_send_announce( nsm, "Luppp", "", argZero.c_str() ); + LUPPP_NOTE("Announcing to NSM"); } else { @@ -372,7 +375,7 @@ Gui::Gui() : } else { - LUPPP_WARN("No NSM_URL env variable"); + LUPPP_NOTE("No session management in use"); } } diff --git a/src/gui.hxx b/src/gui.hxx index 87b8fab..18a5f10 100644 --- a/src/gui.hxx +++ b/src/gui.hxx @@ -30,7 +30,7 @@ class AudioBuffer; class Gui { public: - Gui(); + Gui(std::string argZero); ~Gui(); int show(); diff --git a/src/main.cxx b/src/main.cxx index b22a416..f1ca736 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -66,7 +66,7 @@ int main(int argc, char** argv) // setup the testing Gui / JACK: Jack first, then GUI jack = new Jack(); - gui = new Gui(); + gui = new Gui(argv[0]); // test offline functionality testResult += gui->getDiskReader()->runTests(); @@ -90,7 +90,7 @@ int main(int argc, char** argv) // setup the "real" JACK / Gui: Jack first, then GUI jack = new Jack(); - gui = new Gui(); + gui = new Gui(argv[0]); jack->activate(); diff --git a/src/nsm.h b/src/nsm.h index 28b9d0f..fc5e8ff 100644 --- a/src/nsm.h +++ b/src/nsm.h @@ -353,6 +353,8 @@ nsm_set_broadcast_callback( nsm_client_t *nsm, nsm_broadcast_callback *broadcast NSM_EXPORT int _nsm_osc_open ( const char *path, const char *types, lo_arg **argv, int argc, lo_message msg, void *user_data ) { + printf("NSM OSC OPEN\n"); + (void) types; (void) argc; (void) msg;