#include <TagCounter.h>
Definition at line 12 of file TagCounter.h.
◆ TagCounter()
TagCounter::TagCounter |
( |
| ) |
|
|
inline |
◆ operator+=()
void TagCounter::operator+= |
( |
const TagCounter | _x | ) |
|
|
inline |
◆ read()
__DCL_BEGIN_NAMESPACE void TagCounter::read |
( |
const String & | _filename, |
|
|
TagCounter & | _counter ) |
|
static |
Definition at line 38 of file TagCounter.cpp.
39{
40 File file(_filename);
42
43 int idv2 = 0;
44 int ape = 0;
45 int idv1 = 0;
46
47
48
49 size_t n = file.read(
buf, 32);
51 if (memcmp(
buf,
"ID3", 3) == 0) {
53 }
54 else if (memcmp(
buf,
"APETAGEX", 8) == 0) {
55 ape = APEv2::word(&
buf[8]) / 1000;
56 }
57 }
58
59
61 n = file.read(
buf, 160);
63 if (ape == 0) {
64 if (memcmp(
buf,
"APETAGEX", 8) == 0) {
65 ape = APEv2::word(&
buf[8]) / 1000;
66 }
67 else if (memcmp(&
buf[128],
"APETAGEX", 8) == 0) {
68 ape = APEv2::word(&
buf[128 + 8]) / 1000;
69 }
70 }
71
72 if (memcmp(&
buf[32],
"TAG", 3) == 0) {
73 idv1 = 1;
74 }
75 }
76
77 switch (idv2) {
78 case 2:
80 break;
81 case 3 :
83 break;
84 case 4 :
86 }
87
88 switch (ape) {
89 case 1:
91 break;
92 case 2:
94 }
95
96 if (idv1 == 1) {
98 }
99}
void CharsetConvertException *size_t n
◆ readDir()
Definition at line 101 of file TagCounter.cpp.
103{
104 Dir dir(_path);
105 Dir::Entry entry;
106
107 while (dir.read(entry)) {
108 String name = entry.name();
109 if (entry.isDir()) {
110 if (name.compare(L"..", name.length()) != 0) {
111 String path = dir.path() + name;
114 _counter += counter;
116 _args.output() << L
"[" << path << L
"] " << counter.
toString() <<
endl;
117 }
118 }
119 }
120 else {
121 if (name.toLowerCase().endsWith(L".mp3")) {
122 try {
125 _counter += counter;
127 _args.output() << L
"[ " << name << L
"] " << counter.
toString() <<
endl;
128 }
129 }
130 catch (Exception* e) {
134 }
135 }
136 }
137 }
138}
String toStringAll() const
static void read(const String &_filename, TagCounter &_counter)
static void readDir(const String &_path, TagCounter &_counter, const MainArguments &_args)
◆ toString()
String TagCounter::toString |
( |
| ) |
const |
|
inline |
Definition at line 28 of file TagCounter.h.
28 {
29 return String::format(L""
30 "ID3v1[%d] ID3v22[%d] ID3v23[%d] ID3v24[%d] APEv1[%d] APEv2[%d] error[%d]",
32 );
33 }
◆ APEv1
◆ APEv2
◆ error
◆ ID3v1
◆ ID3v22
◆ ID3v23
◆ ID3v24
The documentation for this class was generated from the following files: