29 #ifndef PLAYLISTITEMMODEL_H
30 #define PLAYLISTITEMMODEL_H
32 #include "Gui/Utils/SearchableWidget/SearchableModel.h"
34 #include "Utils/Playlist/PlaylistFwd.h"
35 #include "Utils/Pimpl.h"
57 void sigCurrentTrackChanged(
int index);
58 void sigCurrentScannedFileChanged(
const QString& filename);
59 void sigBusyChanged(
bool b);
79 RatingRole=Qt::UserRole + 1,
80 DragIndexRole=Qt::UserRole + 2,
81 EntryLookRole=Qt::UserRole + 3,
82 CurrentPlayingRole=Qt::UserRole + 4
88 int playlistIndex()
const;
91 void removeTracks(
const IndexSet& rows);
92 void deleteTracks(
const IndexSet& rows);
94 void findTrack(
int index);
101 void insertTracks(
const QStringList& files,
int row);
103 int currentTrack()
const;
105 const MetaData& metadata(
int row)
const;
108 bool hasLocalMedia(
const IndexSet& rows)
const;
109 void setDragIndex(
int dragIndex);
110 void changeRating(
const IndexSet& rows, Rating rating);
111 void changeTrack(
int trackIndex, Seconds seconds=0);
113 void setBusy(
bool b);
115 Qt::ItemFlags flags(
const QModelIndex& index=QModelIndex())
const override;
116 QVariant data(
const QModelIndex& index,
int role=Qt::DisplayRole)
const override;
117 bool setData(
const QModelIndex& index,
const QVariant &value,
int role)
override;
118 int rowCount(
const QModelIndex& parent=QModelIndex())
const override;
119 int columnCount(
const QModelIndex& parent=QModelIndex())
const override;
122 QMimeData* mimeData(
const QModelIndexList& indexes)
const override;
123 QModelIndexList searchResults(
const QString& searchString)
override;
127 void reverseTracks();
130 void playlistChanged(
int playlistIndex);
131 void currentTrackChanged(
int oldIndex,
int newIndex);
133 void coversChanged();
134 void coverFound(
const QPixmap& pixmap);
135 void coverLookupFinished(
bool success);
138 void startCoverLookup(
const MetaData& track)
const;
140 void refreshPlaylist(
int rowCount,
int columnCount);