Sayonara Player
MetaData.h
1/* MetaData.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/*
22 * MetaData.h
23 *
24 * Created on: Mar 10, 2011
25 * Author: Michael Lugmair (Lucio Carreras)
26 */
27
28#ifndef METADATA_H_
29#define METADATA_H_
30
31#include "Utils/MetaData/LibraryItem.h"
32#include "Utils/MetaData/RadioMode.h"
33#include "Utils/MetaData/Genre.h"
34#include "Utils/Library/Sortorder.h"
35#include "Utils/Pimpl.h"
36
37#include <QMetaType>
38#include <QString>
39
40class QDateTime;
45class MetaData :
46 public LibraryItem
47{
48 PIMPL(MetaData)
49
50 public:
51 MetaData();
52 explicit MetaData(const QString& path);
53 MetaData(const MetaData& other);
54 MetaData(MetaData&& other) noexcept;
55 MetaData& operator=(const MetaData& md);
56 MetaData& operator=(MetaData&& md) noexcept;
57
58 ~MetaData();
59
60 QString title() const;
61 void setTitle(const QString& title);
62
63 QString artist() const;
64 void setArtist(const QString& artist);
65 ArtistId artistId() const;
66 void setArtistId(ArtistId id);
67
68 QString album() const;
69 void setAlbum(const QString& album);
70 AlbumId albumId() const;
71 void setAlbumId(AlbumId id);
72
73 const QString& comment() const;
74 void setComment(const QString& comment);
75
76 QString filepath() const;
77 QString setFilepath(const QString& filepath, RadioMode mode = RadioMode::Undefined);
78
79 ArtistId albumArtistId() const;
80 QString albumArtist() const;
81
82 void setAlbumArtist(const QString& albumArtist, ArtistId id = -1);
83 void setAlbumArtistId(ArtistId id);
84
85 void setRadioStation(const QString& url, const QString& name = QString());
86 QString radioStation() const;
87 QString radioStationName() const;
88
89 RadioMode radioMode() const;
90 void changeRadioMode(RadioMode mode);
91
92 bool isValid() const;
93
94 bool operator==(const MetaData& other) const;
95 bool operator!=(const MetaData& other) const;
96 bool isEqual(const MetaData& other) const;
97 bool isEqualDeep(const MetaData& md) const;
98
99 const Util::Set<GenreID>& genreIds() const;
100 Util::Set<Genre> genres() const;
101 bool hasGenre(const Genre& genre) const;
102 bool removeGenre(const Genre& genre);
103 bool addGenre(const Genre& genre);
104 void setGenres(const Util::Set<Genre>& genres);
105 void setGenres(const QStringList& newGenres);
106
107 void setCreatedDate(uint64_t t);
108 uint64_t createdDate() const;
109 QDateTime createdDateTime() const;
110
111 void setModifiedDate(uint64_t t);
112 uint64_t modifiedDate() const;
113 QDateTime modifiedDateTime() const;
114
115 QString genresToString() const;
116 QStringList genresToList() const;
117
118 Disc discnumber() const;
119 void setDiscnumber(const Disc& value);
120
121 Disc discCount() const;
122 void setDiscCount(const Disc& value);
123
124 Bitrate bitrate() const;
125 void setBitrate(const Bitrate& value);
126
127 TrackNum trackNumber() const;
128 void setTrackNumber(const uint16_t& value);
129
130 Year year() const;
131 void setYear(const uint16_t& value);
132
133 Filesize filesize() const;
134 void setFilesize(const Filesize& value);
135
136 Rating rating() const;
137 void setRating(const Rating& value);
138
139 MilliSeconds durationMs() const;
140 void setDurationMs(const MilliSeconds& value);
141
142 bool isExtern() const;
143 void setExtern(bool value);
144
145 bool isDisabled() const;
146 void setDisabled(bool value);
147
148 LibraryId libraryId() const;
149 void setLibraryid(const LibraryId& value);
150
151 TrackID id() const;
152 void setId(const TrackID& value);
153};
154
155#ifndef MetaDataDeclared
156Q_DECLARE_METATYPE(MetaData)
157#define MetaDataDeclared
158#endif
159
160#endif /* METADATA_H_ */
Definition: Genre.h:31
The LibraryItem class.
Definition: LibraryItem.h:64
The MetaData class.
Definition: MetaData.h:47
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: Set.h:37
RadioMode
The RadioMode enum.
Definition: RadioMode.h:29