diff --git a/src/elisautils.h b/src/elisautils.h index b5e390f9..2571aa80 100644 --- a/src/elisautils.h +++ b/src/elisautils.h @@ -1,54 +1,58 @@ /* * Copyright 2017 Matthieu Gallien * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef ELISAUTILS_H #define ELISAUTILS_H #include "musicaudiotrack.h" -#include - #include #include #include +namespace KFileMetaData { + +class ExtractorCollection; + +} + namespace ElisaUtils { Q_NAMESPACE MusicAudioTrack scanOneFile(const QUrl &scanFile, const QMimeDatabase &mimeDatabase, const KFileMetaData::ExtractorCollection &allExtractors); enum PlayListEnqueueMode { AppendPlayList, ReplacePlayList, }; Q_ENUM_NS(PlayListEnqueueMode) enum PlayListEnqueueTriggerPlay { DoNotTriggerPlay, TriggerPlay, }; Q_ENUM_NS(PlayListEnqueueTriggerPlay) } #endif // ELISAUTILS_H diff --git a/src/models/abstractmediaproxymodel.h b/src/models/abstractmediaproxymodel.h index 03431e3a..b18bf77e 100644 --- a/src/models/abstractmediaproxymodel.h +++ b/src/models/abstractmediaproxymodel.h @@ -1,86 +1,82 @@ /* * Copyright 2016-2017 Matthieu Gallien * Copyright 2017 Alexander Stippich * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef ABSTRACTMEDIAPROXYMODEL_H #define ABSTRACTMEDIAPROXYMODEL_H -#include "mediaplaylist.h" - #include #include #include #include -class MediaPlayList; - class AbstractMediaProxyModel : public QSortFilterProxyModel { Q_OBJECT Q_PROPERTY(QString filterText READ filterText WRITE setFilterText NOTIFY filterTextChanged) Q_PROPERTY(int filterRating READ filterRating WRITE setFilterRating NOTIFY filterRatingChanged) public: explicit AbstractMediaProxyModel(QObject *parent = nullptr); ~AbstractMediaProxyModel() override; QString filterText() const; int filterRating() const; public Q_SLOTS: void setFilterText(const QString &filterText); void setFilterRating(int filterRating); Q_SIGNALS: void filterTextChanged(const QString &filterText); void filterRatingChanged(int filterRating); protected: virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override = 0; QString mFilterText; int mFilterRating = 0; QRegularExpression mFilterExpression; QReadWriteLock mDataLock; QThreadPool mThreadPool; }; #endif // ABSTRACTMEDIAPROXYMODEL_H diff --git a/src/models/allalbumsproxymodel.h b/src/models/allalbumsproxymodel.h index f5d4d430..3c460f69 100644 --- a/src/models/allalbumsproxymodel.h +++ b/src/models/allalbumsproxymodel.h @@ -1,56 +1,58 @@ /* * Copyright 2016-2018 Matthieu Gallien * Copyright 2017 Alexander Stippich * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef ALLALBUMSPROXYMODEL_H #define ALLALBUMSPROXYMODEL_H #include "abstractmediaproxymodel.h" #include "elisautils.h" +class MusicAlbum; + class AllAlbumsProxyModel : public AbstractMediaProxyModel { Q_OBJECT public: explicit AllAlbumsProxyModel(QObject *parent = nullptr); ~AllAlbumsProxyModel() override; Q_SIGNALS: void albumToEnqueue(QList newAlbums, ElisaUtils::PlayListEnqueueMode enqueueMode, ElisaUtils::PlayListEnqueueTriggerPlay triggerPlay); public Q_SLOTS: void enqueueToPlayList(); void replaceAndPlayOfPlayList(); protected: bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; }; #endif // ALLALBUMSPROXYMODEL_H diff --git a/src/models/singleartistproxymodel.h b/src/models/singleartistproxymodel.h index 913b8d69..bfc5d6ef 100644 --- a/src/models/singleartistproxymodel.h +++ b/src/models/singleartistproxymodel.h @@ -1,72 +1,74 @@ /* * Copyright 2016-2018 Matthieu Gallien * Copyright 2017 Alexander Stippich * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef SINGLEARTISTPROXYMODEL_H #define SINGLEARTISTPROXYMODEL_H #include "abstractmediaproxymodel.h" #include "elisautils.h" +class MusicAlbum; + class SingleArtistProxyModel : public AbstractMediaProxyModel { Q_OBJECT Q_PROPERTY(QString artistFilter READ artistFilter WRITE setArtistFilterText NOTIFY artistFilterTextChanged) public: explicit SingleArtistProxyModel(QObject *parent = nullptr); ~SingleArtistProxyModel() override; QString artistFilter() const; Q_SIGNALS: void albumToEnqueue(QList newAlbums, ElisaUtils::PlayListEnqueueMode enqueueMode, ElisaUtils::PlayListEnqueueTriggerPlay triggerPlay); public Q_SLOTS: void enqueueToPlayList(); void replaceAndPlayOfPlayList(); void setArtistFilterText(const QString &filterText); Q_SIGNALS: void artistFilterTextChanged(const QString &filterText); protected: bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; QString mArtistFilter; QRegularExpression mArtistExpression; }; #endif // SINGLEARTISTPROXYMODEL_H