Mercurial > hg > svgui
comparison widgets/LevelPanToolButton.h @ 929:20698aa6a517 tonioni
Introduce level/pan toolbar buttons
author | Chris Cannam |
---|---|
date | Wed, 25 Mar 2015 10:33:19 +0000 |
parents | |
children | 86df7de08e03 |
comparison
equal
deleted
inserted
replaced
928:3fb91da7d98d | 929:20698aa6a517 |
---|---|
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 void setImageSize(int pixels); | |
37 | |
38 public slots: | |
39 /// Set level in the range [0,1] -- will be rounded | |
40 void setLevel(float); | |
41 | |
42 /// Set pan in the range [-1,1] -- will be rounded | |
43 void setPan(float); | |
44 | |
45 /// Redraw icon for toolbar button based on level-pan widget contents | |
46 void redraw(); | |
47 | |
48 signals: | |
49 void levelChanged(float); | |
50 void panChanged(float); | |
51 | |
52 protected: | |
53 LevelPanWidget *m_lpw; | |
54 int m_pixels; | |
55 }; | |
56 | |
57 #endif |