Sayonara Player
Loading...
Searching...
No Matches
MetaData.h
1/* MetaData.h */
2
3/* Copyright (C) 2011-2024 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 [[nodiscard]] HashValue filepathHash() const;
78 QString setFilepath(const QString& filepath, RadioMode mode = RadioMode::Undefined);
79
80 ArtistId albumArtistId() const;
81 QString albumArtist() const;
82
83 void setAlbumArtist(const QString& albumArtist, ArtistId id = -1);
84 void setAlbumArtistId(ArtistId id);
85
86 void setRadioStation(const QString& url, const QString& name = QString());
87 QString radioStation() const;
88 QString radioStationName() const;
89
90 RadioMode radioMode() const;
91 void changeRadioMode(RadioMode mode);
92
93 bool isUpdatable() const;
94 void setUpdateable(bool b);
95
96 bool isValid() const;
97
98 bool operator==(const MetaData& other) const;
99 bool operator!=(const MetaData& other) const;
100 bool isEqual(const MetaData& other) const;
101 bool isEqualDeep(const MetaData& md) const;
102
103 const Util::Set<GenreID>& genreIds() const;
104 Util::Set<Genre> genres() const;
105 bool hasGenre(const Genre& genre) const;
106 bool removeGenre(const Genre& genre);
107 bool addGenre(const Genre& genre);
108 void setGenres(const Util::Set<Genre>& genres);
109 void setGenres(const QStringList& newGenres);
110
111 void setCreatedDate(uint64_t t);
112 uint64_t createdDate() const;
113 QDateTime createdDateTime() const;
114
115 void setModifiedDate(uint64_t t);
116 uint64_t modifiedDate() const;
117 QDateTime modifiedDateTime() const;
118
119 QString genresToString() const;
120 QStringList genresToList() const;
121
122 Disc discnumber() const;
123 void setDiscnumber(const Disc& value);
124
125 Disc discCount() const;
126 void setDiscCount(const Disc& value);
127
128 Bitrate bitrate() const;
129 void setBitrate(const Bitrate& value);
130
131 TrackNum trackNumber() const;
132 void setTrackNumber(const uint16_t& value);
133
134 Year year() const;
135 void setYear(const uint16_t& value);
136
137 Filesize filesize() const;
138 void setFilesize(const Filesize& value);
139
140 Rating rating() const;
141 void setRating(const Rating& value);
142
143 MilliSeconds durationMs() const;
144 void setDurationMs(const MilliSeconds& value);
145
146 bool isExtern() const;
147 void setExtern(bool value);
148
149 bool isDisabled() const;
150 void setDisabled(bool value);
151
152 LibraryId libraryId() const;
153 void setLibraryid(const LibraryId& value);
154
155 TrackID id() const;
156 void setId(const TrackID& value);
157};
158
159#ifndef MetaDataDeclared
160Q_DECLARE_METATYPE(MetaData)
161#define MetaDataDeclared
162#endif
163
164#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:32