-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathbaseexternallibraryfeature.h
60 lines (47 loc) · 1.72 KB
/
baseexternallibraryfeature.h
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
#pragma once
#include <QAction>
#include <QModelIndex>
#include <QPointer>
#include "library/libraryfeature.h"
#include "library/dao/playlistdao.h"
#include "util/parented_ptr.h"
class BaseSqlTableModel;
class TrackCollection;
class BaseExternalLibraryFeature : public LibraryFeature {
Q_OBJECT
public:
BaseExternalLibraryFeature(
Library* pLibrary,
UserSettingsPointer pConfig);
~BaseExternalLibraryFeature() override = default;
public slots:
void bindSidebarWidget(WLibrarySidebar* pSidebarWidget) override;
void onRightClick(const QPoint& globalPos) override;
void onRightClickChild(const QPoint& globalPos, QModelIndex index) override;
protected:
// Must be implemented by external Libraries copied to Mixxx DB
virtual BaseSqlTableModel* getPlaylistModelForPlaylist(QString playlist) {
Q_UNUSED(playlist);
return nullptr;
}
// Must be implemented by external Libraries not copied to Mixxx DB
virtual void appendTrackIdsFromRightClickIndex(QList<TrackId>* trackIds, QString* pPlaylist);
private slots:
void slotAddToAutoDJ();
void slotAddToAutoDJTop();
void slotAddToAutoDJReplace();
void slotImportAsMixxxPlaylist();
protected:
QModelIndex lastRightClickedIndex() const {
return m_lastRightClickedIndex;
}
TrackCollection* const m_pTrackCollection;
private:
void addToAutoDJ(PlaylistDAO::AutoDJSendLoc loc);
QModelIndex m_lastRightClickedIndex;
parented_ptr<QAction> m_pAddToAutoDJAction;
parented_ptr<QAction> m_pAddToAutoDJTopAction;
parented_ptr<QAction> m_pAddToAutoDJReplaceAction;
parented_ptr<QAction> m_pImportAsMixxxPlaylistAction;
QPointer<WLibrarySidebar> m_pSidebarWidget;
};