From: <man...@us...> - 2013-04-10 21:22:58
|
Revision: 1823 http://sourceforge.net/p/modplug/code/1823 Author: manxorist Date: 2013-04-10 21:22:51 +0000 (Wed, 10 Apr 2013) Log Message: ----------- [Fix] Resetting clipping indicator in global vu-meter was broken in r1821. Revision Links: -------------- http://sourceforge.net/p/modplug/code/1821 Modified Paths: -------------- trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Mainbar.h Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-10 20:58:48 UTC (rev 1822) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2013-04-10 21:22:51 UTC (rev 1823) @@ -1175,7 +1175,9 @@ pen += NUM_VUMETER_PENS; bool draw = redraw || (v < lastV[index] && v<=rx && rx<=lastV[index]) || (lastV[index] < v && lastV[index]<=rx && rx<=v); + draw = draw || (last && clip != lastClip[index]); if(draw) dc.FillSolidRect(rx, rect. top, 1, rect.Height(), CMainFrame::gcolrefVuMeter[pen]); + if(last) lastClip[index] = clip; } lastV[index] = v; } else @@ -1194,7 +1196,9 @@ pen += NUM_VUMETER_PENS; bool draw = redraw || (v < lastV[index] && v<=ry && ry<=lastV[index]) || (lastV[index] < v && lastV[index]<=ry && ry<=v); + draw = draw || (last && clip != lastClip[index]); if(draw) dc.FillSolidRect(rect.left, ry, rect.Width(), 1, CMainFrame::gcolrefVuMeter[pen]); + if(last) lastClip[index] = clip; } lastV[index] = v; } Modified: trunk/OpenMPT/mptrack/Mainbar.h =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.h 2013-04-10 20:58:48 UTC (rev 1822) +++ trunk/OpenMPT/mptrack/Mainbar.h 2013-04-10 21:22:51 UTC (rev 1823) @@ -18,10 +18,11 @@ uint32 vuMeter[2]; DWORD lastVuUpdateTime; int lastV[2]; + bool lastClip[2]; bool horizontal; public: - CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; lastV[0] = lastV[1] = 0; } + CStereoVU() { vuMeter[0] = vuMeter[1] = 0; lastVuUpdateTime = timeGetTime(); horizontal = true; lastV[0] = lastV[1] = 0; lastClip[0] = lastClip[1] = false; } void SetVuMeter(uint32 left, uint32 right, bool force=false); void SetOrientation(bool h) { horizontal = h; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |