| AAX SDK 2.8.0 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-2024 Avid Technology, Inc.
5 * All rights reserved.
6 *
7 * This file is part of the Avid AAX SDK.
8 *
9 * The AAX SDK is subject to commercial or open-source licensing.
10 *
11 * By using the AAX SDK, you agree to the terms of both the Avid AAX SDK License
12 * Agreement and Avid Privacy Policy.
13 *
14 * AAX SDK License: https://developer.avid.com/aax
15 * Privacy Policy: https://www.avid.com/legal/privacy-policy-statement
16 *
17 * Or: You may also use this code under the terms of the GPL v3 (see
18 * www.gnu.org/licenses).
19 *
20 * THE AAX SDK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
21 * EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
22 * DISCLAIMED.
23 *
24 */
25
32/*================================================================================================*/
33
34
35#pragma once
36
37#ifndef AAX_CHUNKDATAPARSER_H
38#define AAX_CHUNKDATAPARSER_H
39
40#include "AAX.h"
41#include "AAX_CString.h"
42#include <vector>
43
44//forward declarations
45 struct AAX_SPlugInChunk;
46
50 namespace AAX_ChunkDataParserDefs {
51 const int32_t FLOAT_TYPE = 1;
52 const char FLOAT_STRING_IDENTIFIER[] = "f_";
53
54 const int32_t LONG_TYPE = 2;
55 const char LONG_STRING_IDENTIFIER[] = "l_";
56
57 const int32_t DOUBLE_TYPE = 3;
58 const char DOUBLE_STRING_IDENTIFIER[] = "d_";
59 const size_t DOUBLE_TYPE_SIZE = 8;
60 const size_t DOUBLE_TYPE_INCR = 8;
61
62 const int32_t SHORT_TYPE = 4;
63 const char SHORT_STRING_IDENTIFIER[] = "s_";
64 const size_t SHORT_TYPE_SIZE = 2;
65 const size_t SHORT_TYPE_INCR = 4; // keep life word aligned
66
67 const int32_t STRING_TYPE = 5;
68 const char STRING_STRING_IDENTIFIER[] = "r_";
69 const size_t MAX_STRINGDATA_LENGTH = 255;
70
71 const size_t DEFAULT32BIT_TYPE_SIZE = 4;
72 const size_t DEFAULT32BIT_TYPE_INCR = 4;
73
74 const size_t STRING_IDENTIFIER_SIZE = 2;
75
76 const int32_t NAME_NOT_FOUND = -1;
77 const size_t MAX_NAME_LENGTH = 255;
78 const int32_t BUILD_DATA_FAILED = -333;
79 const int32_t HEADER_SIZE = 4;
80 const int32_t VERSION_ID_1 = 0x01010101;
81}
82
127 class AAX_CChunkDataParser
128{
129 public:
130 AAX_CChunkDataParser();
131 virtual ~AAX_CChunkDataParser();
132
138 void AddFloat(const char *name, float value);
139 void AddDouble(const char *name, double value);
140 void AddInt32(const char *name, int32_t value);
141 void AddInt16(const char *name, int16_t value);
142 void AddString(const char *name, AAX_CString value);
143
149 bool FindFloat(const char *name, float *value);
150 bool FindDouble(const char *name, double *value);
151 bool FindInt32(const char *name, int32_t *value);
152 bool FindInt16(const char *name, int16_t *value);
153 bool FindString(const char *name, AAX_CString *value);
154
155 bool ReplaceDouble(const char *name, double value); //SW added for fela
156 int32_t GetChunkData(AAX_SPlugInChunk *chunk);
157 int32_t GetChunkDataSize();
158 int32_t GetChunkVersion() {return mChunkVersion;}
159 bool IsEmpty();
160 void Clear();
162
165 void LoadChunk(const AAX_SPlugInChunk *chunk);
166
167 protected:
168 void WordAlign(uint32_t &index);
169 void WordAlign(int32_t &index);
170 int32_t FindName(const AAX_CString &Name);
172
179 int32_t mLastFoundIndex;
180
181 char *mChunkData;
182
183 int32_t mChunkVersion;
184 public:
185 struct DataValue
186 {
187 int32_t mDataType;
188 AAX_CString mDataName;
189 int64_t mIntValue;
190 AAX_CString mStringValue;
191
192 DataValue():
193 mDataType(0),
194 mDataName(AAX_CString()),
195 mIntValue(0),
196 mStringValue(AAX_CString())
197 {};
198 };
199
200 std::vector<DataValue> mDataValues;
201};
202
203#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:50
AAX_ChunkDataParserDefs::STRING_IDENTIFIER_SIZE
const size_t STRING_IDENTIFIER_SIZE
Definition: AAX_CChunkDataParser.h:74
AAX_ChunkDataParserDefs::LONG_TYPE
const int32_t LONG_TYPE
Definition: AAX_CChunkDataParser.h:54
AAX_ChunkDataParserDefs::STRING_STRING_IDENTIFIER
const char STRING_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:68
AAX_ChunkDataParserDefs::DOUBLE_TYPE
const int32_t DOUBLE_TYPE
Definition: AAX_CChunkDataParser.h:57
AAX_ChunkDataParserDefs::HEADER_SIZE
const int32_t HEADER_SIZE
Definition: AAX_CChunkDataParser.h:79
AAX_ChunkDataParserDefs::DOUBLE_TYPE_SIZE
const size_t DOUBLE_TYPE_SIZE
Definition: AAX_CChunkDataParser.h:59
AAX_ChunkDataParserDefs::NAME_NOT_FOUND
const int32_t NAME_NOT_FOUND
Definition: AAX_CChunkDataParser.h:76
AAX_ChunkDataParserDefs::SHORT_TYPE
const int32_t SHORT_TYPE
Definition: AAX_CChunkDataParser.h:62
AAX_ChunkDataParserDefs::SHORT_STRING_IDENTIFIER
const char SHORT_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:63
AAX_ChunkDataParserDefs::SHORT_TYPE_SIZE
const size_t SHORT_TYPE_SIZE
Definition: AAX_CChunkDataParser.h:64
AAX_ChunkDataParserDefs::DEFAULT32BIT_TYPE_INCR
const size_t DEFAULT32BIT_TYPE_INCR
Definition: AAX_CChunkDataParser.h:72
AAX_ChunkDataParserDefs::MAX_STRINGDATA_LENGTH
const size_t MAX_STRINGDATA_LENGTH
Definition: AAX_CChunkDataParser.h:69
AAX_ChunkDataParserDefs::FLOAT_STRING_IDENTIFIER
const char FLOAT_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:52
AAX_ChunkDataParserDefs::MAX_NAME_LENGTH
const size_t MAX_NAME_LENGTH
Definition: AAX_CChunkDataParser.h:77
AAX_ChunkDataParserDefs::DOUBLE_STRING_IDENTIFIER
const char DOUBLE_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:58
AAX_ChunkDataParserDefs::SHORT_TYPE_INCR
const size_t SHORT_TYPE_INCR
Definition: AAX_CChunkDataParser.h:65
AAX_ChunkDataParserDefs::STRING_TYPE
const int32_t STRING_TYPE
Definition: AAX_CChunkDataParser.h:67
AAX_ChunkDataParserDefs::DOUBLE_TYPE_INCR
const size_t DOUBLE_TYPE_INCR
Definition: AAX_CChunkDataParser.h:60
AAX_ChunkDataParserDefs::BUILD_DATA_FAILED
const int32_t BUILD_DATA_FAILED
Definition: AAX_CChunkDataParser.h:78
AAX_ChunkDataParserDefs::FLOAT_TYPE
const int32_t FLOAT_TYPE
Definition: AAX_CChunkDataParser.h:51
AAX_ChunkDataParserDefs::VERSION_ID_1
const int32_t VERSION_ID_1
Definition: AAX_CChunkDataParser.h:80
AAX_ChunkDataParserDefs::DEFAULT32BIT_TYPE_SIZE
const size_t DEFAULT32BIT_TYPE_SIZE
Definition: AAX_CChunkDataParser.h:71
AAX_ChunkDataParserDefs::LONG_STRING_IDENTIFIER
const char LONG_STRING_IDENTIFIER[]
Definition: AAX_CChunkDataParser.h:55
AAX_SPlugInChunk
Plug-in chunk header + data.
Definition: AAX.h:549
AAX_CChunkDataParser
Parser utility for plugin chunks.
Definition: AAX_CChunkDataParser.h:128
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:179
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:183
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:181
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:158
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:200
AAX_CChunkDataParser::DataValue
Definition: AAX_CChunkDataParser.h:186
AAX_CChunkDataParser::DataValue::mStringValue
AAX_CString mStringValue
used if this DataValue is a string
Definition: AAX_CChunkDataParser.h:190
AAX_CChunkDataParser::DataValue::mDataType
int32_t mDataType
Definition: AAX_CChunkDataParser.h:187
AAX_CChunkDataParser::DataValue::mDataName
AAX_CString mDataName
name of the stored data
Definition: AAX_CChunkDataParser.h:188
AAX_CChunkDataParser::DataValue::DataValue
DataValue()
Definition: AAX_CChunkDataParser.h:192
AAX_CChunkDataParser::DataValue::mIntValue
int64_t mIntValue
used if this DataValue is not a string
Definition: AAX_CChunkDataParser.h:189
AAX_CString
A generic AAX string class with similar functionality to std::string
Definition: AAX_CString.h:57