Chris@132: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@132: Chris@132: /* Chris@132: Sonic Visualiser Chris@132: An audio file viewer and annotation editor. Chris@132: Centre for Digital Music, Queen Mary, University of London. Chris@132: This file copyright 2006 Chris Cannam. Chris@132: Chris@132: This program is free software; you can redistribute it and/or Chris@132: modify it under the terms of the GNU General Public License as Chris@132: published by the Free Software Foundation; either version 2 of the Chris@132: License, or (at your option) any later version. See the file Chris@132: COPYING included with this distribution for more information. Chris@132: */ Chris@132: Chris@132: #ifndef _THUMBWHEEL_H_ Chris@132: #define _THUMBWHEEL_H_ Chris@132: Chris@132: #include Chris@132: Chris@132: class Thumbwheel : public QWidget Chris@132: { Chris@132: Q_OBJECT Chris@132: Chris@132: public: Chris@133: Thumbwheel(Qt::Orientation orientation, QWidget *parent = 0); Chris@132: virtual ~Thumbwheel(); Chris@132: Chris@133: int getMinimumValue() const; Chris@133: int getMaximumValue() const; Chris@133: int getDefaultValue() const; Chris@132: float getSpeed() const; Chris@132: bool getTracking() const; Chris@132: bool getShowScale() const; Chris@132: int getValue() const; Chris@132: Chris@132: virtual void mousePressEvent(QMouseEvent *e); Chris@132: virtual void mouseDoubleClickEvent(QMouseEvent *e); Chris@132: virtual void mouseMoveEvent(QMouseEvent *e); Chris@132: virtual void mouseReleaseEvent(QMouseEvent *e); Chris@132: virtual void wheelEvent(QWheelEvent *e); Chris@132: virtual void paintEvent(QPaintEvent *e); Chris@132: Chris@132: QSize sizeHint() const; Chris@132: Chris@132: signals: Chris@132: void valueChanged(int); Chris@132: Chris@133: public slots: Chris@133: void setMinimumValue(int min); Chris@133: void setMaximumValue(int max); Chris@133: void setDefaultValue(int deft); Chris@133: void setSpeed(float speed); Chris@133: void setTracking(bool tracking); Chris@133: void setShowScale(bool show); Chris@133: void setValue(int value); Chris@133: void resetToDefault(); Chris@133: Chris@132: private: Chris@132: int m_min; Chris@132: int m_max; Chris@132: int m_default; Chris@132: int m_value; Chris@165: float m_rotation; Chris@132: Qt::Orientation m_orientation; Chris@132: float m_speed; Chris@132: bool m_tracking; Chris@132: bool m_showScale; Chris@132: bool m_clicked; Chris@133: bool m_atDefault; Chris@132: QPoint m_clickPos; Chris@165: float m_clickRotation; Chris@132: }; Chris@132: Chris@132: #endif