1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 07:59:27 +02:00

Get rid of flicker when drawing the peak/rms meter.

This commit is contained in:
lllucius 2014-10-04 22:50:51 +00:00
parent 2c76f78760
commit 6ce364f2d2
2 changed files with 4 additions and 4 deletions

View File

@ -43,6 +43,7 @@
#include <wx/defs.h>
#include <wx/dialog.h>
#include <wx/dcbuffer.h>
#include <wx/dcmemory.h>
#include <wx/image.h>
#include <wx/intl.h>
@ -1129,9 +1130,10 @@ void Meter::RepaintBarsNow()
if (mLayoutValid)
{
wxClientDC dc(this);
wxBufferedDC bufDC(&dc, *mBitmap);
for (int i = 0; i < mNumBars; i++)
{
DrawMeterBar(dc, &mBar[i]);
DrawMeterBar(bufDC, &mBar[i]);
}
}
}
@ -1213,7 +1215,6 @@ void Meter::DrawMeterBar(wxDC &dc, MeterBar *meterBar)
if (meterBar->vert)
{
// Calculate the peak and rms rectangles
// (+1 and -1 to not overlay the bevel)
ht = (int)(meterBar->peak * h + 0.5);
r = wxRect(x, y + h - ht, w, ht);
ht = (int)(meterBar->rms * h + 0.5);

View File

@ -25,7 +25,7 @@
#include "Ruler.h"
// Event used to notify all meters of preference changes
DECLARE_EVENT_TYPE(EVT_METER_PREFERENCES_CHANGED, -1);
DECLARE_EXPORTED_EVENT_TYPE(AUDACITY_DLL_API, EVT_METER_PREFERENCES_CHANGED, -1);
// Increase this when we add support for multichannel meters
// (most of the code is already there)
@ -43,7 +43,6 @@ struct MeterBar {
bool isclipping; //ANSWER-ME: What's the diff between these bools?! "clipping" vs "isclipping" is not clear.
int tailPeakCount;
float peakPeakHold;
wxBitmap bitmap;
};
class MeterUpdateMsg