diff options
author | be_ <be.0@gmx.com> | 2017-03-05 22:01:59 -0600 |
---|---|---|
committer | be_ <be.0@gmx.com> | 2017-03-05 22:01:59 -0600 |
commit | 03557a7a6d2a6717389035fa97a08dd7744d101f (patch) | |
tree | 9539bda8a7fc7e6d5eb893d05fafdf8a7d50f08a | |
parent | 6226e1453ee884046dd098104f2038b9f3eebf35 (diff) |
show DlgCoverArtFullSize on spinny right click
This will allow skins to make the DlgCoverArtFullSize feature available
without needing space for both WCoverArt and WSpinny
-rw-r--r-- | src/widget/wspinny.cpp | 58 | ||||
-rw-r--r-- | src/widget/wspinny.h | 3 |
2 files changed, 35 insertions, 26 deletions
diff --git a/src/widget/wspinny.cpp b/src/widget/wspinny.cpp index 06b770886a..fc792dcb3f 100644 --- a/src/widget/wspinny.cpp +++ b/src/widget/wspinny.cpp @@ -59,7 +59,8 @@ WSpinny::WSpinny(QWidget* parent, const QString& group, m_dRotationsPerSecond(0.), m_bClampFailedWarning(false), m_bGhostPlayback(false), - m_bWidgetDirty(false) { + m_bWidgetDirty(false), + m_pDlgCoverArt(new DlgCoverArtFullSize()) { #ifdef __VINYLCONTROL__ m_pVCManager = pVCMan; #endif @@ -540,38 +541,43 @@ void WSpinny::mouseMoveEvent(QMouseEvent * e) { } void WSpinny::mousePressEvent(QMouseEvent * e) { - int y = e->y(); - int x = e->x(); - - m_iStartMouseX = x; - m_iStartMouseY = y; - - //don't do anything if vinyl control is active - if (m_bVinylActive) { + if (m_pDlgCoverArt->isVisible()) { + m_pDlgCoverArt->close(); return; } - if (e->button() == Qt::LeftButton || e->button() == Qt::RightButton) { - QApplication::setOverrideCursor(QCursor(Qt::ClosedHandCursor)); - - // Coordinates from center of widget - double c_x = x - width()/2; - double c_y = y - height()/2; - double theta = (180.0/M_PI)*atan2(c_x, -c_y); - m_dPrevTheta = theta; - m_iFullRotations = calculateFullRotations(m_pPlayPos->get()); - theta += m_iFullRotations * 360.0; - m_dInitialPos = calculatePositionFromAngle(theta) * m_pTrackSamples->get(); + if (e->button() == Qt::LeftButton) { + int y = e->y(); + int x = e->x(); - m_pScratchPos->set(0); - m_pScratchToggle->set(1.0); + m_iStartMouseX = x; + m_iStartMouseY = y; - if (e->button() == Qt::RightButton) { - m_pSlipEnabled->set(1.0); + //don't do anything if vinyl control is active + if (m_bVinylActive) { + return; } - // Trigger a mouse move to immediately line up the vinyl with the cursor - mouseMoveEvent(e); + if (e->button() == Qt::LeftButton || e->button() == Qt::RightButton) { + QApplication::setOverrideCursor(QCursor(Qt::ClosedHandCursor)); + + // Coordinates from center of widget + double c_x = x - width()/2; + double c_y = y - height()/2; + double theta = (180.0/M_PI)*atan2(c_x, -c_y); + m_dPrevTheta = theta; + m_iFullRotations = calculateFullRotations(m_pPlayPos->get()); + theta += m_iFullRotations * 360.0; + m_dInitialPos = calculatePositionFromAngle(theta) * m_pTrackSamples->get(); + + m_pScratchPos->set(0); + m_pScratchToggle->set(1.0); + + // Trigger a mouse move to immediately line up the vinyl with the cursor + mouseMoveEvent(e); + } + } else if (m_bShowCover) { + m_pDlgCoverArt->init(m_loadedCover); } } diff --git a/src/widget/wspinny.h b/src/widget/wspinny.h index ae3d3f0b7d..4ee2dcb44d 100644 --- a/src/widget/wspinny.h +++ b/src/widget/wspinny.h @@ -7,6 +7,7 @@ #include <QHideEvent> #include <QEvent> +#include "library/dlgcoverartfullsize.h" #include "preferences/usersettings.h" #include "skin/skincontext.h" #include "track/track.h" @@ -119,6 +120,8 @@ class WSpinny : public QGLWidget, public WBaseWidget, public VinylSignalQualityL bool m_bClampFailedWarning; bool m_bGhostPlayback; bool m_bWidgetDirty; + + DlgCoverArtFullSize* m_pDlgCoverArt; }; #endif //_WSPINNY_H |