2013-10-18 14:49:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
#include "goptions.hxx"
|
|
|
|
|
|
|
|
#include "eventhandler.hxx"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void writeBindEnable(Fl_Widget* w, void* data)
|
|
|
|
{
|
|
|
|
OptionsWindow* o = (OptionsWindow*) data;
|
|
|
|
//LUPPP_NOTE("MIDI bind mode");
|
|
|
|
|
|
|
|
Avtk::LightButton* l = (Avtk::LightButton*)w;
|
|
|
|
l->value( !l->value() );
|
|
|
|
|
|
|
|
EventControllerBindEnable e( l->value() );
|
|
|
|
writeToDspRingbuffer( &e );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OptionsWindow::OptionsWindow()
|
|
|
|
{
|
|
|
|
window = new Fl_Double_Window(400,300,"Options");
|
|
|
|
|
2013-10-18 15:12:34 +02:00
|
|
|
tabs = new Fl_Tabs(0, 0, 400, 300);
|
|
|
|
|
|
|
|
int x, y, w, h;
|
|
|
|
tabs->client_area( x, y, w, h, 25 );
|
|
|
|
|
|
|
|
Fl_Group* bindings = new Fl_Group( x, y, w, h, "Binding");
|
|
|
|
{
|
2013-10-18 15:33:00 +02:00
|
|
|
targetLabel = new Avtk::Button(x + 105, y + 5, 100, 25, "Target: ");
|
2013-10-18 15:12:34 +02:00
|
|
|
bindEnable = new Avtk::LightButton(x + 5, y + 5, 100, 25, "Bind Enable");
|
|
|
|
}
|
|
|
|
bindings->end();
|
|
|
|
|
|
|
|
Fl_Group* controllers = new Fl_Group( x, y, w, h, "Controllers");
|
|
|
|
controllers->hide();
|
|
|
|
{
|
|
|
|
ctlrButton = new Avtk::Button(x + 5, y + 5, 100, 25, "Add Controller");
|
|
|
|
}
|
|
|
|
controllers->end();
|
|
|
|
|
|
|
|
tabs->end();
|
2013-10-18 14:49:46 +02:00
|
|
|
|
|
|
|
//ctlrButton->callback( selectLoadController );
|
|
|
|
bindEnable->callback( writeBindEnable, this );
|
|
|
|
|
|
|
|
window->end();
|
|
|
|
}
|
|
|
|
|
2013-10-18 15:33:00 +02:00
|
|
|
void OptionsWindow::setTarget(const char* t)
|
|
|
|
{
|
|
|
|
target = t;
|
|
|
|
printf("%s\n", target.c_str() );
|
|
|
|
targetLabel->setLabel( t );
|
|
|
|
}
|
|
|
|
|
2013-10-18 14:49:46 +02:00
|
|
|
void OptionsWindow::show()
|
|
|
|
{
|
|
|
|
window->show();
|
|
|
|
}
|
|
|
|
|
|
|
|
void OptionsWindow::setBindEnable(bool e)
|
|
|
|
{
|
|
|
|
bindEnable->value( e );
|
|
|
|
}
|
|
|
|
|
|
|
|
|