commit 044b22f60caea89feb882b07c812c99d63ce4d5e
parent 32b90919462821236a0b717887a79bf3e2524310
Author: Christopher A. Oliver <[email protected]>
Date: Sun, 4 Oct 2015 15:50:43 -0400
Tabs to spaces.
Diffstat:
1 file changed, 63 insertions(+), 63 deletions(-)
diff --git a/src/UI/EnvelopeFreeEdit.cpp b/src/UI/EnvelopeFreeEdit.cpp
@@ -181,81 +181,81 @@ int EnvelopeFreeEdit::handle(int event)
switch(event) {
case FL_ENTER:
- old_focus=Fl::focus();
- Fl::focus(this);
- break;
+ old_focus=Fl::focus();
+ Fl::focus(this);
+ break;
case FL_LEAVE:
- Fl::focus(old_focus);
- break;
+ Fl::focus(old_focus);
+ break;
case FL_KEYDOWN:
case FL_KEYUP:
- {
- int key = Fl::event_key();
- if (key==FL_Control_L || key==FL_Control_R){
- ctrldown = (event==FL_KEYDOWN);
- redraw();
- if (pair!=NULL) pair->redraw();
- }
- }
- break;
+ {
+ int key = Fl::event_key();
+ if (key==FL_Control_L || key==FL_Control_R){
+ ctrldown = (event==FL_KEYDOWN);
+ redraw();
+ if (pair!=NULL) pair->redraw();
+ }
+ }
+ break;
case FL_PUSH:
- currentpoint=getnearest(x_,y_);
- cpx=x_;
- cpdt=Penvdt[currentpoint];
- lastpoint=currentpoint;
- redraw();
- if (pair)
- pair->redraw();
- return 1;
+ currentpoint=getnearest(x_,y_);
+ cpx=x_;
+ cpdt=Penvdt[currentpoint];
+ lastpoint=currentpoint;
+ redraw();
+ if (pair)
+ pair->redraw();
+ return 1;
case FL_RELEASE:
- currentpoint=-1;
- redraw();
- if (pair)
- pair->redraw();
- return 1;
+ currentpoint=-1;
+ redraw();
+ if (pair)
+ pair->redraw();
+ return 1;
case FL_MOUSEWHEEL:
- if (lastpoint>=0) {
- if (!ctrldown) {
- int ny = Penvval[lastpoint] - Fl::event_dy();
- ny = ny < 0 ? 0 : ny > 127 ? 127 : ny;
- Penvval[lastpoint] = ny;
- oscWrite(to_s("Penvval")+to_s(lastpoint), "c", ny);
- oscWrite("Penvval","");
- } else if (lastpoint > 0) {
- int newdt = Fl::event_dy() + Penvdt[lastpoint];
- newdt = newdt < 0 ? 0 : newdt > 127 ? 127 : newdt;
- Penvdt[lastpoint] = newdt;
- oscWrite(to_s("Penvdt")+to_s(lastpoint), "c", newdt);
- oscWrite("Penvdt","");
- }
- redraw();
- if (pair!=NULL) pair->redraw();
- return 1;
- }
+ if (lastpoint>=0) {
+ if (!ctrldown) {
+ int ny = Penvval[lastpoint] - Fl::event_dy();
+ ny = ny < 0 ? 0 : ny > 127 ? 127 : ny;
+ Penvval[lastpoint] = ny;
+ oscWrite(to_s("Penvval")+to_s(lastpoint), "c", ny);
+ oscWrite("Penvval","");
+ } else if (lastpoint > 0) {
+ int newdt = Fl::event_dy() + Penvdt[lastpoint];
+ newdt = newdt < 0 ? 0 : newdt > 127 ? 127 : newdt;
+ Penvdt[lastpoint] = newdt;
+ oscWrite(to_s("Penvdt")+to_s(lastpoint), "c", newdt);
+ oscWrite("Penvdt","");
+ }
+ redraw();
+ if (pair!=NULL) pair->redraw();
+ return 1;
+ }
case FL_DRAG:
- if (currentpoint>=0){
- int ny=limit(127-(int) (y_*127.0/h()), 0, 127);
+ if (currentpoint>=0){
+ int ny=limit(127-(int) (y_*127.0/h()), 0, 127);
- Penvval[currentpoint]=ny;
+ Penvval[currentpoint]=ny;
- const int dx=(int)((x_-cpx)*0.1);
- const int newdt=limit(cpdt+dx,0,127);
+ const int dx=(int)((x_-cpx)*0.1);
+ const int newdt=limit(cpdt+dx,0,127);
- if(currentpoint!=0)
- Penvdt[currentpoint]=newdt;
- else
- Penvdt[currentpoint]=0;
+ if(currentpoint!=0)
+ Penvdt[currentpoint]=newdt;
+ else
+ Penvdt[currentpoint]=0;
- oscWrite(to_s("Penvval")+to_s(currentpoint), "c", ny);
- oscWrite(to_s("Penvdt")+to_s(currentpoint), "c", newdt);
- oscWrite("Penvdt","");
- oscWrite("Penvval","");
- redraw();
+ oscWrite(to_s("Penvval")+to_s(currentpoint), "c", ny);
+ oscWrite(to_s("Penvdt")+to_s(currentpoint), "c", newdt);
+ oscWrite("Penvdt","");
+ oscWrite("Penvval","");
+ redraw();
- if(pair)
- pair->redraw();
- return 1;
- }
+ if(pair)
+ pair->redraw();
+ return 1;
+ }
}
// Needed to propagate undo/redo keys.
return 0;