73 painter->setRenderHint( QPainter::Antialiasing );
76 brush.setStyle(Qt::TexturePattern);
77 painter->setBrush(brush);
78 painter->drawRect(0, 0, width(), height());
81 painter->setPen( QColor( 102, 150, 205 ) );
82 int VCenter = height() / 2;
83 for (
int x = 0; x < width(); x++ ) {
84 painter->drawLine( x, VCenter, x,
m_pPeakData[x] + VCenter );
85 painter->drawLine( x, VCenter, x, -
m_pPeakData[x] + VCenter );
90 QFont font( pPref->getApplicationFontFamily(),
getPointSize( pPref->getFontSize() ) );
91 font.setWeight( QFont::Bold );
92 painter->setFont( font );
93 painter->setPen( QColor( 255 , 255, 255, 200 ) );
115 int currentWidth = width();
117 if(!pLayer || currentWidth <= 0){
132 if ( pLayer && pLayer->get_sample() ) {
138 int nSampleLength = pLayer->get_sample()->get_frames();
141 float fGain = height() / 2.0 * pLayer->get_gain();
143 auto pSampleData = pLayer->get_sample()->get_data_l();
147 for (
int i = 0; i < width(); ++i ){
149 for (
int j = 0; j < nScaleFactor; ++j ) {
150 if ( j < nSampleLength ) {
151 int newVal = (int)( pSampleData[ nSamplePos ] * fGain );
152 if ( newVal > nVal ) {