MP4v2

CoverArtBox.h
1
2//
3// The contents of this file are subject to the Mozilla Public License
4// Version 1.1 (the "License"); you may not use this file except in
5// compliance with the License. You may obtain a copy of the License at
6// http://www.mozilla.org/MPL/
7//
8// Software distributed under the License is distributed on an "AS IS"
9// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
10// License for the specific language governing rights and limitations
11// under the License.
12//
13// The Original Code is MP4v2.
14//
15// The Initial Developer of the Original Code is Kona Blend.
16// Portions created by Kona Blend are Copyright (C) 2008.
17// All Rights Reserved.
18//
19// Contributors:
20// Kona Blend, kona8lend@@gmail.com
21//
23
24#ifndef MP4V2_IMPL_ITMF_COVERARTBOX_H
25#define MP4V2_IMPL_ITMF_COVERARTBOX_H
26
27 namespace mp4v2 { namespace impl { namespace itmf {
28
30
33 class MP4V2_EXPORT CoverArtBox
34{
35 public:
40 class MP4V2_EXPORT Item
41 {
42 public:
43 Item();
44 Item( const Item& );
45 ~Item();
46
47 Item& operator=( const Item& );
48
52 void reset();
53
54 BasicType type;
55 uint8_t* buffer;
56 uint32_t size;
57 bool autofree;
58 };
59
61 typedef vector<Item> ItemList;
62
70 static bool list( MP4FileHandle hFile, ItemList& out );
71
82 static bool add( MP4FileHandle hFile, const Item& item );
83
92 static bool set( MP4FileHandle hFile, const Item& item, uint32_t index );
93
104 static bool get( MP4FileHandle hFile, Item& item, uint32_t index );
105
114 static bool remove( MP4FileHandle hFile, uint32_t index = numeric_limits<uint32_t>::max() );
115};
116
118
119}}} // namespace mp4v2::impl::itmf
120
121#endif // MP4V2_IMPL_ITMF_COVERARTBOX_H
mp4v2::impl::itmf::CoverArtBox::Item
Data object for covr-box item.
Definition: CoverArtBox.h:41
mp4v2::impl::itmf::CoverArtBox::Item::size
uint32_t size
size of covr-box buffer size in bytes.
Definition: CoverArtBox.h:56
mp4v2::impl::itmf::CoverArtBox::Item::autofree
bool autofree
when true invoke free(buffer) upon destruction.
Definition: CoverArtBox.h:57
mp4v2::impl::itmf::CoverArtBox::Item::buffer
uint8_t * buffer
buffer point to raw covr-box data.
Definition: CoverArtBox.h:55
mp4v2::impl::itmf::CoverArtBox::Item::type
BasicType type
covr-box type.
Definition: CoverArtBox.h:54
mp4v2::impl::itmf::CoverArtBox::Item::reset
void reset()
Reset to state of newly constructed object.
mp4v2::impl::itmf::CoverArtBox
Functional class for covr-box (Cover-art Box) support.
Definition: CoverArtBox.h:34
mp4v2::impl::itmf::CoverArtBox::get
static bool get(MP4FileHandle hFile, Item &item, uint32_t index)
Fetch covr-box item from file.
mp4v2::impl::itmf::CoverArtBox::ItemList
vector< Item > ItemList
Object representing a list of covr-box items.
Definition: CoverArtBox.h:61
mp4v2::impl::itmf::CoverArtBox::add
static bool add(MP4FileHandle hFile, const Item &item)
Add covr-box item to file.
mp4v2::impl::itmf::CoverArtBox::list
static bool list(MP4FileHandle hFile, ItemList &out)
Fetch list of covr-box items from file.
mp4v2::impl::itmf::CoverArtBox::remove
static bool remove(MP4FileHandle hFile, uint32_t index=numeric_limits< uint32_t >::max())
Remove covr-box item from file.
mp4v2::impl::itmf::CoverArtBox::set
static bool set(MP4FileHandle hFile, const Item &item, uint32_t index)
Replace covr-box item in file.
mp4v2::impl::itmf::BasicType
BasicType
Basic set of types as detailed in spec.
Definition: type.h:33