blob: 1261c60bf56a33f74e2b9bec473d92b86985875e (
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
|
#include <QtDebug>
#include "waveform/waveformfactory.h"
#include "waveform/waveform.h"
// static
Waveform* WaveformFactory::loadWaveformFromAnalysis(
const AnalysisDao::AnalysisInfo& analysis) {
Waveform* pWaveform = new Waveform(analysis.data);
pWaveform->setId(analysis.analysisId);
pWaveform->setVersion(analysis.version);
pWaveform->setDescription(analysis.description);
return pWaveform;
}
// static
WaveformFactory::VersionClass WaveformFactory::waveformVersionToVersionClass(const QString& version) {
if (version == WAVEFORM_CURRENT_VERSION) {
// use, since is our version
return VC_USE;
}
if (version == WAVEFORM_4_VERSION) {
// Used in Mixxx 1.12 beta, suffers Bug lp:1406389
return VC_REMOVE;
}
if (version == WAVEFORM_2_VERSION) {
// keep for use with old Mixxx versions
return VC_KEEP;
}
if (version == WAVEFORM_3_VERSION) {
// Used in Mixxx 1.11 beta, suffers Bug lp:1087425
return VC_REMOVE;
}
// possible a future version
return VC_KEEP;
}
// static
WaveformFactory::VersionClass WaveformFactory::waveformSummaryVersionToVersionClass(const QString& version) {
if (version == WAVEFORMSUMMARY_CURRENT_VERSION) {
// use, since is our version
return VC_USE;
}
if (version == WAVEFORMSUMMARY_4_VERSION) {
// Used in Mixxx 1.12 beta, suffers Bug lp:1406389
return VC_REMOVE;
}
if (version == WAVEFORMSUMMARY_2_VERSION) {
// keep for use with old Mixxx versions
return VC_KEEP;
}
if (version == WAVEFORMSUMMARY_3_VERSION) {
// Used in Mixxx 1.11 beta, suffers Bug lp:1086965
return VC_REMOVE;
}
// possible a future version
return VC_KEEP;
}
// static
QString WaveformFactory::currentWaveformVersion() {
return WAVEFORM_CURRENT_VERSION;
}
// static
QString WaveformFactory::currentWaveformSummaryVersion() {
return WAVEFORMSUMMARY_CURRENT_VERSION;
}
// static
QString WaveformFactory::currentWaveformDescription() {
return WAVEFORM_CURRENT_DESCRIPTION;
}
// static
QString WaveformFactory::currentWaveformSummaryDescription() {
return WAVEFORMSUMMARY_CURRENT_DESCRIPTION;
}
|