forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathanalysisfeature.h
More file actions
70 lines (53 loc) · 1.99 KB
/
Copy pathanalysisfeature.h
File metadata and controls
70 lines (53 loc) · 1.99 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
#pragma once
#include <QList>
#include <QObject>
#include <QUrl>
#include <QVariant>
#include "analyzer/trackanalysisscheduler.h"
#include "library/libraryfeature.h"
#include "library/treeitemmodel.h"
#include "preferences/usersettings.h"
#include "util/parented_ptr.h"
class DlgAnalysis;
class AnalysisFeature : public LibraryFeature {
Q_OBJECT
public:
AnalysisFeature(Library* pLibrary,
UserSettingsPointer pConfig);
~AnalysisFeature() override;
QVariant title() override {
return m_title;
}
bool dropAccept(const QList<QUrl>& urls, QObject* pSource) override;
bool dragMoveAccept(const QUrl& url) override;
void bindLibraryWidget(WLibrary* libraryWidget,
KeyboardEventFilter* keyboard) override;
TreeItemModel* sidebarModel() const override;
void refreshLibraryModels();
signals:
void analysisActive(bool bActive);
void trackProgress(TrackId trackId, AnalyzerProgress progress);
public slots:
void activate() override;
void analyzeTracks(const QList<AnalyzerScheduledTrack>& tracks);
void suspendAnalysis();
void resumeAnalysis();
void stopAnalysis();
private slots:
void onTrackAnalysisSchedulerProgress(AnalyzerProgress currentTrackProgress, int currentTrackNumber, int totalTracksCount);
void onTrackAnalysisSchedulerFinished();
private:
// Sets the title of this feature to the default name, given by
// m_sAnalysisTitleName
void resetTitle();
// Sets the title of this feature to the default name followed by (x / y)
// where x is the current track being analyzed and y is the total number of
// tracks in the job
void setTitleProgress(int currentTrackNumber, int totalTracksCount);
const QString m_baseTitle;
TrackAnalysisScheduler::Pointer m_pTrackAnalysisScheduler;
parented_ptr<TreeItemModel> m_pSidebarModel;
DlgAnalysis* m_pAnalysisView;
// The title is dynamic and reflects the current progress
QString m_title;
};