]> git.sesse.net Git - kdenlive/blob - src/waveform.h
3e385012257a2eaa3fa9fb33997affcdaaeac0e2
[kdenlive] / src / waveform.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com)      *
3  *   This file is part of kdenlive. See www.kdenlive.org.                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10
11 #ifndef WAVEFORM_H
12 #define WAVEFORM_H
13
14 #include <QWidget>
15
16 #include "ui_waveform_ui.h"
17 #include "renderer.h"
18 #include "monitor.h"
19 #include "waveformgenerator.h"
20
21 class Waveform_UI;
22 class WaveformGenerator;
23 class Render;
24 class Monitor;
25
26 class Waveform : public QWidget, public Ui::Waveform_UI {
27     Q_OBJECT
28
29 public:
30     Waveform(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
31     ~Waveform();
32
33 protected:
34     void paintEvent(QPaintEvent *);
35     void resizeEvent(QResizeEvent *);
36     void mouseReleaseEvent(QMouseEvent *);
37
38 private:
39     Monitor *m_projMonitor;
40     Monitor *m_clipMonitor;
41     Render *m_activeRender;
42
43     WaveformGenerator *m_waveformGenerator;
44
45     void updateDimensions();
46     bool initialDimensionUpdateDone;
47
48     QRect m_scopeRect;
49     QImage m_waveform;
50
51 private slots:
52     void slotActiveMonitorChanged(bool isClipMonitor);
53     void slotRenderZoneUpdated();
54     void slotWaveformCalculated(QImage waveform, const uint &msec);
55
56 };
57
58 #endif // WAVEFORM_H