-Updated GenericMIDI handling
parent
17950d7d00
commit
b83fae5575
|
@ -21,6 +21,7 @@ GenericMIDI::GenericMIDI(int waste, std::string n) :
|
||||||
Controller(),
|
Controller(),
|
||||||
MidiIO()
|
MidiIO()
|
||||||
{
|
{
|
||||||
|
LUPPP_NOTE("Adding GenericMIDI %s", n.c_str() );
|
||||||
name = n;
|
name = n;
|
||||||
registerMidiPorts( name );
|
registerMidiPorts( name );
|
||||||
stat = CONTROLLER_OK;
|
stat = CONTROLLER_OK;
|
||||||
|
@ -43,6 +44,7 @@ GenericMIDI::GenericMIDI(std::string file) :
|
||||||
|
|
||||||
if ( result == LUPPP_RETURN_OK )
|
if ( result == LUPPP_RETURN_OK )
|
||||||
{
|
{
|
||||||
|
LUPPP_NOTE("GenericMIDI registering ports: %s", name.c_str() );
|
||||||
registerMidiPorts( name );
|
registerMidiPorts( name );
|
||||||
stat = CONTROLLER_OK;
|
stat = CONTROLLER_OK;
|
||||||
}
|
}
|
||||||
|
@ -429,7 +431,7 @@ void GenericMIDI::midi(unsigned char* midi)
|
||||||
|
|
||||||
if ( b->status == status && b->data == data )
|
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 )
|
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 )
|
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?
|
// FIXME: NON-RT Have stack of Bindings() available, or push in GUI thread?
|
||||||
Binding* tmp = new Binding();
|
Binding* tmp = new Binding();
|
||||||
|
|
|
@ -147,9 +147,9 @@ int DiskWriter::writeControllerFile(std::string name ,
|
||||||
|
|
||||||
cJSON* controllerJson = cJSON_CreateObject();
|
cJSON* controllerJson = cJSON_CreateObject();
|
||||||
|
|
||||||
cJSON_AddItemToObject ( controllerJson, "name", cJSON_CreateString( name.c_str() ));
|
cJSON_AddItemToObject( controllerJson, "name", cJSON_CreateString( name.c_str() ));
|
||||||
cJSON_AddItemToObject ( controllerJson, "author", cJSON_CreateString( author.c_str() ));
|
cJSON_AddItemToObject( controllerJson, "author", cJSON_CreateString( author.c_str() ));
|
||||||
cJSON_AddItemToObject ( controllerJson, "email", cJSON_CreateString( email.c_str() ));
|
cJSON_AddItemToObject( controllerJson, "email", cJSON_CreateString( email.c_str() ));
|
||||||
|
|
||||||
// input bindings
|
// input bindings
|
||||||
std::vector<Binding*> b = g->getMidiToAction();
|
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;
|
ofstream controllerCfgFile;
|
||||||
controllerCfgFile.open ( controllerCfgPath.str().c_str() );
|
controllerCfgFile.open ( controllerCfgPath.str().c_str() );
|
||||||
|
|
|
@ -243,6 +243,7 @@ void handleDspEvents()
|
||||||
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackSendActive) );
|
jack_ringbuffer_read( rbToDsp, (char*)&ev, sizeof(EventTrackSendActive) );
|
||||||
jack->getLogic()->trackSendActive( ev.track, ev.send, ev.active );
|
jack->getLogic()->trackSendActive( ev.track, ev.send, ev.active );
|
||||||
jack->bindingTrack = ev.track;
|
jack->bindingTrack = ev.track;
|
||||||
|
jack->bindingSend = ev.send;
|
||||||
jack->bindingActive = ev.active;
|
jack->bindingActive = ev.active;
|
||||||
} break; }
|
} break; }
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,7 @@ static void writeControllerFile(Fl_Widget* w, void* data)
|
||||||
// a pointer to the controllerID int is passed as data
|
// a pointer to the controllerID int is passed as data
|
||||||
ControllerUI* c = (ControllerUI*)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
|
// FIXME: Controller ID hardcoded
|
||||||
EventControllerInstanceGetToWrite e( 2 );
|
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)
|
ControllerUI::ControllerUI(int x, int y, int w, int h, std::string n, int ID)
|
||||||
{
|
{
|
||||||
name = strdup(n.c_str());
|
name = n;
|
||||||
target = 0;
|
|
||||||
|
|
||||||
widget = new Fl_Group( x, y, w, h, name);
|
widget = new Fl_Group( x, y, w, h, name.c_str());
|
||||||
{
|
{
|
||||||
// author / link
|
// author / link
|
||||||
authorLabel = new Fl_Box( x, y + 0, 200, 30, "Author: -" );
|
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 )
|
void ControllerUI::setTarget( const char* n )
|
||||||
{
|
{
|
||||||
if ( target )
|
target = n;
|
||||||
free (target);
|
targetLabel->label( target.c_str() );
|
||||||
target = strdup(n);
|
|
||||||
|
|
||||||
targetLabel->label( target );
|
|
||||||
targetLabel->redraw();
|
targetLabel->redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ControllerUI
|
||||||
// for adding to GOptions tabs
|
// for adding to GOptions tabs
|
||||||
Fl_Group* widget;
|
Fl_Group* widget;
|
||||||
|
|
||||||
char* name;
|
std::string name;
|
||||||
|
|
||||||
OptionsWindow* optionsWindow;
|
OptionsWindow* optionsWindow;
|
||||||
|
|
||||||
|
@ -53,10 +53,10 @@ class ControllerUI
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// bindings
|
// bindings
|
||||||
char* target;
|
std::string target;
|
||||||
|
|
||||||
std::string author;
|
std::string author;
|
||||||
std::string email;
|
std::string email;
|
||||||
|
|
||||||
Fl_Box* authorLabel;
|
Fl_Box* authorLabel;
|
||||||
Fl_Box* emailLabel;
|
Fl_Box* emailLabel;
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue