\r
class KaxInternalBlock : public EbmlBinary {\r
public:\r
- KaxInternalBlock(EBML_DEF_CONS EBML_DEF_SEP bool bSimple ) :EBML_DEF_BINARY_INIT EBML_DEF_SEP bLocalTimecodeUsed(false), mLacing(LACING_AUTO), mInvisible(false)\r
+ KaxInternalBlock(EBML_DEF_CONS EBML_DEF_SEP bool bSimple EBML_DEF_SEP EBML_EXTRA_PARAM) :EBML_DEF_BINARY_INIT EBML_DEF_SEP bLocalTimecodeUsed(false), mLacing(LACING_AUTO), mInvisible(false)\r
,ParentCluster(NULL), bIsSimple(bSimple), bIsKeyframe(true), bIsDiscardable(false)\r
{}\r
KaxInternalBlock(const KaxInternalBlock & ElementToClone);\r
DECLARE_MKX_CONTEXT(KaxBlock);\r
class MATROSKA_DLL_API KaxBlock : public KaxInternalBlock {\r
public:\r
- KaxBlock() :KaxInternalBlock(EBML_DEF_BINARY_CTX(KaxBlock)EBML_DEF_SEP false) {}\r
+ KaxBlock(EBML_EXTRA_PARAM) :KaxInternalBlock(EBML_DEF_BINARY_CTX(KaxBlock)EBML_DEF_SEP false EBML_DEF_SEP EBML_EXTRA_CALL) {}\r
EBML_CONCRETE_CLASS(KaxBlock)\r
};\r
\r
DECLARE_MKX_CONTEXT(KaxSimpleBlock);\r
class MATROSKA_DLL_API KaxSimpleBlock : public KaxInternalBlock {\r
public:\r
- KaxSimpleBlock() :KaxInternalBlock(EBML_DEF_BINARY_CTX(KaxSimpleBlock)EBML_DEF_SEP true) {}\r
+ KaxSimpleBlock(EBML_EXTRA_PARAM) :KaxInternalBlock(EBML_DEF_BINARY_CTX(KaxSimpleBlock)EBML_DEF_SEP true EBML_DEF_SEP EBML_EXTRA_CALL) {}\r
\r
void SetKeyframe(bool b_keyframe) { bIsKeyframe = b_keyframe; }\r
void SetDiscardable(bool b_discard) { bIsDiscardable = b_discard; }\r
-/****************************************************************************
-** libmatroska : parse Matroska files, see http://www.matroska.org/
-**
-** <file/class description>
-**
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public
-** License along with this library; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
-** Contact license@matroska.org if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/*!
- \file
- \version \$Id: KaxDefines.h,v 1.8 2010/04/02 23:26:17 robux4 Exp $
- \author Steve Lhomme <robux4 @ users.sf.net>
-*/
-#ifndef LIBMATROSKA_DEFINES_H
-#define LIBMATROSKA_DEFINES_H
-
-#include "ebml/EbmlVersion.h"
-#include "ebml/EbmlElement.h"
-
-#if LIBEBML_VERSION >= 0x010000
-#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,*GetKaxGlobal_Context)
-#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,c,d,*GetKaxGlobal_Context)
-#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
-#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_UINTEGER(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_SINTEGER(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_SINTEGER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
-#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_STRING(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_UNISTRING(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_BINARY(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_BINARY_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
-#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_FLOAT(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_FLOAT64(a,b,c,d,e) DEFINE_xxx_FLOAT64(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_DATE(a,b,c,d,e,*GetKaxGlobal_Context)
-
-#define DECLARE_MKX_CONTEXT(x)
-
-#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \
-class MATROSKA_DLL_API x : public EbmlMaster { \
- public: x(); \
- x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \
-class MATROSKA_DLL_API x : public EbmlMaster { \
- public: x(); \
- x(const x & ElementToClone); \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlBinary { \
- public: x(); \
- x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlBinary { \
- public: x(); \
- x(const x & ElementToClone); \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlUnicodeString { \
- public: x(); \
- x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlString { \
- public: x(); \
- x(const x & ElementToClone) :EbmlString(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlUInteger { \
- public: x(); \
- x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlSInteger { \
- public: x(); \
- x(const x & ElementToClone); \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlSInteger { \
- public: x(); \
- x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlDate { \
- public: x(); \
- x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlFloat { \
- public: x(); \
- x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-
-#else
-#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,*GetKaxGlobal_Context)
-#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,c,d,*GetKaxGlobal_Context)
-#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
-#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
-#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)
-#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
-#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)
-
-#define DECLARE_MKX_CONTEXT(x)
-
-#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \
-class MATROSKA_DLL_API x : public EbmlMaster { \
- public: x(); \
- x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \
-class MATROSKA_DLL_API x : public EbmlMaster { \
- public: x(); \
- x(const x & ElementToClone); \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlBinary { \
- public: x(); \
- x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlBinary { \
- public: x(); \
- x(const x & ElementToClone); \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlUnicodeString { \
- public: x(); \
- x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlString { \
- public: x(); \
- x(const x & ElementToClone) :EbmlString(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlUInteger { \
- public: x(); \
- x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlSInteger { \
- public: x(); \
- x(const x & ElementToClone); \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlSInteger { \
- public: x(); \
- x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlDate { \
- public: x(); \
- x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \
- class MATROSKA_DLL_API x : public EbmlFloat { \
- public: x(); \
- x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \
- EBML_CONCRETE_CLASS(x)
-
-#endif
-
-#endif // LIBMATROSKA_DEFINES_H
+/****************************************************************************\r
+** libmatroska : parse Matroska files, see http://www.matroska.org/\r
+**\r
+** <file/class description>\r
+**\r
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
+**\r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+** \r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+** Lesser General Public License for more details.\r
+** \r
+** You should have received a copy of the GNU Lesser General Public\r
+** License along with this library; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+**\r
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
+** Contact license@matroska.org if any conditions of this licensing are\r
+** not clear to you.\r
+**\r
+**********************************************************************/\r
+\r
+/*!\r
+ \file\r
+ \version \$Id: KaxDefines.h,v 1.8 2010/04/02 23:26:17 robux4 Exp $\r
+ \author Steve Lhomme <robux4 @ users.sf.net>\r
+*/\r
+#ifndef LIBMATROSKA_DEFINES_H\r
+#define LIBMATROSKA_DEFINES_H\r
+\r
+#include "ebml/EbmlVersion.h"\r
+#include "ebml/EbmlElement.h"\r
+\r
+#if LIBEBML_VERSION >= 0x010000\r
+#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,c,d,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
+#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_UINTEGER(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_SINTEGER(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_SINTEGER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
+#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_STRING(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_UNISTRING(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_BINARY(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_BINARY_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
+#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_FLOAT(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_FLOAT64(a,b,c,d,e) DEFINE_xxx_FLOAT64(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_DATE(a,b,c,d,e,*GetKaxGlobal_Context)\r
+\r
+#define DECLARE_MKX_CONTEXT(x)\r
+\r
+#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \\r
+class MATROSKA_DLL_API x : public EbmlMaster { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
+class MATROSKA_DLL_API x : public EbmlMaster { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone); \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlBinary { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlBinary { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone); \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlUnicodeString { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlString { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlString(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlUInteger { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlSInteger { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone); \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlSInteger { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlDate { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlFloat { \\r
+ public: x(EBML_EXTRA_PARAM); \\r
+ x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+\r
+#else\r
+#define DEFINE_MKX_CONTEXT(a) DEFINE_xxx_CONTEXT(a,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e) DEFINE_xxx_MASTER_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_MASTER(a,b,c,d,e) DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d) DEFINE_xxx_MASTER_ORPHAN(a,b,c,d,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
+#define DEFINE_MKX_UINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_SINTEGER(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v) DEFINE_xxx_STRING_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
+#define DEFINE_MKX_STRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_UNISTRING(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_BINARY(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v) DEFINE_xxx_FLOAT_DEF(a,b,c,d,e,*GetKaxGlobal_Context,v)\r
+#define DEFINE_MKX_FLOAT(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_DATE(a,b,c,d,e) DEFINE_xxx_CLASS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e) DEFINE_xxx_CLASS_CONS(a,b,c,d,e,*GetKaxGlobal_Context)\r
+\r
+#define DECLARE_MKX_CONTEXT(x)\r
+\r
+#define DECLARE_MKX_MASTER(x) DECLARE_MKX_CONTEXT(x) \\r
+class MATROSKA_DLL_API x : public EbmlMaster { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlMaster(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_MASTER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
+class MATROSKA_DLL_API x : public EbmlMaster { \\r
+ public: x(); \\r
+ x(const x & ElementToClone); \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_BINARY(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlBinary { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlBinary(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_BINARY_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlBinary { \\r
+ public: x(); \\r
+ x(const x & ElementToClone); \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_UNISTRING(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlUnicodeString { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlUnicodeString(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_STRING(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlString { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlString(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_UINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlUInteger { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlUInteger(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_SINTEGER_CONS(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlSInteger { \\r
+ public: x(); \\r
+ x(const x & ElementToClone); \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_SINTEGER(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlSInteger { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlSInteger(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_DATE(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlDate { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlDate(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#define DECLARE_MKX_FLOAT(x) DECLARE_MKX_CONTEXT(x) \\r
+ class MATROSKA_DLL_API x : public EbmlFloat { \\r
+ public: x(); \\r
+ x(const x & ElementToClone) :EbmlFloat(ElementToClone) {} \\r
+ EBML_CONCRETE_CLASS(x)\r
+\r
+#endif\r
+\r
+#endif // LIBMATROSKA_DEFINES_H\r
DECLARE_MKX_BINARY(KaxSegmentUID)\r
public:\r
#if LIBEBML_VERSION >= 0x010000\r
- KaxSegmentUID(EBML_DEF_CONS);\r
+ KaxSegmentUID(EBML_DEF_CONS EBML_DEF_SEP EBML_EXTRA_PARAM);\r
#endif\r
virtual bool ValidateSize() const { return (GetSize() == 16);}\r
};\r
DECLARE_MKX_CONTEXT(KaxPrevUID);\r
class MATROSKA_DLL_API KaxPrevUID : public KaxSegmentUID {\r
public:\r
- KaxPrevUID();\r
+ KaxPrevUID(EBML_EXTRA_PARAM);\r
KaxPrevUID(const KaxPrevUID & ElementToClone) :KaxSegmentUID(ElementToClone){}\r
virtual bool ValidateSize() const { return (GetSize() == 16);}\r
\r
DECLARE_MKX_CONTEXT(KaxNextUID);\r
class MATROSKA_DLL_API KaxNextUID : public KaxSegmentUID {\r
public:\r
- KaxNextUID();\r
+ KaxNextUID(EBML_EXTRA_PARAM);\r
KaxNextUID(const KaxNextUID & ElementToClone) :KaxSegmentUID(ElementToClone){}\r
virtual bool ValidateSize() const { return (GetSize() == 16);}\r
\r
-/****************************************************************************
-** libmatroska : parse Matroska files, see http://www.matroska.org/
-**
-** <file/class description>
-**
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
-**
-** This file is part of libmatroska.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public
-** License along with this library; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
-** Contact license@matroska.org if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/*!
- \file
- \version \$Id: KaxAttached.cpp 1202 2005-08-30 14:39:01Z robux4 $
- \author Steve Lhomme <robux4 @ users.sf.net>
-*/
-#include "matroska/KaxAttached.h"
-#include "matroska/KaxContexts.h"
-#include "matroska/KaxDefines.h"
-
-// sub elements
-
-using namespace LIBEBML_NAMESPACE;
-
-START_LIBMATROSKA_NAMESPACE
-
-DEFINE_START_SEMANTIC(KaxAttached)
-DEFINE_SEMANTIC_ITEM(true, true, KaxFileName)
-DEFINE_SEMANTIC_ITEM(true, true, KaxMimeType)
-DEFINE_SEMANTIC_ITEM(true, true, KaxFileData)
-DEFINE_SEMANTIC_ITEM(false, true, KaxFileDescription)
-DEFINE_SEMANTIC_ITEM(true, true, KaxFileUID)
-#if MATROSKA_VERSION >= 2
-DEFINE_SEMANTIC_ITEM(false, true, KaxFileReferral)
-#endif // MATROSKA_VERSION
-DEFINE_END_SEMANTIC(KaxAttached)
-
-DEFINE_MKX_MASTER_CONS(KaxAttached, 0x61A7, 2, KaxAttachments, "AttachedFile");
-DEFINE_MKX_UNISTRING (KaxFileDescription, 0x467E, 2, KaxAttachments, "FileDescription");
-DEFINE_MKX_UNISTRING (KaxFileName, 0x466E, 2, KaxAttachments, "FileName");
-DEFINE_MKX_STRING (KaxMimeType, 0x4660, 2, KaxAttachments, "FileMimeType");
-DEFINE_MKX_BINARY (KaxFileData, 0x465C, 2, KaxAttachments, "FileData");
-DEFINE_MKX_UINTEGER (KaxFileUID, 0x46AE, 2, KaxAttachments, "FileUID");
-#if MATROSKA_VERSION >= 2
-DEFINE_MKX_BINARY (KaxFileReferral, 0x4675, 2, KaxAttachments, "FileReferral");
-#endif
-
-KaxAttached::KaxAttached()
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttached))
-{
- SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)
-}
-
-END_LIBMATROSKA_NAMESPACE
+/****************************************************************************\r
+** libmatroska : parse Matroska files, see http://www.matroska.org/\r
+**\r
+** <file/class description>\r
+**\r
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
+**\r
+** This file is part of libmatroska.\r
+**\r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+** \r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+** Lesser General Public License for more details.\r
+** \r
+** You should have received a copy of the GNU Lesser General Public\r
+** License along with this library; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+**\r
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
+** Contact license@matroska.org if any conditions of this licensing are\r
+** not clear to you.\r
+**\r
+**********************************************************************/\r
+\r
+/*!\r
+ \file\r
+ \version \$Id: KaxAttached.cpp 1202 2005-08-30 14:39:01Z robux4 $\r
+ \author Steve Lhomme <robux4 @ users.sf.net>\r
+*/\r
+#include "matroska/KaxAttached.h"\r
+#include "matroska/KaxContexts.h"\r
+#include "matroska/KaxDefines.h"\r
+\r
+// sub elements\r
+\r
+using namespace LIBEBML_NAMESPACE;\r
+\r
+START_LIBMATROSKA_NAMESPACE\r
+\r
+DEFINE_START_SEMANTIC(KaxAttached)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxFileName)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxMimeType)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxFileData)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxFileDescription)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxFileUID)\r
+#if MATROSKA_VERSION >= 2\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxFileReferral)\r
+#endif // MATROSKA_VERSION\r
+DEFINE_END_SEMANTIC(KaxAttached)\r
+\r
+DEFINE_MKX_MASTER_CONS(KaxAttached, 0x61A7, 2, KaxAttachments, "AttachedFile");\r
+DEFINE_MKX_UNISTRING (KaxFileDescription, 0x467E, 2, KaxAttachments, "FileDescription");\r
+DEFINE_MKX_UNISTRING (KaxFileName, 0x466E, 2, KaxAttachments, "FileName");\r
+DEFINE_MKX_STRING (KaxMimeType, 0x4660, 2, KaxAttachments, "FileMimeType");\r
+DEFINE_MKX_BINARY (KaxFileData, 0x465C, 2, KaxAttachments, "FileData");\r
+DEFINE_MKX_UINTEGER (KaxFileUID, 0x46AE, 2, KaxAttachments, "FileUID");\r
+#if MATROSKA_VERSION >= 2\r
+DEFINE_MKX_BINARY (KaxFileReferral, 0x4675, 2, KaxAttachments, "FileReferral");\r
+#endif\r
+\r
+KaxAttached::KaxAttached(EBML_EXTRA_DEF)\r
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttached) EBML_DEF_SEP EBML_EXTRA_CALL)\r
+{\r
+ SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)\r
+}\r
+\r
+END_LIBMATROSKA_NAMESPACE\r
-/****************************************************************************
-** libmatroska : parse Matroska files, see http://www.matroska.org/
-**
-** <file/class description>
-**
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
-**
-** This file is part of libmatroska.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public
-** License along with this library; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
-** Contact license@matroska.org if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/*!
- \file
- \version \$Id: KaxAttachments.cpp 640 2004-07-09 21:05:36Z mosu $
- \author Steve Lhomme <robux4 @ users.sf.net>
-*/
-#include "matroska/KaxAttachments.h"
-#include "matroska/KaxAttached.h"
-#include "matroska/KaxContexts.h"
-#include "matroska/KaxDefines.h"
-
-using namespace LIBEBML_NAMESPACE;
-
-// sub elements
-START_LIBMATROSKA_NAMESPACE
-
-DEFINE_START_SEMANTIC(KaxAttachments)
-DEFINE_SEMANTIC_ITEM(true, false, KaxAttached) ///< EBMLVersion
-DEFINE_END_SEMANTIC(KaxAttachments)
-
-DEFINE_MKX_MASTER_CONS(KaxAttachments, 0x1941A469, 4, KaxSegment, "Attachments");
-
-KaxAttachments::KaxAttachments()
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttachments))
-{
- SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)
-}
-
-END_LIBMATROSKA_NAMESPACE
+/****************************************************************************\r
+** libmatroska : parse Matroska files, see http://www.matroska.org/\r
+**\r
+** <file/class description>\r
+**\r
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
+**\r
+** This file is part of libmatroska.\r
+**\r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+** \r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+** Lesser General Public License for more details.\r
+** \r
+** You should have received a copy of the GNU Lesser General Public\r
+** License along with this library; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+**\r
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
+** Contact license@matroska.org if any conditions of this licensing are\r
+** not clear to you.\r
+**\r
+**********************************************************************/\r
+\r
+/*!\r
+ \file\r
+ \version \$Id: KaxAttachments.cpp 640 2004-07-09 21:05:36Z mosu $\r
+ \author Steve Lhomme <robux4 @ users.sf.net>\r
+*/\r
+#include "matroska/KaxAttachments.h"\r
+#include "matroska/KaxAttached.h"\r
+#include "matroska/KaxContexts.h"\r
+#include "matroska/KaxDefines.h"\r
+\r
+using namespace LIBEBML_NAMESPACE;\r
+\r
+// sub elements\r
+START_LIBMATROSKA_NAMESPACE\r
+\r
+DEFINE_START_SEMANTIC(KaxAttachments)\r
+DEFINE_SEMANTIC_ITEM(true, false, KaxAttached) ///< EBMLVersion\r
+DEFINE_END_SEMANTIC(KaxAttachments)\r
+\r
+DEFINE_MKX_MASTER_CONS(KaxAttachments, 0x1941A469, 4, KaxSegment, "Attachments");\r
+\r
+KaxAttachments::KaxAttachments(EBML_EXTRA_DEF)\r
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttachments) EBML_DEF_SEP EBML_EXTRA_CALL)\r
+{\r
+ SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)\r
+}\r
+\r
+END_LIBMATROSKA_NAMESPACE\r
//NOTE("KaxBlockGroup::~KaxBlockGroup");\r
}\r
\r
-KaxBlockGroup::KaxBlockGroup()\r
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxBlockGroup))\r
+KaxBlockGroup::KaxBlockGroup(EBML_EXTRA_DEF)\r
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxBlockGroup) EBML_DEF_SEP EBML_EXTRA_CALL)\r
,ParentCluster(NULL)\r
,ParentTrack(NULL)\r
{}\r
SetValueIsSet(false);\r
}\r
\r
-KaxBlockVirtual::KaxBlockVirtual()\r
+KaxBlockVirtual::KaxBlockVirtual(EBML_EXTRA_DEF)\r
:EBML_DEF_BINARY(KaxBlockVirtual)EBML_DEF_SEP ParentCluster(NULL)\r
{\r
SetBuffer(DataBlock,sizeof(DataBlock));\r
return *RefdBlock;\r
}\r
\r
-KaxReferenceBlock::KaxReferenceBlock()\r
+KaxReferenceBlock::KaxReferenceBlock(EBML_EXTRA_DEF)\r
:EBML_DEF_SINTEGER(KaxReferenceBlock)EBML_DEF_SEP\r
RefdBlock(NULL)\r
,ParentBlock(NULL)\r
-/****************************************************************************
-** libmatroska : parse Matroska files, see http://www.matroska.org/
-**
-** <file/class description>
-**
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public
-** License along with this library; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
-** Contact license@matroska.org if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/*!
- \file
- \version \$Id: KaxCluster.cpp 1228 2005-10-14 19:36:51Z robux4 $
- \author Steve Lhomme <robux4 @ users.sf.net>
-*/
-#include "matroska/KaxCluster.h"
-#include "matroska/KaxClusterData.h"
-#include "matroska/KaxBlock.h"
-#include "matroska/KaxContexts.h"
-#include "matroska/KaxSegment.h"
-#include "matroska/KaxDefines.h"
-
-// sub elements
-START_LIBMATROSKA_NAMESPACE
-
-DEFINE_START_SEMANTIC(KaxCluster)
-DEFINE_SEMANTIC_ITEM(true, true, KaxClusterTimecode)
-DEFINE_SEMANTIC_ITEM(false, true, KaxClusterSilentTracks)
-DEFINE_SEMANTIC_ITEM(false, true, KaxClusterPrevSize)
-DEFINE_SEMANTIC_ITEM(false, false, KaxBlockGroup)
-#if MATROSKA_VERSION == 2
-DEFINE_SEMANTIC_ITEM(false, false, KaxSimpleBlock)
-#endif
-DEFINE_SEMANTIC_ITEM(false, true, KaxClusterPosition)
-DEFINE_END_SEMANTIC(KaxCluster)
-
-DEFINE_MKX_MASTER_CONS(KaxCluster, 0x1F43B675, 4, KaxSegment, "Cluster");
-
-KaxCluster::KaxCluster()
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxCluster))
- ,currentNewBlock(NULL)
- ,ParentSegment(NULL)
- ,bFirstFrameInside(false)
- ,bPreviousTimecodeIsSet(false)
- ,bTimecodeScaleIsSet(false)
- ,bSilentTracksUsed(false)
-{}
-
-KaxCluster::KaxCluster(const KaxCluster & ElementToClone)
- :EbmlMaster(ElementToClone)
- ,bSilentTracksUsed(ElementToClone.bSilentTracksUsed)
-{
- // update the parent of each children
- EBML_MASTER_ITERATOR Itr = begin();
- while (Itr != end())
- {
- if (EbmlId(**Itr) == EBML_ID(KaxBlockGroup)) {
- static_cast<KaxBlockGroup *>(*Itr)->SetParent(*this);
- } else if (EbmlId(**Itr) == EBML_ID(KaxBlock)) {
- static_cast<KaxBlock *>(*Itr)->SetParent(*this);
-#if MATROSKA_VERSION >= 2
- } else if (EbmlId(**Itr) == EBML_ID(KaxBlockVirtual)) {
- static_cast<KaxBlockVirtual *>(*Itr)->SetParent(*this);
-#endif // MATROSKA_VERSION
- }
- ++Itr;
- }
-}
-
-bool KaxCluster::AddBlockBlob(KaxBlockBlob * NewBlob)
-{
- Blobs.push_back(NewBlob);
- return true;
-}
-
-bool KaxCluster::AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup * PastBlock, const KaxBlockGroup * ForwBlock, LacingType lacing)
-{
- if (!bFirstFrameInside) {
- bFirstFrameInside = true;
- MinTimecode = MaxTimecode = timecode;
- } else {
- if (timecode < MinTimecode)
- MinTimecode = timecode;
- if (timecode > MaxTimecode)
- MaxTimecode = timecode;
- }
-
- MyNewBlock = NULL;
-
- if (lacing == LACING_NONE || !track.LacingEnabled()) {
- currentNewBlock = NULL;
- }
-
- // force creation of a new block
- if (currentNewBlock == NULL || uint32(track.TrackNumber()) != uint32(currentNewBlock->TrackNumber()) || PastBlock != NULL || ForwBlock != NULL) {
- KaxBlockGroup & aNewBlock = GetNewBlock();
- MyNewBlock = currentNewBlock = &aNewBlock;
- currentNewBlock = &aNewBlock;
- }
-
- if (PastBlock != NULL) {
- if (ForwBlock != NULL) {
- if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, *ForwBlock, lacing)) {
- // more data are allowed in this Block
- return true;
- } else {
- currentNewBlock = NULL;
- return false;
- }
- } else {
- if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, lacing)) {
- // more data are allowed in this Block
- return true;
- } else {
- currentNewBlock = NULL;
- return false;
- }
- }
- } else {
- if (currentNewBlock->AddFrame(track, timecode, buffer, lacing)) {
- // more data are allowed in this Block
- return true;
- } else {
- currentNewBlock = NULL;
- return false;
- }
- }
-}
-
-bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing)
-{
- assert(Blobs.size() == 0); // mutually exclusive for the moment
- return AddFrameInternal(track, timecode, buffer, MyNewBlock, NULL, NULL, lacing);
-}
-
-bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing)
-{
- assert(Blobs.size() == 0); // mutually exclusive for the moment
- return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, NULL, lacing);
-}
-
-bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing)
-{
- assert(Blobs.size() == 0); // mutually exclusive for the moment
- return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, &ForwBlock, lacing);
-}
-
-/*!
- \todo only put the Blocks written in the cue entries
-*/
-filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault)
-{
- filepos_t Result = 0;
- size_t TrkIndex, Index;
-
- // update the Timecode of the Cluster before writing
- KaxClusterTimecode * Timecode = static_cast<KaxClusterTimecode *>(this->FindElt(EBML_INFO(KaxClusterTimecode)));
- *static_cast<EbmlUInteger *>(Timecode) = GlobalTimecode() / GlobalTimecodeScale();
-
- if (Blobs.size() == 0) {
- // old-school direct KaxBlockGroup
-
- // SilentTracks handling
- // check the parent cluster for existing tracks and see if they are contained in this cluster or not
- if (bSilentTracksUsed)
- {
- KaxTracks & MyTracks = *static_cast<KaxTracks *>(ParentSegment->FindElt(EBML_INFO(KaxTracks)));
- for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) {
- if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry))
- {
- KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(MyTracks[TrkIndex]);
- uint32 tracknum = entry.TrackNumber();
- for (Index = 0; Index < ListSize(); Index++) {
- if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) {
- KaxBlockGroup & group = *static_cast<KaxBlockGroup *>((*this)[Index]);
- if (group.TrackNumber() == tracknum)
- break; // this track is used
- }
- }
- // the track wasn't found in this cluster
- if (Index == ListSize())
- {
- KaxClusterSilentTracks * SilentTracks = static_cast<KaxClusterSilentTracks *>(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks)));
- assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster
- KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));
- *static_cast<EbmlUInteger *>(trackelt) = tracknum;
- }
- }
- }
- }
-
- Result = EbmlMaster::Render(output, bSaveDefault);
- // For all Blocks add their position on the CueEntry
-
- for (Index = 0; Index < ListSize(); Index++) {
- if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) {
- CueToUpdate.PositionSet(*static_cast<const KaxBlockGroup *>((*this)[Index]));
- }
- }
- } else {
- // new school, using KaxBlockBlob
- for (Index = 0; Index<Blobs.size(); Index++)
- {
-#if MATROSKA_VERSION >= 2
- if (Blobs[Index]->IsSimpleBlock())
- PushElement( (KaxSimpleBlock&) *Blobs[Index] );
- else
-#endif
- PushElement( (KaxBlockGroup&) *Blobs[Index] );
- }
-
- // SilentTracks handling
- // check the parent cluster for existing tracks and see if they are contained in this cluster or not
- if (bSilentTracksUsed)
- {
- KaxTracks & MyTracks = *static_cast<KaxTracks *>(ParentSegment->FindElt(EBML_INFO(KaxTracks)));
- for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) {
- if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry))
- {
- KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(MyTracks[TrkIndex]);
- uint32 tracknum = entry.TrackNumber();
- for (Index = 0; Index<Blobs.size(); Index++) {
- if (((KaxInternalBlock&)*Blobs[Index]).TrackNum() == tracknum)
- break; // this track is used
- }
- // the track wasn't found in this cluster
- if (Index == ListSize())
- {
- KaxClusterSilentTracks * SilentTracks = static_cast<KaxClusterSilentTracks *>(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks)));
- assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster
- KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));
- *static_cast<EbmlUInteger *>(trackelt) = tracknum;
- }
- }
- }
- }
-
- Result = EbmlMaster::Render(output, bSaveDefault);
-
- // For all Blocks add their position on the CueEntry
- for (Index = 0; Index<Blobs.size(); Index++) {
- CueToUpdate.PositionSet(*Blobs[Index]);
- }
-
- Blobs.clear();
- }
-
- return Result;
-}
-
-/*!
- \todo automatically choose valid timecode for the Cluster based on the previous cluster timecode (must be incremental)
-*/
-uint64 KaxCluster::GlobalTimecode() const
-{
- assert(bPreviousTimecodeIsSet);
- uint64 result = MinTimecode;
-
- if (result < PreviousTimecode)
- result = PreviousTimecode + 1;
-
- return result;
-}
-
-/*!
- \brief retrieve the relative
- \todo !!! We need a way to know the TimecodeScale
-*/
-int16 KaxCluster::GetBlockLocalTimecode(uint64 aGlobalTimecode) const
-{
- int64 TimecodeDelay = (int64(aGlobalTimecode) - int64(GlobalTimecode())) / int64(GlobalTimecodeScale());
- assert(TimecodeDelay >= int16(0x8000) && TimecodeDelay <= int16(0x7FFF));
- return int16(TimecodeDelay);
-}
-
-uint64 KaxCluster::GetBlockGlobalTimecode(int16 GlobalSavedTimecode)
-{
- if (!bFirstFrameInside) {
- KaxClusterTimecode * Timecode = static_cast<KaxClusterTimecode *>(this->FindElt(EBML_INFO(KaxClusterTimecode)));
- assert (bFirstFrameInside); // use the InitTimecode() hack for now
- MinTimecode = MaxTimecode = PreviousTimecode = *static_cast<EbmlUInteger *>(Timecode);
- bFirstFrameInside = true;
- bPreviousTimecodeIsSet = true;
- }
- return int64(GlobalSavedTimecode * GlobalTimecodeScale()) + GlobalTimecode();
-}
-
-KaxBlockGroup & KaxCluster::GetNewBlock()
-{
- KaxBlockGroup & MyBlock = AddNewChild<KaxBlockGroup>(*this);
- MyBlock.SetParent(*this);
- return MyBlock;
-}
-
-void KaxCluster::ReleaseFrames()
-{
- size_t Index;
-
- for (Index = 0; Index < ListSize(); Index++) {
- if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) {
- static_cast<KaxBlockGroup*>((*this)[Index])->ReleaseFrames();
- }
- }
-}
-
-uint64 KaxCluster::GetPosition() const
-{
- assert(ParentSegment != NULL);
- return ParentSegment->GetRelativePosition(*this);
-}
-
-END_LIBMATROSKA_NAMESPACE
+/****************************************************************************\r
+** libmatroska : parse Matroska files, see http://www.matroska.org/\r
+**\r
+** <file/class description>\r
+**\r
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
+**\r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+** \r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+** Lesser General Public License for more details.\r
+** \r
+** You should have received a copy of the GNU Lesser General Public\r
+** License along with this library; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+**\r
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
+** Contact license@matroska.org if any conditions of this licensing are\r
+** not clear to you.\r
+**\r
+**********************************************************************/\r
+\r
+/*!\r
+ \file\r
+ \version \$Id: KaxCluster.cpp 1228 2005-10-14 19:36:51Z robux4 $\r
+ \author Steve Lhomme <robux4 @ users.sf.net>\r
+*/\r
+#include "matroska/KaxCluster.h"\r
+#include "matroska/KaxClusterData.h"\r
+#include "matroska/KaxBlock.h"\r
+#include "matroska/KaxContexts.h"\r
+#include "matroska/KaxSegment.h"\r
+#include "matroska/KaxDefines.h"\r
+\r
+// sub elements\r
+START_LIBMATROSKA_NAMESPACE\r
+\r
+DEFINE_START_SEMANTIC(KaxCluster)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxClusterTimecode)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxClusterSilentTracks)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxClusterPrevSize)\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxBlockGroup)\r
+#if MATROSKA_VERSION == 2\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxSimpleBlock)\r
+#endif\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxClusterPosition)\r
+DEFINE_END_SEMANTIC(KaxCluster)\r
+\r
+DEFINE_MKX_MASTER_CONS(KaxCluster, 0x1F43B675, 4, KaxSegment, "Cluster");\r
+\r
+KaxCluster::KaxCluster(EBML_EXTRA_DEF)\r
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxCluster) EBML_DEF_SEP EBML_EXTRA_CALL)\r
+ ,currentNewBlock(NULL)\r
+ ,ParentSegment(NULL)\r
+ ,bFirstFrameInside(false)\r
+ ,bPreviousTimecodeIsSet(false)\r
+ ,bTimecodeScaleIsSet(false)\r
+ ,bSilentTracksUsed(false)\r
+{}\r
+\r
+KaxCluster::KaxCluster(const KaxCluster & ElementToClone) \r
+ :EbmlMaster(ElementToClone)\r
+ ,bSilentTracksUsed(ElementToClone.bSilentTracksUsed)\r
+{\r
+ // update the parent of each children\r
+ EBML_MASTER_ITERATOR Itr = begin();\r
+ while (Itr != end())\r
+ {\r
+ if (EbmlId(**Itr) == EBML_ID(KaxBlockGroup)) {\r
+ static_cast<KaxBlockGroup *>(*Itr)->SetParent(*this);\r
+ } else if (EbmlId(**Itr) == EBML_ID(KaxBlock)) {\r
+ static_cast<KaxBlock *>(*Itr)->SetParent(*this);\r
+#if MATROSKA_VERSION >= 2\r
+ } else if (EbmlId(**Itr) == EBML_ID(KaxBlockVirtual)) {\r
+ static_cast<KaxBlockVirtual *>(*Itr)->SetParent(*this);\r
+#endif // MATROSKA_VERSION\r
+ }\r
+ ++Itr;\r
+ }\r
+}\r
+\r
+bool KaxCluster::AddBlockBlob(KaxBlockBlob * NewBlob)\r
+{\r
+ Blobs.push_back(NewBlob);\r
+ return true;\r
+}\r
+\r
+bool KaxCluster::AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup * PastBlock, const KaxBlockGroup * ForwBlock, LacingType lacing)\r
+{\r
+ if (!bFirstFrameInside) {\r
+ bFirstFrameInside = true;\r
+ MinTimecode = MaxTimecode = timecode;\r
+ } else {\r
+ if (timecode < MinTimecode)\r
+ MinTimecode = timecode;\r
+ if (timecode > MaxTimecode)\r
+ MaxTimecode = timecode;\r
+ }\r
+\r
+ MyNewBlock = NULL;\r
+\r
+ if (lacing == LACING_NONE || !track.LacingEnabled()) {\r
+ currentNewBlock = NULL;\r
+ }\r
+\r
+ // force creation of a new block\r
+ if (currentNewBlock == NULL || uint32(track.TrackNumber()) != uint32(currentNewBlock->TrackNumber()) || PastBlock != NULL || ForwBlock != NULL) {\r
+ KaxBlockGroup & aNewBlock = GetNewBlock();\r
+ MyNewBlock = currentNewBlock = &aNewBlock;\r
+ currentNewBlock = &aNewBlock;\r
+ }\r
+\r
+ if (PastBlock != NULL) {\r
+ if (ForwBlock != NULL) {\r
+ if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, *ForwBlock, lacing)) {\r
+ // more data are allowed in this Block\r
+ return true;\r
+ } else {\r
+ currentNewBlock = NULL;\r
+ return false;\r
+ }\r
+ } else {\r
+ if (currentNewBlock->AddFrame(track, timecode, buffer, *PastBlock, lacing)) {\r
+ // more data are allowed in this Block\r
+ return true;\r
+ } else {\r
+ currentNewBlock = NULL;\r
+ return false;\r
+ }\r
+ }\r
+ } else {\r
+ if (currentNewBlock->AddFrame(track, timecode, buffer, lacing)) {\r
+ // more data are allowed in this Block\r
+ return true;\r
+ } else {\r
+ currentNewBlock = NULL;\r
+ return false;\r
+ }\r
+ }\r
+}\r
+\r
+bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, LacingType lacing)\r
+{\r
+ assert(Blobs.size() == 0); // mutually exclusive for the moment\r
+ return AddFrameInternal(track, timecode, buffer, MyNewBlock, NULL, NULL, lacing);\r
+}\r
+\r
+bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, LacingType lacing)\r
+{\r
+ assert(Blobs.size() == 0); // mutually exclusive for the moment\r
+ return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, NULL, lacing);\r
+}\r
+\r
+bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup & PastBlock, const KaxBlockGroup & ForwBlock, LacingType lacing)\r
+{\r
+ assert(Blobs.size() == 0); // mutually exclusive for the moment\r
+ return AddFrameInternal(track, timecode, buffer, MyNewBlock, &PastBlock, &ForwBlock, lacing);\r
+}\r
+\r
+/*!\r
+ \todo only put the Blocks written in the cue entries\r
+*/\r
+filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault)\r
+{\r
+ filepos_t Result = 0;\r
+ size_t TrkIndex, Index;\r
+\r
+ // update the Timecode of the Cluster before writing\r
+ KaxClusterTimecode * Timecode = static_cast<KaxClusterTimecode *>(this->FindElt(EBML_INFO(KaxClusterTimecode)));\r
+ *static_cast<EbmlUInteger *>(Timecode) = GlobalTimecode() / GlobalTimecodeScale();\r
+\r
+ if (Blobs.size() == 0) {\r
+ // old-school direct KaxBlockGroup\r
+\r
+ // SilentTracks handling\r
+ // check the parent cluster for existing tracks and see if they are contained in this cluster or not\r
+ if (bSilentTracksUsed)\r
+ {\r
+ KaxTracks & MyTracks = *static_cast<KaxTracks *>(ParentSegment->FindElt(EBML_INFO(KaxTracks)));\r
+ for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) {\r
+ if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry))\r
+ {\r
+ KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(MyTracks[TrkIndex]);\r
+ uint32 tracknum = entry.TrackNumber();\r
+ for (Index = 0; Index < ListSize(); Index++) {\r
+ if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) {\r
+ KaxBlockGroup & group = *static_cast<KaxBlockGroup *>((*this)[Index]);\r
+ if (group.TrackNumber() == tracknum)\r
+ break; // this track is used\r
+ }\r
+ }\r
+ // the track wasn't found in this cluster\r
+ if (Index == ListSize())\r
+ {\r
+ KaxClusterSilentTracks * SilentTracks = static_cast<KaxClusterSilentTracks *>(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks)));\r
+ assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster\r
+ KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));\r
+ *static_cast<EbmlUInteger *>(trackelt) = tracknum;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ Result = EbmlMaster::Render(output, bSaveDefault);\r
+ // For all Blocks add their position on the CueEntry\r
+ \r
+ for (Index = 0; Index < ListSize(); Index++) {\r
+ if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) {\r
+ CueToUpdate.PositionSet(*static_cast<const KaxBlockGroup *>((*this)[Index]));\r
+ }\r
+ }\r
+ } else {\r
+ // new school, using KaxBlockBlob\r
+ for (Index = 0; Index<Blobs.size(); Index++)\r
+ {\r
+#if MATROSKA_VERSION >= 2\r
+ if (Blobs[Index]->IsSimpleBlock())\r
+ PushElement( (KaxSimpleBlock&) *Blobs[Index] );\r
+ else\r
+#endif\r
+ PushElement( (KaxBlockGroup&) *Blobs[Index] );\r
+ }\r
+\r
+ // SilentTracks handling\r
+ // check the parent cluster for existing tracks and see if they are contained in this cluster or not\r
+ if (bSilentTracksUsed)\r
+ {\r
+ KaxTracks & MyTracks = *static_cast<KaxTracks *>(ParentSegment->FindElt(EBML_INFO(KaxTracks)));\r
+ for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) {\r
+ if (EbmlId(*MyTracks[TrkIndex]) == EBML_ID(KaxTrackEntry))\r
+ {\r
+ KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(MyTracks[TrkIndex]);\r
+ uint32 tracknum = entry.TrackNumber();\r
+ for (Index = 0; Index<Blobs.size(); Index++) {\r
+ if (((KaxInternalBlock&)*Blobs[Index]).TrackNum() == tracknum)\r
+ break; // this track is used\r
+ }\r
+ // the track wasn't found in this cluster\r
+ if (Index == ListSize())\r
+ {\r
+ KaxClusterSilentTracks * SilentTracks = static_cast<KaxClusterSilentTracks *>(this->FindFirstElt(EBML_INFO(KaxClusterSilentTracks)));\r
+ assert(SilentTracks != NULL); // the flag bSilentTracksUsed should be set when creating the Cluster\r
+ KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));\r
+ *static_cast<EbmlUInteger *>(trackelt) = tracknum;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ Result = EbmlMaster::Render(output, bSaveDefault);\r
+\r
+ // For all Blocks add their position on the CueEntry\r
+ for (Index = 0; Index<Blobs.size(); Index++) {\r
+ CueToUpdate.PositionSet(*Blobs[Index]);\r
+ }\r
+\r
+ Blobs.clear();\r
+ }\r
+\r
+ return Result;\r
+}\r
+\r
+/*!\r
+ \todo automatically choose valid timecode for the Cluster based on the previous cluster timecode (must be incremental)\r
+*/\r
+uint64 KaxCluster::GlobalTimecode() const\r
+{\r
+ assert(bPreviousTimecodeIsSet);\r
+ uint64 result = MinTimecode;\r
+\r
+ if (result < PreviousTimecode)\r
+ result = PreviousTimecode + 1;\r
+ \r
+ return result;\r
+}\r
+\r
+/*!\r
+ \brief retrieve the relative \r
+ \todo !!! We need a way to know the TimecodeScale\r
+*/\r
+int16 KaxCluster::GetBlockLocalTimecode(uint64 aGlobalTimecode) const\r
+{\r
+ int64 TimecodeDelay = (int64(aGlobalTimecode) - int64(GlobalTimecode())) / int64(GlobalTimecodeScale());\r
+ assert(TimecodeDelay >= int16(0x8000) && TimecodeDelay <= int16(0x7FFF));\r
+ return int16(TimecodeDelay);\r
+}\r
+\r
+uint64 KaxCluster::GetBlockGlobalTimecode(int16 GlobalSavedTimecode)\r
+{\r
+ if (!bFirstFrameInside) {\r
+ KaxClusterTimecode * Timecode = static_cast<KaxClusterTimecode *>(this->FindElt(EBML_INFO(KaxClusterTimecode)));\r
+ assert (bFirstFrameInside); // use the InitTimecode() hack for now\r
+ MinTimecode = MaxTimecode = PreviousTimecode = *static_cast<EbmlUInteger *>(Timecode);\r
+ bFirstFrameInside = true;\r
+ bPreviousTimecodeIsSet = true;\r
+ }\r
+ return int64(GlobalSavedTimecode * GlobalTimecodeScale()) + GlobalTimecode();\r
+}\r
+\r
+KaxBlockGroup & KaxCluster::GetNewBlock()\r
+{\r
+ KaxBlockGroup & MyBlock = AddNewChild<KaxBlockGroup>(*this);\r
+ MyBlock.SetParent(*this);\r
+ return MyBlock;\r
+}\r
+\r
+void KaxCluster::ReleaseFrames()\r
+{\r
+ size_t Index;\r
+ \r
+ for (Index = 0; Index < ListSize(); Index++) {\r
+ if (EbmlId(*(*this)[Index]) == EBML_ID(KaxBlockGroup)) {\r
+ static_cast<KaxBlockGroup*>((*this)[Index])->ReleaseFrames();\r
+ }\r
+ }\r
+}\r
+\r
+uint64 KaxCluster::GetPosition() const\r
+{\r
+ assert(ParentSegment != NULL);\r
+ return ParentSegment->GetRelativePosition(*this);\r
+}\r
+\r
+END_LIBMATROSKA_NAMESPACE\r
DEFINE_MKX_DATE (KaxDateUTC, 0x4461, 2, KaxInfo, "DateUTC");\r
DEFINE_MKX_UNISTRING (KaxTitle, 0x7BA9, 2, KaxInfo, "Title");\r
\r
-KaxPrevUID::KaxPrevUID()\r
-:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxPrevUID))\r
+KaxPrevUID::KaxPrevUID(EBML_EXTRA_DEF)\r
+:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxPrevUID) EBML_DEF_SEP EBML_EXTRA_CALL)\r
{\r
}\r
\r
-KaxNextUID::KaxNextUID()\r
-:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxNextUID))\r
+KaxNextUID::KaxNextUID(EBML_EXTRA_DEF)\r
+:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxNextUID) EBML_DEF_SEP EBML_EXTRA_CALL)\r
{\r
}\r
\r
#if LIBEBML_VERSION >= 0x010000\r
-KaxSegmentUID::KaxSegmentUID(EBML_DEF_CONS)\r
-:EbmlBinary(EBML_DEF_PARAM)\r
+KaxSegmentUID::KaxSegmentUID(EBML_DEF_CONS EBML_DEF_SEP EBML_EXTRA_DEF)\r
+:EbmlBinary(EBML_DEF_PARAM EBML_DEF_SEP EBML_EXTRA_CALL)\r
{\r
}\r
#endif\r
-/****************************************************************************
-** libmatroska : parse Matroska files, see http://www.matroska.org/
-**
-** <file/class description>
-**
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
-**
-** This file is part of libmatroska.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public
-** License along with this library; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
-** Contact license@matroska.org if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/*!
- \file
- \version \$Id: KaxSegment.cpp 1096 2005-03-17 09:14:52Z robux4 $
- \author Steve Lhomme <robux4 @ users.sf.net>
-*/
-#include "matroska/KaxSegment.h"
-#include "ebml/EbmlHead.h"
-
-// sub elements
-#include "matroska/KaxCluster.h"
-#include "matroska/KaxSeekHead.h"
-#include "matroska/KaxCues.h"
-#include "matroska/KaxTracks.h"
-#include "matroska/KaxInfo.h"
-#include "matroska/KaxChapters.h"
-#include "matroska/KaxAttachments.h"
-#include "matroska/KaxTags.h"
-#include "matroska/KaxContexts.h"
-#include "matroska/KaxDefines.h"
-
-START_LIBMATROSKA_NAMESPACE
-
-DEFINE_START_SEMANTIC(KaxMatroska)
-DEFINE_SEMANTIC_ITEM(true, true, EbmlHead)
-DEFINE_SEMANTIC_ITEM(true, false, KaxSegment)
-DEFINE_END_SEMANTIC(KaxMatroska)
-
-DEFINE_START_SEMANTIC(KaxSegment)
-DEFINE_SEMANTIC_ITEM(false, false, KaxCluster)
-DEFINE_SEMANTIC_ITEM(false, false, KaxSeekHead)
-DEFINE_SEMANTIC_ITEM(false, true, KaxCues)
-DEFINE_SEMANTIC_ITEM(false, false, KaxTracks)
-DEFINE_SEMANTIC_ITEM(true, true, KaxInfo)
-DEFINE_SEMANTIC_ITEM(false, true, KaxChapters)
-DEFINE_SEMANTIC_ITEM(false, true, KaxAttachments)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTags)
-DEFINE_END_SEMANTIC(KaxSegment)
-
-DEFINE_MKX_CONTEXT(KaxMatroska);
-
-DEFINE_MKX_MASTER_ORPHAN(KaxSegment, 0x18538067, 4, "Segment\0rotomopogo");
-
-KaxSegment::KaxSegment()
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxSegment))
-{
- SetSizeLength(5); // mandatory min size support (for easier updating) (2^(7*5)-2 = 32Go)
- SetSizeInfinite(); // by default a segment is big and the size is unknown in advance
-}
-
-KaxSegment::KaxSegment(const KaxSegment & ElementToClone)
- :EbmlMaster(ElementToClone)
-{
- // update the parent of each children
- EBML_MASTER_ITERATOR Itr = begin();
- while (Itr != end())
- {
- if (EbmlId(**Itr) == EBML_ID(KaxCluster)) {
- static_cast<KaxCluster *>(*Itr)->SetParent(*this);
- }
- ++Itr;
- }
-}
-
-
-uint64 KaxSegment::GetRelativePosition(uint64 aGlobalPosition) const
-{
- return aGlobalPosition - GetElementPosition() - HeadSize();
-}
-
-uint64 KaxSegment::GetRelativePosition(const EbmlElement & Elt) const
-{
- return GetRelativePosition(Elt.GetElementPosition());
-}
-
-uint64 KaxSegment::GetGlobalPosition(uint64 aRelativePosition) const
-{
- return aRelativePosition + GetElementPosition() + HeadSize();
-}
-
-END_LIBMATROSKA_NAMESPACE
+/****************************************************************************\r
+** libmatroska : parse Matroska files, see http://www.matroska.org/\r
+**\r
+** <file/class description>\r
+**\r
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
+**\r
+** This file is part of libmatroska.\r
+**\r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+** \r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+** Lesser General Public License for more details.\r
+** \r
+** You should have received a copy of the GNU Lesser General Public\r
+** License along with this library; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+**\r
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
+** Contact license@matroska.org if any conditions of this licensing are\r
+** not clear to you.\r
+**\r
+**********************************************************************/\r
+\r
+/*!\r
+ \file\r
+ \version \$Id: KaxSegment.cpp 1096 2005-03-17 09:14:52Z robux4 $\r
+ \author Steve Lhomme <robux4 @ users.sf.net>\r
+*/\r
+#include "matroska/KaxSegment.h"\r
+#include "ebml/EbmlHead.h"\r
+\r
+// sub elements\r
+#include "matroska/KaxCluster.h"\r
+#include "matroska/KaxSeekHead.h"\r
+#include "matroska/KaxCues.h"\r
+#include "matroska/KaxTracks.h"\r
+#include "matroska/KaxInfo.h"\r
+#include "matroska/KaxChapters.h"\r
+#include "matroska/KaxAttachments.h"\r
+#include "matroska/KaxTags.h"\r
+#include "matroska/KaxContexts.h"\r
+#include "matroska/KaxDefines.h"\r
+\r
+START_LIBMATROSKA_NAMESPACE\r
+\r
+DEFINE_START_SEMANTIC(KaxMatroska)\r
+DEFINE_SEMANTIC_ITEM(true, true, EbmlHead)\r
+DEFINE_SEMANTIC_ITEM(true, false, KaxSegment)\r
+DEFINE_END_SEMANTIC(KaxMatroska)\r
+\r
+DEFINE_START_SEMANTIC(KaxSegment)\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxCluster)\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxSeekHead)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxCues)\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxTracks)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxInfo)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapters)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxAttachments)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTags)\r
+DEFINE_END_SEMANTIC(KaxSegment)\r
+\r
+DEFINE_MKX_CONTEXT(KaxMatroska);\r
+\r
+DEFINE_MKX_MASTER_ORPHAN(KaxSegment, 0x18538067, 4, "Segment\0rotomopogo");\r
+\r
+KaxSegment::KaxSegment(EBML_EXTRA_DEF)\r
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxSegment) EBML_DEF_SEP EBML_EXTRA_CALL)\r
+{\r
+ SetSizeLength(5); // mandatory min size support (for easier updating) (2^(7*5)-2 = 32Go)\r
+ SetSizeInfinite(); // by default a segment is big and the size is unknown in advance\r
+}\r
+\r
+KaxSegment::KaxSegment(const KaxSegment & ElementToClone)\r
+ :EbmlMaster(ElementToClone)\r
+{\r
+ // update the parent of each children\r
+ EBML_MASTER_ITERATOR Itr = begin();\r
+ while (Itr != end())\r
+ {\r
+ if (EbmlId(**Itr) == EBML_ID(KaxCluster)) {\r
+ static_cast<KaxCluster *>(*Itr)->SetParent(*this);\r
+ }\r
+ ++Itr;\r
+ }\r
+}\r
+\r
+\r
+uint64 KaxSegment::GetRelativePosition(uint64 aGlobalPosition) const\r
+{\r
+ return aGlobalPosition - GetElementPosition() - HeadSize();\r
+}\r
+\r
+uint64 KaxSegment::GetRelativePosition(const EbmlElement & Elt) const\r
+{\r
+ return GetRelativePosition(Elt.GetElementPosition());\r
+}\r
+\r
+uint64 KaxSegment::GetGlobalPosition(uint64 aRelativePosition) const\r
+{\r
+ return aRelativePosition + GetElementPosition() + HeadSize();\r
+}\r
+\r
+END_LIBMATROSKA_NAMESPACE\r
-/****************************************************************************
-** libmatroska : parse Matroska files, see http://www.matroska.org/
-**
-** <file/class description>
-**
-** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.
-**
-** This file is part of libmatroska.
-**
-** This library is free software; you can redistribute it and/or
-** modify it under the terms of the GNU Lesser General Public
-** License as published by the Free Software Foundation; either
-** version 2.1 of the License, or (at your option) any later version.
-**
-** This library is distributed in the hope that it will be useful,
-** but WITHOUT ANY WARRANTY; without even the implied warranty of
-** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-** Lesser General Public License for more details.
-**
-** You should have received a copy of the GNU Lesser General Public
-** License along with this library; if not, write to the Free Software
-** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-**
-** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**
-** Contact license@matroska.org if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/*!
- \file
- \version \$Id: KaxTracks.cpp 1202 2005-08-30 14:39:01Z robux4 $
- \author Steve Lhomme <robux4 @ users.sf.net>
-*/
-#include "matroska/KaxTracks.h"
-
-// sub elements
-#include "matroska/KaxTrackEntryData.h"
-#include "matroska/KaxTrackAudio.h"
-#include "matroska/KaxTrackVideo.h"
-#include "matroska/KaxContentEncoding.h"
-#include "matroska/KaxContexts.h"
-#include "matroska/KaxDefines.h"
-
-START_LIBMATROSKA_NAMESPACE
-
-DEFINE_START_SEMANTIC(KaxTracks)
-DEFINE_SEMANTIC_ITEM(true, false, KaxTrackEntry)
-DEFINE_END_SEMANTIC(KaxTracks)
-
-DEFINE_START_SEMANTIC(KaxTrackEntry)
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackNumber)
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackUID)
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackType)
-#if MATROSKA_VERSION >= 2
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagEnabled)
-#endif // MATROSKA_VERSION
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagDefault)
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagForced)
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagLacing)
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackMinCache)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackMaxCache)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackDefaultDuration)
-DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTimecodeScale)
-DEFINE_SEMANTIC_ITEM(true, true, KaxMaxBlockAdditionID)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackName)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackLanguage)
-DEFINE_SEMANTIC_ITEM(true, true, KaxCodecID)
-DEFINE_SEMANTIC_ITEM(false, true, KaxCodecPrivate)
-DEFINE_SEMANTIC_ITEM(false, true, KaxCodecName)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAttachmentLink)
-#if MATROSKA_VERSION >= 2
-DEFINE_SEMANTIC_ITEM(false, true, KaxCodecSettings)
-DEFINE_SEMANTIC_ITEM(false, false, KaxCodecInfoURL)
-DEFINE_SEMANTIC_ITEM(false, false, KaxCodecDownloadURL)
-DEFINE_SEMANTIC_ITEM(true, true, KaxCodecDecodeAll)
-#endif // MATROSKA_VERSION
-DEFINE_SEMANTIC_ITEM(false, false, KaxTrackOverlay)
-DEFINE_SEMANTIC_ITEM(false, false, KaxTrackTranslate)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAudio)
-DEFINE_SEMANTIC_ITEM(false, true, KaxTrackVideo)
-DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncodings)
-DEFINE_END_SEMANTIC(KaxTrackEntry)
-
-DEFINE_MKX_MASTER (KaxTracks, 0x1654AE6B, 4, KaxSegment, "Tracks");
-DEFINE_MKX_MASTER_CONS(KaxTrackEntry, 0xAE, 1, KaxTracks, "TrackEntry");
-
-KaxTrackEntry::KaxTrackEntry()
- :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxTrackEntry))
- ,bGlobalTimecodeScaleIsSet(false)
-{}
-
-void KaxTrackEntry::EnableLacing(bool bEnable)
-{
- KaxTrackFlagLacing & myLacing = GetChild<KaxTrackFlagLacing>(*this);
- *(static_cast<EbmlUInteger *>(&myLacing)) = bEnable ? 1 : 0;
-}
-
-END_LIBMATROSKA_NAMESPACE
+/****************************************************************************\r
+** libmatroska : parse Matroska files, see http://www.matroska.org/\r
+**\r
+** <file/class description>\r
+**\r
+** Copyright (C) 2002-2010 Steve Lhomme. All rights reserved.\r
+**\r
+** This file is part of libmatroska.\r
+**\r
+** This library is free software; you can redistribute it and/or\r
+** modify it under the terms of the GNU Lesser General Public\r
+** License as published by the Free Software Foundation; either\r
+** version 2.1 of the License, or (at your option) any later version.\r
+** \r
+** This library is distributed in the hope that it will be useful,\r
+** but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
+** Lesser General Public License for more details.\r
+** \r
+** You should have received a copy of the GNU Lesser General Public\r
+** License along with this library; if not, write to the Free Software\r
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+**\r
+** See http://www.matroska.org/license/lgpl/ for LGPL licensing information.**\r
+** Contact license@matroska.org if any conditions of this licensing are\r
+** not clear to you.\r
+**\r
+**********************************************************************/\r
+\r
+/*!\r
+ \file\r
+ \version \$Id: KaxTracks.cpp 1202 2005-08-30 14:39:01Z robux4 $\r
+ \author Steve Lhomme <robux4 @ users.sf.net>\r
+*/\r
+#include "matroska/KaxTracks.h"\r
+\r
+// sub elements\r
+#include "matroska/KaxTrackEntryData.h"\r
+#include "matroska/KaxTrackAudio.h"\r
+#include "matroska/KaxTrackVideo.h"\r
+#include "matroska/KaxContentEncoding.h"\r
+#include "matroska/KaxContexts.h"\r
+#include "matroska/KaxDefines.h"\r
+\r
+START_LIBMATROSKA_NAMESPACE\r
+\r
+DEFINE_START_SEMANTIC(KaxTracks)\r
+DEFINE_SEMANTIC_ITEM(true, false, KaxTrackEntry)\r
+DEFINE_END_SEMANTIC(KaxTracks)\r
+\r
+DEFINE_START_SEMANTIC(KaxTrackEntry)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackNumber)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackUID)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackType)\r
+#if MATROSKA_VERSION >= 2\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagEnabled)\r
+#endif // MATROSKA_VERSION\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagDefault)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagForced)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagLacing)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackMinCache)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackMaxCache)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackDefaultDuration)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTimecodeScale)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxMaxBlockAdditionID)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackName)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackLanguage)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxCodecID)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxCodecPrivate)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxCodecName)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAttachmentLink)\r
+#if MATROSKA_VERSION >= 2\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxCodecSettings)\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxCodecInfoURL)\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxCodecDownloadURL)\r
+DEFINE_SEMANTIC_ITEM(true, true, KaxCodecDecodeAll)\r
+#endif // MATROSKA_VERSION\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxTrackOverlay)\r
+DEFINE_SEMANTIC_ITEM(false, false, KaxTrackTranslate)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackAudio)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxTrackVideo)\r
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncodings)\r
+DEFINE_END_SEMANTIC(KaxTrackEntry)\r
+\r
+DEFINE_MKX_MASTER (KaxTracks, 0x1654AE6B, 4, KaxSegment, "Tracks");\r
+DEFINE_MKX_MASTER_CONS(KaxTrackEntry, 0xAE, 1, KaxTracks, "TrackEntry");\r
+\r
+KaxTrackEntry::KaxTrackEntry(EBML_EXTRA_DEF)\r
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxTrackEntry) EBML_DEF_SEP EBML_EXTRA_CALL)\r
+ ,bGlobalTimecodeScaleIsSet(false)\r
+{}\r
+\r
+void KaxTrackEntry::EnableLacing(bool bEnable)\r
+{\r
+ KaxTrackFlagLacing & myLacing = GetChild<KaxTrackFlagLacing>(*this);\r
+ *(static_cast<EbmlUInteger *>(&myLacing)) = bEnable ? 1 : 0;\r
+}\r
+\r
+END_LIBMATROSKA_NAMESPACE\r