![]() |
Sayonara Player
|
#include <PlaylistHandler.h>
Global handler for playlists.
Public Types | |
| enum | PlaylistIndex : uint8_t { 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 IndexSet &indexes, int tgt_idx, int pl_idx) |
| move rows within playlist More... | |
| void | remove_rows (const IndexSet &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 | active_index () const |
| get active playlist index More... | |
| int | current_index () const |
| void | set_current_index (int pl_idx) |
| PlaylistConstPtr | playlist (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 | |
| DBInterface::SaveAsAnswer | save_playlist (int pl_idx) |
| save playlist to database, overwrite old one More... | |
| DBInterface::SaveAsAnswer | save_playlist_as (int pl_idx, const QString &name, bool force_override) |
| Save playlist under new name. More... | |
| DBInterface::SaveAsAnswer | rename_playlist (int pl_idx, const QString &name) |
| rename playlist More... | |
| void | save_playlist_to_file (int pl_idx, 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 (bool override_current=false) |
| create a new empty playlist More... | |
| int | create_empty_playlist (const QString &name) |
| void | delete_tracks (const IndexSet &rows, Library::TrackDeletionMode deletion_mode) |
Protected Attributes | |
| Settings * | _settings =nullptr |
| int Playlist::Handler::active_index | ( | ) | const |
get active playlist index
| void Playlist::Handler::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 Playlist::Handler::change_track | ( | int | track_idx, |
| int | pl_idx | ||
| ) |
change the track in a given playlist
| idx | track index |
| pl_idx | playlist index |
| void Playlist::Handler::clear_playlist | ( | int | pl_idx | ) |
clears the current visible playlist
| pl_idx | playlist index |
| void Playlist::Handler::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 Playlist::Handler::delete_playlist | ( | int | pl_idx | ) |
delete the given playlist from database
| pl_idx | playlist index |
| void Playlist::Handler::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 Playlist::Handler::move_rows | ( | const IndexSet & | 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 Playlist::Handler::play_next | ( | const MetaDataList & | v_md | ) |
insert tracks to active playlist after current playback position
| v_md | list of tracks |
| PlaylistConstPtr Playlist::Handler::playlist | ( | int | pl_idx | ) | const |
get specific playlist at given index
| pl_idx | playlist index |
| void Playlist::Handler::remove_rows | ( | const IndexSet & | indexes, |
| int | pl_idx | ||
| ) |
remove rows from playlist
| indexes | list of row indices to be removed |
| pl_idx | playlist index |
| DBInterface::SaveAsAnswer Playlist::Handler::rename_playlist | ( | int | pl_idx, |
| const QString & | name | ||
| ) |
rename playlist
| pl_idx | playlist index |
| name | new playlist name |
| QString Playlist::Handler::request_new_playlist_name | ( | ) | const |
Request a new name for the playlist (usually new %1 is returned)
| void Playlist::Handler::reset_playlist | ( | int | pl_idx | ) |
reload playlist from db
| pl_idx | playlist index |
| DBInterface::SaveAsAnswer Playlist::Handler::save_playlist | ( | int | pl_idx | ) |
save playlist to database, overwrite old one
| pl_idx | playlist index |
| DBInterface::SaveAsAnswer Playlist::Handler::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 Playlist::Handler::save_playlist_to_file | ( | int | pl_idx, |
| 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 |
1.8.14