libtaginfo  0.2.0
taginfo_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2013 J.Rios <anonbeat@gmail.com>
3  * Copyright (C) 2013 Jörn Magens
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This Program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; see the file LICENSE. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth
18  * Floor, Boston, MA 02110-1301 USA
19  * https://www.gnu.org/licenses/lgpl-2.1.txt
20  *
21  * Author:
22  * Jörn Magens <shuerhaaken@googlemail.com>
23  *
24  */
25 
26 #ifndef TAGINFO_INTERNAL_H
27 #define TAGINFO_INTERNAL_H
28 
29 
30 #include "taginfo.h"
31 
32 #include <tag.h>
33 
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 #define BUFFERSIZE 512
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37 
38 
39 using namespace TagLib;
40 
44 namespace TagInfo {
45 
47  enum ChangedFlags {
51  CHANGED_ARTIST_TAG = (1 << 0),
53  CHANGED_ALBUM_TAG = (1 << 1),
55  CHANGED_TITLE_TAG = (1 << 2),
57  CHANGED_GENRE_TAG = (1 << 3),
59  CHANGED_COMMENT_TAG = (1 << 4),
63  CHANGED_TRACK_COUNT = (1 << 6),
65  CHANGED_YEAR_TAG = (1 << 7),
71  CHANGED_DATA_VOL_CNT = (1 << 10),
73  CHANGED_DATA_IMAGES = (1 << 11),
75  CHANGED_DATA_LYRICS = (1 << 12),
77  CHANGED_DATA_RATING = (1 << 13),
81  CHANGED_COMPOSER_TAG = (1 << 15),
83  CHANGED_TRACK_LABELS = (1 << 16),
85  CHANGED_ARTIST_LABELS = (1 << 17),
87  CHANGED_ALBUM_LABELS = (1 << 18),
91  CHANGED_HOMEPAGE_TAG = (1 << 20),
93  CHANGED_ENCODER_TAG = (1 << 21),
95  CHANGED_COPYRIGHT_TAG = (1 << 22),
97  CHANGED_LICENSE_TAG = (1 << 23),
101  CHANGED_BPM_TAG = (1 << 25)
102  };
103 }
104 
105 #ifndef DOXYGEN_SHOULD_SKIP_THIS
106 inline StringList split(const String str, const String &separator) {
107  return StringList::split(str, separator);
108 }
109 
110 
111 inline int popularity_to_rating(const int popularity) {
112  if(popularity <= 0)
113  return 0;
114  if(popularity < 64)
115  return 1;
116  if(popularity < 128)
117  return 2;
118  if(popularity < 192)
119  return 3;
120  if(popularity < 255)
121  return 4;
122  return 5;
123 }
124 
125 inline int rating_to_popularity(const int rating) {
126  int Ratings[] = { 0, 0, 1, 64, 128, 192, 255 };
127  return Ratings[rating + 1];
128 }
129 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
130 
131 #endif
Images tag changed.
Definition: taginfo_internal.h:73
Is compilation tag changed.
Definition: taginfo_internal.h:89
Encoder tag changed.
Definition: taginfo_internal.h:93
Track number tag changed.
Definition: taginfo_internal.h:61
Track labels changed.
Definition: taginfo_internal.h:83
Year tag changed.
Definition: taginfo_internal.h:65
Artist tag changed.
Definition: taginfo_internal.h:51
Lyrics tag changed.
Definition: taginfo_internal.h:75
Comment tag changed.
Definition: taginfo_internal.h:59
Rating tag changed.
Definition: taginfo_internal.h:77
Beats per minute tag changed.
Definition: taginfo_internal.h:101
Genre tag changed.
Definition: taginfo_internal.h:57
Artist labels changed.
Definition: taginfo_internal.h:85
Composer tag changed.
Definition: taginfo_internal.h:81
ChangedFlags
Internal change flags for implementations.
Definition: taginfo_internal.h:47
Homepage tag changed.
Definition: taginfo_internal.h:91
Play count changed.
Definition: taginfo_internal.h:79
Album labels changed.
Definition: taginfo_internal.h:87
Copyright tag changed.
Definition: taginfo_internal.h:95
Track count tag changed.
Definition: taginfo_internal.h:63
License tag changed.
Definition: taginfo_internal.h:97
Volume number tag changed.
Definition: taginfo_internal.h:69
Nothing changed.
Definition: taginfo_internal.h:49
Volume count tag changed.
Definition: taginfo_internal.h:71
Original artist tag changed.
Definition: taginfo_internal.h:99
Title tag changed.
Definition: taginfo_internal.h:55
Album artist tag changed.
Definition: taginfo_internal.h:67
Album tag changed.
Definition: taginfo_internal.h:53