Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EQ: fixes bug when changing value by double click on fader/knob #4018

Merged
merged 1 commit into from
Nov 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 6 additions & 27 deletions plugins/Eq/EqCurve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,14 @@ 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 );
setAcceptHoverEvents( true );
float totalHeight = 36;
m_pixelsPerUnitHeight = ( m_heigth ) / ( totalHeight );
setMouseHover( false );
connect( this, SIGNAL( positionChanged() ), this, SLOT( handleMoved() ) );
}


Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -189,6 +179,11 @@ void EqHandle::loadPixmap()
m_circlePixmap = PLUGIN_NAME::getIconPixmap( fileName.toLatin1() );
}

bool EqHandle::mousePressed() const
{
return m_mousePressed;
}




Expand Down Expand Up @@ -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;
Expand Down
8 changes: 1 addition & 7 deletions plugins/Eq/EqCurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand All @@ -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();

};


Expand Down
3 changes: 1 addition & 2 deletions plugins/Eq/EqParameterWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
Expand Down