File tree Expand file tree Collapse file tree 3 files changed +27
-5
lines changed
Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ struct MovingTarget
3131 int32_t _targetFastG;
3232 int32_t _targetFastB;
3333 int32_t _targetFastCounter;
34+
35+ void Clear ();
3436};
3537
3638class AnimationBaseMusic : public AnimationBase
Original file line number Diff line number Diff line change @@ -26,3 +26,23 @@ void AnimationBaseMusic::restore(MovingTarget* target) {
2626 memcpy (target, &_myTarget, sizeof (_myTarget));
2727};
2828
29+ void MovingTarget::Clear ()
30+ {
31+ _averageColor = QColor (0 , 0 , 0 );
32+ _fastColor = QColor (0 , 0 , 0 );
33+ _slowColor = QColor (0 , 0 , 0 );
34+ _targetAverageR = 0 ;
35+ _targetAverageG = 0 ;
36+ _targetAverageB = 0 ;
37+ _targetAverageCounter = 0 ;
38+ _targetSlowR = 0 ;
39+ _targetSlowG = 0 ;
40+ _targetSlowB = 0 ;
41+ _targetSlowCounter = 0 ;
42+ _targetFastR = 0 ;
43+ _targetFastG = 0 ;
44+ _targetFastB = 0 ;
45+ _targetFastCounter = 0 ;
46+ };
47+
48+
Original file line number Diff line number Diff line change @@ -462,9 +462,9 @@ void SoundCaptureResult::Smooth()
462462 color[i].getRgb (&rr, &gg, &bb);
463463
464464
465- r += std::max ((rr * (_currentMax - 6 *(_currentMax - buffScaledResult[i])))/_currentMax,0 );
466- g += std::max ((gg * (_currentMax - 6 *(_currentMax - buffScaledResult[i])))/_currentMax,0 );
467- b += std::max ((bb * (_currentMax - 6 *(_currentMax - buffScaledResult[i])))/_currentMax,0 );
465+ r += std::max ((rr * (_currentMax - 5 *(_currentMax - buffScaledResult[i])))/_currentMax,0 );
466+ g += std::max ((gg * (_currentMax - 5 *(_currentMax - buffScaledResult[i])))/_currentMax,0 );
467+ b += std::max ((bb * (_currentMax - 5 *(_currentMax - buffScaledResult[i])))/_currentMax,0 );
468468 }
469469
470470 int32_t ccScale = std::max (std::max (r, g), b);
@@ -681,8 +681,8 @@ void SoundCaptureResult::ResetData()
681681 _currentMax = 0 ;
682682
683683
684- memset (& mtWorking, 0 , sizeof (mtWorking) );
685- memset (& mtInternal, 0 , sizeof (mtInternal) );
684+ mtWorking. Clear ( );
685+ mtInternal. Clear ( );
686686}
687687
688688void SoundCaptureResult::GetBufResult (uint8_t * dest, size_t size) {
You can’t perform that action at this time.
0 commit comments