TagLib
2.0.2
taglib
mpeg
id3v2
frames
textidentificationframe.h
Go to the documentation of this file.
1
/***************************************************************************
2
copyright : (C) 2002 - 2008 by Scott Wheeler
3
email : wheeler@kde.org
4
***************************************************************************/
5
6
/***************************************************************************
7
* This library is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU Lesser General Public License version *
9
* 2.1 as published by the Free Software Foundation. *
10
* *
11
* This library is distributed in the hope that it will be useful, but *
12
* WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14
* Lesser General Public License for more details. *
15
* *
16
* You should have received a copy of the GNU Lesser General Public *
17
* License along with this library; if not, write to the Free Software *
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
19
* 02110-1301 USA *
20
* *
21
* Alternatively, this file is available under the Mozilla Public *
22
* License Version 1.1. You may obtain a copy of the License at *
23
* http://www.mozilla.org/MPL/ *
24
***************************************************************************/
25
26
#ifndef TAGLIB_TEXTIDENTIFICATIONFRAME_H
27
#define TAGLIB_TEXTIDENTIFICATIONFRAME_H
28
29
#include "
tstringlist.h
"
30
#include "
tmap.h
"
31
#include "
taglib_export.h
"
32
#include "
id3v2frame.h
"
33
34
namespace
TagLib
{
35
36
namespace
ID3v2 {
37
38
class
Tag;
39
using
KeyConversionMap
=
Map<String, String>
;
40
42
105
class
TAGLIB_EXPORT
TextIdentificationFrame
:
public
Frame
106
{
107
friend
class
FrameFactory
;
108
109
public
:
119
TextIdentificationFrame
(
const
ByteVector
&type,
String::Type
encoding);
120
125
explicit
TextIdentificationFrame
(
const
ByteVector
&data);
126
132
static
TextIdentificationFrame
*createTIPLFrame(
const
PropertyMap
&properties);
133
140
static
TextIdentificationFrame
*createTMCLFrame(
const
PropertyMap
&properties);
144
~
TextIdentificationFrame
()
override
;
145
146
TextIdentificationFrame
(
const
TextIdentificationFrame
&) =
delete
;
147
TextIdentificationFrame
&operator=(
const
TextIdentificationFrame
&) =
delete
;
148
159
void
setText(
const
StringList
&l);
160
161
// Reimplementations.
162
163
void
setText(
const
String
&s)
override
;
164
String
toString()
const override
;
165
StringList
toStringList()
const override
;
166
177
String::Type
textEncoding()
const
;
178
188
void
setTextEncoding(
String::Type
encoding);
189
193
StringList
fieldList()
const
;
194
199
static
const
KeyConversionMap
&involvedPeopleMap();
200
201
PropertyMap
asProperties()
const override
;
202
203
protected
:
204
// Reimplementations.
205
206
void
parseFields(
const
ByteVector
&data)
override
;
207
ByteVector
renderFields()
const override
;
208
212
TextIdentificationFrame
(
const
ByteVector
&data,
Header
*h);
213
214
private
:
220
PropertyMap
makeTIPLProperties()
const
;
224
PropertyMap
makeTMCLProperties()
const
;
225
class
TextIdentificationFramePrivate;
226
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
227
std::unique_ptr<TextIdentificationFramePrivate> d;
228
};
229
238
240
class
TAGLIB_EXPORT
UserTextIdentificationFrame
:
public
TextIdentificationFrame
241
{
242
friend
class
FrameFactory
;
243
244
public
:
249
explicit
UserTextIdentificationFrame
(
String::Type
encoding =
String::Latin1
);
250
254
explicit
UserTextIdentificationFrame
(
const
ByteVector
&data);
255
260
UserTextIdentificationFrame
(
const
String
&description,
const
StringList
&values,
String::Type
encoding =
String::UTF8
);
261
262
~
UserTextIdentificationFrame
()
override
;
263
264
UserTextIdentificationFrame
(
const
UserTextIdentificationFrame
&) =
delete
;
265
UserTextIdentificationFrame
&operator=(
const
UserTextIdentificationFrame
&) =
delete
;
266
267
String
toString()
const override
;
268
272
String
description()
const
;
273
279
void
setDescription(
const
String
&s);
280
281
void
setText(
const
String
&text)
override
;
282
void
setText(
const
StringList
&fields);
283
297
PropertyMap
asProperties()
const override
;
298
303
static
UserTextIdentificationFrame
*find(
const
Tag
*tag,
const
String
&description);
304
308
static
String
keyToTXXX(
const
String
&);
309
313
static
String
txxxToKey(
const
String
&);
314
315
private
:
316
UserTextIdentificationFrame
(
const
ByteVector
&data,
Header
*h);
317
318
void
checkFields();
319
320
class
UserTextIdentificationFramePrivate;
321
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
322
std::unique_ptr<UserTextIdentificationFramePrivate> d;
323
};
324
325
}
// namespace ID3v2
326
}
// namespace TagLib
327
#endif
TagLib::PropertyMap
A map for format-independent <key,values> tag representations.
Definition:
tpropertymap.h:122
TagLib::ID3v2::Header
An implementation of ID3v2 headers.
Definition:
id3v2header.h:48
TagLib::String
A wide string class suitable for unicode.
Definition:
tstring.h:82
TagLib::ID3v2::TextIdentificationFrame
An ID3v2 text identification frame implementation.
Definition:
textidentificationframe.h:105
TagLib::ByteVector
A byte vector.
Definition:
tbytevector.h:45
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition:
id3v2framefactory.h:67
id3v2frame.h
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition:
taglib_export.h:55
tstringlist.h
TagLib::Map
A generic, implicitly shared map.
Definition:
tmap.h:44
TagLib::StringList
A list of strings.
Definition:
tstringlist.h:43
TagLib::ID3v2::Frame
ID3v2 frame implementation.
Definition:
id3v2frame.h:56
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition:
taglib_export.h:40
TagLib::ID3v2::UserTextIdentificationFrame
An ID3v2 custom text identification frame implementation.
Definition:
textidentificationframe.h:240
TagLib::ID3v2::Tag
The main class in the ID3v2 implementation.
Definition:
id3v2tag.h:133
taglib_export.h
TagLib::String::Type
Type
Definition:
tstring.h:96
tmap.h
TagLib
A namespace for all TagLib related classes and functions.
Definition:
apefile.h:41
TagLib::String::Latin1
Definition:
tstring.h:100
TagLib::String::UTF8
Definition:
tstring.h:113