~mixxxdevelopers/mixxx/engine-control-refactor

« back to all changes in this revision

Viewing changes to mixxx/src/widget/woverview.h

  • Committer: RJ Ryan
  • Date: 2013-06-04 00:41:29 UTC
  • mfrom: (2890.22.101 mixxx)
  • Revision ID: rryan@mixxx.org-20130604004129-8jjxkicsb3givu4a
MergingĀ fromĀ lp:mixxx.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
class WOverview : public WWidget
37
37
{
38
38
    Q_OBJECT
39
 
public:
 
39
  public:
40
40
    WOverview(const char* pGroup, ConfigObject<ConfigValue>* pConfig, QWidget *parent=NULL);
41
41
    virtual ~WOverview();
42
42
    void setup(QDomNode node);
43
43
 
44
 
    QColor getMarkerColor();
45
 
 
46
 
protected:
 
44
  protected:
47
45
    void mouseMoveEvent(QMouseEvent *e);
48
46
    void mouseReleaseEvent(QMouseEvent *e);
49
47
    void mousePressEvent(QMouseEvent *e);
50
48
    void paintEvent(QPaintEvent *);
51
 
    void timerEvent(QTimerEvent *);
52
49
    void resizeEvent(QResizeEvent *);
53
50
 
54
 
public slots:
 
51
  public slots:
55
52
    void setValue(double);
56
 
 
57
53
    void slotLoadNewTrack(TrackPointer pTrack);
 
54
    void slotTrackLoaded(TrackPointer pTrack);
58
55
    void slotUnloadTrack(TrackPointer pTrack);
59
56
 
60
 
signals:
 
57
  signals:
61
58
    void trackDropped(QString filename, QString group);
62
59
 
63
 
protected:
 
60
  protected:
64
61
    virtual void dragEnterEvent(QDragEnterEvent* event);
65
62
    virtual void dropEvent(QDropEvent* event);
66
63
 
67
 
private slots:
68
 
    void onTotalGainChange(double v);
 
64
  private slots:
69
65
    void onEndOfTrackChange(double v);
70
66
 
71
67
    void onMarkChanged(double v);
72
68
    void onMarkRangeChange(double v);
73
69
 
74
70
    void slotWaveformSummaryUpdated();
 
71
    void slotAnalyserProgress(int progress);
75
72
 
76
73
  private:
77
74
    /** append the waveform overview pixmap according to available data in waveform */
78
75
    bool drawNextPixmapPart();
79
 
    inline int valueToPosition( float value) const {
80
 
        return floor(m_a * value + m_b + 0.5);
81
 
    }
82
 
    inline double positionToValue( int position) const {
83
 
        return (float(position) - m_b) / m_a;
84
 
    }
85
 
 
86
 
    const char* m_pGroup;
 
76
    void paintText(const QString &text, QPainter *painter);
 
77
    inline int valueToPosition(float value) const {
 
78
        return (int)(m_a * value - m_b + 0.5);
 
79
    }
 
80
    inline double positionToValue(int position) const {
 
81
        return ((float)position + m_b) / m_a;
 
82
 
 
83
    }
 
84
 
 
85
    const QString m_pGroup;
87
86
    ConfigObject<ConfigValue>* m_pConfig;
88
 
    ControlObjectThreadMain* m_totalGainControl;
89
 
    double m_totalGain;
90
87
    ControlObjectThreadMain* m_endOfTrackControl;
91
88
    double m_endOfTrack;
92
89
    ControlObjectThreadMain* m_trackSamplesControl;
 
90
    ControlObjectThreadMain* m_playControl;
93
91
 
94
 
    Waveform* m_waveform;
95
 
    QPixmap m_waveformPixmap;
 
92
    Waveform* m_pWaveform;
 
93
    QImage* m_pWaveformSourceImage;
 
94
    QImage m_waveformImageScaled;
96
95
 
97
96
    bool m_pixmapDone;
98
97
    float m_waveformPeak;
99
98
 
100
99
    /** Hold the last visual sample processed to generate the pixmap*/
101
100
    int m_actualCompletion;
102
 
    double m_visualSamplesByPixel;
103
 
    int m_renderSampleLimit;
104
 
 
105
 
    int m_timerPixmapRefresh;
106
101
 
107
102
    // Current active track
108
103
    TrackPointer m_pCurrentTrack;
110
105
    /** True if slider is dragged. Only used when m_bEventWhileDrag is false */
111
106
    bool m_bDrag;
112
107
    /** Internal storage of slider position in pixels */
113
 
    int m_iPos, m_iStartMousePos;
 
108
    int m_iPos;
114
109
 
115
110
    QPixmap m_backgroundPixmap;
116
111
    QString m_backgroundPixmapPath;
117
112
    QColor m_qColorBackground;
118
 
    QColor m_qColorMarker;
119
113
    QColor m_endOfTrackColor;
120
114
 
121
115
    WaveformSignalColors m_signalColors;
125
119
    /** coefficient value-position linear transposition */
126
120
    float m_a;
127
121
    float m_b;
 
122
 
 
123
    int m_analyserProgress; // in 0.1%
 
124
    bool m_trackLoaded;
 
125
    int m_diffGain;
128
126
};
129
127
 
130
128
#endif