Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TAGLIB_SYNCHRONIZEDLYRICSFRAME_H
00027 #define TAGLIB_SYNCHRONIZEDLYRICSFRAME_H
00028
00029 #include "id3v2frame.h"
00030 #include "tlist.h"
00031
00032 namespace TagLib {
00033
00034 namespace ID3v2 {
00035
00037
00040 class TAGLIB_EXPORT SynchronizedLyricsFrame : public Frame
00041 {
00042 friend class FrameFactory;
00043
00044 public:
00045
00049 enum TimestampFormat {
00051 Unknown = 0x00,
00054 AbsoluteMpegFrames = 0x01,
00057 AbsoluteMilliseconds = 0x02
00058 };
00059
00063 enum Type {
00065 Other = 0x00,
00067 Lyrics = 0x01,
00069 TextTranscription = 0x02,
00071 Movement = 0x03,
00073 Events = 0x04,
00075 Chord = 0x05,
00077 Trivia = 0x06,
00079 WebpageUrls = 0x07,
00081 ImageUrls = 0x08
00082 };
00083
00087 struct SynchedText {
00088 SynchedText(unsigned int ms, String str) : time(ms), text(str) {}
00089 unsigned int time;
00090 String text;
00091 };
00092
00096 typedef TagLib::List<SynchedText> SynchedTextList;
00097
00102 explicit SynchronizedLyricsFrame(String::Type encoding = String::Latin1);
00103
00107 explicit SynchronizedLyricsFrame(const ByteVector &data);
00108
00112 virtual ~SynchronizedLyricsFrame();
00113
00119 virtual String toString() const;
00120
00129 String::Type textEncoding() const;
00130
00139 ByteVector language() const;
00140
00144 TimestampFormat timestampFormat() const;
00145
00149 Type type() const;
00150
00158 String description() const;
00159
00163 SynchedTextList synchedText() const;
00164
00172 void setTextEncoding(String::Type encoding);
00173
00181 void setLanguage(const ByteVector &languageCode);
00182
00188 void setTimestampFormat(TimestampFormat f);
00189
00195 void setType(Type t);
00196
00202 void setDescription(const String &s);
00203
00209 void setSynchedText(const SynchedTextList &t);
00210
00211 protected:
00212
00213
00214 virtual void parseFields(const ByteVector &data);
00215 virtual ByteVector renderFields() const;
00216
00217 private:
00221 SynchronizedLyricsFrame(const ByteVector &data, Header *h);
00222 SynchronizedLyricsFrame(const SynchronizedLyricsFrame &);
00223 SynchronizedLyricsFrame &operator=(const SynchronizedLyricsFrame &);
00224
00225 class SynchronizedLyricsFramePrivate;
00226 SynchronizedLyricsFramePrivate *d;
00227 };
00228
00229 }
00230 }
00231 #endif