Add smart playlists, ratings and Qobuz

Fixes #259
Fixes #264
This commit is contained in:
Jonas Kvinge
2020-09-17 17:50:17 +02:00
parent fdf96e8342
commit 89d6b7cec0
102 changed files with 10949 additions and 525 deletions

View File

@@ -51,6 +51,7 @@
#include "playlist.h"
#include "core/song.h"
#include "widgets/ratingwidget.h"
class CollectionBackend;
class Player;
@@ -185,4 +186,29 @@ class SongSourceDelegate : public PlaylistDelegateBase {
mutable QPixmapCache pixmap_cache_;
};
class RatingItemDelegate : public PlaylistDelegateBase {
public:
RatingItemDelegate(QObject *parent);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &idx) const override;
QString displayText(const QVariant &value, const QLocale &locale) const override;
void set_mouse_over(const QModelIndex &idx, const QModelIndexList &selected_indexes, const QPoint &pos) {
mouse_over_index_ = idx;
selected_indexes_ = selected_indexes;
mouse_over_pos_ = pos;
}
void set_mouse_out() { mouse_over_index_ = QModelIndex(); }
bool is_mouse_over() const { return mouse_over_index_.isValid(); }
QModelIndex mouse_over_index() const { return mouse_over_index_; }
private:
RatingPainter painter_;
QModelIndex mouse_over_index_;
QPoint mouse_over_pos_;
QModelIndexList selected_indexes_;
};
#endif // PLAYLISTDELEGATES_H