src/itmf/CoverArtBox.h Source File
CoverArtBox.h
1 //
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 
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::type
BasicType type
covr-box type.
Definition: CoverArtBox.h:54
mp4v2::impl::itmf::CoverArtBox::Item
Data object for covr-box item.
Definition: CoverArtBox.h:40
mp4v2::impl::itmf::CoverArtBox::Item::autofree
bool autofree
when true invoke free(buffer) upon destruction.
Definition: CoverArtBox.h:57
mp4v2::impl::itmf::BasicType
BasicType
Basic set of types as detailed in spec.
Definition: type.h:33
mp4v2::impl::itmf::CoverArtBox::Item::buffer
uint8_t * buffer
buffer point to raw covr-box data.
Definition: CoverArtBox.h:55
mp4v2::impl::itmf::CoverArtBox::ItemList
vector< Item > ItemList
Object representing a list of covr-box items.
Definition: CoverArtBox.h:61
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
Functional class for covr-box (Cover-art Box) support.
Definition: CoverArtBox.h:33