fix some little bugs

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18051 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2006-07-06 20:03:44 +00:00
parent c8bb68e11b
commit fc6956ac0c
3 changed files with 25 additions and 11 deletions

View File

@ -246,7 +246,7 @@ RecorderWindow::InitWindow()
r = background->Bounds();
r.left = 2;
r.right = r.left + 39;
r.right = r.left + 37;
r.bottom = r.top + 104;
fVUView = new VUView(r, B_FOLLOW_LEFT|B_FOLLOW_TOP);
background->AddChild(fVUView);

View File

@ -14,9 +14,9 @@
//#define TRACE 1
#ifdef TRACE
#define TRACE(x) printf(x)
#define TRACE(x...) printf(x)
#else
#define TRACE(x)
#define TRACE(x...)
#endif
ScopeView::ScopeView(BRect rect, uint32 resizeFlags)
@ -63,8 +63,13 @@ void
ScopeView::Draw(BRect updateRect)
{
BRect bounds = Bounds();
if (!fIsRendering)
SetHighColor(0,0,0);
if (!fIsRendering) {
FillRect(BRect(0,0,2,bounds.bottom));
DrawBitmapAsync(fBitmap, BPoint(2,0));
} else
FillRect(bounds);
float x = 2;
if (fTotalTime !=0)
@ -152,17 +157,20 @@ ScopeView::RenderLoop()
}
TRACE("finished computing\n");
TRACE("finished computing, rendering\n");
/* rendering */
RenderBitmap();
TRACE("rendering done\n");
/* ask drawing */
fIsRendering = false;
if (Window()->LockWithTimeout(5000) == B_OK) {
Invalidate();
TRACE("invalidate done\n");
Window()->Unlock();
}
}
@ -174,6 +182,7 @@ ScopeView::SetMainTime(bigtime_t timestamp)
{
fMainTime = timestamp;
Invalidate();
TRACE("invalidate done\n");
}
@ -182,6 +191,7 @@ ScopeView::SetTotalTime(bigtime_t timestamp)
{
fTotalTime = timestamp;
Invalidate();
TRACE("invalidate done\n");
}
void
@ -190,6 +200,7 @@ ScopeView::SetLeftTime(bigtime_t timestamp)
fLeftTime = timestamp;
RenderBitmap();
Invalidate();
TRACE("invalidate done\n");
}
void
@ -198,6 +209,7 @@ ScopeView::SetRightTime(bigtime_t timestamp)
fRightTime = timestamp;
RenderBitmap();
Invalidate();
TRACE("invalidate done\n");
}
@ -216,6 +228,7 @@ ScopeView::FrameResized(float width, float height)
InitBitmap();
RenderBitmap();
Invalidate();
TRACE("invalidate done\n");
}

View File

@ -22,6 +22,7 @@ VUView::VUView(BRect rect, uint32 resizeFlags)
fBitmap(NULL),
fQuitting(false)
{
rect.OffsetTo(B_ORIGIN);
fLevelCount = int(rect.Height()) / 2;
fChannels = 2;
fCurrentLevels = new int32[fChannels];
@ -142,10 +143,10 @@ VUView::RenderLoop()
fBitmap->Lock();
fBitmapView->BeginLineArray(fLevelCount * 2);
BPoint start1, end1, start2, end2;
start1.x = 1;
start2.x = 20;
end1.x = 14;
end2.x = 33;
start1.x = 3;
start2.x = 22;
end1.x = 16;
end2.x = 35;
start1.y = end1.y = start2.y = end2.y = 2;
for (int32 i=fLevelCount-1; i>=0; i--) {
fBitmapView->AddLine(start1, end1, levels[i][0]);