TagLib 1.11.1 (eventtimingcodesframe.h Source File)

eventtimingcodesframe.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     copyright            : (C) 2014 by Urs Fleisch
00003     email                : ufleisch@users.sourceforge.net
00004  ***************************************************************************/
00005 
00006 /***************************************************************************
00007  *   This library is free software; you can redistribute it and/or modify  *
00008  *   it  under the terms of the GNU Lesser General Public License version  *
00009  *   2.1 as published by the Free Software Foundation.                     *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful, but   *
00012  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the Free Software   *
00018  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA         *
00019  *   02110-1301  USA                                                       *
00020  *                                                                         *
00021  *   Alternatively, this file is available under the Mozilla Public        *
00022  *   License Version 1.1.  You may obtain a copy of the License at         *
00023  *   http://www.mozilla.org/MPL/                                           *
00024  ***************************************************************************/
00025 
00026 #ifndef TAGLIB_EVENTTIMINGCODESFRAME_H
00027 #define TAGLIB_EVENTTIMINGCODESFRAME_H
00028 
00029 #include "id3v2frame.h"
00030 #include "tlist.h"
00031 
00032 namespace TagLib {
00033 
00034   namespace ID3v2 {
00035 
00037 
00040     class TAGLIB_EXPORT EventTimingCodesFrame : 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 EventType {
00064         Padding                = 0x00,
00065         EndOfInitialSilence    = 0x01,
00066         IntroStart             = 0x02,
00067         MainPartStart          = 0x03,
00068         OutroStart             = 0x04,
00069         OutroEnd               = 0x05,
00070         VerseStart             = 0x06,
00071         RefrainStart           = 0x07,
00072         InterludeStart         = 0x08,
00073         ThemeStart             = 0x09,
00074         VariationStart         = 0x0a,
00075         KeyChange              = 0x0b,
00076         TimeChange             = 0x0c,
00077         MomentaryUnwantedNoise = 0x0d,
00078         SustainedNoise         = 0x0e,
00079         SustainedNoiseEnd      = 0x0f,
00080         IntroEnd               = 0x10,
00081         MainPartEnd            = 0x11,
00082         VerseEnd               = 0x12,
00083         RefrainEnd             = 0x13,
00084         ThemeEnd               = 0x14,
00085         Profanity              = 0x15,
00086         ProfanityEnd           = 0x16,
00087         NotPredefinedSynch0    = 0xe0,
00088         NotPredefinedSynch1    = 0xe1,
00089         NotPredefinedSynch2    = 0xe2,
00090         NotPredefinedSynch3    = 0xe3,
00091         NotPredefinedSynch4    = 0xe4,
00092         NotPredefinedSynch5    = 0xe5,
00093         NotPredefinedSynch6    = 0xe6,
00094         NotPredefinedSynch7    = 0xe7,
00095         NotPredefinedSynch8    = 0xe8,
00096         NotPredefinedSynch9    = 0xe9,
00097         NotPredefinedSynchA    = 0xea,
00098         NotPredefinedSynchB    = 0xeb,
00099         NotPredefinedSynchC    = 0xec,
00100         NotPredefinedSynchD    = 0xed,
00101         NotPredefinedSynchE    = 0xee,
00102         NotPredefinedSynchF    = 0xef,
00103         AudioEnd               = 0xfd,
00104         AudioFileEnds          = 0xfe
00105       };
00106 
00110       struct SynchedEvent {
00111         SynchedEvent(unsigned int ms, EventType t) : time(ms), type(t) {}
00112         unsigned int time;
00113         EventType type;
00114       };
00115 
00119       typedef TagLib::List<SynchedEvent> SynchedEventList;
00120 
00124       explicit EventTimingCodesFrame();
00125 
00129       explicit EventTimingCodesFrame(const ByteVector &data);
00130 
00134       virtual ~EventTimingCodesFrame();
00135 
00139       virtual String toString() const;
00140 
00144       TimestampFormat timestampFormat() const;
00145 
00149       SynchedEventList synchedEvents() const;
00150 
00156       void setTimestampFormat(TimestampFormat f);
00157 
00163       void setSynchedEvents(const SynchedEventList &e);
00164 
00165     protected:
00166       // Reimplementations.
00167 
00168       virtual void parseFields(const ByteVector &data);
00169       virtual ByteVector renderFields() const;
00170 
00171     private:
00175       EventTimingCodesFrame(const ByteVector &data, Header *h);
00176       EventTimingCodesFrame(const EventTimingCodesFrame &);
00177       EventTimingCodesFrame &operator=(const EventTimingCodesFrame &);
00178 
00179       class EventTimingCodesFramePrivate;
00180       EventTimingCodesFramePrivate *d;
00181     };
00182 
00183   }
00184 }
00185 #endif