Mercurial > hg > svgui
comparison widgets/LevelPanToolButton.h @ 946:36cddc3de023 alignment_view
Merge from default branch
| author | Chris Cannam |
|---|---|
| date | Mon, 20 Apr 2015 09:19:52 +0100 |
| parents | fcbfc7fad1f2 |
| children | 6a6a63506e3f |
comparison
equal
deleted
inserted
replaced
| 897:499b637f2a26 | 946:36cddc3de023 |
|---|---|
| 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
| 2 | |
| 3 /* | |
| 4 Sonic Visualiser | |
| 5 An audio file viewer and annotation editor. | |
| 6 Centre for Digital Music, Queen Mary, University of London. | |
| 7 | |
| 8 This program is free software; you can redistribute it and/or | |
| 9 modify it under the terms of the GNU General Public License as | |
| 10 published by the Free Software Foundation; either version 2 of the | |
| 11 License, or (at your option) any later version. See the file | |
| 12 COPYING included with this distribution for more information. | |
| 13 */ | |
| 14 | |
| 15 #ifndef LEVEL_PAN_TOOLBUTTON_H | |
| 16 #define LEVEL_PAN_TOOLBUTTON_H | |
| 17 | |
| 18 #include <QToolButton> | |
| 19 | |
| 20 class LevelPanWidget; | |
| 21 | |
| 22 class LevelPanToolButton : public QToolButton | |
| 23 { | |
| 24 Q_OBJECT | |
| 25 | |
| 26 public: | |
| 27 LevelPanToolButton(QWidget *parent = 0); | |
| 28 ~LevelPanToolButton(); | |
| 29 | |
| 30 /// Return level as a gain value in the range [0,1] | |
| 31 float getLevel() const; | |
| 32 | |
| 33 /// Return pan as a value in the range [-1,1] | |
| 34 float getPan() const; | |
| 35 | |
| 36 /// Discover whether the level range includes muting or not | |
| 37 bool includesMute() const; | |
| 38 | |
| 39 void setImageSize(int pixels); | |
| 40 | |
| 41 void setBigImageSize(int pixels); | |
| 42 | |
| 43 public slots: | |
| 44 /// Set level in the range [0,1] -- will be rounded | |
| 45 void setLevel(float); | |
| 46 | |
| 47 /// Set pan in the range [-1,1] -- will be rounded | |
| 48 void setPan(float); | |
| 49 | |
| 50 /// Specify whether the level range should include muting or not | |
| 51 void setIncludeMute(bool); | |
| 52 | |
| 53 void setEnabled(bool enabled); | |
| 54 | |
| 55 signals: | |
| 56 void levelChanged(float); | |
| 57 void panChanged(float); | |
| 58 | |
| 59 private slots: | |
| 60 void selfLevelChanged(float); | |
| 61 void selfClicked(); | |
| 62 | |
| 63 protected: | |
| 64 void paintEvent(QPaintEvent *); | |
| 65 | |
| 66 LevelPanWidget *m_lpw; | |
| 67 int m_pixels; | |
| 68 int m_pixelsBig; | |
| 69 bool m_muted; | |
| 70 float m_savedLevel; | |
| 71 }; | |
| 72 | |
| 73 #endif |
