blob: 4afbe391d7d680919be00756390b2e9badd6de7c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
#pragma once
#include <QDateTime>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QEvent>
#include <QList>
#include "skin/legacy/skincontext.h"
#include "track/track_decl.h"
#include "util/parented_ptr.h"
#include "waveform/renderers/waveformmark.h"
#include "widget/trackdroptarget.h"
#include "widget/wcuemenupopup.h"
#include "widget/wwidget.h"
class ControlProxy;
class WaveformWidgetAbstract;
class ControlPotmeter;
class WWaveformViewer : public WWidget, public TrackDropTarget {
Q_OBJECT
public:
WWaveformViewer(
const QString& group,
UserSettingsPointer pConfig,
QWidget* parent = nullptr);
~WWaveformViewer() override;
const QString& getGroup() const {
return m_group;
}
void setup(const QDomNode& node, const SkinContext& context);
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
void mousePressEvent(QMouseEvent * /*unused*/) override;
void mouseMoveEvent(QMouseEvent * /*unused*/) override;
void mouseReleaseEvent(QMouseEvent * /*unused*/) override;
void leaveEvent(QEvent* /*unused*/) override;
signals:
void trackDropped(const QString& filename, const QString& group) override;
void cloneDeck(const QString& sourceGroup, const QString& targetGroup) override;
void passthroughChanged(double value);
public slots:
void slotTrackLoaded(TrackPointer track);
void slotLoadingTrack(TrackPointer pNewTrack, TrackPointer pOldTrack);
protected:
void resizeEvent(QResizeEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
private slots:
void onZoomChange(double zoom);
void slotWidgetDead() {
m_waveformWidget = nullptr;
}
private:
void setWaveformWidget(WaveformWidgetAbstract* waveformWidget);
WaveformWidgetAbstract* getWaveformWidget() {
return m_waveformWidget;
}
//direct access to let factory sync/set default zoom
void setZoom(double zoom);
void setDisplayBeatGridAlpha(int alpha);
void setPlayMarkerPosition(double position);
private:
const QString m_group;
UserSettingsPointer m_pConfig;
int m_zoomZoneWidth;
ControlProxy* m_pZoom;
ControlProxy* m_pScratchPositionEnable;
ControlProxy* m_pScratchPosition;
ControlProxy* m_pWheel;
ControlProxy* m_pPlayEnabled;
parented_ptr<ControlProxy> m_pPassthroughEnabled;
bool m_bScratching;
bool m_bBending;
QPoint m_mouseAnchor;
parented_ptr<WCueMenuPopup> m_pCueMenuPopup;
WaveformMarkPointer m_pHoveredMark;
WaveformWidgetAbstract* m_waveformWidget;
int m_dimBrightThreshold;
friend class WaveformWidgetFactory;
CuePointer getCuePointerFromCueMark(WaveformMarkPointer pMark) const;
void highlightMark(WaveformMarkPointer pMark);
void unhighlightMark(WaveformMarkPointer pMark);
bool isPlaying() const;
};
|