MuseScore  3.4
Music composition and notation
mslider.h
Go to the documentation of this file.
1 //=============================================================================
2 // Awl
3 // Audio Widget Library
4 //
5 // Copyright (C) 2002-2006 by Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __AWLMSLIDER_H__
21 #define __AWLMSLIDER_H__
22 
23 #include "volslider.h"
24 
25 namespace Awl {
26 
27 //---------------------------------------------------------
28 // MeterSlider
29 // volume slider with meter display
30 //---------------------------------------------------------
31 
32 class MeterSlider : public VolSlider
33  {
34  Q_PROPERTY(int meterWidth READ meterWidth WRITE setMeterWidth)
35  Q_PROPERTY(int channel READ channel WRITE setChannel)
36  Q_OBJECT
37 
38  int _channel;
39  std::vector<double> meterval;
40  std::vector<double> meterPeak;
43  QPixmap onPm, offPm; // cached pixmap values
44 
45  virtual void mousePressEvent(QMouseEvent*);
46  virtual void paintEvent(QPaintEvent*);
47  virtual void resizeEvent(QResizeEvent*);
48 
49  signals:
50  void meterClicked();
51 
52  public slots:
53  void resetPeaks();
54  void setMeterVal(int channel, double value, double peak);
55 
56  public:
57  MeterSlider(QWidget* parent = 0);
58  void setChannel(int n);
59  int channel() const { return _channel; }
60  int meterWidth() const { return _meterWidth; }
61  void setMeterWidth(int v) { _meterWidth = v; }
62  virtual QSize sizeHint() const;
63  };
64 }
65 
66 #endif
67 
void resetPeaks()
Definition: mslider.cpp:95
std::vector< double > meterval
Definition: mslider.h:39
int channel() const
Definition: mslider.h:59
int _channel
Definition: mslider.h:38
virtual void paintEvent(QPaintEvent *)
Definition: mslider.cpp:164
void setMeterVal(int channel, double value, double peak)
Definition: mslider.cpp:72
virtual QSize sizeHint() const
Definition: mslider.cpp:47
QPixmap offPm
Definition: mslider.h:43
int yellowScale
Definition: mslider.h:41
virtual void resizeEvent(QResizeEvent *)
Definition: mslider.cpp:106
void setChannel(int n)
Definition: mslider.cpp:57
int meterWidth() const
Definition: mslider.h:60
int redScale
Definition: mslider.h:41
Volume Slider entry widget.
Definition: volslider.h:38
virtual void mousePressEvent(QMouseEvent *)
Definition: mslider.cpp:268
void setMeterWidth(int v)
Definition: mslider.h:61
std::vector< double > meterPeak
Definition: mslider.h:40
Definition: aslider.cpp:23
Definition: mslider.h:32
int _meterWidth
Definition: mslider.h:42
virtual double value() const
Definition: volslider.cpp:66
QPixmap onPm
Definition: mslider.h:43