summaryrefslogtreecommitdiffstats
path: root/src/library/traktor/traktorfeature.cpp
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2013-12-29 01:56:47 +0100
committerDaniel Schürmann <daschuer@mixxx.org>2013-12-29 01:56:47 +0100
commit05b1ec4f8b9daf9026ceb6f6a01a7188148010d5 (patch)
treed063dd3c757b87c5389b241c14fa3fae229c7e24 /src/library/traktor/traktorfeature.cpp
parent8164ac661b98576bf28f670f9ffec52d8fcd79ed (diff)
tweaking of the external library interface
Diffstat (limited to 'src/library/traktor/traktorfeature.cpp')
-rw-r--r--src/library/traktor/traktorfeature.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/library/traktor/traktorfeature.cpp b/src/library/traktor/traktorfeature.cpp
index 9eb9aa3003..14f6525a03 100644
--- a/src/library/traktor/traktorfeature.cpp
+++ b/src/library/traktor/traktorfeature.cpp
@@ -17,11 +17,12 @@
#include "library/treeitem.h"
TraktorTrackModel::TraktorTrackModel(QObject* parent,
- TrackCollection* pTrackCollection)
+ TrackCollection* pTrackCollection,
+ QSharedPointer<BaseTrackCache> trackSource)
: BaseExternalTrackModel(parent, pTrackCollection,
"mixxx.db.model.traktor_tablemodel",
"traktor_library",
- "traktor") {
+ trackSource) {
}
bool TraktorTrackModel::isColumnHiddenByDefault(int column) {
@@ -33,12 +34,13 @@ bool TraktorTrackModel::isColumnHiddenByDefault(int column) {
}
TraktorPlaylistModel::TraktorPlaylistModel(QObject* parent,
- TrackCollection* pTrackCollection)
+ TrackCollection* pTrackCollection,
+ QSharedPointer<BaseTrackCache> trackSource)
: BaseExternalPlaylistModel(parent, pTrackCollection,
"mixxx.db.model.traktor.playlistmodel",
"traktor_playlists",
"traktor_playlist_tracks",
- "traktor") {
+ trackSource) {
}
bool TraktorPlaylistModel::isColumnHiddenByDefault(int column) {
@@ -70,13 +72,13 @@ TraktorFeature::TraktorFeature(QObject* parent, TrackCollection* pTrackCollectio
<< "bitrate"
<< "bpm"
<< "key";
- pTrackCollection->addTrackSource(QString("traktor"), QSharedPointer<BaseTrackCache>(
+ m_trackSource = QSharedPointer<BaseTrackCache>(
new BaseTrackCache(m_pTrackCollection, tableName, idColumn,
- columns, false)));
+ columns, false));
m_isActivated = false;
- m_pTraktorTableModel = new TraktorTrackModel(this, m_pTrackCollection);
- m_pTraktorPlaylistModel = new TraktorPlaylistModel(this, m_pTrackCollection);
+ m_pTraktorTableModel = new TraktorTrackModel(this, m_pTrackCollection, m_trackSource);
+ m_pTraktorPlaylistModel = new TraktorPlaylistModel(this, m_pTrackCollection, m_trackSource);
m_title = tr("Traktor");
@@ -101,7 +103,7 @@ TraktorFeature::~TraktorFeature() {
}
BaseSqlTableModel* TraktorFeature::getPlaylistModelForPlaylist(QString playlist) {
- TraktorPlaylistModel* pModel = new TraktorPlaylistModel(this, m_pTrackCollection);
+ TraktorPlaylistModel* pModel = new TraktorPlaylistModel(this, m_pTrackCollection, m_trackSource);
pModel->setPlaylist(playlist);
return pModel;
}
@@ -596,7 +598,7 @@ void TraktorFeature::onTrackCollectionLoaded() {
if (root) {
m_childModel.setRootItem(root);
// Tell the rhythmbox track source that it should re-build its index.
- m_pTrackCollection->getTrackSource("traktor")->buildIndex();
+ m_trackSource->buildIndex();
//m_pTraktorTableModel->select();
emit(showTrackModel(m_pTraktorTableModel));