diff --git a/plugins/Eq/EqCurve.cpp b/plugins/Eq/EqCurve.cpp index 24a560b1556..5d669b04ac4 100644 --- a/plugins/Eq/EqCurve.cpp +++ b/plugins/Eq/EqCurve.cpp @@ -32,8 +32,7 @@ EqHandle::EqHandle( int num, int x, int y ): m_width( x ), m_heigth( y ), m_mousePressed( false ), - m_active( false ), - m_handleMoved( false ) + m_active( false ) { setFlag( ItemIsMovable ); setFlag( ItemSendsGeometryChanges ); @@ -41,7 +40,6 @@ EqHandle::EqHandle( int num, int x, int y ): float totalHeight = 36; m_pixelsPerUnitHeight = ( m_heigth ) / ( totalHeight ); setMouseHover( false ); - connect( this, SIGNAL( positionChanged() ), this, SLOT( handleMoved() ) ); } @@ -93,14 +91,6 @@ float EqHandle::yPixelToGain(float y , int h, float pixelPerUnitHeight ) -void EqHandle::handleMoved() -{ - m_handleMoved = true; -} - - - - void EqHandle::paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ) { painter->setRenderHint( QPainter::Antialiasing, true ); @@ -189,6 +179,11 @@ void EqHandle::loadPixmap() m_circlePixmap = PLUGIN_NAME::getIconPixmap( fileName.toLatin1() ); } +bool EqHandle::mousePressed() const +{ + return m_mousePressed; +} + @@ -463,22 +458,6 @@ void EqHandle::setHandleActive( bool a ) -void EqHandle::setHandleMoved( bool a ) -{ - m_handleMoved = a; -} - - - - -bool EqHandle::getHandleMoved() -{ - return m_handleMoved; -} - - - - void EqHandle::sethp12() { m_hp12 = true; diff --git a/plugins/Eq/EqCurve.h b/plugins/Eq/EqCurve.h index 52e39a520bd..58dfa2ac92b 100644 --- a/plugins/Eq/EqCurve.h +++ b/plugins/Eq/EqCurve.h @@ -71,8 +71,7 @@ class EqHandle : public QGraphicsObject void setMouseHover( bool d ); bool isActiveHandle(); void setHandleActive( bool a ); - void setHandleMoved(bool a); - bool getHandleMoved(); + bool mousePressed() const; void sethp12(); void sethp24(); void sethp48(); @@ -95,7 +94,6 @@ class EqHandle : public QGraphicsObject private: double calculateGain( const double freq, const double a1, const double a2, const double b0, const double b1, const double b2 ); void loadPixmap(); - float m_pixelsPerUnitWidth; float m_pixelsPerUnitHeight; float m_scale; @@ -111,11 +109,7 @@ class EqHandle : public QGraphicsObject float m_resonance; bool m_mousePressed; bool m_active; - bool m_handleMoved; QPixmap m_circlePixmap; -private slots: - void handleMoved(); - }; diff --git a/plugins/Eq/EqParameterWidget.cpp b/plugins/Eq/EqParameterWidget.cpp index 4ccdfbb2fa3..be2174a2b36 100644 --- a/plugins/Eq/EqParameterWidget.cpp +++ b/plugins/Eq/EqParameterWidget.cpp @@ -104,7 +104,7 @@ void EqParameterWidget::updateHandle() m_eqcurve->setModelChanged( true ); for( int i = 0 ; i < bandCount(); i++ ) { - if ( m_handleList->at( i )->getHandleMoved() == false ) //prevents a short circuit between handle and data model + if ( !m_handleList->at( i )->mousePressed() ) //prevents a short circuit between handle and data model { //sets the band on active if a fader or a knob is moved bool hover = false; // prevents an action if handle is moved @@ -126,7 +126,6 @@ void EqParameterWidget::updateHandle() else { m_handleList->at( i )->setHandleActive( m_bands[i].active->value() ); - m_handleList->at( i )->setHandleMoved( false ); } } if ( m_bands[0].hp12->value() ) m_handleList->at( 0 )->sethp12();