-Updated bindings to have an ID for refering to them uniquely, updated GOptions scroll

This commit is contained in:
Harry van Haaren 2013-11-19 21:04:52 +00:00
parent 7d639f2676
commit 07c8d93ab6
4 changed files with 28 additions and 9 deletions

View file

@ -12,7 +12,9 @@ class Binding
{
public:
Binding() : status(0), data(0), action(0), active(-1),
track(-2),scene(-1),send(-1) {}
track(-2),scene(-1),send(-1) { ID = privateID++; }
int ID;
unsigned char status;
unsigned char data;
@ -29,6 +31,11 @@ class Binding
/// maps from Gridlogic::State to MIDI output value from binding
std::map<int,int> clipStateMap;
private:
/// static int counter to allow deleting this specific instance
static int privateID;
};
#endif

View file

@ -15,6 +15,8 @@
extern Jack* jack;
int Binding::privateID = 0;
GenericMIDI::GenericMIDI(int waste, std::string n) :
Controller(),
MidiIO()

View file

@ -177,13 +177,15 @@ ControllerUI::ControllerUI(int x, int y, int w, int h, std::string n, int ID)
//ctlrButton = new Avtk::Button(x + 110, y + 275, 100, 25, "Load");
removeController = new Avtk::Button(x + 110, y + h - 27, 100, 25, "Remove");
Fl_Scroll* s = new Fl_Scroll( x + 5, y + 75, 400, 180 );
s->box( FL_DOWN_FRAME );
bindingsPack = new Fl_Pack( x + 5, y + 75, 340, 10);
bindingsPack->end();
bindingsPack->spacing( 2 );
s->end();
scroll = new Fl_Scroll( x + 5, y + 75, 395, 70 );
{
bindingsPack = new Fl_Pack( x + 5, y + 75, 340, 10);
bindingsPack->end();
bindingsPack->spacing( 2 );
}
scroll->end();
scroll->box( FL_DOWN_FRAME );
scroll->type( Fl_Scroll::VERTICAL_ALWAYS );
}
widget->end();
@ -254,7 +256,7 @@ void ControllerUI::addBinding( Binding* b )
}
// create a horizontal pack, add that to the bindingsPack
Fl_Pack* tmp = new Fl_Pack( 35, 35, 25, 25 );
Fl_Pack* tmp = new Fl_Pack( 35, 35, 25, 25);
{
tmp->type( Fl_Pack::HORIZONTAL );
tmp->spacing( 2 );
@ -294,6 +296,8 @@ void ControllerUI::addBinding( Binding* b )
Fl_Button* but = new Fl_Button(35, 35, 25, 25, "@square");
Fl_Box* b = new Fl_Box(35, 35, 400, 25, strdup(s.str().c_str()) );
b->align( FL_ALIGN_LEFT | FL_ALIGN_INSIDE );
but->redraw();
b->redraw();
}
@ -301,7 +305,12 @@ void ControllerUI::addBinding( Binding* b )
bindingsPack->add( tmp );
bindingsPack->resize( bindingsPack->x(),bindingsPack->y(),bindingsPack->w(),bindingsPack->children() * 36 );
bindingsPack->redraw();
scroll->redraw();
}
void ControllerUI::addBindings( GenericMIDI* c )

View file

@ -56,6 +56,7 @@ class ControllerUI
Fl_Box* authorLabel;
Fl_Box* emailLabel;
Fl_Scroll* scroll;
Fl_Pack* bindingsPack;
Fl_Box* targetLabel;