void UpdateMode(unsigned char om, unsigned char m) { switch(om) { case 2: DrawOff(&MyWatchScr[BALARM]); break; case 1: DrawOff(&MyWatchScr[BTIMER]); break; case 0: DrawOff(&MyWatchScr[BTIME]); break; case 3: DrawOff(&MyWatchScr[BSWATCH]); break; } switch(m) { case 2: DrawOn(&MyWatchScr[BALARM]); break; case 1: DrawOn(&MyWatchScr[BTIMER]); break; case 0: DrawOn(&MyWatchScr[BTIME]); break; case 3: DrawOn(&MyWatchScr[BSWATCH]); break; } }
void ArpFileNameControl::Draw(BRect clip) { BView* into = this; ArpBitmapCache* cache = dynamic_cast<ArpBitmapCache*>( Window() ); if (cache) into = cache->StartDrawing(this, clip); DrawOn(into, clip); if (cache) cache->FinishDrawing(into); }
void SeqSongIndexMatrixView::Draw(BRect clip) { BView* into = this; ArpBitmapCache* cache = dynamic_cast<ArpBitmapCache*>( Window() ); if (cache) into = cache->StartDrawing(this, clip); DrawOn(into, clip); if (cache) cache->FinishDrawing(into); }
void ArpKnobControl::Draw(BRect updateRect) { BView* into = this; ArpBitmapCache* cache = dynamic_cast<ArpBitmapCache*>( Window() ); if( cache ) into = cache->StartDrawing(this, updateRect); DrawOn(updateRect, into); if( cache ) cache->FinishDrawing(into); }
void AmTrackInfoView::Draw(BRect clip) { BView* into = this; ArpBitmapCache* cache = dynamic_cast<ArpBitmapCache*>( Window() ); if (cache) into = cache->StartDrawing(this, clip); DrawOn(clip, into); if (cache) cache->FinishDrawing(into); }
void AmEditorToolBarView::Draw(BRect clip) { BView* into = this; ArpBitmapCache* cache = dynamic_cast<ArpBitmapCache*>( Window() ); if (cache) into = cache->StartDrawing(this, clip); DrawOn(into, clip); if (cache) cache->FinishDrawing(into); }
void AttView::Draw(BRect updateRect) { BView* into = this; ExBitmapCache* cache = dynamic_cast<ExBitmapCache*>(Window()); if( cache ) into = cache->StartDrawing(this); DrawOn(updateRect, into); if( cache ) cache->FinishDrawing(into); }
void AmTrackDataView::Draw(BRect clip) { BRect realClip(clip); float leftFudge = 0; float rightFudge = 0; if (mTarget) mTarget->GetFudgeFactor(&leftFudge, &rightFudge); BRect b = Bounds(); if (leftFudge == AM_FUDGE_TO_EDGE) realClip.left = b.left; else realClip.left -= leftFudge; if (rightFudge == AM_FUDGE_TO_EDGE) realClip.right = b.right; else realClip.right += rightFudge; /* If the left bounds are below zero, that can cause a problem * for some methods in AmPhrase, so I avoid that. */ if (realClip.left < 0) realClip.left = 0; BView* into = this; ArpBitmapCache* cache = dynamic_cast<ArpBitmapCache*>( Window() ); if (cache) into = cache->StartDrawing( this, realClip ); DrawOn(realClip, into); if (cache) cache->FinishDrawing(into); }
void SeqPhraseMatrixView::DrawOn(BRect clip, BView* view) { int32 labelH; if (seq_get_int32_preference(PHRASE_LABEL_HEIGHT_PREF, &labelH) != B_OK) labelH = 8; if (labelH < 6 || labelH > 50) labelH = 8; view->SetFontSize(float(labelH) ); mCurLabelH = arp_get_font_height(view); if (gPhraseBg) arp_tile_bitmap_on(view, clip, gPhraseBg, BPoint(0,0) ); else { view->SetHighColor( Prefs().Color(AM_DATA_BACKDROP_C) ); view->FillRect(clip); } float top = 0; const BRect b( Bounds() ); AmPhraseRendererI* renderer = NULL; // READ SONG BLOCK #ifdef AM_TRACE_LOCKS printf("SeqPhraseMatrixView::DrawOn() read lock\n"); fflush(stdout); #endif const AmSong* song = mSongRef.ReadLock(); if (song) { const AmTrack* track; for (uint32 k = 0; (track = song->Track(k)) != NULL; k++) { float bottom = top + track->PhraseHeight(); if (top > clip.bottom) break; BRect r(clip.left, top, clip.right, bottom); r.left -= 3; if (r.left < b.left) r.left = b.left; r.right += 3; if (r.right > b.right) r.right = b.right; if (r.Intersects(clip)) { renderer = get_phrase_renderer(track, mMtc); DrawOn(r, view, track, renderer); delete renderer; } top = bottom + 1; } } mSongRef.ReadUnlock(song); // END READ SONG BLOCK /* If the user is currently dragging a phrase over my area, draw that. */ if (mDragMetric.IsValid() ) { float left = mMtc.TickToPixel(mDragMetric.mRange.start); float right = mMtc.TickToPixel(mDragMetric.mRange.end); drawing_mode mode = view->DrawingMode(); view->SetDrawingMode(B_OP_ALPHA); view->SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_COMPOSITE); view->SetHighColor(0, 0, 0, 125); for (uint32 k = 0; k < mDragMetric.mSrcIndexes.size(); k++) { int32 dest = (int32)mDragMetric.mSrcIndexes[k] + ((int32)mDragMetric.mDestIndex - (int32)mDragMetric.mSrcIndex); if (dest >= 0 && dest < (int32)mTrackMetrics.size() ) { view->FillRect( BRect(left, mTrackMetrics[dest].mTop, right, mTrackMetrics[dest].mBottom) ); } } view->SetDrawingMode(mode); } if (!gPhraseBg && top <= clip.bottom) { view->SetHighColor( Prefs().Color(AM_DATA_BACKDROP_C) ); view->FillRect( BRect(clip.left, top, clip.right, clip.bottom) ); } /* Draw the song position. */ if (mSongPosition >= 0) { view->SetHighColor(0, 0, 0); view->StrokeLine( BPoint(mSongPosition, clip.top), BPoint(mSongPosition, clip.bottom) ); } }