Miam-Player  0.8.0
A nice music player
Playlist Class Reference

The Playlist class is used to display tracks in the MainWindow class. More...

#include <playlist.h>

Inheritance diagram for Playlist:

Public Types

enum  Columns {
  COL_TRACK_NUMBER = 0, COL_TITLE = 1, COL_ALBUM = 2, COL_LENGTH = 3,
  COL_ARTIST = 4, COL_RATINGS = 5, COL_YEAR = 6, COL_ICON = 7,
  COL_TRACK_DAO = 8
}
 

Public Slots

void moveTracksDown ()
 
void moveTracksUp ()
 
void removeSelectedTracks ()
 

Signals

void aboutToSendToTagEditor (const QList< QUrl > &tracks)
 
void contentHasChanged ()
 
void selectionHasChanged (bool isEmpty)
 

Public Member Functions

 Playlist (MediaPlayer *mediaPlayer, QWidget *parent=nullptr)
 
MediaPlayermediaPlayer () const
 
MediaPlaylistmediaPlaylist () const
 
uint generateNewHash () const
 
uint id () const
 
bool isModified () const
 
QString title () const
 
void insertMedias (int rowIndex, const QList< QMediaContent > &medias)
 
void insertMedias (int rowIndex, const QStringList &tracks)
 
void insertMedias (int rowIndex, const QList< TrackDAO > &tracks)
 
virtual QSize minimumSizeHint () const override
 
void forceDrop (QDropEvent *e)
 
uint hash () const
 
void setHash (uint hash)
 
void setId (uint id)
 
void setTitle (const QString &title)
 

Protected Member Functions

virtual void contextMenuEvent (QContextMenuEvent *event) override
 
virtual void dragEnterEvent (QDragEnterEvent *event) override
 
virtual void dragLeaveEvent (QDragLeaveEvent *event) override
 
virtual void dragMoveEvent (QDragMoveEvent *event) override
 
virtual void startDrag (Qt::DropActions) override
 
virtual void dropEvent (QDropEvent *event) override
 
virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void paintEvent (QPaintEvent *e) override
 
virtual int sizeHintForColumn (int column) const override
 
virtual void showEvent (QShowEvent *event) override
 
virtual void wheelEvent (QWheelEvent *event) override
 

Detailed Description

The Playlist class is used to display tracks in the MainWindow class.

The QTableView uses a small custom model to manage tracks: the PlaylistModel class. Tracks can be moved from one playlist to another, or in the same playlist. You can also drop external files or folder into this table to create a new playlist.

Author
Matthieu Bachelier

Member Enumeration Documentation

Enumerator
COL_TRACK_NUMBER 
COL_TITLE 
COL_ALBUM 
COL_LENGTH 
COL_ARTIST 
COL_RATINGS 
COL_YEAR 
COL_ICON 
COL_TRACK_DAO 

Constructor & Destructor Documentation

Playlist::Playlist ( MediaPlayer mediaPlayer,
QWidget *  parent = nullptr 
)
explicit

XXX not working?

TODO: sub menu tag -> send playlist to editor, edit in-line

TODO

Member Function Documentation

void Playlist::aboutToSendToTagEditor ( const QList< QUrl > &  tracks)
signal
void Playlist::contentHasChanged ( )
signal
void Playlist::contextMenuEvent ( QContextMenuEvent *  event)
overrideprotectedvirtual

Redefined to display a small context menu in the view.

void Playlist::dragEnterEvent ( QDragEnterEvent *  event)
overrideprotectedvirtual
void Playlist::dragLeaveEvent ( QDragLeaveEvent *  event)
overrideprotectedvirtual
void Playlist::dragMoveEvent ( QDragMoveEvent *  event)
overrideprotectedvirtual
void Playlist::dropEvent ( QDropEvent *  event)
overrideprotectedvirtual

Redefined to be able to move tracks between playlists or internally.

void Playlist::forceDrop ( QDropEvent *  e)
inline
uint Playlist::generateNewHash ( ) const
uint Playlist::hash ( ) const
inline
uint Playlist::id ( ) const
inline
void Playlist::insertMedias ( int  rowIndex,
const QList< QMediaContent > &  medias 
)
void Playlist::insertMedias ( int  rowIndex,
const QStringList &  tracks 
)
void Playlist::insertMedias ( int  rowIndex,
const QList< TrackDAO > &  tracks 
)

Insert remote medias to playlist.

bool Playlist::isModified ( ) const
void Playlist::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Redefined to handle escape key when editing ratings.

MediaPlayer* Playlist::mediaPlayer ( ) const
inline
MediaPlaylist* Playlist::mediaPlaylist ( ) const
inline
QSize Playlist::minimumSizeHint ( ) const
overridevirtual
void Playlist::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual
void Playlist::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Redefined to be able to create an editor to modify star rating.

Redifined to be able to create an editor to modify star rating.

void Playlist::moveTracksDown ( )
slot

Move selected tracks downward.

TODO

void Playlist::moveTracksUp ( )
slot

Move selected tracks upward.

void Playlist::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Redefined to display a thin line to help user for dropping tracks.

void Playlist::removeSelectedTracks ( )
slot

Remove selected tracks from the playlist.

void Playlist::selectionHasChanged ( bool  isEmpty)
signal
void Playlist::setHash ( uint  hash)
inline
void Playlist::setId ( uint  id)
inline
void Playlist::setTitle ( const QString &  title)
inline
void Playlist::showEvent ( QShowEvent *  event)
overrideprotectedvirtual
int Playlist::sizeHintForColumn ( int  column) const
overrideprotectedvirtual
void Playlist::startDrag ( Qt::DropActions  )
overrideprotectedvirtual
QString Playlist::title ( ) const
inline
void Playlist::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual

The documentation for this class was generated from the following files: