diff --git a/src/controller/genericmidi.cxx b/src/controller/genericmidi.cxx index dfe230c..1d6b7e2 100644 --- a/src/controller/genericmidi.cxx +++ b/src/controller/genericmidi.cxx @@ -21,6 +21,7 @@ GenericMIDI::GenericMIDI(int waste, std::string n) : Controller(), MidiIO() { + LUPPP_NOTE("Adding GenericMIDI %s", n.c_str() ); name = n; registerMidiPorts( name ); stat = CONTROLLER_OK; @@ -43,6 +44,7 @@ GenericMIDI::GenericMIDI(std::string file) : if ( result == LUPPP_RETURN_OK ) { + LUPPP_NOTE("GenericMIDI registering ports: %s", name.c_str() ); registerMidiPorts( name ); stat = CONTROLLER_OK; } @@ -429,7 +431,7 @@ void GenericMIDI::midi(unsigned char* midi) if ( b->status == status && b->data == data ) { - LUPPP_NOTE("Executing action %s, value %f, b->active %i", Event::getPrettyName(b->action), value, int(b->active) ); + LUPPP_NOTE("Executing action %s, send %i value %f, b->active %i", Event::getPrettyName(b->action), b->send, value, int(b->active) ); switch( b->action ) { @@ -722,7 +724,7 @@ void GenericMIDI::removeBinding( int bindingID ) void GenericMIDI::setupBinding( LupppAction eventType, int midiStatus, int midiData, int track, int scene, int send, int active ) { - LUPPP_NOTE("MIDI binding, track %d, from eventType %d to %d, %d", track, eventType, midiStatus, midiData ); + LUPPP_NOTE("MIDI binding, track %d, send %d from eventType %d to %d, %d", track, send, eventType, midiStatus, midiData ); // FIXME: NON-RT Have stack of Bindings() available, or push in GUI thread? Binding* tmp = new Binding(); diff --git a/src/diskwriter.cxx b/src/diskwriter.cxx index 262240b..b3459e8 100644 --- a/src/diskwriter.cxx +++ b/src/diskwriter.cxx @@ -147,9 +147,9 @@ int DiskWriter::writeControllerFile(std::string name , cJSON* controllerJson = cJSON_CreateObject(); - cJSON_AddItemToObject ( controllerJson, "name", cJSON_CreateString( name.c_str() )); - cJSON_AddItemToObject ( controllerJson, "author", cJSON_CreateString( author.c_str() )); - cJSON_AddItemToObject ( controllerJson, "email", cJSON_CreateString( email.c_str() )); + cJSON_AddItemToObject( controllerJson, "name", cJSON_CreateString( name.c_str() )); + cJSON_AddItemToObject( controllerJson, "author", cJSON_CreateString( author.c_str() )); + cJSON_AddItemToObject( controllerJson, "email", cJSON_CreateString( email.c_str() )); // input bindings std::vector b = g->getMidiToAction(); @@ -257,7 +257,7 @@ int DiskWriter::writeControllerFile(std::string name , } - LUPPP_NOTE("Writing .ctlr file to disk"); + LUPPP_NOTE("Writing %s.ctlr file to disk", g->getName().c_str() ); ofstream controllerCfgFile; controllerCfgFile.open ( controllerCfgPath.str().c_str() ); diff --git a/src/eventhandlerdsp.cxx b/src/eventhandlerdsp.cxx index 866971d..51acbfe 100644 --- a/src/eventhandlerdsp.cxx +++ b/src/eventhandlerdsp.cxx @@ -243,6 +243,7 @@ void handleDspEvents() jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackSendActive) ); jack->getLogic()->trackSendActive( ev.track, ev.send, ev.active ); jack->bindingTrack = ev.track; + jack->bindingSend = ev.send; jack->bindingActive = ev.active; } break; } diff --git a/src/goptions.cxx b/src/goptions.cxx index 2263801..056112b 100644 --- a/src/goptions.cxx +++ b/src/goptions.cxx @@ -149,7 +149,7 @@ static void writeControllerFile(Fl_Widget* w, void* data) // a pointer to the controllerID int is passed as data ControllerUI* c = (ControllerUI*)data; - LUPPP_NOTE("Writing controller %li, %s ID %i .ctlr to disk", c, c->name, c->controllerID ); + LUPPP_NOTE("Writing controller %li, %s ID %i .ctlr to disk", c, c->name.c_str(), c->controllerID ); // FIXME: Controller ID hardcoded EventControllerInstanceGetToWrite e( 2 ); @@ -178,10 +178,9 @@ static void deleteBindingFromController(Fl_Widget* w, void* ud) ControllerUI::ControllerUI(int x, int y, int w, int h, std::string n, int ID) { - name = strdup(n.c_str()); - target = 0; + name = n; - widget = new Fl_Group( x, y, w, h, name); + widget = new Fl_Group( x, y, w, h, name.c_str()); { // author / link authorLabel = new Fl_Box( x, y + 0, 200, 30, "Author: -" ); @@ -230,11 +229,8 @@ void OptionsWindow::setTarget(const char* n) void ControllerUI::setTarget( const char* n ) { - if ( target ) - free (target); - target = strdup(n); - - targetLabel->label( target ); + target = n; + targetLabel->label( target.c_str() ); targetLabel->redraw(); } diff --git a/src/goptions.hxx b/src/goptions.hxx index bbadf27..2b9f1ee 100644 --- a/src/goptions.hxx +++ b/src/goptions.hxx @@ -43,7 +43,7 @@ class ControllerUI // for adding to GOptions tabs Fl_Group* widget; - char* name; + std::string name; OptionsWindow* optionsWindow; @@ -53,10 +53,10 @@ class ControllerUI private: // bindings - char* target; - + std::string target; std::string author; std::string email; + Fl_Box* authorLabel; Fl_Box* emailLabel; diff --git a/src/tests/goptionstest.cxx b/src/tests/goptionstest.cxx new file mode 100644 index 0000000..65e8903 --- /dev/null +++ b/src/tests/goptionstest.cxx @@ -0,0 +1,24 @@ + + +#include "../goptions.hxx" + +#ifdef BUILD_TESTS + +#include "../config.hxx" +#include "qunit.hxx" + +int GOptions::runTests() +{ + QUnit::UnitTest qunit( QUnit::normal, true ); + + OptionsWindow opts; + opts->show(); + + Fl::run(); + + //QUNIT_IS_TRUE( jack->getGridLogic()->getLaunchedScene() == s ); + +} + +#endif // BUILD_TESTS +