From: <pst...@us...> - 2009-10-15 13:37:12
|
Revision: 736 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=736&view=rev Author: pstieber Date: 2009-10-15 13:37:04 +0000 (Thu, 15 Oct 2009) Log Message: ----------- 1. Removed SN++ from comments. I don't know what these represented. 2. Changed allways to always. 3. Wrapped lines longer than 80 columns. 4. Changed the style of some comments and translated others. 5. Put curly brackets around single line conditional statement. Modified Paths: -------------- trunk/jazz/src/PianoWindow.cpp Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-08-13 22:43:48 UTC (rev 735) +++ trunk/jazz/src/PianoWindow.cpp 2009-10-15 13:37:04 UTC (rev 736) @@ -240,7 +240,7 @@ Copy = pKeyOn->Copy()->IsKeyOn(); Win = pPianoWindow; - // SN++ BUG FIX: undo/redo + // BUG FIX: undo/redo Win->GetSong()->NewUndoBuffer(); wxClientDC Dc(Win); @@ -301,7 +301,7 @@ int ScrolledX, int ScrolledY) { - // SN++ Key_Aftertouch + // Key_Aftertouch if (Copy->GetEventLength() < mpKeyOn->GetEventLength()) { int key, channel; @@ -336,10 +336,10 @@ Win->mpMouseAction = 0; - // SN++ Veloc- oder Aftertouch-Editor updaten + // Velocity or aftertouch editor update. Win->UpdateControl(); - // allways repaint + // always repaint Win->Refresh(); delete this; @@ -389,7 +389,7 @@ Copy = k->Copy()->IsPlayTrack(); Win = pPianoWindow; - // SN++ BUG FIX: undo/redo + // BUG FIX: undo/redo Win->GetSong()->NewUndoBuffer(); // wxClientDC Dc(Win); @@ -454,10 +454,10 @@ Win->mpMouseAction = 0; - // SN++ Veloc- oder Aftertouch-Editor updaten + // Velocity or aftertouch editor update. Win->UpdateControl(); - // allways repaint + // always repaint Win->Refresh(); delete this; @@ -478,7 +478,7 @@ Win = pPianoWindow; mpKeyOn = pKeyOn; - // SN++ BUG FIX: undo/redo + // BUG FIX: undo/redo Win->GetSong()->NewUndoBuffer(); // wxClientDC Dc(Win); @@ -809,7 +809,7 @@ mFromClock = mScrolledX * mClockTicsPerPixel; mToClock = x2Clock(mCanvasWidth); - // SN++ Because jazz has a ReDo function. Fixes simultaneously update a + // Because jazz has a ReDo function. Fixes simultaneously update a // small problem when multiple ZoomOut. Active Ctrl draw new windows or // reinitialize. @@ -1218,12 +1218,13 @@ SetXScrollPosition(x); } -// SN++ Is changed. OnPaint always draws new -> Bug Fix for ZoomOut! -/* + // Is changed. OnPaint always draws new -> Bug Fix for ZoomOut! // OnPaint() redraws only if clock has changed - if (mpCtrlEdit && TrackIndex >= 0) - mpCtrlEdit->ReInit(mpTrack, mFromClock, mClockTicsPerPixel); -*/ +// if (mpCtrlEdit && TrackIndex >= 0) +// { +// mpCtrlEdit->ReInit(mpTrack, mFromClock, mClockTicsPerPixel); +// } + Refresh(); } @@ -1294,9 +1295,17 @@ if (IsBlack(Pitch)) { Dc.DrawRectangle(0, y, wBlack, mTrackHeight); - Dc.DrawLine(wBlack, y + mTrackHeight/2, mPianoWidth, y + mTrackHeight/2); + Dc.DrawLine( + wBlack, + y + mTrackHeight / 2, + mPianoWidth, + y + mTrackHeight / 2); Dc.SetPen(*wxWHITE_PEN); - Dc.DrawLine(wBlack + 1, y + mTrackHeight/2+1, mPianoWidth, y + mTrackHeight/2+1); + Dc.DrawLine( + wBlack + 1, + y + mTrackHeight / 2 + 1, + mPianoWidth, + y + mTrackHeight / 2 + 1); Dc.DrawLine(0, y, wBlack, y); Dc.SetPen(*wxBLACK_PEN); } @@ -1475,7 +1484,7 @@ int FromPitch = 127 - mToLine; int ToPitch = 127 - mFromLine; - // Coordinate for Linien + // Coordinate lines. int x0 = Clock2x(0); int y0 = TrackIndex2y(64); @@ -1499,17 +1508,21 @@ // y1 = TrackIndex2y(127 - pEvent->IsPlayTrack()->track); // // use pitch instead // } - // event partially visible? - if (Clock + Length >= mFromClock && FromPitch < Pitch && Pitch <= ToPitch) + + // Test to determine if the event is partially visible. + if ( + Clock + Length >= mFromClock && + FromPitch < Pitch && Pitch <= ToPitch) { int DrawLength = Length / mClockTicsPerPixel; - // do clipping ourselves + // Perform manual clipping. if (x1 < mEventsX) { DrawLength -= mEventsX - x1; x1 = mEventsX; } + // Always draw at least two pixels to avoid invisible (behind a // vertical line) or zero-length events: if (DrawLength < 3) @@ -1517,7 +1530,7 @@ DrawLength = 3; } - // show velocity as colors + // Show velocity as colors. if (!force_color && mUseColors && pEvent->IsKeyOn()) { int vel = pEvent->IsKeyOn()->GetVelocity(); @@ -1527,9 +1540,12 @@ { Dc.SetBrush(*Brush); } - // end velocity colors - Dc.DrawRectangle(x1, y1 + mLittleBit, DrawLength, mTrackHeight - 2 * mLittleBit); + Dc.DrawRectangle( + x1, + y1 + mLittleBit, + DrawLength, + mTrackHeight - 2 * mLittleBit); //shouldnt it be in drawevent? odd. if (pEvent->IsPlayTrack()) @@ -1571,8 +1587,15 @@ // Draw text labels drawn at top. int textlabely = mTopInfoHeight; - Dc.DrawRectangle(x1-textX, textlabely + mLittleBit, textX, textY);//mTrackHeight - 2 * mLittleBit); - Dc.DrawText(pEvent->IsText()->GetText(), x1-textX, textlabely + mLittleBit); + Dc.DrawRectangle( + x1 - textX, + textlabely + mLittleBit, + textX, + textY); //mTrackHeight - 2 * mLittleBit); + Dc.DrawText( + pEvent->IsText()->GetText(), + x1 - textX, + textlabely + mLittleBit); } } @@ -1915,7 +1938,7 @@ mpSnapSel->GetRectangle().x + mpSnapSel->GetRectangle().width + 1))); } - // SN++ Veloc- oder Aftertouch-Editor updaten + // Velocity or aftertouch editor update. if (mpCtrlEdit) { mpCtrlEdit->UpDate(); @@ -2016,7 +2039,9 @@ if (!mpSnapSel->IsSelected()) { if (msg == 0) + { msg = "please select some events first"; + } wxMessageBox((char *)msg, "Error", wxOK); return 0; } @@ -2181,7 +2206,7 @@ Paste(mpTrack, SnapClock(Clock), Pitch); } - // allways redraw + // always redraw Refresh(); } @@ -2349,8 +2374,8 @@ return pTrack == mpTrack; } - return ( - mpTrack->Channel == gpConfig->GetValue(C_DrumChannel)) == + return + (mpTrack->Channel == gpConfig->GetValue(C_DrumChannel)) == (pTrack->Channel == gpConfig->GetValue(C_DrumChannel)); } @@ -2438,9 +2463,10 @@ { if (pEvent->GetClock() <= Clock) { - if ((pEvent->GetClock() + pEvent->GetLength() >= Clock) - && (pEvent->GetPitch() == Pitch || Pitch == -1) - && IsVisible(pEvent)) + if ( + (pEvent->GetClock() + pEvent->GetLength() >= Clock) && + (pEvent->GetPitch() == Pitch || Pitch == -1) && + IsVisible(pEvent)) { return pEvent; } @@ -3043,7 +3069,7 @@ // Need a guitar window hint here. JZProjectManager::Instance()->UpdateAllViews(); - // SN++ Veloc- oder Aftertouch-Editor updaten + // Velocity or aftertouch editor update. if (mpCtrlEdit) { mpCtrlEdit->UpDate(); @@ -3064,7 +3090,7 @@ tKeyOn* pEvent = new tKeyOn(0, 0, 64, 64, len); mPasteBuffer.Put(pEvent); } - // SN++ + if (GetKeyOnEventCount() > 1) { // don't change Pitch @@ -3076,7 +3102,6 @@ JZEvent* pEvent = Iterator.First(); if (pEvent) { - // SN++ JZEvent *a = pEvent; while (a) { @@ -3130,7 +3155,8 @@ pEvent = Iterator.Next(); } pTrack->Cleanup(); - // SN++ Veloc- oder Aftertouch-Editor updaten + + // Velocity or aftertouch editor update. if (mpCtrlEdit) { mpCtrlEdit->UpDate(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |