Fixed #3226. Beat velocity fixes for both themes. (#3229)

* Fixed #3226. Fixed beat velocity on classic theme. Fixed visual difference between 0 velocity and no step.

* Render step_btn_on_0.png always.

* Removed useless if.
This commit is contained in:
Karmo Rosental
2017-02-03 23:35:23 +02:00
committed by Oskar Wallgren
parent 6f3a7ea857
commit 995b14f7b5
8 changed files with 24 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

View File

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

View File

@@ -186,14 +186,14 @@ protected:
private:
static QPixmap * s_stepBtnOn;
static QPixmap * s_stepBtnOverlay;
static QPixmap * s_stepBtnOn0;
static QPixmap * s_stepBtnOn200;
static QPixmap * s_stepBtnOff;
static QPixmap * s_stepBtnOffLight;
Pattern* m_pat;
QPixmap m_paintPixmap;
QStaticText m_staticTextName;
} ;

View File

@@ -51,7 +51,8 @@
#include "MainWindow.h"
QPixmap * PatternView::s_stepBtnOn = NULL;
QPixmap * PatternView::s_stepBtnOn0 = NULL;
QPixmap * PatternView::s_stepBtnOn200 = NULL;
QPixmap * PatternView::s_stepBtnOff = NULL;
QPixmap * PatternView::s_stepBtnOffLight = NULL;
@@ -608,10 +609,16 @@ PatternView::PatternView( Pattern* pattern, TrackView* parent ) :
connect( gui->pianoRoll(), SIGNAL( currentPatternChanged() ),
this, SLOT( update() ) );
if( s_stepBtnOn == NULL )
if( s_stepBtnOn0 == NULL )
{
s_stepBtnOn = new QPixmap( embed::getIconPixmap(
"step_btn_on_100" ) );
s_stepBtnOn0 = new QPixmap( embed::getIconPixmap(
"step_btn_on_0" ) );
}
if( s_stepBtnOn200 == NULL )
{
s_stepBtnOn200 = new QPixmap( embed::getIconPixmap(
"step_btn_on_200" ) );
}
if( s_stepBtnOff == NULL )
@@ -992,7 +999,8 @@ void PatternView::paintEvent( QPaintEvent * )
else if( beatPattern && ( fixedTCOs() || ppt >= 96
|| m_pat->m_steps != MidiTime::stepsPerTact() ) )
{
QPixmap stepon;
QPixmap stepon0;
QPixmap stepon200;
QPixmap stepoff;
QPixmap stepoffl;
const int steps = qMax( 1,
@@ -1000,8 +1008,12 @@ void PatternView::paintEvent( QPaintEvent * )
const int w = width() - 2 * TCO_BORDER_WIDTH;
// scale step graphics to fit the beat pattern length
stepon = s_stepBtnOn->scaled( w / steps,
s_stepBtnOn->height(),
stepon0 = s_stepBtnOn0->scaled( w / steps,
s_stepBtnOn0->height(),
Qt::IgnoreAspectRatio,
Qt::SmoothTransformation );
stepon200 = s_stepBtnOn200->scaled( w / steps,
s_stepBtnOn200->height(),
Qt::IgnoreAspectRatio,
Qt::SmoothTransformation );
stepoff = s_stepBtnOff->scaled( w / steps,
@@ -1025,8 +1037,9 @@ void PatternView::paintEvent( QPaintEvent * )
{
const int vol = n->getVolume();
p.drawPixmap( x, y, stepoffl );
p.drawPixmap( x, y, stepon0 );
p.setOpacity( sqrt( vol / 200.0 ) );
p.drawPixmap( x, y, stepon );
p.drawPixmap( x, y, stepon200 );
p.setOpacity( 1 );
}
else if( ( it / 4 ) % 2 )