30#include "id3/io_decorators.h"
31#include "io_strings.h"
37 io::ExitTrigger et(reader);
43 ID3D_NOTICE(
"id3::v1::parse: not enough bytes to parse, pos = " << end );
51 ID3D_WARNING(
"id3::v1::parse: failed to reposition " <<
ID3_V1_LEN <<
74 ID3D_NOTICE(
"id3::v1::parse: read bytes: " << reader.
getCur() - beg);
77 if (title.size() > 0 && (field.size() == 0 || field ==
""))
81 ID3D_NOTICE(
"id3::v1::parse: title = \"" << title <<
"\"" );
83 ID3D_NOTICE(
"id3::v1::parse: read bytes: " << reader.
getCur() - beg);
86 if (artist.size() > 0 && (field.size() == 0 || field ==
""))
90 ID3D_NOTICE(
"id3::v1::parse: artist = \"" << artist <<
"\"" );
92 ID3D_NOTICE(
"id3::v1::parse: read bytes: " << reader.
getCur() - beg);
95 if (album.size() > 0 && (field.size() == 0 || field ==
""))
99 ID3D_NOTICE(
"id3::v1::parse: album = \"" << title <<
"\"" );
101 ID3D_NOTICE(
"id3::v1::parse: read bytes: " << reader.
getCur() - beg);
104 if (year.size() > 0 && (field.size() == 0 || field ==
""))
108 ID3D_NOTICE(
"id3::v1::parse: year = \"" << year <<
"\"" );
110 ID3D_NOTICE(
"id3::v1::parse: read bytes: " << reader.
getCur() - beg);
114 if (trackno[0] ==
'\0')
116 if (trackno[1] !=
'\0')
118 size_t track = trackno[1];
120 if (field.size() == 0 || field ==
"00")
124 ID3D_NOTICE(
"id3::v1::parse: track = \"" << track <<
"\"" );
125 ID3D_NOTICE(
"id3::v1::parse: comment length = \"" << comment.length() <<
"\"" );
132 const char * padding =
" ";
134 if (trackno[1] ==
'\0' || trackno[1] == 0x20 && trackno[0] != 0x20)
137 comment.append(padding, paddingsize);
138 comment.append((
const char *)trackno.data(), 1);
140 else if (trackno[1] !=
'\0' && trackno[1] != 0x20 && trackno[0] != 0x20)
143 comment.append(padding, paddingsize);
144 comment.append((
const char *)trackno.data(), 2);
147 ID3D_NOTICE(
"id3::v1::parse: comment = \"" << comment <<
"\"" );
148 if (comment.size() > 0)
153 ID3D_NOTICE(
"id3::v1::parse: read bytes: " << reader.
getCur() - beg);
157 if (genre != 0xFF && (field.size() == 0 || field ==
""))
161 ID3D_NOTICE(
"id3::v1::parse: genre = \"" << (
int) genre <<
"\"" );
163 ID3D_NOTICE(
"id3::v1::parse: read bytes: " << reader.
getCur() - beg);
virtual pos_type setCur(pos_type pos)=0
Set the value of the current position for reading.
virtual pos_type getCur()=0
Return the current position in the reader.
virtual int_type readChar()
Read a single character and advance the internal position.
virtual pos_type getBeg()
Return the beginning position in the reader.
#define STR_V1_COMMENT_DESC
String used for the description field of a comment tag converted from an id3v1 tag to an id3v2 tag.
bool parse(ID3_TagImpl &, ID3_Reader &)
ID3_C_EXPORT String getArtist(const ID3_TagImpl &)
ID3_C_EXPORT String getTitle(const ID3_TagImpl &)
ID3_C_EXPORT ID3_Frame * setAlbum(ID3_TagImpl &, String)
ID3_C_EXPORT String getAlbum(const ID3_TagImpl &)
ID3_C_EXPORT ID3_Frame * setTitle(ID3_TagImpl &, String)
ID3_C_EXPORT ID3_Frame * setArtist(ID3_TagImpl &, String)
ID3_C_EXPORT ID3_Frame * setYear(ID3_TagImpl &, String)
ID3_C_EXPORT String getYear(const ID3_TagImpl &)
ID3_C_EXPORT ID3_Frame * setComment(ID3_TagImpl &, String, String, String)
ID3_C_EXPORT ID3_Frame * setTrack(ID3_TagImpl &, uchar ucTrack, uchar ucTotal)
ID3_C_EXPORT String getGenre(const ID3_TagImpl &)
ID3_C_EXPORT String getTrack(const ID3_TagImpl &)
ID3_C_EXPORT ID3_Frame * setGenre(ID3_TagImpl &, size_t ucGenre)