Sayonara Player
Album.h
1/* Album.h */
2
3/* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
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 HEADER_ALBUM_H_
22#define HEADER_ALBUM_H_
23
24#include "Utils/MetaData/LibraryItem.h"
25#include "Utils/Library/Sortorder.h"
26#include <QMetaType>
27#include <deque>
28
29class QVariant;
30class QStringList;
31class Album;
32
33Q_DECLARE_METATYPE(Album)
34
35class Album :
36 public LibraryItem
37{
38 PIMPL(Album)
39
40 public:
41 Album();
42 Album(const Album& other);
43 Album(Album&& other) noexcept;
44
45 Album& operator=(const Album& other);
46 Album& operator=(Album&& other) noexcept;
47 bool operator==(const Album& other) const = delete;
48
49 ~Album() override;
50
51 [[nodiscard]] AlbumId id() const;
52 void setId(const AlbumId& id);
53
54 [[nodiscard]] QString name() const;
55 void setName(const QString& name);
56
57 [[nodiscard]] QStringList artists() const;
58 void setArtists(const QStringList& artists);
59
60 [[nodiscard]] QString albumArtist() const;
61 void setAlbumArtist(const QString& albumArtist);
62
63 [[nodiscard]] QStringList pathHint() const;
64 void setPathHint(const QStringList& paths);
65
66 [[nodiscard]] Seconds durationSec() const;
67 void setDurationSec(const Seconds& sec);
68
69 [[nodiscard]] TrackNum songcount() const;
70 void setSongcount(const TrackNum& songs);
71
72 [[nodiscard]] Year year() const;
73 void setYear(const Year& year);
74
75 [[nodiscard]] Disc disccount() const;
76
77 [[nodiscard]] Rating rating() const;
78 void setRating(const Rating& rating);
79
80 [[nodiscard]] bool isSampler() const;
81
82 [[nodiscard]] QList<Disc> discnumbers() const;
83 void setDiscnumbers(const QList<Disc>& discnumbers);
84};
85
86class AlbumList :
87 public std::deque<Album>
88{
89 public:
90 [[nodiscard]] int count() const;
91
92 AlbumList& operator<<(const Album& album);
93
94 Album& operator[](int idx);
95 const Album& operator[](int idx) const;
96
97 AlbumList& appendUnique(const AlbumList& other);
98};
99
100#endif //HEADER_ALBUM_H_
101
102
Definition: Album.h:88
Definition: Album.h:37
The LibraryItem class.
Definition: LibraryItem.h:64
Definition: EngineUtils.h:33