RhythmboxFeature::RhythmboxFeature(QObject* parent, TrackCollection* pTrackCollection) : BaseExternalLibraryFeature(parent, pTrackCollection), m_pTrackCollection(pTrackCollection), m_cancelImport(false) { QString tableName = "rhythmbox_library"; QString idColumn = "id"; QStringList columns; columns << "id" << "artist" << "title" << "album" << "year" << "genre" << "tracknumber" << "location" << "comment" << "rating" << "duration" << "bitrate" << "bpm"; m_trackSource = QSharedPointer<BaseTrackCache>( new BaseTrackCache(m_pTrackCollection, tableName, idColumn, columns, false)); QStringList searchColumns; searchColumns << "artist" << "album" << "location" << "comment" << "title" << "genre"; m_trackSource->setSearchColumns(searchColumns); m_pRhythmboxTrackModel = new BaseExternalTrackModel( this, m_pTrackCollection, "mixxx.db.model.rhythmbox", "rhythmbox_library", m_trackSource); m_pRhythmboxPlaylistModel = new BaseExternalPlaylistModel( this, m_pTrackCollection, "mixxx.db.model.rhythmbox_playlist", "rhythmbox_playlists", "rhythmbox_playlist_tracks", m_trackSource); m_isActivated = false; m_title = tr("Rhythmbox"); m_database = QSqlDatabase::cloneDatabase(pTrackCollection->getDatabase(), "RHYTHMBOX_SCANNER"); //Open the database connection in this thread. if (!m_database.open()) { qDebug() << "Failed to open database for Rhythmbox scanner." << m_database.lastError(); } connect(&m_track_watcher, SIGNAL(finished()), this, SLOT(onTrackCollectionLoaded()), Qt::QueuedConnection); }
ITunesFeature::ITunesFeature(QObject* parent, TrackCollection* pTrackCollection) : BaseExternalLibraryFeature(parent, pTrackCollection), m_pTrackCollection(pTrackCollection), m_cancelImport(false), m_icon(":/images/library/ic_library_itunes.svg") { QString tableName = "itunes_library"; QString idColumn = "id"; QStringList columns; columns << "id" << "artist" << "title" << "album" << "album_artist" << "year" << "genre" << "grouping" << "tracknumber" << "location" << "comment" << "duration" << "bitrate" << "bpm" << "rating"; m_trackSource = QSharedPointer<BaseTrackCache>( new BaseTrackCache(m_pTrackCollection, tableName, idColumn, columns, false)); m_pITunesTrackModel = new BaseExternalTrackModel( this, m_pTrackCollection, "mixxx.db.model.itunes", "itunes_library", m_trackSource); m_pITunesPlaylistModel = new BaseExternalPlaylistModel( this, m_pTrackCollection, "mixxx.db.model.itunes_playlist", "itunes_playlists", "itunes_playlist_tracks", m_trackSource); m_isActivated = false; m_title = tr("iTunes"); m_database = QSqlDatabase::cloneDatabase(pTrackCollection->database(), "ITUNES_SCANNER"); // Open the database connection in this thread. if (!m_database.open()) { qDebug() << "Failed to open database for iTunes scanner." << m_database.lastError(); } connect(&m_future_watcher, SIGNAL(finished()), this, SLOT(onTrackCollectionLoaded())); }
TraktorFeature::TraktorFeature(QObject* parent, TrackCollection* pTrackCollection) : BaseExternalLibraryFeature(parent, pTrackCollection), m_pTrackCollection(pTrackCollection), m_cancelImport(false) { QString tableName = "traktor_library"; QString idColumn = "id"; QStringList columns; columns << "id" << "artist" << "title" << "album" << "year" << "genre" << "tracknumber" << "location" << "comment" << "rating" << "duration" << "bitrate" << "bpm" << "key"; pTrackCollection->addTrackSource(QString("traktor"), QSharedPointer<BaseTrackCache>( new BaseTrackCache(m_pTrackCollection, tableName, idColumn, columns, false))); m_isActivated = false; m_pTraktorTableModel = new TraktorTrackModel(this, m_pTrackCollection); m_pTraktorPlaylistModel = new TraktorPlaylistModel(this, m_pTrackCollection); m_title = tr("Traktor"); m_database = QSqlDatabase::cloneDatabase(pTrackCollection->getDatabase(), "TRAKTOR_SCANNER"); //Open the database connection in this thread. if (!m_database.open()) { qDebug() << "Failed to open database for iTunes scanner." << m_database.lastError(); } connect(&m_future_watcher, SIGNAL(finished()), this, SLOT(onTrackCollectionLoaded())); }