Chris@929: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@929: Chris@929: /* Chris@929: Sonic Visualiser Chris@929: An audio file viewer and annotation editor. Chris@929: Centre for Digital Music, Queen Mary, University of London. Chris@929: Chris@929: This program is free software; you can redistribute it and/or Chris@929: modify it under the terms of the GNU General Public License as Chris@929: published by the Free Software Foundation; either version 2 of the Chris@929: License, or (at your option) any later version. See the file Chris@929: COPYING included with this distribution for more information. Chris@929: */ Chris@929: Chris@929: #ifndef LEVEL_PAN_TOOLBUTTON_H Chris@929: #define LEVEL_PAN_TOOLBUTTON_H Chris@929: Chris@929: #include Chris@929: Chris@929: class LevelPanWidget; Chris@929: Chris@929: class LevelPanToolButton : public QToolButton Chris@929: { Chris@929: Q_OBJECT Chris@929: Chris@929: public: Chris@929: LevelPanToolButton(QWidget *parent = 0); Chris@929: ~LevelPanToolButton(); Chris@929: Chris@929: /// Return level as a gain value in the range [0,1] Chris@929: float getLevel() const; Chris@929: Chris@929: /// Return pan as a value in the range [-1,1] Chris@929: float getPan() const; Chris@929: Chris@929: void setImageSize(int pixels); Chris@929: Chris@929: public slots: Chris@929: /// Set level in the range [0,1] -- will be rounded Chris@929: void setLevel(float); Chris@929: Chris@929: /// Set pan in the range [-1,1] -- will be rounded Chris@929: void setPan(float); Chris@929: Chris@929: /// Redraw icon for toolbar button based on level-pan widget contents Chris@929: void redraw(); Chris@929: Chris@929: signals: Chris@929: void levelChanged(float); Chris@929: void panChanged(float); Chris@929: Chris@929: protected: Chris@929: LevelPanWidget *m_lpw; Chris@929: int m_pixels; Chris@929: }; Chris@929: Chris@929: #endif