SomE WHITESPACE

This commit is contained in:
Valentin Boettcher 2018-04-10 08:36:37 +02:00
parent bbaa7554cd
commit 69db656239
3 changed files with 175 additions and 182 deletions

View file

@ -104,7 +104,7 @@ double getCairoTextWith(cairo_t * cr, const char * str)
return ex.width;
}
void trimToFit(cairo_t * cr, std::string * str, double maxWidth)
void trimStringToFit(cairo_t * cr, std::string * str, double maxWidth)
{
double ellWidth = getCairoTextWith(cr, "");
double textWidth = getCairoTextWith(cr, str->c_str());
@ -253,7 +253,7 @@ void ClipSelector::draw()
cairo_set_font_size( cr, 11 );
std::string tmp = clips[i].getName();
trimToFit(cr, &tmp, clipWidth - (clipHeight + 15 + beatLen));
trimStringToFit(cr, &tmp, clipWidth - (clipHeight + 15 + beatLen));
cairo_show_text( cr, tmp.c_str() );
// special indicator
@ -316,16 +316,6 @@ void setLengthCb(Fl_Widget *w, void* data)
writeToDspRingbuffer( &e );
}
int ClipSelector::findClipNum() {
// calculate the clicked clip number
int clipHeight = (h / numClips);
clipNum = ( (Fl::event_y() ) - y ) / clipHeight;
if (clipNum >= numClips)
clipNum = numClips -1; // fix for clicking the lowest pixel
return clipNum;
}
int ClipSelector::getLastClipNum()
{
return clipNum;
@ -342,7 +332,13 @@ int ClipSelector::handle(int event)
case FL_PUSH:
highlight = 1;
{
findClipNum();
// calculate the clicked clip number
int clipHeight = (h / numClips);
clipNum = ( (Fl::event_y() ) - y ) / clipHeight;
if (clipNum >= numClips)
clipNum = numClips -1; // fix for clicking the lowest pixel
return clipNum;
// handle right clicks: popup menu
if ( Fl::event_state(FL_BUTTON3) ) {

View file

@ -129,13 +129,11 @@ public:
int handle(int event);
void resize(int X, int Y, int W, int H);
int findClipNum();
int getLastClipNum();
private:
int clipNum;
};
} // Avtk
#endif // AVTK_CLIP_SELECTOR_H

View file

@ -75,20 +75,20 @@ 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++)
// {
// int iph=clips[i]->getPlayhead()+1.0;
// long targetFrames = clips[i]->getBeats() * fpb;
// long actualFrames = clips[i]->getActualAudioLength();//getBufferLenght();
// float playSpeed = 1.0;
// for(int i=0;i<NSCENES;i++)
// {
// int iph=clips[i]->getPlayhead()+1.0;
// long targetFrames = clips[i]->getBeats() * fpb;
// long actualFrames = clips[i]->getActualAudioLength();//getBufferLenght();
// float playSpeed = 1.0;
// if ( targetFrames != 0 && actualFrames != 0 )
// {
// playSpeed = float(actualFrames) / targetFrames;
// }
// clips[i]->setPlayHead(iph-(iph%fpb)*playSpeed);
// if ( targetFrames != 0 && actualFrames != 0 )
// {
// playSpeed = float(actualFrames) / targetFrames;
// }
// clips[i]->setPlayHead(iph-(iph%fpb)*playSpeed);
// }
// }
}
@ -203,7 +203,6 @@ void Looper::pitchShift(int count, float* input, float* output)
&65535]))) + (fTemp3 * (((fRec0[0] - iTemp1) * fVec0[(IOTA-int((int(
iTemp2) & 65535)))&65535]) + ((iTemp2 - fRec0[0]) * fVec0[(IOTA-int((
iTemp1 & 65535)))&65535]))));
output[0]=out;
fRec0[1] = fRec0[0];
IOTA = IOTA+1;