Sayonara Player
MetaData.h
1 /* MetaData.h */
2 
3 /* Copyright (C) 2011-2016 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: Lucio Carreras
26  */
27 
28 #ifndef METADATA_H_
29 #define METADATA_H_
30 
31 #include "Helper/MetaData/LibraryItem.h"
32 
33 #include <QMetaType>
34 #include <QStringList>
35 #include <QString>
36 
41 enum class RadioMode : quint8
42 {
43 
44  Off = 0,
45  Station,
46  Soundcloud
47 };
48 
49 class MetaData :
50  public LibraryItem
51 {
52 
53 private:
54  QString _filepath;
55  RadioMode _radio_mode;
56 
57 public:
58  qint32 id;
59  qint32 album_id;
60  qint32 artist_id;
61  QString title;
62  QString artist;
63  QString album; // if radio station: name of radio station
64  QStringList genres;
65  quint8 rating;
66  quint64 length_ms;
67  quint16 year;
68 
69  quint16 track_num;
70  quint32 bitrate;
71  quint64 filesize;
72  //QString comment;
73  quint8 discnumber;
74  quint8 n_discs;
75 
76  bool played;
77  bool is_extern;
78  bool pl_playing;
79 
80  bool is_disabled;
81 
82  MetaData ();
83  MetaData (const MetaData& );
84  MetaData ( MetaData&& );
85  MetaData (const QString& path);
86  virtual ~MetaData();
87 
88  QUrl url() const;
89  QString filepath() const;
90  QString set_filepath(QString filepath);
91 
92  RadioMode radio_mode() const;
93 
94  MetaData& operator=(const MetaData& md);
95  bool operator==(const MetaData& md) const;
96  bool operator!=(const MetaData& md) const;
97  bool is_equal(const MetaData& md) const;
98  bool is_equal_deep(const MetaData& md) const;
99 
100  QString to_string() const;
101 
102  static QVariant toVariant(const MetaData& md);
103  static bool fromVariant(const QVariant& v, MetaData& md);
104 };
105 
106 Q_DECLARE_METATYPE(MetaData)
107 
108 
109 
110 
111 #endif /* METADATA_H_ */
The LibraryItem class.
Definition: LibraryItem.h:59
RadioMode
The RadioMode enum.
Definition: MetaData.h:41
Definition: MetaData.h:49