![]() |
Sayonara Player
|
#include <PlaylistHandler.h>
Global handler for playlists.
Public Types | |
enum | PlaylistIndex : quint8 { Current =0, Active } |
The PlaylistIndex enum. | |
Signals | |
void | sig_playlist_created (PlaylistPtr pl) |
emitted when new playlist has been created More... | |
void | sig_cur_track_idx_changed (int track_idx, int playlist_idx) |
emitted when current track index has changed More... | |
void | sig_new_playlist_added (PlaylistPtr pl) |
emitted when new playlist has been added More... | |
void | sig_playlist_name_changed (int idx) |
emitted when playlist name has changed More... | |
void | sig_saved_playlists_changed () |
emitted when saved playlists have changed | |
void | sig_playlist_idx_changed (int idx) |
void | sig_track_deletion_requested (const MetaDataList &v_md, Library::TrackDeletionMode deletion_mode) |
Public Member Functions | |
void | clear_playlist (int pl_idx) |
clears the current visible playlist More... | |
void | play_next (const MetaDataList &v_md) |
insert tracks to active playlist after current playback position More... | |
void | insert_tracks (const MetaDataList &v_md, int idx, int pl_idx) |
insert tracks into a playlist at a given index More... | |
void | append_tracks (const MetaDataList &v_md, int pl_idx) |
append tracks at a given playlist index More... | |
void | move_rows (const SP::Set< int > &indexes, int tgt_idx, int pl_idx) |
move rows within playlist More... | |
void | remove_rows (const SP::Set< int > &indexes, int pl_idx) |
remove rows from playlist More... | |
void | change_track (int track_idx, int pl_idx) |
change the track in a given playlist More... | |
int | get_active_idx_of_cur_track () const |
get playlist where current track is playing More... | |
int | get_active_idx () const |
get active playlist index More... | |
int | get_current_idx () const |
void | set_current_idx (int pl_idx) |
PlaylistConstPtr | get_playlist_at (int pl_idx) const |
get specific playlist at given index More... | |
void | delete_playlist (int pl_idx) |
delete the given playlist from database More... | |
void | close_playlist (int pl_idx) |
close playlist More... | |
void | reset_playlist (int pl_idx) |
reload playlist from db More... | |
QString | request_new_playlist_name () const |
Request a new name for the playlist (usually new %1 is returned) More... | |
void | save_all_playlists () |
save all playlists to database. This could be done in destructor | |
PlaylistDBInterface::SaveAsAnswer | save_playlist (int pl_idx) |
save playlist to database, overwrite old one More... | |
PlaylistDBInterface::SaveAsAnswer | save_playlist_as (int pl_idx, const QString &name, bool force_override) |
Save playlist under new name. More... | |
PlaylistDBInterface::SaveAsAnswer | rename_playlist (int pl_idx, const QString &name) |
rename playlist More... | |
void | save_playlist_to_file (const QString &filename, bool relative) |
save a playlist to file More... | |
Public Slots | |
int | load_old_playlists () |
load playlists of last session from database More... | |
int | create_playlist (const MetaDataList &v_md, const QString &name=QString(), bool temporary=true, Playlist::Type type=Playlist::Type::Std) |
create a new playlist More... | |
int | create_playlist (const QStringList &path_list, const QString &name=QString(), bool temporary=true, Playlist::Type type=Playlist::Type::Std) |
create a new playlist (overloaded) More... | |
int | create_playlist (const QString &dir, const QString &name=QString(), bool temporary=true, Playlist::Type type=Playlist::Type::Std) |
create a new playlist (overloaded) More... | |
int | create_playlist (const CustomPlaylist &pl) |
create a new playlist (overloaded) More... | |
int | create_empty_playlist (const QString &name) |
create a new empty playlist More... | |
void | delete_tracks (const SP::Set< int > &rows, Library::TrackDeletionMode deletion_mode) |
Protected Attributes | |
Settings * | _settings =nullptr |
void PlaylistHandler::append_tracks | ( | const MetaDataList & | v_md, |
int | pl_idx | ||
) |
append tracks at a given playlist index
v_md | track list |
pl_idx | playlist index |
void PlaylistHandler::change_track | ( | int | track_idx, |
int | pl_idx | ||
) |
change the track in a given playlist
idx | track index |
pl_idx | playlist index |
void PlaylistHandler::clear_playlist | ( | int | pl_idx | ) |
clears the current visible playlist
pl_idx | playlist index |
void PlaylistHandler::close_playlist | ( | int | pl_idx | ) |
close playlist
pl_idx | playlist index |
|
slot |
create a new empty playlist
name | new playlist name. If no name given, current playlist will be overwritten |
|
slot |
create a new playlist
v_md | track list |
name | new playlist name. If no name given, current playlist will be overwritten |
temporary | is the playlist temporary or persistent? |
type | deprecated |
|
slot |
create a new playlist (overloaded)
pathlist | paths, may contain files or directories |
name | new playlist name. If no name given, current playlist will be overwritten |
temporary | is the playlist temporary or persistent? |
type | deprecated |
|
slot |
create a new playlist (overloaded)
dir | directory path |
name | new playlist name. If no name given, current playlist will be overwritten |
temporary | is the playlist temporary or persistent? |
type | deprecated |
|
slot |
create a new playlist (overloaded)
pl | a CustomPlaylist object fetched from database |
void PlaylistHandler::delete_playlist | ( | int | pl_idx | ) |
delete the given playlist from database
pl_idx | playlist index |
int PlaylistHandler::get_active_idx | ( | ) | const |
get active playlist index
int PlaylistHandler::get_active_idx_of_cur_track | ( | ) | const |
get playlist where current track is playing
PlaylistConstPtr PlaylistHandler::get_playlist_at | ( | int | pl_idx | ) | const |
get specific playlist at given index
pl_idx | playlist index |
void PlaylistHandler::insert_tracks | ( | const MetaDataList & | v_md, |
int | idx, | ||
int | pl_idx | ||
) |
insert tracks into a playlist at a given index
v_md | track list |
idx | track index within playlist |
pl_idx | playlist index |
|
slot |
load playlists of last session from database
void PlaylistHandler::move_rows | ( | const SP::Set< int > & | indexes, |
int | tgt_idx, | ||
int | pl_idx | ||
) |
move rows within playlist
idx_list | list of row indices to be moved |
tgt_idx | target index where rows should be moved |
pl_idx | playlist index |
void PlaylistHandler::play_next | ( | const MetaDataList & | v_md | ) |
insert tracks to active playlist after current playback position
v_md | list of tracks |
void PlaylistHandler::remove_rows | ( | const SP::Set< int > & | indexes, |
int | pl_idx | ||
) |
remove rows from playlist
indexes | list of row indices to be removed |
pl_idx | playlist index |
PlaylistDBInterface::SaveAsAnswer PlaylistHandler::rename_playlist | ( | int | pl_idx, |
const QString & | name | ||
) |
rename playlist
pl_idx | playlist index |
name | new playlist name |
QString PlaylistHandler::request_new_playlist_name | ( | ) | const |
Request a new name for the playlist (usually new %1 is returned)
void PlaylistHandler::reset_playlist | ( | int | pl_idx | ) |
reload playlist from db
pl_idx | playlist index |
PlaylistDBInterface::SaveAsAnswer PlaylistHandler::save_playlist | ( | int | pl_idx | ) |
save playlist to database, overwrite old one
pl_idx | playlist index |
PlaylistDBInterface::SaveAsAnswer PlaylistHandler::save_playlist_as | ( | int | pl_idx, |
const QString & | name, | ||
bool | force_override | ||
) |
Save playlist under new name.
pl_idx | playlist index |
name | new playlist name |
force_override | override if name exists |
void PlaylistHandler::save_playlist_to_file | ( | const QString & | filename, |
bool | relative | ||
) |
save a playlist to file
filename,if | filename does not end with m3u, extension is appended automatically |
relative | relative paths in m3u file |
|
signal |
emitted when current track index has changed
track_idx | index in playlist |
playlist_idx | index of playlist |
|
signal |
emitted when new playlist has been added
pl | reference to new playlist |
|
signal |
emitted when new playlist has been created
pl | Playlist, usually current one |
|
signal |
emitted when playlist name has changed
idx | index of playlist |