Merge remote-tracking branch 'openav-master/master'

main
Gerald 2016-11-26 12:27:07 +01:00
commit 066f551a2f
8 changed files with 7 additions and 269 deletions

View File

@ -106,55 +106,6 @@ class Box : public Fl_Widget
h = H;
redraw();
}
/*
int handle(int event)
{
switch(event)
{
case FL_PUSH:
if ( Fl::event_state(FL_BUTTON3) && Fl::event_y() < y + 20 )
{
const char* name = fl_input( "Track name: ", "" );
if ( name )
{
free( (char*) label );
label = strdup( name );
redraw();
}
return 1;
}
redraw();
return 1;
case FL_DRAG: {
int t = Fl::event_inside(this);
if (t != highlight) {
redraw();
}
}
return 1;
case FL_RELEASE:
if (highlight) {
highlight = 0;
redraw();
do_callback();
}
return 1;
case FL_SHORTCUT:
if ( test_shortcut() )
{
do_callback();
return 1;
}
return 0;
default:
return Fl_Widget::handle(event);
}
}
*/
};
} // Avtk

View File

@ -85,17 +85,6 @@ class Image : public Fl_Widget
x = gui->getWindowWidth() - w;
}
/*
Fl_Widget::resize(X,Y,W,H);
x = X;
y = Y;
w = W;
h = H;
*/
redraw();
}

View File

@ -165,55 +165,6 @@ class SidechainGain : public Fl_Slider
cairo_line_to( cr, x + w, y + h * 0.25 + h/2 * _release );
cairo_set_source_rgba( cr, 1.0, 0.0, 0.f , 1 );
cairo_stroke( cr );
/*
float makeupGainPx = makeupGain * h * 0.5;
float xDist = 0.1 * w;
float yDist = 0.1 * h;
float xThresh = x + (w * 0.25) + (w*0.5) * threshVal;
float yThresh = y + (h * 0.25) + (h*0.5)*(1-threshVal);
float startx = xThresh - xDist;
float starty = yThresh + yDist;
float cp1x = xThresh;
float cp1y = yThresh - makeupGainPx;
float cp2x = xThresh;
float cp2y = yThresh - makeupGainPx;
float endx = xThresh + (xDist*1.2);
float endy = yThresh - (yDist*1.2)*(1-ratioVal) - makeupGainPx;
// normal line (greyed)
cairo_move_to( cr, x , y + h );
cairo_line_to( cr, x + w, y );
cairo_set_source_rgba( cr, 66 / 255.f, 66 / 255.f , 66 / 255.f , 0.5 );
cairo_set_line_width(cr, 1.4);
cairo_stroke( cr );
cairo_move_to( cr, x , y + h - makeupGainPx );
cairo_line_to( cr, startx, starty - makeupGainPx );
// draw curve
cairo_curve_to( cr, cp1x, cp1y, cp2x, cp2y, endx, endy );
cairo_line_to( cr, x + w, y + (h/4)*ratioVal + (h)*(1-threshVal)*(0.5*ratioVal) - makeupGainPx );
cairo_line_to( cr, x + w, y + h );
cairo_line_to( cr, x , y + h );
cairo_close_path(cr);
cairo_set_source_rgba( cr, 0 / 255.f, 153 / 255.f , 255 / 255.f , 0.21 );
cairo_fill_preserve(cr);
cairo_set_source_rgba( cr, 0 / 255.f, 153 / 255.f , 255 / 255.f , 1 );
cairo_set_line_width(cr, 1.5);
cairo_set_line_join( cr, CAIRO_LINE_JOIN_ROUND);
cairo_set_line_cap ( cr, CAIRO_LINE_CAP_ROUND);
cairo_stroke( cr );
*/
// stroke outline
cairo_rectangle(cr, x, y, w, h);
@ -251,77 +202,7 @@ class SidechainGain : public Fl_Slider
}
int handle(int event)
{
/*
switch(event)
{
case FL_PUSH:
highlight = 0;
mouseRightClicked = false;
if ( Fl::event_button() == FL_RIGHT_MOUSE )
{
active = !active;
redraw();
mouseRightClicked = true;
do_callback();
}
return 1;
case FL_DRAG:
{
if ( Fl::event_state(FL_BUTTON1) )
{
if ( mouseClicked == false ) // catch the "click" event
{
mouseClickedX = Fl::event_x();
mouseClickedY = Fl::event_y();
mouseClicked = true;
}
float deltaX = mouseClickedX - Fl::event_x();
float deltaY = mouseClickedY - Fl::event_y();
float valX = value();
valX -= deltaX / 100.f;
float valY = makeupGain;
valY += deltaY / 100.f;
if ( valX > 1.0 ) valX = 1.0;
if ( valX < 0.0 ) valX = 0.0;
if ( valY > 1.0 ) valY = 1.0;
if ( valY < 0.0 ) valY = 0.0;
//handle_drag( value + deltaY );
set_value( valX );
makeupGain = valY;
mouseClickedX = Fl::event_x();
mouseClickedY = Fl::event_y();
redraw();
do_callback();
}
}
return 1;
case FL_RELEASE:
mouseRightClicked = false;
if (highlight) {
highlight = 0;
redraw();
do_callback();
}
mouseClicked = false;
return 1;
case FL_SHORTCUT:
if ( test_shortcut() )
{
do_callback();
return 1;
}
return 0;
default:
return Fl_Widget::handle(event);
}
*/
{ //TODO needed?
return 0;
}

View File

@ -155,67 +155,4 @@ void Bindings::resize(int X, int Y, int W, int H)
redraw();
}
/*
int Bindings::handle(int event)
{
switch(event)
{
case FL_PUSH:
highlight = 0;
redraw();
return 1;
case FL_DRAG:
{
if ( Fl::event_state(FL_BUTTON1) )
{
if ( mouseClicked == false ) // catch the "click" event
{
mouseClickedX = Fl::event_x();
mouseClickedY = Fl::event_y();
mouseClicked = true;
}
float delta = (mouseClickedY - Fl::event_y() ) / float(h);
// handle the x / y swap, and the inverting of direction (mouseX / Y relative)
if ( orientationHorizontal )
delta = ( Fl::event_x() - mouseClickedX ) / float(w);
float valY = value();
valY += delta;
if ( valY > 1.0 ) valY = 1.0;
if ( valY < 0.0 ) valY = 0.0;
set_value( valY );
mouseClickedX = Fl::event_x();
mouseClickedY = Fl::event_y();
redraw();
do_callback();
}
}
return 1;
case FL_ENTER:
return 1;
case FL_RELEASE:
if (highlight) {
highlight = 0;
redraw();
do_callback();
}
mouseClicked = false;
return 1;
case FL_SHORTCUT:
if ( test_shortcut() )
{
do_callback();
return 1;
}
return 0;
default:
return Fl_Widget::handle(event);
}
}
*/
} // namespace Avtk

View File

@ -601,7 +601,7 @@ void GenericMIDI::setSceneState(int t, int scene, GridLogic::State s)
void GenericMIDI::reset()
{
{//TODO needed?
/*
unsigned char data[3];
// setup "volume" style rotary display

View File

@ -215,25 +215,7 @@ void GridLogic::pressed( int track, int scene )
{
//LUPPP_NOTE("netralizing & qStop on scene %i due to press on %i", i, scene );
LooperClip* ilc = jack->getLooper( track )->getClip( i );
/*
if ( ilc->getState() == GridLogic::STATE_EMPTY ||
ilc->getState() == GridLogic::STATE_STOPPED )
{
// pass
}
else if ( ilc->somethingQueued() )
{
LUPPP_NOTE("netralizing & qStop on scene %i due to press on %i", i, scene );
ilc->neutralize();
jack->getControllerUpdater()->setSceneState(track, i, ilc->getState() );
}
else // catch all others, netralize & stop
{
ilc->neutralize();
ilc->queueStop();
jack->getControllerUpdater()->setSceneState(track, i, ilc->getState() );
}
*/
ilc->neutralize();
ilc->queueStop();
jack->getControllerUpdater()->setSceneState(track, i, ilc->getState() );

View File

@ -218,7 +218,7 @@ Jack::Jack( std::string name ) :
if(gui->enablePerTrackOutput)
{
char name[50];
sprintf(name,"track_%d\0",i);
sprintf(name,"track_%d\n",i);
trackJackOutputPorts[i]=jack_port_register( client,
name,
JACK_DEFAULT_AUDIO_TYPE,
@ -528,10 +528,8 @@ void Jack::processFrames(int nframes)
if(fabs(masterVol-masterVolLag)>=fabs(masterVolDiff/10.0))
masterVolLag+=masterVolDiff/10.0;
/// mixdown returns into master buffers
// FIXME: Returns broken, due to metronome glitch in master output: buffer
// writing issue or such. See #95 on github
buffers.audio[Buffers::JACK_MASTER_OUT_L][i] = L * masterVolLag;// (L + returnL*returnVol) * masterVol;
buffers.audio[Buffers::JACK_MASTER_OUT_R][i] = R * masterVolLag;// (R + returnR*returnVol) * masterVol;
buffers.audio[Buffers::JACK_MASTER_OUT_L][i] = (L + returnL*returnVol) * masterVolLag;
buffers.audio[Buffers::JACK_MASTER_OUT_R][i] = (R + returnR*returnVol) * masterVolLag;
/// write SEND content to JACK port
buffers.audio[Buffers::JACK_SEND_OUT][i] = buffers.audio[Buffers::SEND][i];

View File

@ -72,7 +72,7 @@ LooperClip* Looper::getClip(int scene)
}
void Looper::beat()
{
{//TODO needed?
//FIXME: Need to keep looperClips in sync when there exists no int N
// such that playSpeed*N==1
// for(int i=0;i<NSCENES;i++)