TagLib  1.13.1
mp4atom.h
Go to the documentation of this file.
1 /**************************************************************************
2  copyright : (C) 2007,2011 by Lukáš Lalinský
3  email : lalinsky@gmail.com
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 // This file is not part of the public API!
27 
28 #ifndef DO_NOT_DOCUMENT
29 
30 #ifndef TAGLIB_MP4ATOM_H
31 #define TAGLIB_MP4ATOM_H
32 
33 #include "tfile.h"
34 #include "tlist.h"
35 
36 namespace TagLib {
37  namespace MP4 {
38  class Atom;
39  typedef TagLib::List<Atom *> AtomList;
40 
41  enum AtomDataType
42  {
43  TypeImplicit = 0, // for use with tags for which no type needs to be indicated because only one type is allowed
44  TypeUTF8 = 1, // without any count or null terminator
45  TypeUTF16 = 2, // also known as UTF-16BE
46  TypeSJIS = 3, // deprecated unless it is needed for special Japanese characters
47  TypeHTML = 6, // the HTML file header specifies which HTML version
48  TypeXML = 7, // the XML header must identify the DTD or schemas
49  TypeUUID = 8, // also known as GUID; stored as 16 bytes in binary (valid as an ID)
50  TypeISRC = 9, // stored as UTF-8 text (valid as an ID)
51  TypeMI3P = 10, // stored as UTF-8 text (valid as an ID)
52  TypeGIF = 12, // (deprecated) a GIF image
53  TypeJPEG = 13, // a JPEG image
54  TypePNG = 14, // a PNG image
55  TypeURL = 15, // absolute, in UTF-8 characters
56  TypeDuration = 16, // in milliseconds, 32-bit integer
57  TypeDateTime = 17, // in UTC, counting seconds since midnight, January 1, 1904; 32 or 64-bits
58  TypeGenred = 18, // a list of enumerated values
59  TypeInteger = 21, // a signed big-endian integer with length one of { 1,2,3,4,8 } bytes
60  TypeRIAAPA = 24, // RIAA parental advisory; { -1=no, 1=yes, 0=unspecified }, 8-bit integer
61  TypeUPC = 25, // Universal Product Code, in text UTF-8 format (valid as an ID)
62  TypeBMP = 27, // Windows bitmap image
63  TypeUndefined = 255 // undefined
64  };
65 
66  struct AtomData {
67  AtomData(AtomDataType type, ByteVector data) : type(type), locale(0), data(data) {}
68  AtomDataType type;
69  int locale;
70  ByteVector data;
71  };
72 
73  typedef TagLib::List<AtomData> AtomDataList;
74 
75  class TAGLIB_EXPORT Atom
76  {
77  public:
78  Atom(File *file);
79  ~Atom();
80  Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
81  bool path(AtomList &path, const char *name1, const char *name2 = 0, const char *name3 = 0);
82  AtomList findall(const char *name, bool recursive = false);
83  long offset;
84  long length;
85  TagLib::ByteVector name;
86  AtomList children;
87  private:
88  static const int numContainers = 11;
89  static const char *const containers[11];
90  };
91 
93  class TAGLIB_EXPORT Atoms
94  {
95  public:
96  Atoms(File *file);
97  ~Atoms();
98  Atom *find(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
99  AtomList path(const char *name1, const char *name2 = 0, const char *name3 = 0, const char *name4 = 0);
100  AtomList atoms;
101  };
102  } // namespace MP4
103 } // namespace TagLib
104 
105 #endif
106 
107 #endif
A generic, implicitly shared list.
Definition: tlist.h:53
A byte vector.
Definition: tbytevector.h:45
#define TAGLIB_EXPORT
Definition: taglib_export.h:40
A namespace for all TagLib related classes and functions.
Definition: apefile.h:41