diff --git a/Source/Processors/Channel/MetaData.cpp b/Source/Processors/Channel/MetaData.cpp index 850c50f1ad8df4b7af5580d9676c21ffa642d603..2458f09bff8622b2cfad48961cba7c4e78630291 100644 --- a/Source/Processors/Channel/MetaData.cpp +++ b/Source/Processors/Channel/MetaData.cpp @@ -44,8 +44,8 @@ bool checkMetaDataType(MetaDataDescriptor::MetaDataTypes baseType) //MetaDataDescriptor -MetaDataDescriptor::MetaDataDescriptor(MetaDataDescriptor::MetaDataTypes t, unsigned int length, String n, String d) - : m_type(t), m_length(length), m_name(n), m_desc(d) +MetaDataDescriptor::MetaDataDescriptor(MetaDataDescriptor::MetaDataTypes t, unsigned int length, String n, String d, String dm) + : m_name(n), m_description(d), m_descriptor(dm), m_type(t), m_length(length) {}; MetaDataDescriptor::~MetaDataDescriptor() {}; @@ -54,7 +54,8 @@ MetaDataDescriptor::MetaDataTypes MetaDataDescriptor::getType() const { return m unsigned int MetaDataDescriptor::getLength() const { return m_length; } size_t MetaDataDescriptor::getDataSize() const { return m_length*getTypeSize(m_type); } String MetaDataDescriptor::getName() const { return m_name; } -String MetaDataDescriptor::getDescription() const { return m_desc; } +String MetaDataDescriptor::getDescription() const { return m_description; } +String MetaDataDescriptor::getDescriptor() const { return m_descriptor; } bool MetaDataDescriptor::isEqual(const MetaDataDescriptor& other) const { diff --git a/Source/Processors/Channel/MetaData.h b/Source/Processors/Channel/MetaData.h index ffcf5e9dfe44933a2cdcf4a16ac3b38760621181..db5b8481f3f83fa9a1f2a596604152f1c6f53cfa 100644 --- a/Source/Processors/Channel/MetaData.h +++ b/Source/Processors/Channel/MetaData.h @@ -57,13 +57,30 @@ public: DOUBLE }; - MetaDataDescriptor(MetaDataTypes type, unsigned int length, String name, String desc); + /** + MetaData descriptor constructor + @param type The primitive type this metadata field will hold + @param length The length of the data. 1 for single value or mroe for arrays. + @param name The human-readable name of this metadata field + @param humanDescription A human-readable description of what this field represents + @param machineDescriptor A simple machine-readable name for this metadata value + + name and humanDescription will be saved in most data formats for latter reference + */ + MetaDataDescriptor(MetaDataTypes type, unsigned int length, String name, String humanDescription, String machineDescriptor); ~MetaDataDescriptor(); + /** Gets the primitive type of this field */ MetaDataTypes getType() const; + /** Gets the number of elements in this field */ unsigned int getLength() const; + /** Gets the total data in bytes for this field */ size_t getDataSize() const; + /** Gets the human-readable name of this field */ String getName() const; + /** Gets the human-readable description of the field */ String getDescription() const; + /** Gets the machine-readable descriptor for this field */ + String getDescriptor() const; bool isEqual(const MetaDataDescriptor& other) const; bool operator==(const MetaDataDescriptor& other) const; @@ -71,10 +88,11 @@ public: static size_t getTypeSize(MetaDataTypes type); private: MetaDataDescriptor() = delete; - String m_name; - String m_desc; - MetaDataTypes m_type; - unsigned int m_length; + const String m_name; + const String m_descriptor; + const String m_description; + const MetaDataTypes m_type; + const unsigned int m_length; JUCE_LEAK_DETECTOR(MetaDataDescriptor); };