| TagLib 1.13 |  |

synchronizedlyricsframe.h
Go to the documentation of this file.
1/***************************************************************************
2 copyright : (C) 2014 by Urs Fleisch
3 email : ufleisch@users.sourceforge.net
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_SYNCHRONIZEDLYRICSFRAME_H
27#define TAGLIB_SYNCHRONIZEDLYRICSFRAME_H
28
29#include "id3v2frame.h"
30#include "tlist.h"
31
32 namespace TagLib {
33
34 namespace ID3v2 {
35
37
40 class TAGLIB_EXPORT SynchronizedLyricsFrame : public Frame
41 {
42 friend class FrameFactory;
43
44 public:
45
49 enum TimestampFormat {
51 Unknown = 0x00,
54 AbsoluteMpegFrames = 0x01,
57 AbsoluteMilliseconds = 0x02
58 };
59
63 enum Type {
65 Other = 0x00,
67 Lyrics = 0x01,
69 TextTranscription = 0x02,
71 Movement = 0x03,
73 Events = 0x04,
75 Chord = 0x05,
77 Trivia = 0x06,
79 WebpageUrls = 0x07,
81 ImageUrls = 0x08
82 };
83
87 struct SynchedText {
88 SynchedText(unsigned int ms, String str) : time(ms), text(str) {}
89 unsigned int time;
90 String text;
91 };
92
96 typedef TagLib::List<SynchedText> SynchedTextList;
97
102 explicit SynchronizedLyricsFrame(String::Type encoding = String::Latin1);
103
107 explicit SynchronizedLyricsFrame(const ByteVector &data);
108
112 virtual ~SynchronizedLyricsFrame();
113
119 virtual String toString() const;
120
129 String::Type textEncoding() const;
130
139 ByteVector language() const;
140
144 TimestampFormat timestampFormat() const;
145
149 Type type() const;
150
158 String description() const;
159
163 SynchedTextList synchedText() const;
164
172 void setTextEncoding(String::Type encoding);
173
181 void setLanguage(const ByteVector &languageCode);
182
188 void setTimestampFormat(TimestampFormat f);
189
195 void setType(Type t);
196
202 void setDescription(const String &s);
203
209 void setSynchedText(const SynchedTextList &t);
210
211 protected:
212 // Reimplementations.
213
214 virtual void parseFields(const ByteVector &data);
215 virtual ByteVector renderFields() const;
216
217 private:
221 SynchronizedLyricsFrame(const ByteVector &data, Header *h);
222 SynchronizedLyricsFrame(const SynchronizedLyricsFrame &);
223 SynchronizedLyricsFrame &operator=(const SynchronizedLyricsFrame &);
224
225 class SynchronizedLyricsFramePrivate;
226 SynchronizedLyricsFramePrivate *d;
227 };
228
229 }
230}
231#endif
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::ID3v2::FrameFactory
A factory for creating ID3v2 frames during parsing.
Definition: id3v2framefactory.h:66
TagLib::ID3v2::Frame
ID3v2 frame implementation.
Definition: id3v2frame.h:55
TagLib::ID3v2::Header
An implementation of ID3v2 headers.
Definition: id3v2header.h:49
TagLib::ID3v2::SynchronizedLyricsFrame
ID3v2 synchronized lyrics frame.
Definition: synchronizedlyricsframe.h:41
TagLib::ID3v2::SynchronizedLyricsFrame::setDescription
void setDescription(const String &s)
TagLib::ID3v2::SynchronizedLyricsFrame::textEncoding
String::Type textEncoding() const
TagLib::ID3v2::SynchronizedLyricsFrame::setSynchedText
void setSynchedText(const SynchedTextList &t)
TagLib::ID3v2::SynchronizedLyricsFrame::setTextEncoding
void setTextEncoding(String::Type encoding)
TagLib::ID3v2::SynchronizedLyricsFrame::timestampFormat
TimestampFormat timestampFormat() const
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedTextList
TagLib::List< SynchedText > SynchedTextList
Definition: synchronizedlyricsframe.h:96
TagLib::ID3v2::SynchronizedLyricsFrame::setLanguage
void setLanguage(const ByteVector &languageCode)
TagLib::ID3v2::SynchronizedLyricsFrame::toString
virtual String toString() const
TagLib::ID3v2::SynchronizedLyricsFrame::type
Type type() const
TagLib::ID3v2::SynchronizedLyricsFrame::Type
Type
Definition: synchronizedlyricsframe.h:63
TagLib::ID3v2::SynchronizedLyricsFrame::SynchronizedLyricsFrame
SynchronizedLyricsFrame(String::Type encoding=String::Latin1)
TagLib::ID3v2::SynchronizedLyricsFrame::description
String description() const
TagLib::ID3v2::SynchronizedLyricsFrame::TimestampFormat
TimestampFormat
Definition: synchronizedlyricsframe.h:49
TagLib::ID3v2::SynchronizedLyricsFrame::~SynchronizedLyricsFrame
virtual ~SynchronizedLyricsFrame()
TagLib::ID3v2::SynchronizedLyricsFrame::setTimestampFormat
void setTimestampFormat(TimestampFormat f)
TagLib::ID3v2::SynchronizedLyricsFrame::language
ByteVector language() const
TagLib::ID3v2::SynchronizedLyricsFrame::setType
void setType(Type t)
TagLib::ID3v2::SynchronizedLyricsFrame::synchedText
SynchedTextList synchedText() const
TagLib::ID3v2::SynchronizedLyricsFrame::parseFields
virtual void parseFields(const ByteVector &data)
TagLib::ID3v2::SynchronizedLyricsFrame::renderFields
virtual ByteVector renderFields() const
TagLib::ID3v2::SynchronizedLyricsFrame::SynchronizedLyricsFrame
SynchronizedLyricsFrame(const ByteVector &data)
TagLib::List
A generic, implicitly shared list.
Definition: tlist.h:54
TagLib::String
A wide string class suitable for unicode.
Definition: tstring.h:85
TagLib::String::Type
Type
Definition: tstring.h:97
TagLib::String::Latin1
@ Latin1
Definition: tstring.h:101
id3v2frame.h
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText
Definition: synchronizedlyricsframe.h:87
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText::SynchedText
SynchedText(unsigned int ms, String str)
Definition: synchronizedlyricsframe.h:88
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText::time
unsigned int time
Definition: synchronizedlyricsframe.h:89
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText::text
String text
Definition: synchronizedlyricsframe.h:90
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tlist.h