Call PBD::init in ARDOUR::init and PBD::cleanup in ARDOUR::cleanup
[ardour.git] / libs / taglib / taglib / mpeg / id3v2 / frames / generalencapsulatedobjectframe.h
1 /***************************************************************************
2     copyright            : (C) 2002 - 2008 by Scott Wheeler
3     email                : wheeler@kde.org
4     copyright            : (C) 2006 by Aaron VonderHaar
5     email                : avh4@users.sourceforge.net
6  ***************************************************************************/
7
8 /***************************************************************************
9  *   This library is free software; you can redistribute it and/or modify  *
10  *   it under the terms of the GNU Lesser General Public License version   *
11  *   2.1 as published by the Free Software Foundation.                     *
12  *                                                                         *
13  *   This library is distributed in the hope that it will be useful, but   *
14  *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
16  *   Lesser General Public License for more details.                       *
17  *                                                                         *
18  *   You should have received a copy of the GNU Lesser General Public      *
19  *   License along with this library; if not, write to the Free Software   *
20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
21  *   USA                                                                   *
22  *                                                                         *
23  *   Alternatively, this file is available under the Mozilla Public        *
24  *   License Version 1.1.  You may obtain a copy of the License at         *
25  *   http://www.mozilla.org/MPL/                                           *
26  ***************************************************************************/
27
28 #ifndef TAGLIB_GENERALENCAPSULATEDOBJECT_H
29 #define TAGLIB_GENERALENCAPSULATEDOBJECT_H
30
31 #include <id3v2frame.h>
32 #include <id3v2header.h>
33 #include "taglib_export.h"
34
35 namespace TagLib {
36
37   namespace ID3v2 {
38
39     //! An ID3v2 general encapsulated object frame implementation
40
41     /*!
42      * This is an implementation of ID3v2 general encapsulated objects.
43      * Arbitrary binary data may be included in tags, stored in GEOB frames.
44      * There may be multiple GEOB frames in a single tag.  Each GEOB it
45      * labelled with a content description (which may be blank), a required
46      * mime-type, and a file name (may be blank).  The content description
47      * uniquely identifies the GEOB frame in the tag.
48      */
49
50     class TAGLIB_EXPORT GeneralEncapsulatedObjectFrame : public Frame
51     {
52       friend class FrameFactory;
53
54     public:
55
56       /*!
57        * Constructs an empty object frame.  The description, file name and text
58        * encoding should be set manually.
59        */
60       GeneralEncapsulatedObjectFrame();
61
62       /*!
63        * Constructs a GeneralEncapsulatedObjectFrame frame based on \a data.
64        */
65       explicit GeneralEncapsulatedObjectFrame(const ByteVector &data);
66
67       /*!
68        * Destroys the GeneralEncapsulatedObjectFrame instance.
69        */
70       virtual ~GeneralEncapsulatedObjectFrame();
71
72       /*!
73        * Returns a string containing the description, file name and mime-type
74        */
75       virtual String toString() const;
76
77       /*!
78        * Returns the text encoding used for the description and file name.
79        *
80        * \see setTextEncoding()
81        * \see description()
82        * \see fileName()
83        */
84       String::Type textEncoding() const;
85
86       /*!
87        * Set the text encoding used for the description and file name.
88        *
89        * \see description()
90        * \see fileName()
91        */
92       void setTextEncoding(String::Type encoding);
93
94       /*!
95        * Returns the mime type of the object.
96        */
97       String mimeType() const;
98
99       /*!
100        * Sets the mime type of the object.
101        */
102       void setMimeType(const String &type);
103
104       /*!
105        * Returns the file name of the object.
106        *
107        * \see setFileName()
108        */
109       String fileName() const;
110
111       /*!
112        * Sets the file name for the object.
113        *
114        * \see fileName()
115        */
116       void setFileName(const String &name);
117
118       /*!
119        * Returns the content description of the object.
120        *
121        * \see setDescription()
122        * \see textEncoding()
123        * \see setTextEncoding()
124        */
125
126       String description() const;
127
128       /*!
129        * Sets the content description of the object to \a desc.
130        *
131        * \see description()
132        * \see textEncoding()
133        * \see setTextEncoding()
134        */
135
136       void setDescription(const String &desc);
137
138       /*!
139        * Returns the object data as a ByteVector.
140        *
141        * \note ByteVector has a data() method that returns a const char * which
142        * should make it easy to export this data to external programs.
143        *
144        * \see setObject()
145        * \see mimeType()
146        */
147       ByteVector object() const;
148
149       /*!
150        * Sets the object data to \a data.  \a data should be of the type specified in
151        * this frame's mime-type specification.
152        *
153        * \see object()
154        * \see mimeType()
155        * \see setMimeType()
156        */
157       void setObject(const ByteVector &object);
158
159     protected:
160       virtual void parseFields(const ByteVector &data);
161       virtual ByteVector renderFields() const;
162
163     private:
164       GeneralEncapsulatedObjectFrame(const ByteVector &data, Header *h);
165       GeneralEncapsulatedObjectFrame(const GeneralEncapsulatedObjectFrame &);
166       GeneralEncapsulatedObjectFrame &operator=(const GeneralEncapsulatedObjectFrame &);
167
168       class GeneralEncapsulatedObjectFramePrivate;
169       GeneralEncapsulatedObjectFramePrivate *d;
170     };
171   }
172 }
173
174 #endif