| AAX SDK 2.6.1 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- File List
- File Members

Loading...
Searching...
No Matches
AAX_CChunkDataParser.h
Go to the documentation of this file.
1/*================================================================================================*/
2/*
3 *
4 * Copyright 2013-2015, 2023 Avid Technology, Inc.
5 * All rights reserved.
6 *
7 * CONFIDENTIAL: this document contains confidential information of Avid. Do
8 * not disclose to any third party. Use of the information contained in this
9 * document is subject to an Avid SDK license.
10 *
11 */
12
19/*================================================================================================*/
20
21
22#pragma once
23
24#ifndef AAX_CHUNKDATAPARSER_H
25#define AAX_CHUNKDATAPARSER_H
26
27#include "AAX.h"
28#include "AAX_CString.h"
29#include <vector>
30
31//forward declarations
32 struct AAX_SPlugInChunk;
33
37 namespace AAX_ChunkDataParserDefs {
38 const int32_t FLOAT_TYPE = 1;
39 const char FLOAT_STRING_IDENTIFIER[] = "f_";
40
41 const int32_t LONG_TYPE = 2;
42 const char LONG_STRING_IDENTIFIER[] = "l_";
43
44 const int32_t DOUBLE_TYPE = 3;
45 const char DOUBLE_STRING_IDENTIFIER[] = "d_";
46 const size_t DOUBLE_TYPE_SIZE = 8;
47 const size_t DOUBLE_TYPE_INCR = 8;
48
49 const int32_t SHORT_TYPE = 4;
50 const char SHORT_STRING_IDENTIFIER[] = "s_";
51 const size_t SHORT_TYPE_SIZE = 2;
52 const size_t SHORT_TYPE_INCR = 4; // keep life word aligned
53
54 const int32_t STRING_TYPE = 5;
55 const char STRING_STRING_IDENTIFIER[] = "r_";
56 const size_t MAX_STRINGDATA_LENGTH = 255;
57
58 const size_t DEFAULT32BIT_TYPE_SIZE = 4;
59 const size_t DEFAULT32BIT_TYPE_INCR = 4;
60
61 const size_t STRING_IDENTIFIER_SIZE = 2;
62
63 const int32_t NAME_NOT_FOUND = -1;
64 const size_t MAX_NAME_LENGTH = 255;
65 const int32_t BUILD_DATA_FAILED = -333;
66 const int32_t HEADER_SIZE = 4;
67 const int32_t VERSION_ID_1 = 0x01010101;
68}
69
114 class AAX_CChunkDataParser
115{
116 public:
117 AAX_CChunkDataParser();
118 virtual ~AAX_CChunkDataParser();
119
125 void AddFloat(const char *name, float value);
126 void AddDouble(const char *name, double value);
127 void AddInt32(const char *name, int32_t value);
128 void AddInt16(const char *name, int16_t value);
129 void AddString(const char *name, AAX_CString value);
130
136 bool FindFloat(const char *name, float *value);
137 bool FindDouble(const char *name, double *value);
138 bool FindInt32(const char *name, int32_t *value);
139 bool FindInt16(const char *name, int16_t *value);
140 bool FindString(const char *name, AAX_CString *value);
141
142 bool ReplaceDouble(const char *name, double value); //SW added for fela
143 int32_t GetChunkData(AAX_SPlugInChunk *chunk);
144 int32_t GetChunkDataSize();
145 int32_t GetChunkVersion() {return mChunkVersion;}
146 bool IsEmpty();
147 void Clear();
149
152 void LoadChunk(const AAX_SPlugInChunk *chunk);
153
154 protected:
155 void WordAlign(uint32_t &index);
156 void WordAlign(int32_t &index);
157 int32_t FindName(const AAX_CString &Name);
159
166 int32_t mLastFoundIndex;
167
168 char *mChunkData;
169
170 int32_t mChunkVersion;
171 public:
172 struct DataValue
173 {
174 int32_t mDataType;
175 AAX_CString mDataName;
176 int64_t mIntValue;
177 AAX_CString mStringValue;
178
179 DataValue():
180 mDataType(0),
181 mDataName(AAX_CString()),
182 mIntValue(0),
183 mStringValue(AAX_CString())
184 {};
185 };
186
187 std::vector<DataValue> mDataValues;
188};
189
190#endif //AAX_CHUNKDATAPARSER_H
AAX_CString.h
A generic AAX string class with similar functionality to std::string.
AAX.h
Various utility definitions for AAX.
AAX_ChunkDataParserDefs
Constants used by ChunkDataParser class.
Definition: AAX_CChunkDataParser.h:37
AAX_ChunkDataParserDefs::STRING_IDENTIFIER_SIZE
const size_t STRING_IDENTIFIER_SIZE
Definition: AAX_CChunkDataParser.h:61
AAX_ChunkDataParserDefs::LONG_TYPE
const int32_t LONG_TYPE
Definition: AAX_CChunkDataParser.h:41
AAX_ChunkDataParserDefs::STRING_STRING_IDENTIFIER
const char STRING_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:55
AAX_ChunkDataParserDefs::DOUBLE_TYPE
const int32_t DOUBLE_TYPE
Definition: AAX_CChunkDataParser.h:44
AAX_ChunkDataParserDefs::HEADER_SIZE
const int32_t HEADER_SIZE
Definition: AAX_CChunkDataParser.h:66
AAX_ChunkDataParserDefs::DOUBLE_TYPE_SIZE
const size_t DOUBLE_TYPE_SIZE
Definition: AAX_CChunkDataParser.h:46
AAX_ChunkDataParserDefs::NAME_NOT_FOUND
const int32_t NAME_NOT_FOUND
Definition: AAX_CChunkDataParser.h:63
AAX_ChunkDataParserDefs::SHORT_TYPE
const int32_t SHORT_TYPE
Definition: AAX_CChunkDataParser.h:49
AAX_ChunkDataParserDefs::SHORT_STRING_IDENTIFIER
const char SHORT_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:50
AAX_ChunkDataParserDefs::SHORT_TYPE_SIZE
const size_t SHORT_TYPE_SIZE
Definition: AAX_CChunkDataParser.h:51
AAX_ChunkDataParserDefs::DEFAULT32BIT_TYPE_INCR
const size_t DEFAULT32BIT_TYPE_INCR
Definition: AAX_CChunkDataParser.h:59
AAX_ChunkDataParserDefs::MAX_STRINGDATA_LENGTH
const size_t MAX_STRINGDATA_LENGTH
Definition: AAX_CChunkDataParser.h:56
AAX_ChunkDataParserDefs::FLOAT_STRING_IDENTIFIER
const char FLOAT_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:39
AAX_ChunkDataParserDefs::MAX_NAME_LENGTH
const size_t MAX_NAME_LENGTH
Definition: AAX_CChunkDataParser.h:64
AAX_ChunkDataParserDefs::DOUBLE_STRING_IDENTIFIER
const char DOUBLE_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:45
AAX_ChunkDataParserDefs::SHORT_TYPE_INCR
const size_t SHORT_TYPE_INCR
Definition: AAX_CChunkDataParser.h:52
AAX_ChunkDataParserDefs::STRING_TYPE
const int32_t STRING_TYPE
Definition: AAX_CChunkDataParser.h:54
AAX_ChunkDataParserDefs::DOUBLE_TYPE_INCR
const size_t DOUBLE_TYPE_INCR
Definition: AAX_CChunkDataParser.h:47
AAX_ChunkDataParserDefs::BUILD_DATA_FAILED
const int32_t BUILD_DATA_FAILED
Definition: AAX_CChunkDataParser.h:65
AAX_ChunkDataParserDefs::FLOAT_TYPE
const int32_t FLOAT_TYPE
Definition: AAX_CChunkDataParser.h:38
AAX_ChunkDataParserDefs::VERSION_ID_1
const int32_t VERSION_ID_1
Definition: AAX_CChunkDataParser.h:67
AAX_ChunkDataParserDefs::DEFAULT32BIT_TYPE_SIZE
const size_t DEFAULT32BIT_TYPE_SIZE
Definition: AAX_CChunkDataParser.h:58
AAX_ChunkDataParserDefs::LONG_STRING_IDENTIFIER
const char LONG_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:42
AAX_SPlugInChunk
Plug-in chunk header + data.
Definition: AAX.h:536
AAX_CChunkDataParser
Parser utility for plugin chunks.
Definition: AAX_CChunkDataParser.h:115
AAX_CChunkDataParser::FindFloat
bool FindFloat(const char *name, float *value)
CALL: Finds some data of type float with name and value in the current chunk.
AAX_CChunkDataParser::AddInt16
void AddInt16(const char *name, int16_t value)
CALL: See AddFloat()
AAX_CChunkDataParser::LoadChunk
void LoadChunk(const AAX_SPlugInChunk *chunk)
Sets current chunk to data in chunk parameter.
AAX_CChunkDataParser::AddDouble
void AddDouble(const char *name, double value)
CALL: See AddFloat()
AAX_CChunkDataParser::mLastFoundIndex
int32_t mLastFoundIndex
The last index found in the chunk.
Definition: AAX_CChunkDataParser.h:166
AAX_CChunkDataParser::FindString
bool FindString(const char *name, AAX_CString *value)
AAX_CChunkDataParser::~AAX_CChunkDataParser
virtual ~AAX_CChunkDataParser()
AAX_CChunkDataParser::Clear
void Clear()
Resets chunk.
AAX_CChunkDataParser::mChunkVersion
int32_t mChunkVersion
Equal to fVersion from the chunk header. Equal to -1 if no chunk is loaded.
Definition: AAX_CChunkDataParser.h:170
AAX_CChunkDataParser::AddInt32
void AddInt32(const char *name, int32_t value)
CALL: See AddFloat()
AAX_CChunkDataParser::FindName
int32_t FindName(const AAX_CString &Name)
used by public Find methods
AAX_CChunkDataParser::mChunkData
char * mChunkData
Definition: AAX_CChunkDataParser.h:168
AAX_CChunkDataParser::GetChunkData
int32_t GetChunkData(AAX_SPlugInChunk *chunk)
CALL: Fills passed in chunk with data from current chunk; returns 0 if successful.
AAX_CChunkDataParser::GetChunkVersion
int32_t GetChunkVersion()
CALL: Lists fVersion in chunk header for convenience.
Definition: AAX_CChunkDataParser.h:145
AAX_CChunkDataParser::IsEmpty
bool IsEmpty()
CALL: Returns true if no data is in the chunk.
AAX_CChunkDataParser::AddString
void AddString(const char *name, AAX_CString value)
AAX_CChunkDataParser::WordAlign
void WordAlign(int32_t &index)
sets index to 4-byte boundary
AAX_CChunkDataParser::AddFloat
void AddFloat(const char *name, float value)
CALL: Adds some data of type float with name and value to the current chunk.
AAX_CChunkDataParser::FindInt16
bool FindInt16(const char *name, int16_t *value)
CALL: See FindFloat()
AAX_CChunkDataParser::GetChunkDataSize
int32_t GetChunkDataSize()
CALL: Returns size of current chunk.
AAX_CChunkDataParser::FindDouble
bool FindDouble(const char *name, double *value)
CALL: See FindFloat()
AAX_CChunkDataParser::WordAlign
void WordAlign(uint32_t &index)
sets index to 4-byte boundary
AAX_CChunkDataParser::AAX_CChunkDataParser
AAX_CChunkDataParser()
AAX_CChunkDataParser::FindInt32
bool FindInt32(const char *name, int32_t *value)
CALL: See FindFloat()
AAX_CChunkDataParser::ReplaceDouble
bool ReplaceDouble(const char *name, double value)
AAX_CChunkDataParser::mDataValues
std::vector< DataValue > mDataValues
Definition: AAX_CChunkDataParser.h:187
AAX_CChunkDataParser::DataValue
Definition: AAX_CChunkDataParser.h:173
AAX_CChunkDataParser::DataValue::mStringValue
AAX_CString mStringValue
used if this DataValue is a string
Definition: AAX_CChunkDataParser.h:177
AAX_CChunkDataParser::DataValue::mDataType
int32_t mDataType
Definition: AAX_CChunkDataParser.h:174
AAX_CChunkDataParser::DataValue::mDataName
AAX_CString mDataName
name of the stored data
Definition: AAX_CChunkDataParser.h:175
AAX_CChunkDataParser::DataValue::DataValue
DataValue()
Definition: AAX_CChunkDataParser.h:179
AAX_CChunkDataParser::DataValue::mIntValue
int64_t mIntValue
used if this DataValue is not a string
Definition: AAX_CChunkDataParser.h:176
AAX_CString
A generic AAX string class with similar functionality to std::string
Definition: AAX_CString.h:44