author | waspe <waspe> | 2003-11-17 20:33:37 (UTC) |
---|---|---|
committer | waspe <waspe> | 2003-11-17 20:33:37 (UTC) |
commit | ede1a10411dd859c6473aadbc7fa54bf2419380d (patch) (side-by-side diff) | |
tree | d8561730a0932e57a25a15441a579cdaae1919fd | |
parent | 9ea83d1fc66171dbbcf8d1d435eedbb75c346935 (diff) | |
download | opie-ede1a10411dd859c6473aadbc7fa54bf2419380d.zip opie-ede1a10411dd859c6473aadbc7fa54bf2419380d.tar.gz opie-ede1a10411dd859c6473aadbc7fa54bf2419380d.tar.bz2 |
changed color of notes
-rw-r--r-- | noncore/multimedia/tonleiter/fretboard.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/tonleiter/fretboard.cpp b/noncore/multimedia/tonleiter/fretboard.cpp index d8e48d3..57806be 100644 --- a/noncore/multimedia/tonleiter/fretboard.cpp +++ b/noncore/multimedia/tonleiter/fretboard.cpp @@ -54,106 +54,106 @@ void FretBoard::resizeEvent(QResizeEvent* re) } //**************************************************************************** void FretBoard::paintBoard(QPainter* p) { //debug QColor bgc=QColor(142,138,120); p->setPen(QPen(bgc,5)); p->setBrush(QBrush(bgc)); p->drawRect(xmin,ymin,xwidth,yheight); } //**************************************************************************** void FretBoard::paintFrets(QPainter* p) { //draw frets p->setPen(fretpen); p->setBrush(markerbrush); fretdist=(double)(xwidth)/(double)(inst.noOfFrets()); int markerwidth = (int)(fretdist/4.0); if(markerwidth>5) markerwidth=5; else if(markerwidth<2) markerwidth=2; for(int f=0;f<=inst.noOfFrets();f++) { int fretpos=(int)(fretdist*f); p->drawLine(fretpos+xmin,ymin,fretpos+xmin,ymax); int above_octave=f%12; int octave=(f-above_octave)/12; int marker=f-12*octave; if(marker==5 || marker==7 || marker==9) { p->drawEllipse(fretpos+xmin,ymax+ymargin,markerwidth,markerwidth); } else if(marker==0 && f!=0) { p->drawEllipse(fretpos+xmin,ymax+ymargin+2*markerwidth,markerwidth,markerwidth); p->drawEllipse(fretpos+xmin,ymax+ymargin-2*markerwidth,markerwidth,markerwidth); } } } //**************************************************************************** void FretBoard::paintStrings(QPainter* p) { //draw strings p->setPen(stringpen); stringdist=(double)(yheight)/(double)(inst.noOfStrings()-1); for(int s=0;s<inst.noOfStrings();s++) { int stringpos=(int)(stringdist*s); p->drawLine(xmin,stringpos+ymin,xmax,stringpos+ymin); int stinglabelid=inst.noOfStrings()-(s+1); QString label=Note::getNameOfNote(inst.string(stinglabelid)); p->drawText(xmargin/2,stringpos+ymin,label); } } //**************************************************************************** void FretBoard::paintScale(QPainter* p) { int dotsize=10; int scaleid=data->getCurrentScaleID(); Scale scale=data->getScale(scaleid); int colorstart=255%inst.noOfOctaves(); int colorintervall=(255-colorstart)/inst.noOfOctaves(); for(int s=0;s<inst.noOfStrings();s++) { int y=(int)(stringdist*s)+ymin; int stingid=inst.noOfStrings()-(s+1); for(int f=0;f<=inst.noOfFrets();f++) { int note=inst.string(stingid)+f; if(scale.noteInScale(data->getCurrentBaseNote(),note)) { int x=(int)(fretdist*f)+xmin; int octave=Note::octaveOfBaseNote(data->getCurrentBaseNote(),note); if(octave>5) octave=5; p->setPen(QColor(255,0,0)); int c=colorstart+octave*colorintervall; QColor dotcolor(c,c,255); p->setBrush(dotcolor); p->drawEllipse(x-dotsize/2,y-dotsize/2,dotsize,dotsize); if(data->isDrawNames()) { - p->setPen(QColor(0,255,0)); + p->setPen(QColor(255,155,0)); p->drawText(x-dotsize/2,y-dotsize/2,Note::getNameOfNote(note)); } } } } } //**************************************************************************** //**************************************************************************** |