Sayonara Player
Popularimeter.h
1 /* Popularimeter.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 
23 #ifndef POPULARIMETER_H
24 #define POPULARIMETER_H
25 
26 
27 #include "AbstractFrame.h"
28 
29 #include <QString>
30 #include <taglib/popularimeterframe.h>
31 
32 namespace ID3v2Frame
33 {
39  {
40  public:
41 
42  QString email;
43  quint8 rating_byte; // value between 0 and 0xff
44  int playcount;
45 
46  Popularimeter();
47  Popularimeter(const QString& email_, quint8 rating_byte_, int playcount);
48  void set_sayonara_rating(quint8 max_5);
49  quint8 get_sayonara_rating() const;
50  QString to_string();
51  };
52 
53 
59  public AbstractFrame<Popularimeter, TagLib::ID3v2::PopularimeterFrame>
60  {
61 
62  protected:
63  TagLib::ID3v2::Frame* create_id3v2_frame() override;
64 
65  public:
66  PopularimeterFrame(TagLib::FileRef* file_ref);
68 
69  void map_model_to_frame() override;
70  void map_frame_to_model() override;
71  };
72 }
73 #endif // POPULARIMETER_H
The PopularimeterFrame class.
Definition: Popularimeter.h:58
The Popularimeter class.
Definition: Popularimeter.h:38
ID3v2Frame namespace.
Definition: AbstractFrame.h:38
The AbstractFrame class for example AbstractFrame<Discnumber, TagLib::ID3v2::TextIdentificationFrame>...
Definition: AbstractFrame.h:47