synchronizedlyricsframe.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2014 by Urs Fleisch
email : ufleisch@users.sourceforge.net
***************************************************************************/
/***************************************************************************
* This library is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License version *
* 2.1 as published by the Free Software Foundation. *
* *
* This library is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA *
* 02110-1301 USA *
* *
* Alternatively, this file is available under the Mozilla Public *
* License Version 1.1. You may obtain a copy of the License at *
* http://www.mozilla.org/MPL/ *
***************************************************************************/
#ifndef TAGLIB_SYNCHRONIZEDLYRICSFRAME_H
#define TAGLIB_SYNCHRONIZEDLYRICSFRAME_H
#include "tlist.h"
#include "id3v2frame.h"
namespace TagLib {
namespace ID3v2 {
class TAGLIB_EXPORT SynchronizedLyricsFrame : public Frame
{
friend class FrameFactory;
public:
enum TimestampFormat {
Unknown = 0x00,
AbsoluteMpegFrames = 0x01,
AbsoluteMilliseconds = 0x02
};
enum Type {
Other = 0x00,
Lyrics = 0x01,
TextTranscription = 0x02,
Movement = 0x03,
Events = 0x04,
Chord = 0x05,
Trivia = 0x06,
WebpageUrls = 0x07,
ImageUrls = 0x08
};
struct SynchedText {
SynchedText(unsigned int ms, const String &str) :
time(ms), text(str) { }
unsigned int time;
String text;
};
using SynchedTextList = TagLib::List<SynchedText>;
explicit SynchronizedLyricsFrame(String::Type encoding = String::Latin1);
explicit SynchronizedLyricsFrame(const ByteVector &data);
~SynchronizedLyricsFrame() override;
SynchronizedLyricsFrame(const SynchronizedLyricsFrame &) = delete;
SynchronizedLyricsFrame &operator=(const SynchronizedLyricsFrame &) = delete;
String toString() const override;
String::Type textEncoding() const;
ByteVector language() const;
TimestampFormat timestampFormat() const;
Type type() const;
String description() const;
SynchedTextList synchedText() const;
void setTextEncoding(String::Type encoding);
void setLanguage(const ByteVector &languageEncoding);
void setTimestampFormat(TimestampFormat f);
void setType(Type t);
void setDescription(const String &s);
void setSynchedText(const SynchedTextList &t);
protected:
// Reimplementations.
void parseFields(const ByteVector &data) override;
ByteVector renderFields() const override;
private:
SynchronizedLyricsFrame(const ByteVector &data, Header *h);
class SynchronizedLyricsFramePrivate;
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
std::unique_ptr<SynchronizedLyricsFramePrivate> d;
};
} // namespace ID3v2
} // namespace TagLib
#endif
TagLib::ByteVector
A byte vector.
Definition tbytevector.h:46
TagLib::ID3v2::Frame::Header
ID3v2 frame header implementation.
Definition id3v2frame.h:293
TagLib::ID3v2::Frame::Frame
Frame(const Frame &)=delete
TagLib::ID3v2::SynchronizedLyricsFrame::operator=
SynchronizedLyricsFrame & operator=(const SynchronizedLyricsFrame &)=delete
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::SynchedTextList
TagLib::List< SynchedText > SynchedTextList
Definition synchronizedlyricsframe.h:97
TagLib::ID3v2::SynchronizedLyricsFrame::timestampFormat
TimestampFormat timestampFormat() const
TagLib::ID3v2::SynchronizedLyricsFrame::setLanguage
void setLanguage(const ByteVector &languageEncoding)
TagLib::ID3v2::SynchronizedLyricsFrame::type
Type type() const
TagLib::ID3v2::SynchronizedLyricsFrame::FrameFactory
friend class FrameFactory
Definition synchronizedlyricsframe.h:42
TagLib::ID3v2::SynchronizedLyricsFrame::Type
Type
Definition synchronizedlyricsframe.h:63
TagLib::ID3v2::SynchronizedLyricsFrame::Events
@ Events
The text describes events that occur.
Definition synchronizedlyricsframe.h:73
TagLib::ID3v2::SynchronizedLyricsFrame::Movement
@ Movement
The text lists the movements in the piece.
Definition synchronizedlyricsframe.h:71
TagLib::ID3v2::SynchronizedLyricsFrame::WebpageUrls
@ WebpageUrls
The text contains URLs for relevant webpages.
Definition synchronizedlyricsframe.h:79
TagLib::ID3v2::SynchronizedLyricsFrame::TextTranscription
@ TextTranscription
The text contains a transcription.
Definition synchronizedlyricsframe.h:69
TagLib::ID3v2::SynchronizedLyricsFrame::ImageUrls
@ ImageUrls
The text contains URLs for relevant images.
Definition synchronizedlyricsframe.h:81
TagLib::ID3v2::SynchronizedLyricsFrame::Other
@ Other
The text is some other type of text.
Definition synchronizedlyricsframe.h:65
TagLib::ID3v2::SynchronizedLyricsFrame::Lyrics
@ Lyrics
The text contains lyrical data.
Definition synchronizedlyricsframe.h:67
TagLib::ID3v2::SynchronizedLyricsFrame::Chord
@ Chord
The text contains chord changes that occur in the music.
Definition synchronizedlyricsframe.h:75
TagLib::ID3v2::SynchronizedLyricsFrame::Trivia
@ Trivia
The text contains trivia or "pop up" information about the media.
Definition synchronizedlyricsframe.h:77
TagLib::ID3v2::SynchronizedLyricsFrame::~SynchronizedLyricsFrame
~SynchronizedLyricsFrame() override
TagLib::ID3v2::SynchronizedLyricsFrame::SynchronizedLyricsFrame
SynchronizedLyricsFrame(String::Type encoding=String::Latin1)
TagLib::ID3v2::SynchronizedLyricsFrame::parseFields
void parseFields(const ByteVector &data) override
TagLib::ID3v2::SynchronizedLyricsFrame::renderFields
ByteVector renderFields() const override
TagLib::ID3v2::SynchronizedLyricsFrame::description
String description() const
TagLib::ID3v2::SynchronizedLyricsFrame::toString
String toString() const override
TagLib::ID3v2::SynchronizedLyricsFrame::SynchronizedLyricsFrame
SynchronizedLyricsFrame(const SynchronizedLyricsFrame &)=delete
TagLib::ID3v2::SynchronizedLyricsFrame::TimestampFormat
TimestampFormat
Definition synchronizedlyricsframe.h:49
TagLib::ID3v2::SynchronizedLyricsFrame::AbsoluteMilliseconds
@ AbsoluteMilliseconds
Definition synchronizedlyricsframe.h:57
TagLib::ID3v2::SynchronizedLyricsFrame::AbsoluteMpegFrames
@ AbsoluteMpegFrames
Definition synchronizedlyricsframe.h:54
TagLib::ID3v2::SynchronizedLyricsFrame::Unknown
@ Unknown
The timestamp is of unknown format.
Definition synchronizedlyricsframe.h:51
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::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:83
TagLib::String::Type
Type
Definition tstring.h:96
TagLib::String::Latin1
@ Latin1
Definition tstring.h:100
id3v2frame.h
TagLib::ID3v2
An ID3v2 implementation.
Definition flacfile.h:39
TagLib
A namespace for all TagLib related classes and functions.
Definition apefile.h:41
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText::time
unsigned int time
Definition synchronizedlyricsframe.h:90
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText::text
String text
Definition synchronizedlyricsframe.h:91
TagLib::ID3v2::SynchronizedLyricsFrame::SynchedText::SynchedText
SynchedText(unsigned int ms, const String &str)
Definition synchronizedlyricsframe.h:88
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition taglib_export.h:40
TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
#define TAGLIB_MSVC_SUPPRESS_WARNING_NEEDS_TO_HAVE_DLL_INTERFACE
Definition taglib_export.h:55
tlist.h