summaryrefslogtreecommitdiff
path: root/XMPFiles/source/FormatSupport/WAVE/CartMetadata.h
blob: 9dfe6e0f14a8e1c0004a68add0d276fdf6045cf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// =================================================================================================
// Copyright Adobe
// Copyright 2011 Adobe
// All Rights Reserved
//
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
// of the Adobe license agreement accompanying it. If you have received this file from a source other 
// than Adobe, then your use, modification, or distribution of it requires the prior written permission
// of Adobe.
// =================================================================================================

#ifndef _CartMetadata_h_
#define _CartMetadata_h_

#include "public/include/XMP_Environment.h"	// ! XMP_Environment.h must be the first included header.

#include "public/include/XMP_Const.h"
#include "public/include/XMP_IO.hpp"

#include "XMPFiles/source/NativeMetadataSupport/IMetadata.h"

namespace IFF_RIFF {

// =================================================================================================

class CartMetadata : public IMetadata {

public:

	enum {

		// IDs for the mapped cart chunk fields.
		kVersion,				// Local text, max 4 bytes
		kTitle,					// Local text, max 64 bytes
		kArtist,				// Local text, max 64 bytes
		kCutID,					// Local text, max 64 bytes
		kClientID,				// Local text, max 64 bytes
		kCategory,				// Local text, max 64 bytes
		kClassification,		// Local text, max 64 bytes
		kOutCue,				// Local text, max 64 bytes
		kStartDate,				// Local text, max 10 bytes
		kStartTime,				// Local text, max 8 bytes
		kEndDate,				// Local text, max 10 bytes
		kEndTime,				// Local text, max 8 bytes
		kProducerAppID,			// Local text, max 64 bytes
		kProducerAppVersion,	// Local text, max 64 bytes
		kUserDef,				// Local text, max 64 bytes
		kURL,					// Local text, max 1024 bytes
		kTagText,				// Local text, no limit
		kLevelReference,		// Little endian unsigned 32
		kPostTimer,				// array[8] of usage(Uns32), value(Uns32)
		kReserved,				// 276 reserved bytes

		// Constants for the range of fixed length text fields.
		kFirstFixedTextField = kVersion,
		kLastFixedTextField  = kURL

	};

	struct StoredCartTimer {
		XMP_Uns32 usage;
		XMP_Uns32 value;

		bool operator == (const StoredCartTimer & other ) const {
			return usage == other.usage && value == other.value;
		}

		bool operator != ( const StoredCartTimer & other ) const {
			return usage != other.usage || value != other.value;
		}
	};

	enum { kPostTimerLength = 8 };

	CartMetadata();
	virtual ~CartMetadata();

	void parse ( const XMP_Uns8* chunkData, XMP_Uns64 chunkSize );
	void parse ( XMP_IO* input ) { IMetadata::parse ( input ); }
	
	XMP_Uns64 serialize ( XMP_Uns8** buffer );

protected:

	virtual	bool isEmptyValue ( XMP_Uns32 id, ValueObject& valueObj );

private:

	// Operators hidden on purpose.
	CartMetadata ( const CartMetadata& ) {};
	CartMetadata& operator= ( const CartMetadata& ) { return *this; };

};	// CartMetadata

}	// namespace IFF_RIFF

#endif