| TagLib 1.13 |  |

eventtimingcodesframe.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_EVENTTIMINGCODESFRAME_H
27#define TAGLIB_EVENTTIMINGCODESFRAME_H
28
29#include "id3v2frame.h"
30#include "tlist.h"
31
32 namespace TagLib {
33
34 namespace ID3v2 {
35
37
40 class TAGLIB_EXPORT EventTimingCodesFrame : 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 EventType {
64 Padding = 0x00,
65 EndOfInitialSilence = 0x01,
66 IntroStart = 0x02,
67 MainPartStart = 0x03,
68 OutroStart = 0x04,
69 OutroEnd = 0x05,
70 VerseStart = 0x06,
71 RefrainStart = 0x07,
72 InterludeStart = 0x08,
73 ThemeStart = 0x09,
74 VariationStart = 0x0a,
75 KeyChange = 0x0b,
76 TimeChange = 0x0c,
77 MomentaryUnwantedNoise = 0x0d,
78 SustainedNoise = 0x0e,
79 SustainedNoiseEnd = 0x0f,
80 IntroEnd = 0x10,
81 MainPartEnd = 0x11,
82 VerseEnd = 0x12,
83 RefrainEnd = 0x13,
84 ThemeEnd = 0x14,
85 Profanity = 0x15,
86 ProfanityEnd = 0x16,
87 NotPredefinedSynch0 = 0xe0,
88 NotPredefinedSynch1 = 0xe1,
89 NotPredefinedSynch2 = 0xe2,
90 NotPredefinedSynch3 = 0xe3,
91 NotPredefinedSynch4 = 0xe4,
92 NotPredefinedSynch5 = 0xe5,
93 NotPredefinedSynch6 = 0xe6,
94 NotPredefinedSynch7 = 0xe7,
95 NotPredefinedSynch8 = 0xe8,
96 NotPredefinedSynch9 = 0xe9,
97 NotPredefinedSynchA = 0xea,
98 NotPredefinedSynchB = 0xeb,
99 NotPredefinedSynchC = 0xec,
100 NotPredefinedSynchD = 0xed,
101 NotPredefinedSynchE = 0xee,
102 NotPredefinedSynchF = 0xef,
103 AudioEnd = 0xfd,
104 AudioFileEnds = 0xfe
105 };
106
110 struct SynchedEvent {
111 SynchedEvent(unsigned int ms, EventType t) : time(ms), type(t) {}
112 unsigned int time;
113 EventType type;
114 };
115
119 typedef TagLib::List<SynchedEvent> SynchedEventList;
120
124 explicit EventTimingCodesFrame();
125
129 explicit EventTimingCodesFrame(const ByteVector &data);
130
134 virtual ~EventTimingCodesFrame();
135
139 virtual String toString() const;
140
144 TimestampFormat timestampFormat() const;
145
149 SynchedEventList synchedEvents() const;
150
156 void setTimestampFormat(TimestampFormat f);
157
163 void setSynchedEvents(const SynchedEventList &e);
164
165 protected:
166 // Reimplementations.
167
168 virtual void parseFields(const ByteVector &data);
169 virtual ByteVector renderFields() const;
170
171 private:
175 EventTimingCodesFrame(const ByteVector &data, Header *h);
176 EventTimingCodesFrame(const EventTimingCodesFrame &);
177 EventTimingCodesFrame &operator=(const EventTimingCodesFrame &);
178
179 class EventTimingCodesFramePrivate;
180 EventTimingCodesFramePrivate *d;
181 };
182
183 }
184}
185#endif
TagLib::ByteVector
A byte vector.
Definition: tbytevector.h:46
TagLib::ID3v2::EventTimingCodesFrame
ID3v2 event timing codes frame.
Definition: eventtimingcodesframe.h:41
TagLib::ID3v2::EventTimingCodesFrame::~EventTimingCodesFrame
virtual ~EventTimingCodesFrame()
TagLib::ID3v2::EventTimingCodesFrame::EventTimingCodesFrame
EventTimingCodesFrame(const ByteVector &data)
TagLib::ID3v2::EventTimingCodesFrame::SynchedEventList
TagLib::List< SynchedEvent > SynchedEventList
Definition: eventtimingcodesframe.h:119
TagLib::ID3v2::EventTimingCodesFrame::timestampFormat
TimestampFormat timestampFormat() const
TagLib::ID3v2::EventTimingCodesFrame::renderFields
virtual ByteVector renderFields() const
TagLib::ID3v2::EventTimingCodesFrame::EventTimingCodesFrame
EventTimingCodesFrame()
TagLib::ID3v2::EventTimingCodesFrame::synchedEvents
SynchedEventList synchedEvents() const
TagLib::ID3v2::EventTimingCodesFrame::setTimestampFormat
void setTimestampFormat(TimestampFormat f)
TagLib::ID3v2::EventTimingCodesFrame::setSynchedEvents
void setSynchedEvents(const SynchedEventList &e)
TagLib::ID3v2::EventTimingCodesFrame::toString
virtual String toString() const
TagLib::ID3v2::EventTimingCodesFrame::parseFields
virtual void parseFields(const ByteVector &data)
TagLib::ID3v2::EventTimingCodesFrame::EventType
EventType
Definition: eventtimingcodesframe.h:63
TagLib::ID3v2::EventTimingCodesFrame::TimestampFormat
TimestampFormat
Definition: eventtimingcodesframe.h:49
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::List
A generic, implicitly shared list.
Definition: tlist.h:54
TagLib::String
A wide string class suitable for unicode.
Definition: tstring.h:85
id3v2frame.h
TagLib
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41
TagLib::ID3v2::EventTimingCodesFrame::SynchedEvent
Definition: eventtimingcodesframe.h:110
TagLib::ID3v2::EventTimingCodesFrame::SynchedEvent::SynchedEvent
SynchedEvent(unsigned int ms, EventType t)
Definition: eventtimingcodesframe.h:111
TagLib::ID3v2::EventTimingCodesFrame::SynchedEvent::time
unsigned int time
Definition: eventtimingcodesframe.h:112
TagLib::ID3v2::EventTimingCodesFrame::SynchedEvent::type
EventType type
Definition: eventtimingcodesframe.h:113
TAGLIB_EXPORT
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
tlist.h