void midiSequencer::draw(int _x, int _y) { x=_x; w=ofGetWidth()-x; y=_y; mark.y=y+10; band->drawBackground(); //Draw measure lines drawDivs(true); band->drawInstruments(); ofSetColor(0xA0835B); ofRect(x, y, w, h); ofShade(x, y+h, 15, w, OF_UP, .4); ofShade(x, y+h, 5, w, OF_DOWN, .3); drawDivs(false); drawMark(); // Bottom scroll bar ofShade(_x, band->getBottomPos(), 5, w, OF_UP, .3); int botY=band->getBottomPos(); if(bar.available()){ bar.draw(_x, band->getBottomPos()); botY=bar.y+bar.h+2; } int botH=ofGetHeight()-botY; //Task bar on bottom ofSetColor(0xA0835B); ofShadeBox(x,botY, w, botH, OF_DOWN, .3); //ofShade(x, bar.y+bar.h+2, 5, w, OF_UP, .3); ofShade(x,botY, 10, w, OF_DOWN, .3); double indent=8; ofRoundShadow(x+w/2-playBut.w/2-indent/2, botY+(botH/2-playBut.h/2)-indent/2, playBut.w+indent, playBut.h+indent, playBut.w/2+indent/2, 1); playBut.draw(x+w/2-playBut.w/2, botY+(botH-playBut.h)/2); ofRoundShadow(x+w/2-playBut.w/2-indent/2-50, botY+(botH/2-rewindBut.h/2)-indent/2,\ rewindBut.w+indent, rewindBut.h+indent, rewindBut.w/2+indent/2, 1); rewindBut.draw(x+w/2-playBut.w/2-50, botY+(botH-rewindBut.h)/2); ofRoundShadow(x+w/2-playBut.w/2-indent/2-100, botY+(botH/2-loopBut.h/2)-indent/2, loopBut.w+indent, loopBut.h+indent, loopBut.w/2+indent/2, 1); loopBut.draw(x+w/2-playBut.w/2-100, botY+(botH-loopBut.h)/2); ofRoundShadow(display.x-10-indent/2, display.y-10-indent/2,\ display.w+20+indent, display.h+20+indent, 5, 1); ofSetColor(0, 0, 0); ofRoundBox(display.x-10, display.y-10, display.w+20, display.h+20, 5, .2); ofSetColor(0, 128, 200); int secs=metronome.getElapsed(); display.draw(ssprintf("%02i:%02i.%02i",(secs/1000/60),(secs/1000)%60,(secs%1000/10)), x+w/2+playBut.w/2+20, botY+(botH-display.h)/2); }
void bandBar::draw(int _x, int _y) { x=_x,y=_y; //sidebar background ofSetColor(255, 255, 255); sideBarBack.draw(x+w-(sideBarBack.height/h)*sideBarBack.width, y,(sideBarBack.height/h)*sideBarBack.width,h); // ofSetColor(0x80633B); ofRect(x+xoff-10, y+yoff, w-xoff-10, viewSize); ofShade(x+w, y+yoff, 10, viewSize, OF_LEFT, .3); for (unsigned int i=0; i<instruments.size(); i++) { instruments[i].draw(x+xoff,y+yoff+5 +50*(i)); double tmpY=y+instruments[i].y+instruments[i].h+instruments[i].yoff+7.5; ofShade(x, tmpY, 3, w-20, OF_UP, .3); ofShade(x, tmpY, 3, w-20, OF_DOWN, .3,false); } ofShade(x+w-20, y+yoff, 10, viewSize, OF_LEFT, .3); //Box at top of sidebar ofSetColor(230, 230, 230); ofShadeBox(x, y, w, yoff, OF_DOWN, .4); ofShade(x, y+yoff, 10, w, OF_DOWN, .3); //box at bottom of sidebar ofRoundBox(x-10, getBottomPos(), w+10, ofGetHeight()-(y+yoff+viewSize), 10, .4); ofShade(x, getBottomPos(), 10, w, OF_UP, .3); ofShade(x, getBottomPos(), 15, w, OF_DOWN, .2); bar.draw(x,yoff); //Shades over ends of the scroll bar ofShade(x, y+yoff, 5, bar.w+4, OF_DOWN, .3); ofShade(x, y+yoff+viewSize, 5, bar.w+4, OF_UP, .3); //shade to right of scrollbar ofShade(x+bar.w+2, y+yoff, 5, viewSize, OF_RIGHT, .3); clearBut.draw((w-clearBut.w)/2, ofGetHeight()-((yBot)*2-clearBut.h)/2); }
void sbGroup::draw(){ //--------- Draw a brown box onto the sidebar to hold the blocks //ofSetColor(0x80633B); ofSetColor(0x777777); ofShadeBox(0,y,w-15-25,h,OF_DOWN,.1); int pos=0; for (unsigned int i=0; i<bars.size()-1; i++) { ofSetColor(0, 0, 0,60); ofRect(bars[i].x+bars[i].h/2, bars[i].y+bars[i].h, bars[i].w-bars[i].h, bars[i+1].y-(bars[i].y+bars[i].h)); shadeHor(0,bars[i].y+bars[i].h,5,bars[i+1].y-(bars[i].y+bars[i].h),.4); shadeHor(bars[i].w-bars[i].h,bars[i].y+bars[i].h,-5,bars[i+1].y-(bars[i].y+bars[i].h),.4); if(bars[i].Open) shadeVer(0,bars[i].y+bars[i].h,bars[i].w-bars[i].h,5,.4); if(bars[i+1].y>bars[i].y+bars[i].h) shadeVer(0,bars[i+1].y,bars[i].w-bars[i].h,-5,.4); bars[i].draw(-20,pos+y); pos+=bars[i].h; if(bars[i].Open) pos+=sideBarSpace; } bars[bars.size()-1].y=y+h; }