~mixxxdevelopers/mixxx/atomic-co

« back to all changes in this revision

Viewing changes to mixxx/src/vinylcontrol/vinylcontrolsignalwidget.h

  • Committer: Daniel Schürmann
  • Date: 2013-05-23 21:29:35 UTC
  • mfrom: (3332.1.70 mixxx)
  • Revision ID: daschuer@mixxx.org-20130523212935-e04eohxt8yb86br0
merged from lp:mixxx

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *      Author: asantoni
6
6
 */
7
7
 
8
 
#ifndef VINYLCONTROLSIGNALWIDGET_H_
9
 
#define VINYLCONTROLSIGNALWIDGET_H_
 
8
#ifndef VINYLCONTROLSIGNALWIDGET_H
 
9
#define VINYLCONTROLSIGNALWIDGET_H
10
10
 
11
11
#include <QtGui>
12
12
#include <QPainter>
13
13
#include <QTimerEvent>
14
14
 
15
 
class VinylControlProxy;
16
 
 
17
 
enum VinylControlSignalType {
18
 
    VINYLCONTROL_SIGQUALITY = 0,
19
 
    VINYLCONTROL_SIGLEFTCHANNEL,
20
 
    VINYLCONTROL_SIGRIGHTCHANNEL,
21
 
    VINYLCONTROL_SIGTYPE_NUM
22
 
};
23
 
 
24
 
class VinylControlSignalWidget : public QWidget
25
 
{
 
15
#include "vinylcontrol/vinylsignalquality.h"
 
16
 
 
17
class VinylControlSignalWidget : public QWidget, public VinylSignalQualityListener {
26
18
    Q_OBJECT
27
 
public:
 
19
  public:
28
20
    VinylControlSignalWidget();
29
21
    VinylControlSignalWidget(int size);
30
 
    ~VinylControlSignalWidget();
31
 
    void setVinylControlProxy(VinylControlProxy* vc);
 
22
    virtual ~VinylControlSignalWidget();
 
23
 
 
24
    void onVinylSignalQualityUpdate(const VinylSignalQualityReport& report);
 
25
 
32
26
    void paintEvent(QPaintEvent* event);
 
27
    void setVinylInput(int input);
33
28
    void setSize(int size);
34
29
    void setVinylActive(bool active);
35
30
 
36
31
    void resetWidget();
37
 
    void startDrawing();
38
 
    void stopDrawing();
39
 
 
40
 
public slots:
41
 
    void invalidateVinylControl();
42
 
 
43
 
protected:
44
 
    void timerEvent(QTimerEvent* event);
45
 
 
46
 
private:
47
 
    QMutex m_controlLock;
48
 
    VinylControlProxy* m_pVinylControl;
49
 
 
50
 
    float m_fRMSvolumeSum[VINYLCONTROL_SIGTYPE_NUM];
51
 
    float m_fRMSvolume[VINYLCONTROL_SIGTYPE_NUM];
52
 
    long m_samplesCalculated[VINYLCONTROL_SIGTYPE_NUM];
53
 
 
54
 
    int m_iTimerId;
 
32
 
 
33
  private:
 
34
    int m_iVinylInput;
55
35
    int m_iSize;
56
36
 
57
37
    QImage m_qImage;
61
41
    bool m_bVinylActive;
62
42
};
63
43
 
64
 
#endif /* VINYLCONTROLSIGNALWIDGET_H_ */
 
44
#endif /* VINYLCONTROLSIGNALWIDGET_H */