-Updated GenericMIDI handling

This commit is contained in:
Harry van Haaren 2013-11-21 14:43:22 +00:00
parent 17950d7d00
commit b83fae5575
6 changed files with 41 additions and 18 deletions

View file

@ -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();

View file

@ -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<Binding*> 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() );

View file

@ -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; }

View file

@ -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();
}

View file

@ -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;

View file

@ -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