-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathdeckattributes.cpp
More file actions
81 lines (67 loc) · 2.91 KB
/
Copy pathdeckattributes.cpp
File metadata and controls
81 lines (67 loc) · 2.91 KB
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
#include "library/autodj/track/deckattributes.h"
#include "mixer/basetrackplayer.h"
#include "moc_deckattributes.cpp"
DeckAttributes::DeckAttributes(int index,
BaseTrackPlayer* pPlayer)
: index(index),
group(pPlayer->getGroup()),
loading(false),
m_orientation(group, "orientation"),
m_playPos(group, "playposition"),
m_play(group, "play"),
m_repeat(group, "repeat"),
m_introStartPos(group, "intro_start_position"),
m_introEndPos(group, "intro_end_position"),
m_outroStartPos(group, "outro_start_position"),
m_outroEndPos(group, "outro_end_position"),
m_trackSamples(group, "track_samples"),
m_sampleRate(group, "track_samplerate"),
m_rateRatio(group, "rate_ratio"),
m_pPlayer(pPlayer) {
connect(m_pPlayer, &BaseTrackPlayer::newTrackLoaded, this, &DeckAttributes::slotTrackLoaded);
connect(m_pPlayer, &BaseTrackPlayer::loadingTrack, this, &DeckAttributes::slotLoadingTrack);
connect(m_pPlayer, &BaseTrackPlayer::playerEmpty, this, &DeckAttributes::slotPlayerEmpty);
m_playPos.connectValueChanged(this, &DeckAttributes::slotPlayPosChanged);
m_play.connectValueChanged(this, &DeckAttributes::slotPlayChanged);
m_introStartPos.connectValueChanged(this, &DeckAttributes::slotIntroStartPositionChanged);
m_introEndPos.connectValueChanged(this, &DeckAttributes::slotIntroEndPositionChanged);
m_outroStartPos.connectValueChanged(this, &DeckAttributes::slotOutroStartPositionChanged);
m_outroEndPos.connectValueChanged(this, &DeckAttributes::slotOutroEndPositionChanged);
m_rateRatio.connectValueChanged(this, &DeckAttributes::slotRateChanged);
}
DeckAttributes::~DeckAttributes() {
}
void DeckAttributes::slotPlayChanged(double v) {
emit playChanged(this, v > 0.0);
}
void DeckAttributes::slotPlayPosChanged(double v) {
emit playPositionChanged(this, v);
}
void DeckAttributes::slotIntroStartPositionChanged(double v) {
emit introStartPositionChanged(this, v);
}
void DeckAttributes::slotIntroEndPositionChanged(double v) {
emit introEndPositionChanged(this, v);
}
void DeckAttributes::slotOutroStartPositionChanged(double v) {
emit outroStartPositionChanged(this, v);
}
void DeckAttributes::slotOutroEndPositionChanged(double v) {
emit outroEndPositionChanged(this, v);
}
void DeckAttributes::slotTrackLoaded(TrackPointer pTrack) {
emit trackLoaded(this, pTrack);
}
void DeckAttributes::slotLoadingTrack(TrackPointer pNewTrack, TrackPointer pOldTrack) {
// qDebug() << "DeckAttributes::slotLoadingTrack";
emit loadingTrack(this, pNewTrack, pOldTrack);
}
void DeckAttributes::slotPlayerEmpty() {
emit playerEmpty(this);
}
void DeckAttributes::slotRateChanged(double) {
emit rateChanged(this);
}
TrackPointer DeckAttributes::getLoadedTrack() const {
return m_pPlayer != nullptr ? m_pPlayer->getLoadedTrack() : TrackPointer();
}