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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
|
// library.h
// Created 8/23/2009 by RJ Ryan (rryan@mit.edu)
// A Library class is a container for all the model-side aspects of the library.
// A library widget can be attached to the Library object by calling bindWidget.
#ifndef LIBRARY_H
#define LIBRARY_H
#include <QList>
#include <QObject>
#include <QAbstractItemModel>
#include <QFont>
#include "preferences/usersettings.h"
#include "trackinfoobject.h"
#include "recording/recordingmanager.h"
#include "analysisfeature.h"
#include "library/coverartcache.h"
#include "library/setlogfeature.h"
class TrackModel;
class TrackCollection;
class SidebarModel;
class LibraryFeature;
class LibraryTableModel;
class WLibrarySidebar;
class WLibrary;
class WSearchLineEdit;
class MixxxLibraryFeature;
class PlaylistFeature;
class CrateFeature;
class LibraryControl;
class MixxxKeyboard;
class PlayerManagerInterface;
class Library : public QObject {
Q_OBJECT
public:
Library(QObject* parent,
UserSettingsPointer pConfig,
PlayerManagerInterface* pPlayerManager,
RecordingManager* pRecordingManager);
virtual ~Library();
void bindWidget(WLibrary* libraryWidget,
MixxxKeyboard* pKeyboard);
void bindSidebarWidget(WLibrarySidebar* sidebarWidget);
void addFeature(LibraryFeature* feature);
QStringList getDirs();
// TODO(rryan) Transitionary only -- the only reason this is here is so the
// waveform widgets can signal to a player to load a track. This can be
// fixed by moving the waveform renderers inside player and connecting the
// signals directly.
TrackCollection* getTrackCollection() {
return m_pTrackCollection;
}
inline int getTrackTableRowHeight() const {
return m_iTrackTableRowHeight;
}
inline const QFont& getTrackTableFont() const {
return m_trackTableFont;
}
//static Library* buildDefaultLibrary();
enum RemovalType {
LeaveTracksUnchanged = 0,
HideTracks,
PurgeTracks
};
static const int kDefaultRowHeightPx;
public slots:
void slotShowTrackModel(QAbstractItemModel* model);
void slotSwitchToView(const QString& view);
void slotLoadTrack(TrackPointer pTrack);
void slotLoadTrackToPlayer(TrackPointer pTrack, QString group, bool play);
void slotLoadLocationToPlayer(QString location, QString group);
void slotRestoreSearch(const QString& text);
void slotRefreshLibraryModels();
void slotCreatePlaylist();
void slotCreateCrate();
void slotRequestAddDir(QString directory);
void slotRequestRemoveDir(QString directory, Library::RemovalType removalType);
void slotRequestRelocateDir(QString previousDirectory, QString newDirectory);
void onSkinLoadFinished();
void slotSetTrackTableFont(const QFont& font);
void slotSetTrackTableRowHeight(int rowHeight);
signals:
void showTrackModel(QAbstractItemModel* model);
void switchToView(const QString& view);
void loadTrack(TrackPointer pTrack);
void loadTrackToPlayer(TrackPointer pTrack, QString group, bool play = false);
void restoreSearch(const QString&);
void search(const QString& text);
void searchCleared();
void searchStarting();
// emit this signal to enable/disable the cover art widget
void enableCoverArtDisplay(bool);
void trackSelected(TrackPointer pTrack);
void setTrackTableFont(const QFont& font);
void setTrackTableRowHeight(int rowHeight);
private:
UserSettingsPointer m_pConfig;
SidebarModel* m_pSidebarModel;
TrackCollection* m_pTrackCollection;
QList<LibraryFeature*> m_features;
const static QString m_sTrackViewName;
const static QString m_sAutoDJViewName;
MixxxLibraryFeature* m_pMixxxLibraryFeature;
PlaylistFeature* m_pPlaylistFeature;
CrateFeature* m_pCrateFeature;
AnalysisFeature* m_pAnalysisFeature;
LibraryControl* m_pLibraryControl;
RecordingManager* m_pRecordingManager;
QFont m_trackTableFont;
int m_iTrackTableRowHeight;
};
#endif /* LIBRARY_H */
|