Sayonara Player
Loading...
Searching...
No Matches
PlaylistModifiers.h
1/* PlaylistModifiers.h */
2/*
3 * Copyright (C) 2011-2024 Michael Lugmair
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef SAYONARA_PLAYER_PLAYLISTMODIFIERS_H
22#define SAYONARA_PLAYER_PLAYLISTMODIFIERS_H
23
24#include "Utils/typedefs.h"
25#include "Utils/Library/Sortorder.h"
26
27class MetaDataList;
28
29namespace Playlist
30{
31 class Playlist;
32
33 enum Reason
34 {
35 DynamicPlayback = 0,
36 ReloadFromDatabase,
37 Library,
38 AsyncPlaylistCreator,
39 StreamHistory,
40 TracksDeleted,
41 UserInterface,
42 Undefined
43 };
44
45 enum class Operation :
46 uint8_t
47 {
48 Arrange = 0,
49 Append,
50 Clear,
51 Duplicate,
52 EnableAll,
53 Insert,
54 Rebuild,
55 Remove
56 };
57
58 void reverse(Playlist& playlist, Reason reason);
59 void randomize(Playlist& playlist, Reason reason);
60 void sortTracks(Playlist& playlist, Library::TrackSortorder sortOrder, Reason reason);
61
62 IndexSet moveTracks(Playlist& playlist, const IndexSet& indexes, int targetRow, Reason reason);
63 IndexSet copyTracks(Playlist& playlist, const IndexSet& indexes, int targetRow, Reason reason);
64 void insertTracks(Playlist& playlist, const MetaDataList& tracks, int targetRow, Reason reason);
65 void appendTracks(Playlist& playlist, const MetaDataList& tracks, Reason reason);
66 void removeTracks(Playlist& playlist, const IndexSet& indexes, Reason reason);
67 void clear(Playlist& playlist, Reason reason);
68 int count(const Playlist& playlist);
69 void enableAll(Playlist& playlist, Reason reason);
70
71 MilliSeconds runningTime(const Playlist& playlist);
72 void jumpToNextAlbum(Playlist& playlist);
73 int currentTrackWithoutDisabled(const Playlist& playlist);
74}
75
76#endif //SAYONARA_PLAYER_PLAYLISTMODIFIERS_H
Definition: MetaDataList.h:34
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: Set.h:37