Sayonara Player
src
Components
SmartPlaylists
SmartPlaylist.h
1
/* SmartPlaylist.h */
2
/*
3
* Copyright (C) 2011-2022 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_SMARTPLAYLIST_H
22
#define SAYONARA_PLAYER_SMARTPLAYLIST_H
23
24
#include "Utils/Pimpl.h"
25
#include "StringConverter.h"
26
27
#include <optional>
28
29
class
MetaDataList
;
30
class
QString;
31
struct
SmartPlaylistDatabaseEntry
;
32
33
namespace
SmartPlaylists
34
{
35
enum class
Type
36
{
37
Rating = 0,
38
Year,
39
Created,
40
CreatedRelative,
41
LastPlayed,
42
RandomTracks,
43
RandomAlbums,
44
NumEntries
45
};
46
47
enum class
InputFormat
48
{
49
Text = 0,
50
Calendar,
51
TimeSpan
52
};
53
}
54
55
class
SmartPlaylist
56
{
57
PIMPL(
SmartPlaylist
)
58
59
public
:
60
SmartPlaylist
(
int
id
,
const
QList<int>
& values,
bool
isRandomized);
61
virtual
~SmartPlaylist
();
62
63
[[nodiscard]]
int
id()
const
;
64
void
setId(
int
id
);
65
66
[[nodiscard]]
virtual
int
minimumValue()
const
= 0;
67
[[nodiscard]]
virtual
int
maximumValue()
const
= 0;
68
69
[[nodiscard]]
int
count()
const
;
70
[[nodiscard]]
int
value(
int
index)
const
;
71
void
setValue(
int
index,
int
value);
72
73
[[nodiscard]]
bool
isRandomized()
const
;
74
void
setRandomized(
bool
b);
75
[[nodiscard]]
virtual
bool
isRandomizable()
const
;
76
77
virtual
MetaDataList
filterTracks(
MetaDataList
tracks) = 0;
78
79
[[nodiscard]]
virtual
QString classType()
const
= 0;
// for database
80
[[nodiscard]]
virtual
QString displayClassType()
const
= 0;
// for ui
81
[[nodiscard]]
virtual
QString name()
const
= 0;
// for plugin
82
[[nodiscard]]
virtual
QString text(
int
value)
const
;
83
[[nodiscard]]
virtual
SmartPlaylists::Type type()
const
= 0;
84
[[nodiscard]]
virtual
SmartPlaylists::InputFormat inputFormat()
const
;
85
[[nodiscard]]
virtual
bool
canFetchTracks()
const
;
86
87
[[nodiscard]]
SmartPlaylistDatabaseEntry
toDatabaseEntry()
const
;
88
[[nodiscard]]
virtual
SmartPlaylists::StringConverterPtr stringConverter()
const
final
;
89
90
protected
:
91
[[nodiscard]]
virtual
SmartPlaylists::StringConverterPtr createConverter()
const
;
92
93
private
:
94
[[nodiscard]] QString attributesToString()
const
;
95
};
96
97
#endif
//SAYONARA_PLAYER_SMARTPLAYLIST_H
MetaDataList
The MetaDataList class.
Definition:
MetaDataList.h:39
QList
Definition:
EngineUtils.h:33
SmartPlaylist
Definition:
SmartPlaylist.h:56
SmartPlaylistDatabaseEntry
Definition:
SmartPlaylists.h:29
Generated on Wed Aug 31 2022 00:00:00 for Sayonara Player by
1.9.4