From 995b14f7b56efbdf36eb7715f40e97a4c2682f0a Mon Sep 17 00:00:00 2001 From: Karmo Rosental Date: Fri, 3 Feb 2017 23:35:23 +0200 Subject: [PATCH] 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. --- data/themes/classic/step_btn_on.png | Bin 191 -> 0 bytes ...{step_btn_on_100.png => step_btn_on_0.png} | Bin data/themes/classic/step_btn_on_200.png | Bin 0 -> 171 bytes data/themes/classic/step_btn_on_yellow.png | Bin 459 -> 0 bytes data/themes/default/step_btn_on_0.png | Bin 0 -> 487 bytes ...tep_btn_on_100.png => step_btn_on_200.png} | Bin include/Pattern.h | 6 ++-- src/tracks/Pattern.cpp | 29 +++++++++++++----- 8 files changed, 24 insertions(+), 11 deletions(-) delete mode 100644 data/themes/classic/step_btn_on.png rename data/themes/classic/{step_btn_on_100.png => step_btn_on_0.png} (100%) create mode 100644 data/themes/classic/step_btn_on_200.png delete mode 100644 data/themes/classic/step_btn_on_yellow.png create mode 100644 data/themes/default/step_btn_on_0.png rename data/themes/default/{step_btn_on_100.png => step_btn_on_200.png} (100%) diff --git a/data/themes/classic/step_btn_on.png b/data/themes/classic/step_btn_on.png deleted file mode 100644 index d4d207d835df93e5a653e5c6bb1268379928805d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEX7WqAsj$Z!;#Vf2?p zp9EpX^;?ho00kvWTq8`EWIspIx diff --git a/data/themes/classic/step_btn_on_100.png b/data/themes/classic/step_btn_on_0.png similarity index 100% rename from data/themes/classic/step_btn_on_100.png rename to data/themes/classic/step_btn_on_0.png diff --git a/data/themes/classic/step_btn_on_200.png b/data/themes/classic/step_btn_on_200.png new file mode 100644 index 0000000000000000000000000000000000000000..02586b33747459078b1632a46417eae26848c51d GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkE)1d!(-=1Y+S>XPD8gCb z5m^k>aT0_X*Ka-U0~BO0@$_|Nf5^xw#%ZzP{EZbrAq!6z#}JR>$$$R;w`bO66lU&a z4FB!>*$PZ;;FmB}1etP~5$SDk-u6{1- HoD!Myxz literal 0 HcmV?d00001 diff --git a/data/themes/classic/step_btn_on_yellow.png b/data/themes/classic/step_btn_on_yellow.png deleted file mode 100644 index b69defeb97fb6966f30d2b0aac88f54ec385c734..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 459 zcmV;+0W|)JP))P z&cTN;vtD4~KfXYWZ^v=qmF4ZF>HzLq`S|*Nm-6JS3b0o>yIQ+<)W_$K16Xm{=(Dsj zto;q3bco1=I6x+zfru$8s%nZtQh>O3?n4G9ccTz3i%o7ri$2ny-UcKr#)sH$f zMrSjYwW&)}e1~&Rcb5Q}4_w-H9hX0UeF*&Y>kI`5A##59tttHbkBh+pK!^c=gD*$8 zo!xhVmy0L<{e4_92LT@ea67vk9)8AIw;kLsna_v0Fg52)2w^NmEh%r;yQ*Eyg{c6( z6396<>A=?lwS%16ytV&12!0gUHl9}kev^Yn5v_ILM+c1}D$GH^*A5y9l!#JF+}z$) zCAW#FFcl!i)V$=vRDcv?^N0#_5U65FjUpkrNx|YAK}_W!M`p9rrgw7A dabv1Y*E9XP%UDnmA4C8E002ovPDHLkV1m;I&VT>_ literal 0 HcmV?d00001 diff --git a/data/themes/default/step_btn_on_100.png b/data/themes/default/step_btn_on_200.png similarity index 100% rename from data/themes/default/step_btn_on_100.png rename to data/themes/default/step_btn_on_200.png diff --git a/include/Pattern.h b/include/Pattern.h index cb5464539da..947f26d11f0 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -186,14 +186,14 @@ protected slots: 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; } ; diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 2266e512f04..86766b11299 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -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 )