[SCM] libmatroska packaging branch, upstream, updated. upstream/1.0.0

fabian-guest at users.alioth.debian.org fabian-guest at users.alioth.debian.org
Mon Aug 2 09:32:20 UTC 2010


The following commit has been merged in the upstream branch:
commit 4f576dfbe261e61ddfba72cc177833e57d0bc4bd
Author: Fabian Greffrath <fabian at greffrath.com>
Date:   Mon Aug 2 11:33:53 2010 +0200

    Imported Upstream version 1.0.0

diff --git a/ChangeLog b/ChangeLog
index ae86a98..d3c3a6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,1944 +1,1957 @@
-2007-01-19 09:58  robux4
-
-	* trunk/libebml/libebml.proj, trunk/libmatroska/libmatroska.proj,
-	  trunk/libmatroska/test/ebml/ebml.proj,
-	  trunk/libmatroska/test/mux/mux.proj,
-	  trunk/libmatroska/test/tags/tags.proj,
-	  trunk/libmatroska/test/test.proj,
-	  trunk/libmatroska/test/utf8/utf8.proj: add support for coremake
-	  building for the moment the config.h and coremake are referenced
-	  by a parent project
-
-2007-01-15 16:01  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/matroska/KaxVersion.h: Version number upgrade to
-	  0.8.1.
-
-2007-01-14 17:20  mosu
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp: Added support for
-	  KaxCodecState and for indexing them in the cues.
-
-2006-06-02 14:32  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Overwrite existing symlinks
-	  during install.
-
-2006-03-30 19:57  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Do not abort if the symlink
-	  exists already.
-
-2005-10-18 18:02  mosu
-
-	* trunk/libmatroska/ChangeLog, trunk/libmatroska/debian/changelog:
-	  Changed the version in the Debian control file & automatic
-	  ChangeLog update.
-
-2005-10-16 13:06  robux4
-
-	* trunk/libmatroska/src/KaxBlock.cpp: libmatroska: set the
-	  discardable bit of SimpleBlock correctly
-
-2005-10-16 10:28  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: libmatroska: support for
-	  reading extra features of SimpleBlock
-
-2005-10-15 17:00  robux4
-
-	* trunk/libmatroska/src/KaxBlock.cpp: libmatroska: better decision
-	  to lace or not
-
-2005-10-15 15:56  robux4
-
-	* trunk/libebml/ebml/EbmlElement.h, trunk/libebml/ebml/EbmlMaster.h,
-	  trunk/libebml/src/EbmlElement.cpp, trunk/libebml/src/EbmlVoid.cpp,
-	  trunk/libmatroska/src/KaxBlock.cpp: libebml/libmatroska: fix a
-	  major bug when "unknown size" was used (Haali does)
-
-2005-10-15 12:34  robux4
-
-	* trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: fix
-	  compilation under gcc
-
-2005-10-14 19:36  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: allow correct
-	  compilation & linking with MATROSKA_VERSION set to 1
-
-2005-10-13 21:21  robux4
-
-	* trunk/libmatroska/src/KaxCues.cpp: libmatroska: simplify the code
-	  for the backward compatibility
-
-2005-10-13 21:16  robux4
-
-	* trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp: libmatroska: make the newer
-	  library work with older code (again after internal changes)
-
-2005-10-13 20:35  robux4
-
-	* trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp: libmatroska: KaxBlockBlob
-	  now works in NO SimpleBlock mode too that means writing or
-	  KaxSimpleBlock is now fully functional
-
-2005-10-13 19:33  robux4
-
-	* trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp: libmatroska: fix writing
-	  in auto SimpleBlock mode
-
-2005-10-12 22:18  robux4
-
-	* trunk/libmatroska/src/KaxBlock.cpp: libmatroska: fix for the
-	  non-forced SimpleBlock use
-
-2005-10-12 22:12  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp: libmatroska: writing from
-	  KaxBlockBlob now works !
-
-2005-10-12 21:21  robux4
-
-	* trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/src/KaxCluster.cpp: libmatroska: prepare the
-	  cluster to render from KaxBlockBlob
-
-2005-10-10 20:48  robux4
-
-	* trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxTypes.h,
-	  trunk/libmatroska/src/KaxBlockData.cpp: libmatroska: correct
-	  copyright year
-
-2005-10-10 20:47  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxTypes.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: more code to
-	  use SimpleBlock automatically (when enabled) reworked the KaxCues
-	  code to use KaxBlockBlob where possible, the previous API may not
-	  be 100% compatible (mkvmerge not affected) the code is still not
-	  100% operational
-
-2005-10-09 14:30  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: simplify a
-	  cast
-
-2005-10-09 14:18  robux4
-
-	* trunk/libmatroska/matroska/FileKax.h,
-	  trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/KaxContentEncoding.h,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h,
-	  trunk/libmatroska/matroska/KaxTypes.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/matroska/c/libmatroska.h,
-	  trunk/libmatroska/matroska/c/libmatroska_t.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: introduce
-	  KaxBlockBlob to automatically select between BlockGroup and
-	  SimpleBlock + native eol-style
-
-2005-10-08 15:32  robux4
-
-	* trunk/libmatroska/matroska/KaxConfig.h: libmatroska: the default
-	  matroska version to use is now 2
-
-2005-10-08 15:27  robux4
-
-	* trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp: libmatroska: make
-	  KaxSimpleBlock really MATROSKA_VERSION 2
-
-2005-10-08 15:04  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h: libmatroska: KaxSimpleBlock
-	  is MATROSKA_VERSION 2
-
-2005-10-08 14:39  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: libmatroska: first attempt to
-	  write the new SimpleBlock bits correctly
-
-2005-10-06 21:30  robux4
-
-	* trunk/libmatroska/src/KaxCluster.cpp: libmatroska: fix the
-	  mandatory setting according to the new specs
-
-2005-10-06 21:20  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp: libmatroska: add
-	  KaxSimpleBlock and a parent class used by KaxBlock (not tested
-	  yet, and some things left to implement)
-
-2005-08-31 13:26  mosu
-
-	* trunk/libmatroska/make/linux/fedora-core.spec,
-	  trunk/libmatroska/make/linux/suse-libmatroska-makefile.diff,
-	  trunk/libmatroska/make/linux/suse.spec: Added the spec files I use
-	  for building libmatroska on SuSE and Fedora Core.
-
-2005-08-30 14:39  robux4
-
-	* trunk/libmatroska/matroska/KaxVersion.h: libmatroska: the next
-	  version will be 0.7.8
-
-2005-08-30 14:39  robux4
-
-	* trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp: libmatroska: compilation
-	  fixes for the new elements
-
-2005-08-30 14:28  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp: added:
-	  KaxChapterSegmentEditionUID and KaxTrackAttachmentLink
-
-2005-08-30 14:20  robux4
-
-	* trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/src/KaxAttached.cpp: libmatroska: added
-	  KaxFileReferral
-
-2005-08-26 08:19  mosu
-
-	* trunk/libmatroska/matroska/KaxBlock.h: Make the compiler happy:
-	  gcc wants classes with virtual functions to have virtual
-	  destructors.
-
-2005-05-22 07:28  mosu
-
-	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update.
-
-2005-05-22 07:28  mosu
-
-	* trunk/libmatroska, trunk/libmatroska/debian: Ignore some files and
-	  directories created during the Debian build process.
-
-2005-05-22 07:27  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/matroska/KaxVersion.h: Bumped the version number
-	  to 0.7.7 in the places that robux4 forgot.
-
-2005-05-19 19:16  robux4
-
-	* trunk/libebml/ebml/EbmlVersion.h,
-	  trunk/libmatroska/matroska/KaxVersion.h: update version numbers
-	  for the upcoming release
-
-2005-05-03 06:56  mosu
-
-	* trunk/libmatroska/matroska/KaxTrackEntryData.h: The default value
-	  of MaxBlockAdditionID is 0, not 1.
-
-2005-04-19 07:00  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Do not compile shared libs
-	  on Mac OS X due to how they should be handled there. If need
-	  arises we can always implement it properly. Patch by Shawn
-	  Holwegner <shawn () holwegner ! com>
-
-2005-04-16 11:29  mosu
-
-	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update.
-
-2005-04-16 11:29  mosu
-
-	* trunk/libmatroska/debian/rules,
-	  trunk/libmatroska/make/linux/Makefile: Updated the Linux build
-	  system and added targets for installing only the static lib +
-	  headers. Updated the Debian package build script for that, too.
-
-2005-04-16 11:24  mosu
-
-	* trunk/libmatroska/debian/changelog: Updated the Debian package's
-	  version number.
-
-2005-04-09 22:11  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h: libmatroska:
-	  KaxChapterSegmentUID is an EbmlBinary
-
-2005-04-05 12:02  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: libmatroska: add support for
-	  the invisible flag
-
-2005-03-28 14:49  robux4
-
-	* trunk/libmatroska/matroska/KaxInfoData.h: libmatroska: make all
-	  segment UID derive from the same class for easier handling
-
-2005-03-19 11:14  mosu
-
-	* trunk/libmatroska/src/KaxChapters.cpp: Wrong element ID according
-	  to the specs.
-
-2005-03-19 10:37  mosu
-
-	* trunk/libmatroska/make/linux: Ignore the shared libs.
-
-2005-03-19 10:36  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: 'clean' should remove the
-	  .los, too. Provide separate targets for the static and the shared
-	  lib. 'lib' is obsolete.
-
-2005-03-17 09:36  robux4
-
-	* trunk/libebml/src/EbmlCrc32.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp: some strings to
-	  watermark the code
-
-2005-03-17 09:14  robux4
-
-	* trunk/libebml/src/EbmlHead.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp: some strings to watermark
-	  the code
-
-2005-03-16 18:30  robux4
-
-	* trunk/libebml/src/StdIOCallback.cpp,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/mkxuncat/mkxuncat.cpp, trunk/mkxuncat/mkxuncat.vcproj: misc
-	  compilation fixes
-
-2005-03-14 10:34  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: libmatroska: added
-	  KaxChapterSegmentUID
-
-2005-03-13 10:49  robux4
-
-	* trunk/libebml/make/linux/Makefile,
-	  trunk/libmatroska/make/linux/Makefile: libebml/libmatroska: allow
-	  to build as shared libraries for Gentoo
-
-2005-03-03 13:13  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/test/ebml/test0.cpp,
-	  trunk/libmatroska/test/ebml/test00.cpp,
-	  trunk/libmatroska/test/mux/test6.cpp,
-	  trunk/libmatroska/test/utf8/test5.cpp: update the copyright dates
-
-2005-02-06 20:03  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/matroska/KaxVersion.h: Bumped the version number
-	  to 0.7.5.
-
-2005-02-06 19:51  mosu
-
-	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update (with a
-	  new program -- that's why the diff is so huge)
-
-2005-02-06 19:49  mosu
-
-	* trunk/libmatroska/debian/control: Let's require the latest libebml
-	  for building.
-
-2005-02-06 18:12  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Output an error if a mingw
-	  gcc is used with the Linux Makefile (I simply do that too often).
-
-2005-01-31 14:04  mosu
-
-	* trunk/libmatroska/make/linux/check_ids: Also output the
-	  files/classes in which the duplicate IDs occur.
-
-2005-01-31 13:54  robux4
-
-	* trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: fix the
-	  segment family UID
-
-2005-01-31 13:48  mosu
-
-	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp: The usual compilation
-	  fixes.
-
-2005-01-31 13:39  robux4
-
-	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp: libmatroska: no more
-	  TrackAngle and new TrackTranslate elements
-
-2005-01-30 18:00  mosu
-
-	* trunk/libmatroska/src/KaxInfoData.cpp: Some leftovers from
-	  renaming ChapterLink to ChapterTranslate.
-
-2005-01-28 12:10  robux4
-
-	* trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: rename
-	  ChapterLink* to ChapterTranslate*
-
-2005-01-20 12:01  mosu
-
-	* trunk/libmatroska/make/mingw32/Makefile: Only remove files that
-	  might have been built (and not e.g. libmatroska.dev).
-
-2005-01-17 13:48  robux4
-
-	* trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: add
-	  KaxChapterLinkEditionUID
-
-2005-01-15 12:47  robux4
-
-	* trunk/libmatroska/src/KaxInfo.cpp: libmatroska: fix the
-	  KaxSegmentFamily flags
-
-2005-01-13 17:51  robux4
-
-	* trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: the usual
-	  post-commit fixes
-
-2005-01-13 16:41  robux4
-
-	* trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: added
-	  KaxSegmentFamily, KaxChapterLink, KaxChapterLinkCodec and
-	  KaxChapterLinkID
-
-2005-01-05 16:14  robux4
-
-	* trunk/libmatroska/make/linux/Makefile: patches from the VLC
-	  repository
-
-2005-01-03 19:20  mosu
-
-	* trunk/libmatroska/src/KaxChapters.cpp: An element cannot require
-	  itself to be a mandatory child element.
-
-2005-01-03 15:47  mosu
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: Look! Squirrels! (The usual
-	  compilation fixes after one of robux' "I commit from work without
-	  having compiled it first" commits :-) )
-
-2005-01-03 12:31  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: libmatroska: update with
-	  latest changes in the chapter codecs (may not compile)
-
-2004-12-18 22:26  mosu
-
-	* trunk/libmatroska/src/KaxBlock.cpp: Move all of the (re-)activated
-	  Matroska v1 elements out of "#if == 2" blocks.
-
-2004-12-18 17:52  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp: support for
-	  KaxMaxBlockAdditionID and fix default values
-
-2004-12-18 08:49  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h: BlockAdditions is in
-	  Matroska 1 now
-
-2004-12-15 14:24  robux4
-
-	* trunk/libmatroska/matroska/c/libmatroska_t.h: added the button
-	  track type
-
-2004-11-30 15:45  mosu
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: Use malloc() and free()
-	  instead of new[] and delete[] where the lib might deal with
-	  pointers that have been allocated by the app, or where the app has
-	  allocated the memory. Reason: new[]ed memory cannot be
-	  realloc()ed.
-
-2004-11-28 17:43  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: remove support for the gap
-	  flag in the Block
-
-2004-11-28 15:24  robux4
-
-	* trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp: add almost automatic
-	  handling of SilentTracks
-
-2004-11-19 12:17  mosu
-
-	* trunk/libmatroska/make/mingw32/Makefile: Compile libmatroska as a
-	  DLL by default (is anyone except me using this mingw Makefile
-	  anyway?). Do not remove the dependency file on "make clean".
-
-2004-11-17 14:51  robux4
-
-	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp: added KaxTrackFlagForced
-
-2004-11-17 08:45  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Do not remove the .depend
-	  file on "make clean".
-
-2004-11-14 10:40  mosu
-
-	* trunk/libmatroska/matroska/KaxVersion.h: Numbers starting with '0'
-	  are octal numbers. Therefore a version like '0.8.4' cannot be
-	  expressed as '000804'.
-
-2004-11-13 21:15  mosu
-
-	* trunk/libmatroska/make/mingw32,
-	  trunk/libmatroska/make/mingw32/Makefile: Fixed "make depend".
-	  Ignore a couple of files.
-
-2004-11-13 11:30  mosu
-
-	* trunk/libmatroska/make/linux: Ignore the .depend file created by
-	  "make depend".
-
-2004-11-13 11:29  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Improved the dependency
-	  calculation to be more portable (makedepend doesn't exist
-	  everywhere, and it doesn't necessarily use the compiler we want).
-
-2004-10-02 16:02  robux4
-
-	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp: added KaxTrackAngle and
-	  various fixes
-
-2004-10-02 15:42  robux4
-
-	* trunk/libmatroska/src/KaxTracks.cpp: KaxTrackOverlay is not in
-	  "Matroska 2"
-
-2004-10-02 15:40  robux4
-
-	* trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp: correct the
-	  unique/multiple attribute
-
-2004-10-02 15:39  robux4
-
-	* trunk/libmatroska/src/KaxTracks.cpp: TrackOverlay is now multiple
-
-2004-10-02 15:08  robux4
-
-	* trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp: added
-	  KaxClusterSilentTracks and KaxClusterSilentTrackNumber
-
-2004-09-26 10:34  mosu
-
-	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update
-
-2004-09-26 10:21  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/debian/control: Bumped the version number to
-	  0.7.4 and the libebml build requirements to 0.7.2 in the Debian
-	  build system.
-
-2004-09-26 10:20  mosu
-
-	* trunk/libmatroska/make/linux/check_ids: Added a small script that
-	  looks for duplicate EBML IDs in all of libmatroska's source files.
-
-2004-09-11 17:42  mosu
-
-	* trunk/libmatroska/matroska/KaxChapters.h: EditionProcessed has a
-	  default value (0) according to the specs.
-
-2004-09-04 16:29  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: KaxEditionManaged becomes
-	  KaxEditionProcessed and mandatory KaxEditionManagedPrivate becomes
-	  KaxChapterManagedPrivate and moves
-
-2004-09-03 13:38  robux4
-
-	* trunk/libmatroska/matroska/KaxTrackAudio.h: no more automatic
-	  OutputSamplingFrequency default value
-
-2004-09-02 14:17  mosu
-
-	* trunk/libmatroska/src/KaxChapters.cpp: The usual after-robux4
-	  compilation fix ;-)
-
-2004-09-02 11:08  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: add support for
-	  KaxChapterProcessCommand and KaxEditionManagedPrivate
-
-2004-08-31 17:02  mosu
-
-	* trunk/libmatroska/matroska/KaxAttached.h: The ValidateSize
-	  function is neither needed nor correct (probably copy & paste from
-	  somewhere). Integers of all sizes are accepted as in all the other
-	  UID cases.
-
-2004-08-30 18:52  mosu
-
-	* trunk/libmatroska/src/KaxTracks.cpp: MinCache IS mandatory. My
-	  bad.
-
-2004-08-30 18:17  mosu
-
-	* trunk/libmatroska/src/KaxTracks.cpp: MinCache is not mandatory.
-
-2004-08-30 09:21  robux4
-
-	* trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp: flags are mandatory
-
-2004-08-28 14:04  robux4
-
-	* trunk/libmatroska/make/vc7/lib/dll,
-	  trunk/libmatroska/make/vc7/lib/dll/libmatroskadll.v71.vcproj,
-	  trunk/libmatroska/make/vc7/vc7.sln: allow DLL building with MSVC7
-	  (not compatible with the MinGW DLLs)
-
-2004-08-27 18:58  robux4
-
-	* trunk/libmatroska/matroska/KaxTag.h: KaxTagTargetTypeValue default
-	  to 50
-
-2004-08-27 12:25  robux4
-
-	* trunk/libmatroska/src/KaxTag.cpp: TargetTypeValue is no longer
-	  mandatory
-
-2004-08-27 10:01  mosu
-
-	* trunk/libmatroska/src/KaxChapters.cpp: Fixed the wrong element
-	  names.
-
-2004-08-27 09:31  robux4
-
-	* trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/src/KaxTag.cpp: add KaxTagTargetTypeValue as in
-	  the specs
-
-2004-08-27 09:22  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: add KaxChapterPhysicalEquiv
-	  as in the new specs
-
-2004-08-25 14:56  mosu
-
-	* trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: Fixed the compilation.
-
-2004-08-25 14:48  mosu
-
-	* trunk/libmatroska/matroska/KaxVersion.h: Pushed the version
-	  number.
-
-2004-08-25 14:44  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: add KaxChapterProcess and
-	  KaxChapterProcessTime
-
-2004-08-25 14:22  robux4
-
-	* trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp: add the new PixelCropXXX
-	  elements
-
-2004-08-21 20:18  mosu
-
-	* trunk/libmatroska/ChangeLog: Updates
-
-2004-08-19 20:08  mosu
-
-	* trunk/libmatroska/src/KaxChapters.cpp: Wrong element ID.
-
-2004-08-19 17:16  robux4
-
-	* trunk/libmatroska/src/KaxChapters.cpp: I always forget to update
-	  the table size
-
-2004-08-19 17:15  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: added KaxEditionFlagDefault
-	  and KaxEditionManaged
-
-2004-08-19 08:54  robux4
-
-	* trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/src/KaxTag.cpp: add the new TargetType element
-	  in tags
-
-2004-08-16 21:22  mosu
-
-	* trunk/libmatroska/ChangeLog: Updates
-
-2004-08-16 21:04  mosu
-
-	* trunk/libmatroska/matroska/KaxTag.h: Set the default value for
-	  KaxTagLangue to "und" complying with the specs.
-
-2004-08-16 20:49  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/matroska/KaxVersion.h: New version number 0.7.3
-	  because of the changes / additions to the tags.
-
-2004-08-10 15:49  robux4
-
-	* trunk/libmatroska/src/KaxTag.cpp: never make the same mistake
-	  twice...
-
-2004-08-10 14:03  robux4
-
-	* trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/src/KaxTag.cpp: rename the new KaxTagLanguage to
-	  KaxTagLangue
-
-2004-08-10 12:58  robux4
-
-	* trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTags.cpp: fix mandatory values add
-	  support for TagLanguage and TagDefault
-
-2004-08-06 07:34  mosu
-
-	* trunk/libmatroska/ChangeLog: Updates
-
-2004-08-05 11:59  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: support for
-	  EditionFlagHidden (not compiled!)
-
-2004-08-04 17:49  mosu
-
-	* trunk/libmatroska/ChangeLog, trunk/libmatroska/debian/changelog:
-	  Updated the ChangeLog and bumped the version number on the Debian
-	  package to 0.7.2.
-
-2004-08-01 15:33  mosu
-
-	* trunk/libmatroska/matroska/KaxInfoData.h: Use a double for the
-	  KaxDuration element and not only a float. Otherwise the duration
-	  might be off a couple of samples for large values due to the
-	  limited resolution of a float.
-
-2004-07-31 09:01  robux4
-
-	* trunk/libmatroska/matroska/KaxTag.h: The default value of 0 makes
-	  sense again at the container level (not binary content)
-
-2004-07-30 20:31  mosu
-
-	* trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp: Never commit code without having
-	  compiled it before :) When adding elements to an array the array
-	  size has to be adjusted.
-
-2004-07-30 12:47  robux4
-
-	* trunk/libmatroska/matroska/KaxVersion.h: push the version number
-	  to avoid confusion if beta softwares are released in public
-
-2004-07-30 12:45  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp: add an edition UID and clean the
-	  code according to the specs (I haven't tried to compile !!!)
-
-2004-07-27 07:56  mosu
-
-	* trunk/libmatroska/test/mux/test8.cpp: Fix for compilation on
-	  NetBSD. Patch by Lubomir Sedlacik (salo at Xtrmntr dot org).
-
-2004-07-26 17:53  mosu
-
-	* trunk/libmatroska/make/mingw32/Makefile: Proper description for
-	  the SHARED option. Make building the lib statically the default
-	  just like it is for libembl.
-
-2004-07-25 10:37  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/debian/control,
-	  trunk/libmatroska/matroska/KaxVersion.h: Bumped the version number
-	  to 0.7.1. Same for libebml dependencies for the Debian package.
-
-2004-07-22 20:28  mosu
-
-	* trunk/libmatroska/make/mingw32/Makefile: Do not build the test
-	  apps by default.
-
-2004-07-19 16:43  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Let the user specify his
-	  own CXXFLAGS and CPPFLAGS.
-
-2004-07-14 13:29  mosu
-
-	* trunk/libmatroska/src/KaxCues.cpp: I hate tabs. They suck.
-	  Especially in multi user development.
-
-2004-07-14 13:27  mosu
-
-	* trunk/libmatroska/src/KaxCues.cpp: Do not let the user add a
-	  BlockGroup more than once to the cues. KaxCluster::Render() does
-	  call KaxCues::PositionSet(), but PositionSet() only cleans the
-	  first occurence. This will lead to an assert() in the KaxCues
-	  d\tor.
-
-2004-07-09 21:19  mosu
-
-	* trunk/libmatroska/debian/rules: debian/rules should be executable.
-
-2004-07-09 21:10  mosu
-
-	* trunk/libmatroska/make/linux,
-	  trunk/libmatroska/make/linux/.cvsignore: Use the svn:ignore
-	  property instead of the .cvsignore file.
-
-2004-07-09 21:07  mosu
-
-	* trunk/libmatroska/make/linux/Makefile: Do not compile the test
-	  apps with the "all" target. gcc 3.4.0 does not like the non-ASCII
-	  cahrs in one of them, and only libmatroska devs need them anyway.
-
-2004-07-09 21:05  mosu
-
-	* trunk/libmatroska/ChangeLog, trunk/libmatroska/LICENSE.LGPL,
-	  trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/debian/control,
-	  trunk/libmatroska/debian/copyright, trunk/libmatroska/debian/dirs,
-	  trunk/libmatroska/debian/docs,
-	  trunk/libmatroska/debian/libmatroska-dev.dirs,
-	  trunk/libmatroska/debian/libmatroska-dev.files,
-	  trunk/libmatroska/debian/rules, trunk/libmatroska/make/Doxyfile,
-	  trunk/libmatroska/make/cygwin/Makefile,
-	  trunk/libmatroska/make/cygwin/Makefile.rule,
-	  trunk/libmatroska/make/linux/Makefile,
-	  trunk/libmatroska/make/linux/Makefile.rule,
-	  trunk/libmatroska/make/makedoc.bat,
-	  trunk/libmatroska/make/makedoc.sh,
-	  trunk/libmatroska/make/mingw32/Makefile,
-	  trunk/libmatroska/make/mingw32/test/Makefile,
-	  trunk/libmatroska/make/mingw32/test/test6.dev,
-	  trunk/libmatroska/make/mingw32/test/test8.dev,
-	  trunk/libmatroska/src/FileKax.cpp,
-	  trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxAttachments.cpp,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp,
-	  trunk/libmatroska/src/KaxContentEncoding.cpp,
-	  trunk/libmatroska/src/KaxContexts.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp,
-	  trunk/libmatroska/src/KaxSeekHead.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTagMulti.cpp,
-	  trunk/libmatroska/src/KaxTags.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/src/KaxVersion.cpp,
-	  trunk/libmatroska/test/Makefile,
-	  trunk/libmatroska/test/ebml/Makefile,
-	  trunk/libmatroska/test/ebml/test0.cpp,
-	  trunk/libmatroska/test/ebml/test00.cpp,
-	  trunk/libmatroska/test/mux/test6.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp,
-	  trunk/libmatroska/test/tags/test9.cpp,
-	  trunk/libmatroska/test/utf8/test5.cpp: Set eol-style and keywords
-	  properties.
-
-2004-07-09 09:16  robux4
-
-	* trunk/libmatroska/matroska/KaxVersion.h: test SSL authentication
-
-2004-07-08 12:02  
-
-	* trunk/libmatroska/matroska/KaxVersion.h: Test changes
-
-2004-05-11 20:33  mosu
-
-	* trunk/libmatroska/make/beos,
-	  trunk/libmatroska/make/linux/Makefile,
-	  trunk/libmatroska/test/mux/test8.cpp: Compilation on BeOS. Patch
-	  by Vegard W&#65533;rp <devel at vegardw.com>
-
-2004-04-26 19:35  robux4
-
-	* trunk/libebml/make/vc7/Makefile,
-	  trunk/libmatroska/make/vc7/Makefile: Makefile to use the free
-	  VS.Net 2003 command-line compiler
-
-2004-04-24 09:09  mosu
-
-	* trunk/libebml/make/linux/Makefile,
-	  trunk/libmatroska/make/linux/Makefile: Set LD to CXX by default.
-
-2004-04-23 16:46  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/debian/control,
-	  trunk/libmatroska/matroska/KaxVersion.h: Bumped version number to
-	  0.7.0.
-
-2004-04-21 19:55  mosu
-
-	* trunk/libebml/ChangeLog, trunk/libmatroska/ChangeLog: Updates
-
-2004-04-21 19:50  mosu
-
-	* trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp: KaxClusterPosition is
-	  already in use and therefore a v1 element.
-
-2004-04-14 23:26  robux4
-
-	* trunk/libmatroska/matroska/FileKax.h,
-	  trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/KaxContentEncoding.h,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h,
-	  trunk/libmatroska/matroska/KaxTypes.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/matroska/c/libmatroska.h,
-	  trunk/libmatroska/matroska/c/libmatroska_t.h,
-	  trunk/libmatroska/src/FileKax.cpp,
-	  trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxAttachments.cpp,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp,
-	  trunk/libmatroska/src/KaxContentEncoding.cpp,
-	  trunk/libmatroska/src/KaxContexts.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp,
-	  trunk/libmatroska/src/KaxSeekHead.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTagMulti.cpp,
-	  trunk/libmatroska/src/KaxTags.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/src/KaxVersion.cpp,
-	  trunk/libmatroska/test/mux/test6.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp: Switch to LGPL license
-
-2004-04-14 23:04  robux4
-
-	* trunk/libebml/LICENSE.GPL, trunk/libebml/LICENSE.LGPL,
-	  trunk/libebml/LICENSE.QPL, trunk/libmatroska/LICENSE.GPL,
-	  trunk/libmatroska/LICENSE.LGPL, trunk/libmatroska/LICENSE.QPL:
-	  Switch to LGPL license
-
-2004-01-31 13:43  robux4
-
-	* trunk/libebml/ebml/EbmlConfig.h, trunk/libebml/ebml/EbmlTypes.h,
-	  trunk/libebml/ebml/c/libebml_t.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/c/libmatroska_t.h: Simplify and change
-	  the copyright holder (nothing left from Ingo)
-
-2004-01-19 10:33  mosu
-
-	* trunk/libebml/ChangeLog, trunk/libmatroska/ChangeLog: Updated the
-	  ChangeLog.
-
-2004-01-17 21:40  mosu
-
-	* trunk/libmatroska/make/mingw32/Makefile,
-	  trunk/libmatroska/matroska/FileKax.h,
-	  trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/KaxContentEncoding.h,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h: Readded the code for DLL
-	  builds on Windows.
-
-2004-01-17 16:33  robux4
-
-	* trunk/libmatroska/test/mux/test6.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp: Fix minor things in test
-	  examples
-
-2004-01-17 13:38  robux4
-
-	* trunk/libmatroska/src/KaxTrackAudio.cpp: Fix a problem when
-	  MATROSKA_VERSION is set to 2
-
-2004-01-15 20:47  cyrius
-
-	* trunk/libmatroska/src/KaxBlock.cpp: Fix for partial XipH lacing
-	  reading
-
-2004-01-15 15:17  mosu
-
-	* trunk/libmatroska/ChangeLog: Updated the ChangeLog.
-
-2004-01-10 16:50  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/test/mux/test6.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp: Handle MATROSKA_VERSION to
-	  enable/disable some future additions
-
-2004-01-10 15:57  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp: No more new elements for
-	  sample accurate seeking
-
-2004-01-10 15:31  robux4
-
-	* trunk/libebml/ebml/Debug.h, trunk/libebml/ebml/EbmlBinary.h,
-	  trunk/libebml/ebml/EbmlConfig.h,
-	  trunk/libebml/ebml/EbmlContexts.h, trunk/libebml/ebml/EbmlCrc32.h,
-	  trunk/libebml/ebml/EbmlDate.h, trunk/libebml/ebml/EbmlDummy.h,
-	  trunk/libebml/ebml/EbmlElement.h, trunk/libebml/ebml/EbmlEndian.h,
-	  trunk/libebml/ebml/EbmlFloat.h, trunk/libebml/ebml/EbmlHead.h,
-	  trunk/libebml/ebml/EbmlId.h, trunk/libebml/ebml/EbmlMaster.h,
-	  trunk/libebml/ebml/EbmlSInteger.h,
-	  trunk/libebml/ebml/EbmlStream.h, trunk/libebml/ebml/EbmlString.h,
-	  trunk/libebml/ebml/EbmlSubHead.h, trunk/libebml/ebml/EbmlTypes.h,
-	  trunk/libebml/ebml/EbmlUInteger.h,
-	  trunk/libebml/ebml/EbmlUnicodeString.h,
-	  trunk/libebml/ebml/EbmlVersion.h, trunk/libebml/ebml/EbmlVoid.h,
-	  trunk/libebml/ebml/IOCallback.h,
-	  trunk/libebml/ebml/MemIOCallback.h,
-	  trunk/libebml/ebml/StdIOCallback.h, trunk/libebml/src/Debug.cpp,
-	  trunk/libebml/src/EbmlBinary.cpp,
-	  trunk/libebml/src/EbmlContexts.cpp,
-	  trunk/libebml/src/EbmlCrc32.cpp, trunk/libebml/src/EbmlDate.cpp,
-	  trunk/libebml/src/EbmlDummy.cpp,
-	  trunk/libebml/src/EbmlElement.cpp,
-	  trunk/libebml/src/EbmlFloat.cpp, trunk/libebml/src/EbmlHead.cpp,
-	  trunk/libebml/src/EbmlMaster.cpp,
-	  trunk/libebml/src/EbmlSInteger.cpp,
-	  trunk/libebml/src/EbmlStream.cpp,
-	  trunk/libebml/src/EbmlString.cpp,
-	  trunk/libebml/src/EbmlSubHead.cpp,
-	  trunk/libebml/src/EbmlUInteger.cpp,
-	  trunk/libebml/src/EbmlUnicodeString.cpp,
-	  trunk/libebml/src/EbmlVersion.cpp, trunk/libebml/src/EbmlVoid.cpp,
-	  trunk/libebml/src/IOCallback.cpp,
-	  trunk/libebml/src/StdIOCallback.cpp,
-	  trunk/libmatroska/matroska/FileKax.h,
-	  trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/KaxContentEncoding.h,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxAttachments.cpp,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp,
-	  trunk/libmatroska/src/KaxContentEncoding.cpp,
-	  trunk/libmatroska/src/KaxContexts.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp,
-	  trunk/libmatroska/src/KaxSeekHead.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTagMulti.cpp,
-	  trunk/libmatroska/src/KaxTags.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/src/KaxVersion.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp,
-	  trunk/libmatroska/test/tags/test9.cpp: Update the copyright years
-
-2004-01-10 15:19  robux4
-
-	* trunk/libmatroska/test/mux/test8.cpp: Fix a behaviour incompatible
-	  with the checking of the max size
-
-2004-01-10 14:26  mosu
-
-	* trunk/libmatroska/matroska/FileKax.h,
-	  trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/KaxContentEncoding.h,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h: Added code that allows
-	  libmatroska to be built as a DLL on Windows.
-
-2004-01-10 14:19  mosu
-
-	* trunk/libebml/make/mingw32/Makefile,
-	  trunk/libmatroska/make/mingw32/Makefile: Updated the MinGW build
-	  system.
-
-2004-01-06 22:29  robux4
-
-	* trunk/libmatroska/matroska/KaxVersion.h: Ooops, did I do something
-	  wrong ?
-
-2004-01-06 22:15  robux4
-
-	* trunk/libebml/make/vc6/lib/static/libebml.dsp,
-	  trunk/libmatroska/make/vc6/lib/static/libmatroska.dsp:
-	  StdInclude.h doesn't exist anymore
-
-2004-01-06 22:05  robux4
-
-	* trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxAttachments.cpp,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp,
-	  trunk/libmatroska/src/KaxContentEncoding.cpp,
-	  trunk/libmatroska/src/KaxContexts.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp,
-	  trunk/libmatroska/src/KaxSeekHead.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTagMulti.cpp,
-	  trunk/libmatroska/src/KaxTags.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/src/KaxVersion.cpp,
-	  trunk/libmatroska/src/StdInclude.h: No more StdInclude
-
-2004-01-06 21:02  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp: Add support for
-	  SampleScale and BlockSamples
-
-2004-01-05 18:56  mosu
-
-	* trunk/libmatroska/debian/changelog: Updated the version from 0.6.2
-	  to 0.6.3.
-
-2004-01-05 18:46  robux4
-
-	* trunk/libmatroska/src/KaxCuesData.cpp: Changed the ID of the new
-	  CueBlockNumber
-
-2004-01-05 11:39  mosu
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: Fixes for wrong C++ syntax
-	  ("not enough sleep" syndrome).
-
-2004-01-05 11:28  mosu
-
-	* trunk/libmatroska/make/linux/Makefile,
-	  trunk/libmatroska/test/mux/test8.cpp: Fixed a couple of warnings.
-
-2004-01-05 11:28  mosu
-
-	* trunk/libmatroska/debian/control: Updated the dependencies.
-
-2004-01-04 21:39  robux4
-
-	* trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/src/KaxChapters.cpp: Added 2 flags for Chapters
-
-2004-01-01 13:28  mosu
-
-	* trunk/libebml/debian/rules, trunk/libmatroska/debian/rules: Also
-	  install the ChangeLog.
-
-2004-01-01 13:20  mosu
-
-	* trunk/libebml/ChangeLog, trunk/libmatroska/ChangeLog,
-	  trunk/libmatroska/ChangeLog.txt: Added a ChangeLog.
-
-2003-12-30 10:00  mosu
-
-	* trunk/libmatroska/debian/changelog: Bumped version number.
-
-2003-12-28 16:20  mosu
-
-	* trunk/libmatroska/test/tags/test9.cpp: Added test cases for the
-	  new simple tags.
-
-2003-12-28 16:20  mosu
-
-	* trunk/libmatroska/src/KaxTag.cpp: Made KaxTagSimple a possible
-	  child for itself - otherwise reading nested tags does not work.
-
-2003-12-28 16:07  mosu
-
-	* trunk/libmatroska/matroska/KaxVersion.h: Updated the version
-	  number from 0.6.1 to 0.6.2.
-
-2003-12-28 01:08  jcsston
-
-	* trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/src/KaxTag.cpp: The new Simple Tagging system
-
-2003-12-03 16:17  cyrius
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: Fixes
-
-2003-11-16 10:58  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: Added the possibility to
-	  retrieve the position/size of each frame in the data stream
-	  (usefull for people using SCOPE_PARTIAL_DATA and then only reading
-	  the data they need)
-
-2003-11-16 09:36  robux4
-
-	* trunk/libmatroska/src/KaxBlock.cpp: Fixed a serious bug in Block
-	  reading
-
-2003-11-03 22:17  robux4
-
-	* trunk/libebml/ebml/EbmlBinary.h, trunk/libebml/ebml/EbmlCrc32.h,
-	  trunk/libebml/ebml/EbmlDate.h, trunk/libebml/ebml/EbmlElement.h,
-	  trunk/libebml/ebml/EbmlFloat.h, trunk/libebml/ebml/EbmlMaster.h,
-	  trunk/libebml/ebml/EbmlSInteger.h,
-	  trunk/libebml/ebml/EbmlString.h,
-	  trunk/libebml/ebml/EbmlUInteger.h,
-	  trunk/libebml/ebml/EbmlUnicodeString.h,
-	  trunk/libebml/src/EbmlBinary.cpp, trunk/libebml/src/EbmlCrc32.cpp,
-	  trunk/libebml/src/EbmlDate.cpp, trunk/libebml/src/EbmlElement.cpp,
-	  trunk/libebml/src/EbmlFloat.cpp, trunk/libebml/src/EbmlMaster.cpp,
-	  trunk/libebml/src/EbmlSInteger.cpp,
-	  trunk/libebml/src/EbmlString.cpp,
-	  trunk/libebml/src/EbmlUInteger.cpp,
-	  trunk/libebml/src/EbmlUnicodeString.cpp,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp: Better handling of scope
-	  reading
-
-2003-10-31 12:34  mosu
-
-	* trunk/libmatroska/matroska/KaxBlock.h: Added default value for
-	  ReadData.
-
-2003-10-31 08:59  mosu
-
-	* trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp: Fixed the new line/carriage
-	  return mess.
-
-2003-10-31 08:55  mosu
-
-	* trunk/libmatroska/debian/control: Updated dependency to libebml
-	  0.6.2.
-
-2003-10-30 23:07  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp: Allow KaxBlock not to be
-	  fully read
-
-2003-10-30 12:56  mosu
-
-	* trunk/libmatroska/matroska/KaxBlock.h: Set LACING_AUTO as the
-	  default value for the AddFrame() functions. The re-establishes API
-	  compatibility with < 0.6.0.
-
-2003-10-30 12:50  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/matroska/KaxVersion.h: Updated version number to
-	  0.6.1.
-
-2003-10-28 22:09  mosu
-
-	* trunk/libmatroska/debian/changelog: New version number.
-
-2003-10-28 20:59  robux4
-
-	* trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxVersion.h: Update the version
-	  number, LACING_AUTO is the default value
-
-2003-10-28 20:55  robux4
-
-	* trunk/libebml/ebml/EbmlElement.h,
-	  trunk/libebml/src/EbmlElement.cpp,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: EBML-size handling is more
-	  general and handle the Unknown Size
-
-2003-10-25 15:09  mosu
-
-	* trunk/libebml/make/mingw32/Makefile,
-	  trunk/libmatroska/make/mingw32/Makefile: Support the same targest
-	  as the Linux Makefile.
-
-2003-10-24 22:05  mosu
-
-	* trunk/libmatroska/src/KaxBlock.cpp: Fixed an off-by-one error.
-	  Fixed the building of the size list for the lacing. Fixed some of
-	  my own mistakes introduced in the last revision resulting in wrong
-	  data being read for Ebml lacing.
-
-2003-10-24 19:22  mosu
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: Implemented LACING_AUTO:
-	  automatic use of the best lacing method (Xiph, Ebml or fixed).
-
-2003-10-24 16:08  mosu
-
-	* trunk/libmatroska/src/KaxBlock.cpp: Reversed my so-called "fix"
-	  which only broke things.
-
-2003-10-24 15:52  mosu
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: Fixed some warnings. Added
-	  some safety fallbacks instead of undefined behaviour for
-	  unimplemented lacing schemes (fixes some more warnings).
-
-2003-10-24 08:40  jcsston
-
-	* trunk/libmatroska/make/vc7/lib/static/libmatroska.v71.vcproj,
-	  trunk/libmatroska/make/vc7/lib/static/libmatroska.vcproj: Missing
-	  KaxContentEncoding.cpp
-
-2003-10-22 14:18  pamel
-
-	* trunk/libebml/ebml/EbmlElement.h,
-	  trunk/libebml/src/EbmlElement.cpp,
-	  trunk/libmatroska/matroska/KaxTypes.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: New lacing modes reading.
-
-2003-10-21 21:27  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxTypes.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/test/mux/test6.cpp: New lacing modes writing
-
-2003-10-21 19:42  robux4
-
-	* trunk/libmatroska/make/vc6/lib/static/libmatroska.dsp,
-	  trunk/libmatroska/make/vc7/lib/static/libmatroska.v71.vcproj,
-	  trunk/libmatroska/make/vc7/lib/static/libmatroska.vcproj: Fix
-	  windows makefiles for the encoding settings
-
-2003-10-21 18:22  mosu
-
-	* trunk/doc/website/technical/specs/index.html,
-	  trunk/libmatroska/matroska/KaxContentEncoding.h,
-	  trunk/libmatroska/src/KaxContentEncoding.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/test/mux/test6.cpp: Moved the content encoding
-	  elements under a new parent, KaxContentEncodings.
-
-2003-10-19 16:09  mosu
-
-	* trunk/libmatroska/matroska/KaxContentEncoding.h: Changing default
-	  value to match the specs.
-
-2003-10-19 15:23  mosu
-
-	* trunk/libmatroska/ChangeLog.txt: Updated ChangeLog.
-
-2003-10-19 15:22  mosu
-
-	* trunk/libmatroska/make/mingw32/Makefile,
-	  trunk/libmatroska/matroska/KaxContentEncoding.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/src/KaxContentEncoding.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/test/mux/test6.cpp: Added the new track elements
-	  for content encoding (compression/encryption).
-
-2003-10-19 15:17  mosu
-
-	* trunk/libmatroska/make/linux/.cvsignore: Added the resulting test
-	  binaries to the CVS ignore list.
-
-2003-10-19 15:11  mosu
-
-	* trunk/libmatroska/ChangeLog.txt: Added a ChangeLog (generated
-	  automatically from the CVS log messages, but should be updated by
-	  ourselves).
-
-2003-10-15 20:34  mosu
-
-	* trunk/libebml/make/linux/Makefile,
-	  trunk/libmatroska/make/linux/Makefile: Removed -pedantic due to
-	  problems on FreeBSD.
-
-2003-09-17 20:22  mosu
-
-	* trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/debian/control: Updated Debian dependencies.
-
-2003-09-14 08:20  robux4
-
-	* trunk/libmatroska/matroska/KaxVersion.h: New version to reflect
-	  additions
-
-2003-09-14 08:19  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp: Add the possibility to Clone
-	  Blocks and correct the parent when needed
-
-2003-09-13 20:40  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/src/KaxBlock.cpp: Added a Clone() method to the
-	  Blocked data (impossible for now)
-
-2003-09-13 17:48  robux4
-
-	* trunk/libebml/ebml/EbmlHead.h, trunk/libebml/ebml/EbmlSubHead.h,
-	  trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h,
-	  trunk/libmatroska/test/mux/test6.cpp: Added a Clone() method and a
-	  IsMaster() method
-
-2003-09-12 16:57  mosu
-
-	* trunk/libmatroska/src/KaxTrackEntryData.cpp: Fixed wrong length
-	  for KaxTrackTimecodeScale_TheId.
-
-2003-09-01 15:37  jcsston
-
-	* trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/src/KaxBlockData.cpp: Added a protected method
-	  to update the reference timecode
-
-2003-09-01 11:43  mosu
-
-	* trunk/libmatroska/debian/changelog: New version number.
-
-2003-08-21 17:25  mosu
-
-	* trunk/libmatroska/matroska/KaxVersion.h: Bumped version number to
-	  make conditional compilation possible for newly added elements
-	  (like KaxAudioOutputSamplingFreq).
-
-2003-08-20 03:36  spyder
-
-	* trunk/libmatroska/src/KaxTrackAudio.cpp: Fixed a small coding
-	  error where an array of 4 objects was initialized with 5 values.
-
-2003-08-08 17:42  robux4
-
-	* trunk/doc/website/technical/specs/index.html,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp: New Output sampling
-	  frequency parameter
-
-2003-08-04 07:36  robux4
-
-	* trunk/libebml/ebml/EbmlVersion.h,
-	  trunk/libmatroska/matroska/KaxVersion.h: Remove some old TODO
-
-2003-08-01 19:21  robux4
-
-	* trunk/libmatroska/make/Doxyfile: Version 0.5.0 of the lib
-
-2003-08-01 12:03  robux4
-
-	* trunk/libebml/make/vc7/lib/libebml.v71.vcproj,
-	  trunk/libmatroska/make/vc7/lib/static/libmatroska.v71.vcproj,
-	  trunk/mkxds/mkxds.v71.sln, trunk/mkxds/mkxds.v71.vcproj: Added
-	  VC7.1 (VS.Net 2003) projects
-
-2003-08-01 02:26  jcsston
-
-	* trunk/libmatroska/make/Doxyfile: Updated to new source tree
-	  structure
-
-2003-07-31 19:42  robux4
-
-	* trunk/libebml/ebml/EbmlCrc32.h, trunk/libebml/ebml/EbmlDate.h,
-	  trunk/libebml/ebml/EbmlSInteger.h,
-	  trunk/libebml/ebml/EbmlUInteger.h, trunk/libebml/ebml/EbmlVoid.h,
-	  trunk/libebml/src/EbmlCrc32.cpp,
-	  trunk/libebml/src/EbmlSInteger.cpp,
-	  trunk/libebml/src/EbmlVoid.cpp,
-	  trunk/libebml/src/platform/win32/WinIOCallback.cpp,
-	  trunk/libmatroska/src/KaxBlock.cpp: Some fixes for better casting
-	  / type checking
-
-2003-07-30 08:01  robux4
-
-	* trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp: UpdateSize actually
-	  overrides the default one
-
-2003-07-29 21:43  robux4
-
-	* trunk/libebml/ebml/EbmlBinary.h, trunk/libebml/ebml/EbmlCrc32.h,
-	  trunk/libebml/ebml/EbmlDate.h, trunk/libebml/ebml/EbmlElement.h,
-	  trunk/libebml/ebml/EbmlFloat.h, trunk/libebml/ebml/EbmlMaster.h,
-	  trunk/libebml/ebml/EbmlSInteger.h,
-	  trunk/libebml/ebml/EbmlString.h,
-	  trunk/libebml/ebml/EbmlUInteger.h,
-	  trunk/libebml/ebml/EbmlUnicodeString.h,
-	  trunk/libebml/ebml/EbmlVoid.h, trunk/libebml/src/EbmlBinary.cpp,
-	  trunk/libebml/src/EbmlCrc32.cpp, trunk/libebml/src/EbmlDate.cpp,
-	  trunk/libebml/src/EbmlElement.cpp,
-	  trunk/libebml/src/EbmlFloat.cpp, trunk/libebml/src/EbmlMaster.cpp,
-	  trunk/libebml/src/EbmlSInteger.cpp,
-	  trunk/libebml/src/EbmlString.cpp,
-	  trunk/libebml/src/EbmlUInteger.cpp,
-	  trunk/libebml/src/EbmlUnicodeString.cpp,
-	  trunk/libebml/src/EbmlVoid.cpp,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp: Checksum now doesn't care
-	  about mandatory data
-
-2003-07-28 23:04  robux4
-
-	* trunk/libmatroska/src/KaxChapters.cpp: Chapter end time is not
-	  mandatory
-
-2003-07-28 22:55  robux4
-
-	* trunk/libmatroska/matroska/KaxTag.h: Fix the size of the video
-	  genre
-
-2003-07-28 08:49  mosu
-
-	* trunk/libebml/debian/changelog,
-	  trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/debian/control: Updated version information.
-
-2003-07-27 20:28  mosu
-
-	* trunk/libebml/make/mingw32/Makefile,
-	  trunk/libmatroska/make/mingw32/Makefile: Necessary fixes for
-	  compilation with mingw.
-
-2003-07-25 19:25  robux4
-
-	* trunk/doc/website/technical/specs/index.html,
-	  trunk/doc/website/technical/specs/tagging/index.html,
-	  trunk/doc/website/technical/specs/tagging/multi/multititles.html,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTagMulti.cpp: Fixes some IDs
-
-2003-07-24 17:05  robux4
-
-	* trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/src/KaxTagMulti.cpp: New LegalContent element +
-	  fixed some mandatory values
-
-2003-07-19 20:31  robux4
-
-	* trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTagMulti.cpp: Added attachment links with
-	  tags, fix a bad default value
-
-2003-07-17 09:48  mosu
-
-	* trunk/libebml/make/linux/Makefile,
-	  trunk/libmatroska/make/linux/Makefile: Proper Makefile that also
-	  installs the header files.
-
-2003-07-16 16:31  mosu
-
-	* trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxAttachments.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp,
-	  trunk/libmatroska/test/ebml/test00.cpp: Fixed the following
-	  spelling error: Attachements --> Attachments
-
-2003-07-16 16:21  mosu
-
-	* trunk/libebml/make/linux/Makefile,
-	  trunk/libmatroska/make/linux/Makefile: Removed old stuff.
-
-2003-07-16 15:46  robux4
-
-	* trunk/libmatroska, trunk/libmatroska/LICENSE.GPL,
-	  trunk/libmatroska/LICENSE.QPL, trunk/libmatroska/debian,
-	  trunk/libmatroska/debian/changelog,
-	  trunk/libmatroska/debian/control,
-	  trunk/libmatroska/debian/copyright, trunk/libmatroska/debian/dirs,
-	  trunk/libmatroska/debian/docs,
-	  trunk/libmatroska/debian/libmatroska-dev.dirs,
-	  trunk/libmatroska/debian/libmatroska-dev.files,
-	  trunk/libmatroska/debian/rules, trunk/libmatroska/make,
-	  trunk/libmatroska/make/Doxyfile, trunk/libmatroska/make/beos,
-	  trunk/libmatroska/make/beos/Makefile,
-	  trunk/libmatroska/make/cygwin,
-	  trunk/libmatroska/make/cygwin/Makefile,
-	  trunk/libmatroska/make/cygwin/Makefile.rule,
-	  trunk/libmatroska/make/linux,
-	  trunk/libmatroska/make/linux/Makefile,
-	  trunk/libmatroska/make/linux/Makefile.rule,
-	  trunk/libmatroska/make/macosx,
-	  trunk/libmatroska/make/macosx/macosx.pbproj,
-	  trunk/libmatroska/make/macosx/macosx.pbproj/project.pbxproj,
-	  trunk/libmatroska/make/makedoc.bat,
-	  trunk/libmatroska/make/makedoc.sh, trunk/libmatroska/make/mingw32,
-	  trunk/libmatroska/make/mingw32/Makefile,
-	  trunk/libmatroska/make/mingw32/libmatroska.dev,
-	  trunk/libmatroska/make/mingw32/test,
-	  trunk/libmatroska/make/mingw32/test/Makefile,
-	  trunk/libmatroska/make/mingw32/test/test6.dev,
-	  trunk/libmatroska/make/mingw32/test/test8.dev,
-	  trunk/libmatroska/make/vc6, trunk/libmatroska/make/vc6/lib,
-	  trunk/libmatroska/make/vc6/lib/static,
-	  trunk/libmatroska/make/vc6/lib/static/libmatroska.dsp,
-	  trunk/libmatroska/make/vc6/test,
-	  trunk/libmatroska/make/vc6/test/test0.dsp,
-	  trunk/libmatroska/make/vc6/test/test00.dsp,
-	  trunk/libmatroska/make/vc6/test/test1.dsp,
-	  trunk/libmatroska/make/vc6/test/test2.dsp,
-	  trunk/libmatroska/make/vc6/test/test3.dsp,
-	  trunk/libmatroska/make/vc6/test/test4.dsp,
-	  trunk/libmatroska/make/vc6/test/test5.dsp,
-	  trunk/libmatroska/make/vc6/test/test6.dsp,
-	  trunk/libmatroska/make/vc6/test/test6c.dsp,
-	  trunk/libmatroska/make/vc6/test/test7.dsp,
-	  trunk/libmatroska/make/vc6/test/test8.dsp,
-	  trunk/libmatroska/make/vc6/test/test8c.dsp,
-	  trunk/libmatroska/make/vc6/test/test9.dsp,
-	  trunk/libmatroska/make/vc6/vc6.dsw, trunk/libmatroska/make/vc7,
-	  trunk/libmatroska/make/vc7/lib,
-	  trunk/libmatroska/make/vc7/lib/static,
-	  trunk/libmatroska/make/vc7/lib/static/libmatroska.vcproj,
-	  trunk/libmatroska/make/vc7/test,
-	  trunk/libmatroska/make/vc7/test/test0.vcproj,
-	  trunk/libmatroska/make/vc7/test/test00.vcproj,
-	  trunk/libmatroska/make/vc7/test/test6.vcproj,
-	  trunk/libmatroska/make/vc7/test/test8.vcproj,
-	  trunk/libmatroska/make/vc7/test/test9.vcproj,
-	  trunk/libmatroska/make/vc7/vc7.sln, trunk/libmatroska/matroska,
-	  trunk/libmatroska/matroska/FileKax.h,
-	  trunk/libmatroska/matroska/KaxAttached.h,
-	  trunk/libmatroska/matroska/KaxAttachments.h,
-	  trunk/libmatroska/matroska/KaxBlock.h,
-	  trunk/libmatroska/matroska/KaxBlockData.h,
-	  trunk/libmatroska/matroska/KaxChapters.h,
-	  trunk/libmatroska/matroska/KaxCluster.h,
-	  trunk/libmatroska/matroska/KaxClusterData.h,
-	  trunk/libmatroska/matroska/KaxConfig.h,
-	  trunk/libmatroska/matroska/KaxContexts.h,
-	  trunk/libmatroska/matroska/KaxCues.h,
-	  trunk/libmatroska/matroska/KaxCuesData.h,
-	  trunk/libmatroska/matroska/KaxInfo.h,
-	  trunk/libmatroska/matroska/KaxInfoData.h,
-	  trunk/libmatroska/matroska/KaxSeekHead.h,
-	  trunk/libmatroska/matroska/KaxSegment.h,
-	  trunk/libmatroska/matroska/KaxTag.h,
-	  trunk/libmatroska/matroska/KaxTagMulti.h,
-	  trunk/libmatroska/matroska/KaxTags.h,
-	  trunk/libmatroska/matroska/KaxTrackAudio.h,
-	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
-	  trunk/libmatroska/matroska/KaxTrackVideo.h,
-	  trunk/libmatroska/matroska/KaxTracks.h,
-	  trunk/libmatroska/matroska/KaxTypes.h,
-	  trunk/libmatroska/matroska/KaxVersion.h,
-	  trunk/libmatroska/matroska/c,
-	  trunk/libmatroska/matroska/c/libmatroska.h,
-	  trunk/libmatroska/matroska/c/libmatroska_t.h,
-	  trunk/libmatroska/src, trunk/libmatroska/src/FileKax.cpp,
-	  trunk/libmatroska/src/KaxAttached.cpp,
-	  trunk/libmatroska/src/KaxAttachments.cpp,
-	  trunk/libmatroska/src/KaxBlock.cpp,
-	  trunk/libmatroska/src/KaxBlockData.cpp,
-	  trunk/libmatroska/src/KaxChapters.cpp,
-	  trunk/libmatroska/src/KaxCluster.cpp,
-	  trunk/libmatroska/src/KaxClusterData.cpp,
-	  trunk/libmatroska/src/KaxContexts.cpp,
-	  trunk/libmatroska/src/KaxCues.cpp,
-	  trunk/libmatroska/src/KaxCuesData.cpp,
-	  trunk/libmatroska/src/KaxInfo.cpp,
-	  trunk/libmatroska/src/KaxInfoData.cpp,
-	  trunk/libmatroska/src/KaxSeekHead.cpp,
-	  trunk/libmatroska/src/KaxSegment.cpp,
-	  trunk/libmatroska/src/KaxTag.cpp,
-	  trunk/libmatroska/src/KaxTagMulti.cpp,
-	  trunk/libmatroska/src/KaxTags.cpp,
-	  trunk/libmatroska/src/KaxTrackAudio.cpp,
-	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
-	  trunk/libmatroska/src/KaxTrackVideo.cpp,
-	  trunk/libmatroska/src/KaxTracks.cpp,
-	  trunk/libmatroska/src/KaxVersion.cpp,
-	  trunk/libmatroska/src/StdInclude.h, trunk/libmatroska/test,
-	  trunk/libmatroska/test/Makefile, trunk/libmatroska/test/ebml,
-	  trunk/libmatroska/test/ebml/Makefile,
-	  trunk/libmatroska/test/ebml/test0.cpp,
-	  trunk/libmatroska/test/ebml/test00.cpp,
-	  trunk/libmatroska/test/mux, trunk/libmatroska/test/mux/test6.cpp,
-	  trunk/libmatroska/test/mux/test8.cpp, trunk/libmatroska/test/tags,
-	  trunk/libmatroska/test/tags/test9.cpp,
-	  trunk/libmatroska/test/utf8,
-	  trunk/libmatroska/test/utf8/test5.cpp: Initial CVS version after
-	  the crash
-
+2010-06-04 robux4/mosu
+New 1.0.0 version:
+    - rename the library .so name as it's backward incompatible
+
+2010-04-30 robux4/mosu
+New 0.9.0 version:
+    - fix a memory freeing issue in KaxBlock
+    - use the macros from the new libebml 0.8.0 to simplify the element definitions and avoid possible typo bugs
+    - fix some building issues on Linux and MinGW
+    - add matroska_init() and matroska_done() functions, necessary when used with libebml v2
+    - use the new libebml iterators of EbmlMaster where possible
+
+
+2007-01-19 09:58  robux4
+
+	* trunk/libebml/libebml.proj, trunk/libmatroska/libmatroska.proj,
+	  trunk/libmatroska/test/ebml/ebml.proj,
+	  trunk/libmatroska/test/mux/mux.proj,
+	  trunk/libmatroska/test/tags/tags.proj,
+	  trunk/libmatroska/test/test.proj,
+	  trunk/libmatroska/test/utf8/utf8.proj: add support for coremake
+	  building for the moment the config.h and coremake are referenced
+	  by a parent project
+
+2007-01-15 16:01  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/matroska/KaxVersion.h: Version number upgrade to
+	  0.8.1.
+
+2007-01-14 17:20  mosu
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp: Added support for
+	  KaxCodecState and for indexing them in the cues.
+
+2006-06-02 14:32  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Overwrite existing symlinks
+	  during install.
+
+2006-03-30 19:57  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Do not abort if the symlink
+	  exists already.
+
+2005-10-18 18:02  mosu
+
+	* trunk/libmatroska/ChangeLog, trunk/libmatroska/debian/changelog:
+	  Changed the version in the Debian control file & automatic
+	  ChangeLog update.
+
+2005-10-16 13:06  robux4
+
+	* trunk/libmatroska/src/KaxBlock.cpp: libmatroska: set the
+	  discardable bit of SimpleBlock correctly
+
+2005-10-16 10:28  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: libmatroska: support for
+	  reading extra features of SimpleBlock
+
+2005-10-15 17:00  robux4
+
+	* trunk/libmatroska/src/KaxBlock.cpp: libmatroska: better decision
+	  to lace or not
+
+2005-10-15 15:56  robux4
+
+	* trunk/libebml/ebml/EbmlElement.h, trunk/libebml/ebml/EbmlMaster.h,
+	  trunk/libebml/src/EbmlElement.cpp, trunk/libebml/src/EbmlVoid.cpp,
+	  trunk/libmatroska/src/KaxBlock.cpp: libebml/libmatroska: fix a
+	  major bug when "unknown size" was used (Haali does)
+
+2005-10-15 12:34  robux4
+
+	* trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: fix
+	  compilation under gcc
+
+2005-10-14 19:36  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: allow correct
+	  compilation & linking with MATROSKA_VERSION set to 1
+
+2005-10-13 21:21  robux4
+
+	* trunk/libmatroska/src/KaxCues.cpp: libmatroska: simplify the code
+	  for the backward compatibility
+
+2005-10-13 21:16  robux4
+
+	* trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp: libmatroska: make the newer
+	  library work with older code (again after internal changes)
+
+2005-10-13 20:35  robux4
+
+	* trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp: libmatroska: KaxBlockBlob
+	  now works in NO SimpleBlock mode too that means writing or
+	  KaxSimpleBlock is now fully functional
+
+2005-10-13 19:33  robux4
+
+	* trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp: libmatroska: fix writing
+	  in auto SimpleBlock mode
+
+2005-10-12 22:18  robux4
+
+	* trunk/libmatroska/src/KaxBlock.cpp: libmatroska: fix for the
+	  non-forced SimpleBlock use
+
+2005-10-12 22:12  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp: libmatroska: writing from
+	  KaxBlockBlob now works !
+
+2005-10-12 21:21  robux4
+
+	* trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/src/KaxCluster.cpp: libmatroska: prepare the
+	  cluster to render from KaxBlockBlob
+
+2005-10-10 20:48  robux4
+
+	* trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxTypes.h,
+	  trunk/libmatroska/src/KaxBlockData.cpp: libmatroska: correct
+	  copyright year
+
+2005-10-10 20:47  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxTypes.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: more code to
+	  use SimpleBlock automatically (when enabled) reworked the KaxCues
+	  code to use KaxBlockBlob where possible, the previous API may not
+	  be 100% compatible (mkvmerge not affected) the code is still not
+	  100% operational
+
+2005-10-09 14:30  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: simplify a
+	  cast
+
+2005-10-09 14:18  robux4
+
+	* trunk/libmatroska/matroska/FileKax.h,
+	  trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/KaxContentEncoding.h,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h,
+	  trunk/libmatroska/matroska/KaxTypes.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/matroska/c/libmatroska.h,
+	  trunk/libmatroska/matroska/c/libmatroska_t.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp: libmatroska: introduce
+	  KaxBlockBlob to automatically select between BlockGroup and
+	  SimpleBlock + native eol-style
+
+2005-10-08 15:32  robux4
+
+	* trunk/libmatroska/matroska/KaxConfig.h: libmatroska: the default
+	  matroska version to use is now 2
+
+2005-10-08 15:27  robux4
+
+	* trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp: libmatroska: make
+	  KaxSimpleBlock really MATROSKA_VERSION 2
+
+2005-10-08 15:04  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h: libmatroska: KaxSimpleBlock
+	  is MATROSKA_VERSION 2
+
+2005-10-08 14:39  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: libmatroska: first attempt to
+	  write the new SimpleBlock bits correctly
+
+2005-10-06 21:30  robux4
+
+	* trunk/libmatroska/src/KaxCluster.cpp: libmatroska: fix the
+	  mandatory setting according to the new specs
+
+2005-10-06 21:20  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp: libmatroska: add
+	  KaxSimpleBlock and a parent class used by KaxBlock (not tested
+	  yet, and some things left to implement)
+
+2005-08-31 13:26  mosu
+
+	* trunk/libmatroska/make/linux/fedora-core.spec,
+	  trunk/libmatroska/make/linux/suse-libmatroska-makefile.diff,
+	  trunk/libmatroska/make/linux/suse.spec: Added the spec files I use
+	  for building libmatroska on SuSE and Fedora Core.
+
+2005-08-30 14:39  robux4
+
+	* trunk/libmatroska/matroska/KaxVersion.h: libmatroska: the next
+	  version will be 0.7.8
+
+2005-08-30 14:39  robux4
+
+	* trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp: libmatroska: compilation
+	  fixes for the new elements
+
+2005-08-30 14:28  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp: added:
+	  KaxChapterSegmentEditionUID and KaxTrackAttachmentLink
+
+2005-08-30 14:20  robux4
+
+	* trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/src/KaxAttached.cpp: libmatroska: added
+	  KaxFileReferral
+
+2005-08-26 08:19  mosu
+
+	* trunk/libmatroska/matroska/KaxBlock.h: Make the compiler happy:
+	  gcc wants classes with virtual functions to have virtual
+	  destructors.
+
+2005-05-22 07:28  mosu
+
+	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update.
+
+2005-05-22 07:28  mosu
+
+	* trunk/libmatroska, trunk/libmatroska/debian: Ignore some files and
+	  directories created during the Debian build process.
+
+2005-05-22 07:27  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/matroska/KaxVersion.h: Bumped the version number
+	  to 0.7.7 in the places that robux4 forgot.
+
+2005-05-19 19:16  robux4
+
+	* trunk/libebml/ebml/EbmlVersion.h,
+	  trunk/libmatroska/matroska/KaxVersion.h: update version numbers
+	  for the upcoming release
+
+2005-05-03 06:56  mosu
+
+	* trunk/libmatroska/matroska/KaxTrackEntryData.h: The default value
+	  of MaxBlockAdditionID is 0, not 1.
+
+2005-04-19 07:00  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Do not compile shared libs
+	  on Mac OS X due to how they should be handled there. If need
+	  arises we can always implement it properly. Patch by Shawn
+	  Holwegner <shawn () holwegner ! com>
+
+2005-04-16 11:29  mosu
+
+	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update.
+
+2005-04-16 11:29  mosu
+
+	* trunk/libmatroska/debian/rules,
+	  trunk/libmatroska/make/linux/Makefile: Updated the Linux build
+	  system and added targets for installing only the static lib +
+	  headers. Updated the Debian package build script for that, too.
+
+2005-04-16 11:24  mosu
+
+	* trunk/libmatroska/debian/changelog: Updated the Debian package's
+	  version number.
+
+2005-04-09 22:11  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h: libmatroska:
+	  KaxChapterSegmentUID is an EbmlBinary
+
+2005-04-05 12:02  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: libmatroska: add support for
+	  the invisible flag
+
+2005-03-28 14:49  robux4
+
+	* trunk/libmatroska/matroska/KaxInfoData.h: libmatroska: make all
+	  segment UID derive from the same class for easier handling
+
+2005-03-19 11:14  mosu
+
+	* trunk/libmatroska/src/KaxChapters.cpp: Wrong element ID according
+	  to the specs.
+
+2005-03-19 10:37  mosu
+
+	* trunk/libmatroska/make/linux: Ignore the shared libs.
+
+2005-03-19 10:36  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: 'clean' should remove the
+	  .los, too. Provide separate targets for the static and the shared
+	  lib. 'lib' is obsolete.
+
+2005-03-17 09:36  robux4
+
+	* trunk/libebml/src/EbmlCrc32.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp: some strings to
+	  watermark the code
+
+2005-03-17 09:14  robux4
+
+	* trunk/libebml/src/EbmlHead.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp: some strings to watermark
+	  the code
+
+2005-03-16 18:30  robux4
+
+	* trunk/libebml/src/StdIOCallback.cpp,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/mkxuncat/mkxuncat.cpp, trunk/mkxuncat/mkxuncat.vcproj: misc
+	  compilation fixes
+
+2005-03-14 10:34  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: libmatroska: added
+	  KaxChapterSegmentUID
+
+2005-03-13 10:49  robux4
+
+	* trunk/libebml/make/linux/Makefile,
+	  trunk/libmatroska/make/linux/Makefile: libebml/libmatroska: allow
+	  to build as shared libraries for Gentoo
+
+2005-03-03 13:13  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/test/ebml/test0.cpp,
+	  trunk/libmatroska/test/ebml/test00.cpp,
+	  trunk/libmatroska/test/mux/test6.cpp,
+	  trunk/libmatroska/test/utf8/test5.cpp: update the copyright dates
+
+2005-02-06 20:03  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/matroska/KaxVersion.h: Bumped the version number
+	  to 0.7.5.
+
+2005-02-06 19:51  mosu
+
+	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update (with a
+	  new program -- that's why the diff is so huge)
+
+2005-02-06 19:49  mosu
+
+	* trunk/libmatroska/debian/control: Let's require the latest libebml
+	  for building.
+
+2005-02-06 18:12  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Output an error if a mingw
+	  gcc is used with the Linux Makefile (I simply do that too often).
+
+2005-01-31 14:04  mosu
+
+	* trunk/libmatroska/make/linux/check_ids: Also output the
+	  files/classes in which the duplicate IDs occur.
+
+2005-01-31 13:54  robux4
+
+	* trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: fix the
+	  segment family UID
+
+2005-01-31 13:48  mosu
+
+	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp: The usual compilation
+	  fixes.
+
+2005-01-31 13:39  robux4
+
+	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp: libmatroska: no more
+	  TrackAngle and new TrackTranslate elements
+
+2005-01-30 18:00  mosu
+
+	* trunk/libmatroska/src/KaxInfoData.cpp: Some leftovers from
+	  renaming ChapterLink to ChapterTranslate.
+
+2005-01-28 12:10  robux4
+
+	* trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: rename
+	  ChapterLink* to ChapterTranslate*
+
+2005-01-20 12:01  mosu
+
+	* trunk/libmatroska/make/mingw32/Makefile: Only remove files that
+	  might have been built (and not e.g. libmatroska.dev).
+
+2005-01-17 13:48  robux4
+
+	* trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: add
+	  KaxChapterLinkEditionUID
+
+2005-01-15 12:47  robux4
+
+	* trunk/libmatroska/src/KaxInfo.cpp: libmatroska: fix the
+	  KaxSegmentFamily flags
+
+2005-01-13 17:51  robux4
+
+	* trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: the usual
+	  post-commit fixes
+
+2005-01-13 16:41  robux4
+
+	* trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp: libmatroska: added
+	  KaxSegmentFamily, KaxChapterLink, KaxChapterLinkCodec and
+	  KaxChapterLinkID
+
+2005-01-05 16:14  robux4
+
+	* trunk/libmatroska/make/linux/Makefile: patches from the VLC
+	  repository
+
+2005-01-03 19:20  mosu
+
+	* trunk/libmatroska/src/KaxChapters.cpp: An element cannot require
+	  itself to be a mandatory child element.
+
+2005-01-03 15:47  mosu
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: Look! Squirrels! (The usual
+	  compilation fixes after one of robux' "I commit from work without
+	  having compiled it first" commits :-) )
+
+2005-01-03 12:31  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: libmatroska: update with
+	  latest changes in the chapter codecs (may not compile)
+
+2004-12-18 22:26  mosu
+
+	* trunk/libmatroska/src/KaxBlock.cpp: Move all of the (re-)activated
+	  Matroska v1 elements out of "#if == 2" blocks.
+
+2004-12-18 17:52  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp: support for
+	  KaxMaxBlockAdditionID and fix default values
+
+2004-12-18 08:49  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h: BlockAdditions is in
+	  Matroska 1 now
+
+2004-12-15 14:24  robux4
+
+	* trunk/libmatroska/matroska/c/libmatroska_t.h: added the button
+	  track type
+
+2004-11-30 15:45  mosu
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: Use malloc() and free()
+	  instead of new[] and delete[] where the lib might deal with
+	  pointers that have been allocated by the app, or where the app has
+	  allocated the memory. Reason: new[]ed memory cannot be
+	  realloc()ed.
+
+2004-11-28 17:43  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: remove support for the gap
+	  flag in the Block
+
+2004-11-28 15:24  robux4
+
+	* trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp: add almost automatic
+	  handling of SilentTracks
+
+2004-11-19 12:17  mosu
+
+	* trunk/libmatroska/make/mingw32/Makefile: Compile libmatroska as a
+	  DLL by default (is anyone except me using this mingw Makefile
+	  anyway?). Do not remove the dependency file on "make clean".
+
+2004-11-17 14:51  robux4
+
+	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp: added KaxTrackFlagForced
+
+2004-11-17 08:45  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Do not remove the .depend
+	  file on "make clean".
+
+2004-11-14 10:40  mosu
+
+	* trunk/libmatroska/matroska/KaxVersion.h: Numbers starting with '0'
+	  are octal numbers. Therefore a version like '0.8.4' cannot be
+	  expressed as '000804'.
+
+2004-11-13 21:15  mosu
+
+	* trunk/libmatroska/make/mingw32,
+	  trunk/libmatroska/make/mingw32/Makefile: Fixed "make depend".
+	  Ignore a couple of files.
+
+2004-11-13 11:30  mosu
+
+	* trunk/libmatroska/make/linux: Ignore the .depend file created by
+	  "make depend".
+
+2004-11-13 11:29  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Improved the dependency
+	  calculation to be more portable (makedepend doesn't exist
+	  everywhere, and it doesn't necessarily use the compiler we want).
+
+2004-10-02 16:02  robux4
+
+	* trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp: added KaxTrackAngle and
+	  various fixes
+
+2004-10-02 15:42  robux4
+
+	* trunk/libmatroska/src/KaxTracks.cpp: KaxTrackOverlay is not in
+	  "Matroska 2"
+
+2004-10-02 15:40  robux4
+
+	* trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp: correct the
+	  unique/multiple attribute
+
+2004-10-02 15:39  robux4
+
+	* trunk/libmatroska/src/KaxTracks.cpp: TrackOverlay is now multiple
+
+2004-10-02 15:08  robux4
+
+	* trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp: added
+	  KaxClusterSilentTracks and KaxClusterSilentTrackNumber
+
+2004-09-26 10:34  mosu
+
+	* trunk/libmatroska/ChangeLog: Automatic ChangeLog update
+
+2004-09-26 10:21  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/debian/control: Bumped the version number to
+	  0.7.4 and the libebml build requirements to 0.7.2 in the Debian
+	  build system.
+
+2004-09-26 10:20  mosu
+
+	* trunk/libmatroska/make/linux/check_ids: Added a small script that
+	  looks for duplicate EBML IDs in all of libmatroska's source files.
+
+2004-09-11 17:42  mosu
+
+	* trunk/libmatroska/matroska/KaxChapters.h: EditionProcessed has a
+	  default value (0) according to the specs.
+
+2004-09-04 16:29  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: KaxEditionManaged becomes
+	  KaxEditionProcessed and mandatory KaxEditionManagedPrivate becomes
+	  KaxChapterManagedPrivate and moves
+
+2004-09-03 13:38  robux4
+
+	* trunk/libmatroska/matroska/KaxTrackAudio.h: no more automatic
+	  OutputSamplingFrequency default value
+
+2004-09-02 14:17  mosu
+
+	* trunk/libmatroska/src/KaxChapters.cpp: The usual after-robux4
+	  compilation fix ;-)
+
+2004-09-02 11:08  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: add support for
+	  KaxChapterProcessCommand and KaxEditionManagedPrivate
+
+2004-08-31 17:02  mosu
+
+	* trunk/libmatroska/matroska/KaxAttached.h: The ValidateSize
+	  function is neither needed nor correct (probably copy & paste from
+	  somewhere). Integers of all sizes are accepted as in all the other
+	  UID cases.
+
+2004-08-30 18:52  mosu
+
+	* trunk/libmatroska/src/KaxTracks.cpp: MinCache IS mandatory. My
+	  bad.
+
+2004-08-30 18:17  mosu
+
+	* trunk/libmatroska/src/KaxTracks.cpp: MinCache is not mandatory.
+
+2004-08-30 09:21  robux4
+
+	* trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp: flags are mandatory
+
+2004-08-28 14:04  robux4
+
+	* trunk/libmatroska/make/vc7/lib/dll,
+	  trunk/libmatroska/make/vc7/lib/dll/libmatroskadll.v71.vcproj,
+	  trunk/libmatroska/make/vc7/vc7.sln: allow DLL building with MSVC7
+	  (not compatible with the MinGW DLLs)
+
+2004-08-27 18:58  robux4
+
+	* trunk/libmatroska/matroska/KaxTag.h: KaxTagTargetTypeValue default
+	  to 50
+
+2004-08-27 12:25  robux4
+
+	* trunk/libmatroska/src/KaxTag.cpp: TargetTypeValue is no longer
+	  mandatory
+
+2004-08-27 10:01  mosu
+
+	* trunk/libmatroska/src/KaxChapters.cpp: Fixed the wrong element
+	  names.
+
+2004-08-27 09:31  robux4
+
+	* trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/src/KaxTag.cpp: add KaxTagTargetTypeValue as in
+	  the specs
+
+2004-08-27 09:22  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: add KaxChapterPhysicalEquiv
+	  as in the new specs
+
+2004-08-25 14:56  mosu
+
+	* trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: Fixed the compilation.
+
+2004-08-25 14:48  mosu
+
+	* trunk/libmatroska/matroska/KaxVersion.h: Pushed the version
+	  number.
+
+2004-08-25 14:44  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: add KaxChapterProcess and
+	  KaxChapterProcessTime
+
+2004-08-25 14:22  robux4
+
+	* trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp: add the new PixelCropXXX
+	  elements
+
+2004-08-21 20:18  mosu
+
+	* trunk/libmatroska/ChangeLog: Updates
+
+2004-08-19 20:08  mosu
+
+	* trunk/libmatroska/src/KaxChapters.cpp: Wrong element ID.
+
+2004-08-19 17:16  robux4
+
+	* trunk/libmatroska/src/KaxChapters.cpp: I always forget to update
+	  the table size
+
+2004-08-19 17:15  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: added KaxEditionFlagDefault
+	  and KaxEditionManaged
+
+2004-08-19 08:54  robux4
+
+	* trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/src/KaxTag.cpp: add the new TargetType element
+	  in tags
+
+2004-08-16 21:22  mosu
+
+	* trunk/libmatroska/ChangeLog: Updates
+
+2004-08-16 21:04  mosu
+
+	* trunk/libmatroska/matroska/KaxTag.h: Set the default value for
+	  KaxTagLangue to "und" complying with the specs.
+
+2004-08-16 20:49  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/matroska/KaxVersion.h: New version number 0.7.3
+	  because of the changes / additions to the tags.
+
+2004-08-10 15:49  robux4
+
+	* trunk/libmatroska/src/KaxTag.cpp: never make the same mistake
+	  twice...
+
+2004-08-10 14:03  robux4
+
+	* trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/src/KaxTag.cpp: rename the new KaxTagLanguage to
+	  KaxTagLangue
+
+2004-08-10 12:58  robux4
+
+	* trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTags.cpp: fix mandatory values add
+	  support for TagLanguage and TagDefault
+
+2004-08-06 07:34  mosu
+
+	* trunk/libmatroska/ChangeLog: Updates
+
+2004-08-05 11:59  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: support for
+	  EditionFlagHidden (not compiled!)
+
+2004-08-04 17:49  mosu
+
+	* trunk/libmatroska/ChangeLog, trunk/libmatroska/debian/changelog:
+	  Updated the ChangeLog and bumped the version number on the Debian
+	  package to 0.7.2.
+
+2004-08-01 15:33  mosu
+
+	* trunk/libmatroska/matroska/KaxInfoData.h: Use a double for the
+	  KaxDuration element and not only a float. Otherwise the duration
+	  might be off a couple of samples for large values due to the
+	  limited resolution of a float.
+
+2004-07-31 09:01  robux4
+
+	* trunk/libmatroska/matroska/KaxTag.h: The default value of 0 makes
+	  sense again at the container level (not binary content)
+
+2004-07-30 20:31  mosu
+
+	* trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp: Never commit code without having
+	  compiled it before :) When adding elements to an array the array
+	  size has to be adjusted.
+
+2004-07-30 12:47  robux4
+
+	* trunk/libmatroska/matroska/KaxVersion.h: push the version number
+	  to avoid confusion if beta softwares are released in public
+
+2004-07-30 12:45  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp: add an edition UID and clean the
+	  code according to the specs (I haven't tried to compile !!!)
+
+2004-07-27 07:56  mosu
+
+	* trunk/libmatroska/test/mux/test8.cpp: Fix for compilation on
+	  NetBSD. Patch by Lubomir Sedlacik (salo at Xtrmntr dot org).
+
+2004-07-26 17:53  mosu
+
+	* trunk/libmatroska/make/mingw32/Makefile: Proper description for
+	  the SHARED option. Make building the lib statically the default
+	  just like it is for libembl.
+
+2004-07-25 10:37  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/debian/control,
+	  trunk/libmatroska/matroska/KaxVersion.h: Bumped the version number
+	  to 0.7.1. Same for libebml dependencies for the Debian package.
+
+2004-07-22 20:28  mosu
+
+	* trunk/libmatroska/make/mingw32/Makefile: Do not build the test
+	  apps by default.
+
+2004-07-19 16:43  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Let the user specify his
+	  own CXXFLAGS and CPPFLAGS.
+
+2004-07-14 13:29  mosu
+
+	* trunk/libmatroska/src/KaxCues.cpp: I hate tabs. They suck.
+	  Especially in multi user development.
+
+2004-07-14 13:27  mosu
+
+	* trunk/libmatroska/src/KaxCues.cpp: Do not let the user add a
+	  BlockGroup more than once to the cues. KaxCluster::Render() does
+	  call KaxCues::PositionSet(), but PositionSet() only cleans the
+	  first occurence. This will lead to an assert() in the KaxCues
+	  d\tor.
+
+2004-07-09 21:19  mosu
+
+	* trunk/libmatroska/debian/rules: debian/rules should be executable.
+
+2004-07-09 21:10  mosu
+
+	* trunk/libmatroska/make/linux,
+	  trunk/libmatroska/make/linux/.cvsignore: Use the svn:ignore
+	  property instead of the .cvsignore file.
+
+2004-07-09 21:07  mosu
+
+	* trunk/libmatroska/make/linux/Makefile: Do not compile the test
+	  apps with the "all" target. gcc 3.4.0 does not like the non-ASCII
+	  cahrs in one of them, and only libmatroska devs need them anyway.
+
+2004-07-09 21:05  mosu
+
+	* trunk/libmatroska/ChangeLog, trunk/libmatroska/LICENSE.LGPL,
+	  trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/debian/control,
+	  trunk/libmatroska/debian/copyright, trunk/libmatroska/debian/dirs,
+	  trunk/libmatroska/debian/docs,
+	  trunk/libmatroska/debian/libmatroska-dev.dirs,
+	  trunk/libmatroska/debian/libmatroska-dev.files,
+	  trunk/libmatroska/debian/rules, trunk/libmatroska/make/Doxyfile,
+	  trunk/libmatroska/make/cygwin/Makefile,
+	  trunk/libmatroska/make/cygwin/Makefile.rule,
+	  trunk/libmatroska/make/linux/Makefile,
+	  trunk/libmatroska/make/linux/Makefile.rule,
+	  trunk/libmatroska/make/makedoc.bat,
+	  trunk/libmatroska/make/makedoc.sh,
+	  trunk/libmatroska/make/mingw32/Makefile,
+	  trunk/libmatroska/make/mingw32/test/Makefile,
+	  trunk/libmatroska/make/mingw32/test/test6.dev,
+	  trunk/libmatroska/make/mingw32/test/test8.dev,
+	  trunk/libmatroska/src/FileKax.cpp,
+	  trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxAttachments.cpp,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp,
+	  trunk/libmatroska/src/KaxContentEncoding.cpp,
+	  trunk/libmatroska/src/KaxContexts.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp,
+	  trunk/libmatroska/src/KaxSeekHead.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTagMulti.cpp,
+	  trunk/libmatroska/src/KaxTags.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/src/KaxVersion.cpp,
+	  trunk/libmatroska/test/Makefile,
+	  trunk/libmatroska/test/ebml/Makefile,
+	  trunk/libmatroska/test/ebml/test0.cpp,
+	  trunk/libmatroska/test/ebml/test00.cpp,
+	  trunk/libmatroska/test/mux/test6.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp,
+	  trunk/libmatroska/test/tags/test9.cpp,
+	  trunk/libmatroska/test/utf8/test5.cpp: Set eol-style and keywords
+	  properties.
+
+2004-07-09 09:16  robux4
+
+	* trunk/libmatroska/matroska/KaxVersion.h: test SSL authentication
+
+2004-07-08 12:02  
+
+	* trunk/libmatroska/matroska/KaxVersion.h: Test changes
+
+2004-05-11 20:33  mosu
+
+	* trunk/libmatroska/make/beos,
+	  trunk/libmatroska/make/linux/Makefile,
+	  trunk/libmatroska/test/mux/test8.cpp: Compilation on BeOS. Patch
+	  by Vegard W&#65533;rp <devel at vegardw.com>
+
+2004-04-26 19:35  robux4
+
+	* trunk/libebml/make/vc7/Makefile,
+	  trunk/libmatroska/make/vc7/Makefile: Makefile to use the free
+	  VS.Net 2003 command-line compiler
+
+2004-04-24 09:09  mosu
+
+	* trunk/libebml/make/linux/Makefile,
+	  trunk/libmatroska/make/linux/Makefile: Set LD to CXX by default.
+
+2004-04-23 16:46  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/debian/control,
+	  trunk/libmatroska/matroska/KaxVersion.h: Bumped version number to
+	  0.7.0.
+
+2004-04-21 19:55  mosu
+
+	* trunk/libebml/ChangeLog, trunk/libmatroska/ChangeLog: Updates
+
+2004-04-21 19:50  mosu
+
+	* trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp: KaxClusterPosition is
+	  already in use and therefore a v1 element.
+
+2004-04-14 23:26  robux4
+
+	* trunk/libmatroska/matroska/FileKax.h,
+	  trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/KaxContentEncoding.h,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h,
+	  trunk/libmatroska/matroska/KaxTypes.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/matroska/c/libmatroska.h,
+	  trunk/libmatroska/matroska/c/libmatroska_t.h,
+	  trunk/libmatroska/src/FileKax.cpp,
+	  trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxAttachments.cpp,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp,
+	  trunk/libmatroska/src/KaxContentEncoding.cpp,
+	  trunk/libmatroska/src/KaxContexts.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp,
+	  trunk/libmatroska/src/KaxSeekHead.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTagMulti.cpp,
+	  trunk/libmatroska/src/KaxTags.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/src/KaxVersion.cpp,
+	  trunk/libmatroska/test/mux/test6.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp: Switch to LGPL license
+
+2004-04-14 23:04  robux4
+
+	* trunk/libebml/LICENSE.GPL, trunk/libebml/LICENSE.LGPL,
+	  trunk/libebml/LICENSE.QPL, trunk/libmatroska/LICENSE.GPL,
+	  trunk/libmatroska/LICENSE.LGPL, trunk/libmatroska/LICENSE.QPL:
+	  Switch to LGPL license
+
+2004-01-31 13:43  robux4
+
+	* trunk/libebml/ebml/EbmlConfig.h, trunk/libebml/ebml/EbmlTypes.h,
+	  trunk/libebml/ebml/c/libebml_t.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/c/libmatroska_t.h: Simplify and change
+	  the copyright holder (nothing left from Ingo)
+
+2004-01-19 10:33  mosu
+
+	* trunk/libebml/ChangeLog, trunk/libmatroska/ChangeLog: Updated the
+	  ChangeLog.
+
+2004-01-17 21:40  mosu
+
+	* trunk/libmatroska/make/mingw32/Makefile,
+	  trunk/libmatroska/matroska/FileKax.h,
+	  trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/KaxContentEncoding.h,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h: Readded the code for DLL
+	  builds on Windows.
+
+2004-01-17 16:33  robux4
+
+	* trunk/libmatroska/test/mux/test6.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp: Fix minor things in test
+	  examples
+
+2004-01-17 13:38  robux4
+
+	* trunk/libmatroska/src/KaxTrackAudio.cpp: Fix a problem when
+	  MATROSKA_VERSION is set to 2
+
+2004-01-15 20:47  cyrius
+
+	* trunk/libmatroska/src/KaxBlock.cpp: Fix for partial XipH lacing
+	  reading
+
+2004-01-15 15:17  mosu
+
+	* trunk/libmatroska/ChangeLog: Updated the ChangeLog.
+
+2004-01-10 16:50  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/test/mux/test6.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp: Handle MATROSKA_VERSION to
+	  enable/disable some future additions
+
+2004-01-10 15:57  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp: No more new elements for
+	  sample accurate seeking
+
+2004-01-10 15:31  robux4
+
+	* trunk/libebml/ebml/Debug.h, trunk/libebml/ebml/EbmlBinary.h,
+	  trunk/libebml/ebml/EbmlConfig.h,
+	  trunk/libebml/ebml/EbmlContexts.h, trunk/libebml/ebml/EbmlCrc32.h,
+	  trunk/libebml/ebml/EbmlDate.h, trunk/libebml/ebml/EbmlDummy.h,
+	  trunk/libebml/ebml/EbmlElement.h, trunk/libebml/ebml/EbmlEndian.h,
+	  trunk/libebml/ebml/EbmlFloat.h, trunk/libebml/ebml/EbmlHead.h,
+	  trunk/libebml/ebml/EbmlId.h, trunk/libebml/ebml/EbmlMaster.h,
+	  trunk/libebml/ebml/EbmlSInteger.h,
+	  trunk/libebml/ebml/EbmlStream.h, trunk/libebml/ebml/EbmlString.h,
+	  trunk/libebml/ebml/EbmlSubHead.h, trunk/libebml/ebml/EbmlTypes.h,
+	  trunk/libebml/ebml/EbmlUInteger.h,
+	  trunk/libebml/ebml/EbmlUnicodeString.h,
+	  trunk/libebml/ebml/EbmlVersion.h, trunk/libebml/ebml/EbmlVoid.h,
+	  trunk/libebml/ebml/IOCallback.h,
+	  trunk/libebml/ebml/MemIOCallback.h,
+	  trunk/libebml/ebml/StdIOCallback.h, trunk/libebml/src/Debug.cpp,
+	  trunk/libebml/src/EbmlBinary.cpp,
+	  trunk/libebml/src/EbmlContexts.cpp,
+	  trunk/libebml/src/EbmlCrc32.cpp, trunk/libebml/src/EbmlDate.cpp,
+	  trunk/libebml/src/EbmlDummy.cpp,
+	  trunk/libebml/src/EbmlElement.cpp,
+	  trunk/libebml/src/EbmlFloat.cpp, trunk/libebml/src/EbmlHead.cpp,
+	  trunk/libebml/src/EbmlMaster.cpp,
+	  trunk/libebml/src/EbmlSInteger.cpp,
+	  trunk/libebml/src/EbmlStream.cpp,
+	  trunk/libebml/src/EbmlString.cpp,
+	  trunk/libebml/src/EbmlSubHead.cpp,
+	  trunk/libebml/src/EbmlUInteger.cpp,
+	  trunk/libebml/src/EbmlUnicodeString.cpp,
+	  trunk/libebml/src/EbmlVersion.cpp, trunk/libebml/src/EbmlVoid.cpp,
+	  trunk/libebml/src/IOCallback.cpp,
+	  trunk/libebml/src/StdIOCallback.cpp,
+	  trunk/libmatroska/matroska/FileKax.h,
+	  trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/KaxContentEncoding.h,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxAttachments.cpp,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp,
+	  trunk/libmatroska/src/KaxContentEncoding.cpp,
+	  trunk/libmatroska/src/KaxContexts.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp,
+	  trunk/libmatroska/src/KaxSeekHead.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTagMulti.cpp,
+	  trunk/libmatroska/src/KaxTags.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/src/KaxVersion.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp,
+	  trunk/libmatroska/test/tags/test9.cpp: Update the copyright years
+
+2004-01-10 15:19  robux4
+
+	* trunk/libmatroska/test/mux/test8.cpp: Fix a behaviour incompatible
+	  with the checking of the max size
+
+2004-01-10 14:26  mosu
+
+	* trunk/libmatroska/matroska/FileKax.h,
+	  trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/KaxContentEncoding.h,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h: Added code that allows
+	  libmatroska to be built as a DLL on Windows.
+
+2004-01-10 14:19  mosu
+
+	* trunk/libebml/make/mingw32/Makefile,
+	  trunk/libmatroska/make/mingw32/Makefile: Updated the MinGW build
+	  system.
+
+2004-01-06 22:29  robux4
+
+	* trunk/libmatroska/matroska/KaxVersion.h: Ooops, did I do something
+	  wrong ?
+
+2004-01-06 22:15  robux4
+
+	* trunk/libebml/make/vc6/lib/static/libebml.dsp,
+	  trunk/libmatroska/make/vc6/lib/static/libmatroska.dsp:
+	  StdInclude.h doesn't exist anymore
+
+2004-01-06 22:05  robux4
+
+	* trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxAttachments.cpp,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp,
+	  trunk/libmatroska/src/KaxContentEncoding.cpp,
+	  trunk/libmatroska/src/KaxContexts.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp,
+	  trunk/libmatroska/src/KaxSeekHead.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTagMulti.cpp,
+	  trunk/libmatroska/src/KaxTags.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/src/KaxVersion.cpp,
+	  trunk/libmatroska/src/StdInclude.h: No more StdInclude
+
+2004-01-06 21:02  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp: Add support for
+	  SampleScale and BlockSamples
+
+2004-01-05 18:56  mosu
+
+	* trunk/libmatroska/debian/changelog: Updated the version from 0.6.2
+	  to 0.6.3.
+
+2004-01-05 18:46  robux4
+
+	* trunk/libmatroska/src/KaxCuesData.cpp: Changed the ID of the new
+	  CueBlockNumber
+
+2004-01-05 11:39  mosu
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: Fixes for wrong C++ syntax
+	  ("not enough sleep" syndrome).
+
+2004-01-05 11:28  mosu
+
+	* trunk/libmatroska/make/linux/Makefile,
+	  trunk/libmatroska/test/mux/test8.cpp: Fixed a couple of warnings.
+
+2004-01-05 11:28  mosu
+
+	* trunk/libmatroska/debian/control: Updated the dependencies.
+
+2004-01-04 21:39  robux4
+
+	* trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/src/KaxChapters.cpp: Added 2 flags for Chapters
+
+2004-01-01 13:28  mosu
+
+	* trunk/libebml/debian/rules, trunk/libmatroska/debian/rules: Also
+	  install the ChangeLog.
+
+2004-01-01 13:20  mosu
+
+	* trunk/libebml/ChangeLog, trunk/libmatroska/ChangeLog,
+	  trunk/libmatroska/ChangeLog.txt: Added a ChangeLog.
+
+2003-12-30 10:00  mosu
+
+	* trunk/libmatroska/debian/changelog: Bumped version number.
+
+2003-12-28 16:20  mosu
+
+	* trunk/libmatroska/test/tags/test9.cpp: Added test cases for the
+	  new simple tags.
+
+2003-12-28 16:20  mosu
+
+	* trunk/libmatroska/src/KaxTag.cpp: Made KaxTagSimple a possible
+	  child for itself - otherwise reading nested tags does not work.
+
+2003-12-28 16:07  mosu
+
+	* trunk/libmatroska/matroska/KaxVersion.h: Updated the version
+	  number from 0.6.1 to 0.6.2.
+
+2003-12-28 01:08  jcsston
+
+	* trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/src/KaxTag.cpp: The new Simple Tagging system
+
+2003-12-03 16:17  cyrius
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: Fixes
+
+2003-11-16 10:58  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: Added the possibility to
+	  retrieve the position/size of each frame in the data stream
+	  (usefull for people using SCOPE_PARTIAL_DATA and then only reading
+	  the data they need)
+
+2003-11-16 09:36  robux4
+
+	* trunk/libmatroska/src/KaxBlock.cpp: Fixed a serious bug in Block
+	  reading
+
+2003-11-03 22:17  robux4
+
+	* trunk/libebml/ebml/EbmlBinary.h, trunk/libebml/ebml/EbmlCrc32.h,
+	  trunk/libebml/ebml/EbmlDate.h, trunk/libebml/ebml/EbmlElement.h,
+	  trunk/libebml/ebml/EbmlFloat.h, trunk/libebml/ebml/EbmlMaster.h,
+	  trunk/libebml/ebml/EbmlSInteger.h,
+	  trunk/libebml/ebml/EbmlString.h,
+	  trunk/libebml/ebml/EbmlUInteger.h,
+	  trunk/libebml/ebml/EbmlUnicodeString.h,
+	  trunk/libebml/src/EbmlBinary.cpp, trunk/libebml/src/EbmlCrc32.cpp,
+	  trunk/libebml/src/EbmlDate.cpp, trunk/libebml/src/EbmlElement.cpp,
+	  trunk/libebml/src/EbmlFloat.cpp, trunk/libebml/src/EbmlMaster.cpp,
+	  trunk/libebml/src/EbmlSInteger.cpp,
+	  trunk/libebml/src/EbmlString.cpp,
+	  trunk/libebml/src/EbmlUInteger.cpp,
+	  trunk/libebml/src/EbmlUnicodeString.cpp,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp: Better handling of scope
+	  reading
+
+2003-10-31 12:34  mosu
+
+	* trunk/libmatroska/matroska/KaxBlock.h: Added default value for
+	  ReadData.
+
+2003-10-31 08:59  mosu
+
+	* trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp: Fixed the new line/carriage
+	  return mess.
+
+2003-10-31 08:55  mosu
+
+	* trunk/libmatroska/debian/control: Updated dependency to libebml
+	  0.6.2.
+
+2003-10-30 23:07  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp: Allow KaxBlock not to be
+	  fully read
+
+2003-10-30 12:56  mosu
+
+	* trunk/libmatroska/matroska/KaxBlock.h: Set LACING_AUTO as the
+	  default value for the AddFrame() functions. The re-establishes API
+	  compatibility with < 0.6.0.
+
+2003-10-30 12:50  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/matroska/KaxVersion.h: Updated version number to
+	  0.6.1.
+
+2003-10-28 22:09  mosu
+
+	* trunk/libmatroska/debian/changelog: New version number.
+
+2003-10-28 20:59  robux4
+
+	* trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxVersion.h: Update the version
+	  number, LACING_AUTO is the default value
+
+2003-10-28 20:55  robux4
+
+	* trunk/libebml/ebml/EbmlElement.h,
+	  trunk/libebml/src/EbmlElement.cpp,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: EBML-size handling is more
+	  general and handle the Unknown Size
+
+2003-10-25 15:09  mosu
+
+	* trunk/libebml/make/mingw32/Makefile,
+	  trunk/libmatroska/make/mingw32/Makefile: Support the same targest
+	  as the Linux Makefile.
+
+2003-10-24 22:05  mosu
+
+	* trunk/libmatroska/src/KaxBlock.cpp: Fixed an off-by-one error.
+	  Fixed the building of the size list for the lacing. Fixed some of
+	  my own mistakes introduced in the last revision resulting in wrong
+	  data being read for Ebml lacing.
+
+2003-10-24 19:22  mosu
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: Implemented LACING_AUTO:
+	  automatic use of the best lacing method (Xiph, Ebml or fixed).
+
+2003-10-24 16:08  mosu
+
+	* trunk/libmatroska/src/KaxBlock.cpp: Reversed my so-called "fix"
+	  which only broke things.
+
+2003-10-24 15:52  mosu
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: Fixed some warnings. Added
+	  some safety fallbacks instead of undefined behaviour for
+	  unimplemented lacing schemes (fixes some more warnings).
+
+2003-10-24 08:40  jcsston
+
+	* trunk/libmatroska/make/vc7/lib/static/libmatroska.v71.vcproj,
+	  trunk/libmatroska/make/vc7/lib/static/libmatroska.vcproj: Missing
+	  KaxContentEncoding.cpp
+
+2003-10-22 14:18  pamel
+
+	* trunk/libebml/ebml/EbmlElement.h,
+	  trunk/libebml/src/EbmlElement.cpp,
+	  trunk/libmatroska/matroska/KaxTypes.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: New lacing modes reading.
+
+2003-10-21 21:27  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxTypes.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/test/mux/test6.cpp: New lacing modes writing
+
+2003-10-21 19:42  robux4
+
+	* trunk/libmatroska/make/vc6/lib/static/libmatroska.dsp,
+	  trunk/libmatroska/make/vc7/lib/static/libmatroska.v71.vcproj,
+	  trunk/libmatroska/make/vc7/lib/static/libmatroska.vcproj: Fix
+	  windows makefiles for the encoding settings
+
+2003-10-21 18:22  mosu
+
+	* trunk/doc/website/technical/specs/index.html,
+	  trunk/libmatroska/matroska/KaxContentEncoding.h,
+	  trunk/libmatroska/src/KaxContentEncoding.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/test/mux/test6.cpp: Moved the content encoding
+	  elements under a new parent, KaxContentEncodings.
+
+2003-10-19 16:09  mosu
+
+	* trunk/libmatroska/matroska/KaxContentEncoding.h: Changing default
+	  value to match the specs.
+
+2003-10-19 15:23  mosu
+
+	* trunk/libmatroska/ChangeLog.txt: Updated ChangeLog.
+
+2003-10-19 15:22  mosu
+
+	* trunk/libmatroska/make/mingw32/Makefile,
+	  trunk/libmatroska/matroska/KaxContentEncoding.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/src/KaxContentEncoding.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/test/mux/test6.cpp: Added the new track elements
+	  for content encoding (compression/encryption).
+
+2003-10-19 15:17  mosu
+
+	* trunk/libmatroska/make/linux/.cvsignore: Added the resulting test
+	  binaries to the CVS ignore list.
+
+2003-10-19 15:11  mosu
+
+	* trunk/libmatroska/ChangeLog.txt: Added a ChangeLog (generated
+	  automatically from the CVS log messages, but should be updated by
+	  ourselves).
+
+2003-10-15 20:34  mosu
+
+	* trunk/libebml/make/linux/Makefile,
+	  trunk/libmatroska/make/linux/Makefile: Removed -pedantic due to
+	  problems on FreeBSD.
+
+2003-09-17 20:22  mosu
+
+	* trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/debian/control: Updated Debian dependencies.
+
+2003-09-14 08:20  robux4
+
+	* trunk/libmatroska/matroska/KaxVersion.h: New version to reflect
+	  additions
+
+2003-09-14 08:19  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp: Add the possibility to Clone
+	  Blocks and correct the parent when needed
+
+2003-09-13 20:40  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/src/KaxBlock.cpp: Added a Clone() method to the
+	  Blocked data (impossible for now)
+
+2003-09-13 17:48  robux4
+
+	* trunk/libebml/ebml/EbmlHead.h, trunk/libebml/ebml/EbmlSubHead.h,
+	  trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h,
+	  trunk/libmatroska/test/mux/test6.cpp: Added a Clone() method and a
+	  IsMaster() method
+
+2003-09-12 16:57  mosu
+
+	* trunk/libmatroska/src/KaxTrackEntryData.cpp: Fixed wrong length
+	  for KaxTrackTimecodeScale_TheId.
+
+2003-09-01 15:37  jcsston
+
+	* trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/src/KaxBlockData.cpp: Added a protected method
+	  to update the reference timecode
+
+2003-09-01 11:43  mosu
+
+	* trunk/libmatroska/debian/changelog: New version number.
+
+2003-08-21 17:25  mosu
+
+	* trunk/libmatroska/matroska/KaxVersion.h: Bumped version number to
+	  make conditional compilation possible for newly added elements
+	  (like KaxAudioOutputSamplingFreq).
+
+2003-08-20 03:36  spyder
+
+	* trunk/libmatroska/src/KaxTrackAudio.cpp: Fixed a small coding
+	  error where an array of 4 objects was initialized with 5 values.
+
+2003-08-08 17:42  robux4
+
+	* trunk/doc/website/technical/specs/index.html,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp: New Output sampling
+	  frequency parameter
+
+2003-08-04 07:36  robux4
+
+	* trunk/libebml/ebml/EbmlVersion.h,
+	  trunk/libmatroska/matroska/KaxVersion.h: Remove some old TODO
+
+2003-08-01 19:21  robux4
+
+	* trunk/libmatroska/make/Doxyfile: Version 0.5.0 of the lib
+
+2003-08-01 12:03  robux4
+
+	* trunk/libebml/make/vc7/lib/libebml.v71.vcproj,
+	  trunk/libmatroska/make/vc7/lib/static/libmatroska.v71.vcproj,
+	  trunk/mkxds/mkxds.v71.sln, trunk/mkxds/mkxds.v71.vcproj: Added
+	  VC7.1 (VS.Net 2003) projects
+
+2003-08-01 02:26  jcsston
+
+	* trunk/libmatroska/make/Doxyfile: Updated to new source tree
+	  structure
+
+2003-07-31 19:42  robux4
+
+	* trunk/libebml/ebml/EbmlCrc32.h, trunk/libebml/ebml/EbmlDate.h,
+	  trunk/libebml/ebml/EbmlSInteger.h,
+	  trunk/libebml/ebml/EbmlUInteger.h, trunk/libebml/ebml/EbmlVoid.h,
+	  trunk/libebml/src/EbmlCrc32.cpp,
+	  trunk/libebml/src/EbmlSInteger.cpp,
+	  trunk/libebml/src/EbmlVoid.cpp,
+	  trunk/libebml/src/platform/win32/WinIOCallback.cpp,
+	  trunk/libmatroska/src/KaxBlock.cpp: Some fixes for better casting
+	  / type checking
+
+2003-07-30 08:01  robux4
+
+	* trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp: UpdateSize actually
+	  overrides the default one
+
+2003-07-29 21:43  robux4
+
+	* trunk/libebml/ebml/EbmlBinary.h, trunk/libebml/ebml/EbmlCrc32.h,
+	  trunk/libebml/ebml/EbmlDate.h, trunk/libebml/ebml/EbmlElement.h,
+	  trunk/libebml/ebml/EbmlFloat.h, trunk/libebml/ebml/EbmlMaster.h,
+	  trunk/libebml/ebml/EbmlSInteger.h,
+	  trunk/libebml/ebml/EbmlString.h,
+	  trunk/libebml/ebml/EbmlUInteger.h,
+	  trunk/libebml/ebml/EbmlUnicodeString.h,
+	  trunk/libebml/ebml/EbmlVoid.h, trunk/libebml/src/EbmlBinary.cpp,
+	  trunk/libebml/src/EbmlCrc32.cpp, trunk/libebml/src/EbmlDate.cpp,
+	  trunk/libebml/src/EbmlElement.cpp,
+	  trunk/libebml/src/EbmlFloat.cpp, trunk/libebml/src/EbmlMaster.cpp,
+	  trunk/libebml/src/EbmlSInteger.cpp,
+	  trunk/libebml/src/EbmlString.cpp,
+	  trunk/libebml/src/EbmlUInteger.cpp,
+	  trunk/libebml/src/EbmlUnicodeString.cpp,
+	  trunk/libebml/src/EbmlVoid.cpp,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp: Checksum now doesn't care
+	  about mandatory data
+
+2003-07-28 23:04  robux4
+
+	* trunk/libmatroska/src/KaxChapters.cpp: Chapter end time is not
+	  mandatory
+
+2003-07-28 22:55  robux4
+
+	* trunk/libmatroska/matroska/KaxTag.h: Fix the size of the video
+	  genre
+
+2003-07-28 08:49  mosu
+
+	* trunk/libebml/debian/changelog,
+	  trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/debian/control: Updated version information.
+
+2003-07-27 20:28  mosu
+
+	* trunk/libebml/make/mingw32/Makefile,
+	  trunk/libmatroska/make/mingw32/Makefile: Necessary fixes for
+	  compilation with mingw.
+
+2003-07-25 19:25  robux4
+
+	* trunk/doc/website/technical/specs/index.html,
+	  trunk/doc/website/technical/specs/tagging/index.html,
+	  trunk/doc/website/technical/specs/tagging/multi/multititles.html,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTagMulti.cpp: Fixes some IDs
+
+2003-07-24 17:05  robux4
+
+	* trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/src/KaxTagMulti.cpp: New LegalContent element +
+	  fixed some mandatory values
+
+2003-07-19 20:31  robux4
+
+	* trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTagMulti.cpp: Added attachment links with
+	  tags, fix a bad default value
+
+2003-07-17 09:48  mosu
+
+	* trunk/libebml/make/linux/Makefile,
+	  trunk/libmatroska/make/linux/Makefile: Proper Makefile that also
+	  installs the header files.
+
+2003-07-16 16:31  mosu
+
+	* trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxAttachments.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp,
+	  trunk/libmatroska/test/ebml/test00.cpp: Fixed the following
+	  spelling error: Attachements --> Attachments
+
+2003-07-16 16:21  mosu
+
+	* trunk/libebml/make/linux/Makefile,
+	  trunk/libmatroska/make/linux/Makefile: Removed old stuff.
+
+2003-07-16 15:46  robux4
+
+	* trunk/libmatroska, trunk/libmatroska/LICENSE.GPL,
+	  trunk/libmatroska/LICENSE.QPL, trunk/libmatroska/debian,
+	  trunk/libmatroska/debian/changelog,
+	  trunk/libmatroska/debian/control,
+	  trunk/libmatroska/debian/copyright, trunk/libmatroska/debian/dirs,
+	  trunk/libmatroska/debian/docs,
+	  trunk/libmatroska/debian/libmatroska-dev.dirs,
+	  trunk/libmatroska/debian/libmatroska-dev.files,
+	  trunk/libmatroska/debian/rules, trunk/libmatroska/make,
+	  trunk/libmatroska/make/Doxyfile, trunk/libmatroska/make/beos,
+	  trunk/libmatroska/make/beos/Makefile,
+	  trunk/libmatroska/make/cygwin,
+	  trunk/libmatroska/make/cygwin/Makefile,
+	  trunk/libmatroska/make/cygwin/Makefile.rule,
+	  trunk/libmatroska/make/linux,
+	  trunk/libmatroska/make/linux/Makefile,
+	  trunk/libmatroska/make/linux/Makefile.rule,
+	  trunk/libmatroska/make/macosx,
+	  trunk/libmatroska/make/macosx/macosx.pbproj,
+	  trunk/libmatroska/make/macosx/macosx.pbproj/project.pbxproj,
+	  trunk/libmatroska/make/makedoc.bat,
+	  trunk/libmatroska/make/makedoc.sh, trunk/libmatroska/make/mingw32,
+	  trunk/libmatroska/make/mingw32/Makefile,
+	  trunk/libmatroska/make/mingw32/libmatroska.dev,
+	  trunk/libmatroska/make/mingw32/test,
+	  trunk/libmatroska/make/mingw32/test/Makefile,
+	  trunk/libmatroska/make/mingw32/test/test6.dev,
+	  trunk/libmatroska/make/mingw32/test/test8.dev,
+	  trunk/libmatroska/make/vc6, trunk/libmatroska/make/vc6/lib,
+	  trunk/libmatroska/make/vc6/lib/static,
+	  trunk/libmatroska/make/vc6/lib/static/libmatroska.dsp,
+	  trunk/libmatroska/make/vc6/test,
+	  trunk/libmatroska/make/vc6/test/test0.dsp,
+	  trunk/libmatroska/make/vc6/test/test00.dsp,
+	  trunk/libmatroska/make/vc6/test/test1.dsp,
+	  trunk/libmatroska/make/vc6/test/test2.dsp,
+	  trunk/libmatroska/make/vc6/test/test3.dsp,
+	  trunk/libmatroska/make/vc6/test/test4.dsp,
+	  trunk/libmatroska/make/vc6/test/test5.dsp,
+	  trunk/libmatroska/make/vc6/test/test6.dsp,
+	  trunk/libmatroska/make/vc6/test/test6c.dsp,
+	  trunk/libmatroska/make/vc6/test/test7.dsp,
+	  trunk/libmatroska/make/vc6/test/test8.dsp,
+	  trunk/libmatroska/make/vc6/test/test8c.dsp,
+	  trunk/libmatroska/make/vc6/test/test9.dsp,
+	  trunk/libmatroska/make/vc6/vc6.dsw, trunk/libmatroska/make/vc7,
+	  trunk/libmatroska/make/vc7/lib,
+	  trunk/libmatroska/make/vc7/lib/static,
+	  trunk/libmatroska/make/vc7/lib/static/libmatroska.vcproj,
+	  trunk/libmatroska/make/vc7/test,
+	  trunk/libmatroska/make/vc7/test/test0.vcproj,
+	  trunk/libmatroska/make/vc7/test/test00.vcproj,
+	  trunk/libmatroska/make/vc7/test/test6.vcproj,
+	  trunk/libmatroska/make/vc7/test/test8.vcproj,
+	  trunk/libmatroska/make/vc7/test/test9.vcproj,
+	  trunk/libmatroska/make/vc7/vc7.sln, trunk/libmatroska/matroska,
+	  trunk/libmatroska/matroska/FileKax.h,
+	  trunk/libmatroska/matroska/KaxAttached.h,
+	  trunk/libmatroska/matroska/KaxAttachments.h,
+	  trunk/libmatroska/matroska/KaxBlock.h,
+	  trunk/libmatroska/matroska/KaxBlockData.h,
+	  trunk/libmatroska/matroska/KaxChapters.h,
+	  trunk/libmatroska/matroska/KaxCluster.h,
+	  trunk/libmatroska/matroska/KaxClusterData.h,
+	  trunk/libmatroska/matroska/KaxConfig.h,
+	  trunk/libmatroska/matroska/KaxContexts.h,
+	  trunk/libmatroska/matroska/KaxCues.h,
+	  trunk/libmatroska/matroska/KaxCuesData.h,
+	  trunk/libmatroska/matroska/KaxInfo.h,
+	  trunk/libmatroska/matroska/KaxInfoData.h,
+	  trunk/libmatroska/matroska/KaxSeekHead.h,
+	  trunk/libmatroska/matroska/KaxSegment.h,
+	  trunk/libmatroska/matroska/KaxTag.h,
+	  trunk/libmatroska/matroska/KaxTagMulti.h,
+	  trunk/libmatroska/matroska/KaxTags.h,
+	  trunk/libmatroska/matroska/KaxTrackAudio.h,
+	  trunk/libmatroska/matroska/KaxTrackEntryData.h,
+	  trunk/libmatroska/matroska/KaxTrackVideo.h,
+	  trunk/libmatroska/matroska/KaxTracks.h,
+	  trunk/libmatroska/matroska/KaxTypes.h,
+	  trunk/libmatroska/matroska/KaxVersion.h,
+	  trunk/libmatroska/matroska/c,
+	  trunk/libmatroska/matroska/c/libmatroska.h,
+	  trunk/libmatroska/matroska/c/libmatroska_t.h,
+	  trunk/libmatroska/src, trunk/libmatroska/src/FileKax.cpp,
+	  trunk/libmatroska/src/KaxAttached.cpp,
+	  trunk/libmatroska/src/KaxAttachments.cpp,
+	  trunk/libmatroska/src/KaxBlock.cpp,
+	  trunk/libmatroska/src/KaxBlockData.cpp,
+	  trunk/libmatroska/src/KaxChapters.cpp,
+	  trunk/libmatroska/src/KaxCluster.cpp,
+	  trunk/libmatroska/src/KaxClusterData.cpp,
+	  trunk/libmatroska/src/KaxContexts.cpp,
+	  trunk/libmatroska/src/KaxCues.cpp,
+	  trunk/libmatroska/src/KaxCuesData.cpp,
+	  trunk/libmatroska/src/KaxInfo.cpp,
+	  trunk/libmatroska/src/KaxInfoData.cpp,
+	  trunk/libmatroska/src/KaxSeekHead.cpp,
+	  trunk/libmatroska/src/KaxSegment.cpp,
+	  trunk/libmatroska/src/KaxTag.cpp,
+	  trunk/libmatroska/src/KaxTagMulti.cpp,
+	  trunk/libmatroska/src/KaxTags.cpp,
+	  trunk/libmatroska/src/KaxTrackAudio.cpp,
+	  trunk/libmatroska/src/KaxTrackEntryData.cpp,
+	  trunk/libmatroska/src/KaxTrackVideo.cpp,
+	  trunk/libmatroska/src/KaxTracks.cpp,
+	  trunk/libmatroska/src/KaxVersion.cpp,
+	  trunk/libmatroska/src/StdInclude.h, trunk/libmatroska/test,
+	  trunk/libmatroska/test/Makefile, trunk/libmatroska/test/ebml,
+	  trunk/libmatroska/test/ebml/Makefile,
+	  trunk/libmatroska/test/ebml/test0.cpp,
+	  trunk/libmatroska/test/ebml/test00.cpp,
+	  trunk/libmatroska/test/mux, trunk/libmatroska/test/mux/test6.cpp,
+	  trunk/libmatroska/test/mux/test8.cpp, trunk/libmatroska/test/tags,
+	  trunk/libmatroska/test/tags/test9.cpp,
+	  trunk/libmatroska/test/utf8,
+	  trunk/libmatroska/test/utf8/test5.cpp: Initial CVS version after
+	  the crash
+
diff --git a/LICENSE.LGPL b/LICENSE.LGPL
index b1e3f5a..cbee875 100644
--- a/LICENSE.LGPL
+++ b/LICENSE.LGPL
@@ -1,504 +1,504 @@
-		  GNU LESSER GENERAL PUBLIC LICENSE
-		       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-		  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-			    NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-
-
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/debian/changelog b/debian/changelog
index a5f9cb6..c19f20c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+libmatroska (1.0.0-1) lucid; urgency=low
+
+  * New version.
+
+ -- Moritz Bunkus <moritz at bunkus.org>  Sat, 05 Jun 2010 10:39:00 +0200
+
+libmatroska (0.9.0-1) karmic; urgency=low
+
+  * New version.
+
+ -- Moritz Bunkus <moritz at bunkus.org>  Sun, 09 May 2010 16:59:20 +0200
+
 libmatroska (0.8.1-1) unstable; urgency=low
 
   * New version.
diff --git a/debian/control b/debian/control
index b338900..3c3c0e1 100644
--- a/debian/control
+++ b/debian/control
@@ -1,13 +1,13 @@
 Source: libmatroska
 Priority: optional
 Maintainer: Moritz Bunkus <moritz at bunkus.org>
-Build-Depends: debhelper (>> 3.0.0), libebml-dev (>= 0.7.3-1)
+Build-Depends: debhelper (>> 3.0.0), libebml-dev (>= 1.0.0-1)
 Standards-Version: 3.5.8
 
 Package: libmatroska-dev
 Section: devel
 Architecture: any
-Depends: libebml-dev (>= 0.7.2-1)
+Depends: libebml-dev (>= 1.0.0-1)
 Description: an extensible open standard Audio/Video container format
  Matroska is aiming to become the standard of Multimedia
  Container Formats one day. It is based on EBML (Extensible Binary
diff --git a/debian/rules b/debian/rules
old mode 100755
new mode 100644
diff --git a/libmatroska.proj b/libmatroska.proj
index c453e9c..769c701 100644
--- a/libmatroska.proj
+++ b/libmatroska.proj
@@ -1,68 +1,76 @@
-Include "*/*.proj"
-
-LIB matroska
-{
-  INCLUDE .
-  INCLUDE ../libebml
-
-  USE ebml
-
-//  OPTIMIZE_GLOBALLY .
-  FAVOR_MAX_SPEED .
-  REDUCE_SIZE .
-  FASTER_FLOAT .
-  
-  SOURCE src/FileKax.cpp
-  SOURCE src/KaxAttached.cpp
-  SOURCE src/KaxAttachments.cpp
-  SOURCE src/KaxBlock.cpp
-  SOURCE src/KaxBlockData.cpp
-  SOURCE src/KaxChapters.cpp
-  SOURCE src/KaxCluster.cpp
-  SOURCE src/KaxClusterData.cpp
-  SOURCE src/KaxContentEncoding.cpp
-  SOURCE src/KaxContexts.cpp
-  SOURCE src/KaxCues.cpp
-  SOURCE src/KaxCuesData.cpp
-  SOURCE src/KaxInfo.cpp
-  SOURCE src/KaxInfoData.cpp
-  SOURCE src/KaxSeekHead.cpp
-  SOURCE src/KaxSegment.cpp
-  SOURCE src/KaxTag.cpp
-  SOURCE src/KaxTagMulti.cpp
-  SOURCE src/KaxTags.cpp
-  SOURCE src/KaxTrackAudio.cpp
-  SOURCE src/KaxTrackEntryData.cpp
-  SOURCE src/KaxTrackVideo.cpp
-  SOURCE src/KaxTracks.cpp
-  SOURCE src/KaxVersion.cpp
-
-  HEADER matroska/FileKax.h
-  HEADER matroska/KaxAttached.h
-  HEADER matroska/KaxAttachments.h
-  HEADER matroska/KaxBlock.h
-  HEADER matroska/KaxBlockData.h
-  HEADER matroska/KaxChapters.h
-  HEADER matroska/KaxCluster.h
-  HEADER matroska/KaxClusterData.h
-  HEADER matroska/KaxConfig.h
-  HEADER matroska/KaxContentEncoding.h
-  HEADER matroska/KaxContexts.h
-  HEADER matroska/KaxCues.h
-  HEADER matroska/KaxCuesData.h
-  HEADER matroska/KaxInfo.h
-  HEADER matroska/KaxInfoData.h
-  HEADER matroska/KaxSeekHead.h
-  HEADER matroska/KaxSegment.h
-  HEADER matroska/KaxTag.h
-  HEADER matroska/KaxTagMulti.h
-  HEADER matroska/KaxTags.h
-  HEADER matroska/KaxTrackAudio.h
-  HEADER matroska/KaxTrackEntryData.h
-  HEADER matroska/KaxTrackVideo.h
-  HEADER matroska/KaxTracks.h
-  HEADER matroska/KaxTypes.h
-  HEADER matroska/KaxVersion.h
-  HEADER matroska/c/libmatroska_t.h
-  HEADER matroska/c/libmatroska.h
-}
+Include "*/*.proj"
+
+LIB matroska
+{
+  PROJECT_VERSION 1.0.0
+
+  INCLUDE .
+  EXPINCLUDE .
+
+  IF HAVE_EBML2
+    USE ebml2_legacy
+  ELSE
+    USE ebml
+    USEINCLUDE corec // so that stdafx implied by ebml2_legacy can build
+  ENDIF
+
+//  OPTIMIZE_GLOBALLY .
+  FAVOR_MAX_SPEED .
+  REDUCE_SIZE .
+  FASTER_FLOAT .
+  
+  SOURCE src/FileKax.cpp
+  SOURCE src/KaxAttached.cpp
+  SOURCE src/KaxAttachments.cpp
+  SOURCE src/KaxBlock.cpp
+  SOURCE src/KaxBlockData.cpp
+  SOURCE src/KaxChapters.cpp
+  SOURCE src/KaxCluster.cpp
+  SOURCE src/KaxClusterData.cpp
+  SOURCE src/KaxContentEncoding.cpp
+  SOURCE src/KaxContexts.cpp
+  SOURCE src/KaxCues.cpp
+  SOURCE src/KaxCuesData.cpp
+  SOURCE src/KaxInfo.cpp
+  SOURCE src/KaxInfoData.cpp
+  SOURCE src/KaxSeekHead.cpp
+  SOURCE src/KaxSegment.cpp
+  SOURCE src/KaxTag.cpp
+  SOURCE src/KaxTagMulti.cpp
+  SOURCE src/KaxTags.cpp
+  SOURCE src/KaxTrackAudio.cpp
+  SOURCE src/KaxTrackEntryData.cpp
+  SOURCE src/KaxTrackVideo.cpp
+  SOURCE src/KaxTracks.cpp
+  SOURCE src/KaxVersion.cpp
+
+  HEADER matroska/FileKax.h
+  HEADER matroska/KaxAttached.h
+  HEADER matroska/KaxAttachments.h
+  HEADER matroska/KaxBlock.h
+  HEADER matroska/KaxBlockData.h
+  HEADER matroska/KaxChapters.h
+  HEADER matroska/KaxCluster.h
+  HEADER matroska/KaxClusterData.h
+  HEADER matroska/KaxConfig.h
+  HEADER matroska/KaxContentEncoding.h
+  HEADER matroska/KaxContexts.h
+  HEADER matroska/KaxCues.h
+  HEADER matroska/KaxCuesData.h
+  HEADER matroska/KaxDefines.h
+  HEADER matroska/KaxInfo.h
+  HEADER matroska/KaxInfoData.h
+  HEADER matroska/KaxSeekHead.h
+  HEADER matroska/KaxSegment.h
+  HEADER matroska/KaxTag.h
+  HEADER matroska/KaxTagMulti.h
+  HEADER matroska/KaxTags.h
+  HEADER matroska/KaxTrackAudio.h
+  HEADER matroska/KaxTrackEntryData.h
+  HEADER matroska/KaxTrackVideo.h
+  HEADER matroska/KaxTracks.h
+  HEADER matroska/KaxTypes.h
+  HEADER matroska/KaxVersion.h
+  HEADER matroska/c/libmatroska_t.h
+  HEADER matroska/c/libmatroska.h
+}
diff --git a/make/Doxyfile b/make/Doxyfile
index be25f52..e9e0cb9 100644
--- a/make/Doxyfile
+++ b/make/Doxyfile
@@ -1,211 +1,211 @@
-# Doxyfile 1.3
-
-#---------------------------------------------------------------------------
-# General configuration options
-#---------------------------------------------------------------------------
-PROJECT_NAME           = libmatroska
-PROJECT_NUMBER         = 0.5.0
-OUTPUT_DIRECTORY       = ../../doc/src
-OUTPUT_LANGUAGE        = English
-USE_WINDOWS_ENCODING   = YES
-EXTRACT_ALL            = YES
-EXTRACT_PRIVATE        = NO
-EXTRACT_STATIC         = YES
-EXTRACT_LOCAL_CLASSES  = YES
-HIDE_UNDOC_MEMBERS     = NO
-HIDE_UNDOC_CLASSES     = NO
-HIDE_FRIEND_COMPOUNDS  = NO
-HIDE_IN_BODY_DOCS      = NO
-BRIEF_MEMBER_DESC      = YES
-REPEAT_BRIEF           = YES
-ALWAYS_DETAILED_SEC    = NO
-INLINE_INHERITED_MEMB  = YES
-FULL_PATH_NAMES        = NO
-STRIP_FROM_PATH        = 
-INTERNAL_DOCS          = NO
-CASE_SENSE_NAMES       = YES
-SHORT_NAMES            = NO
-HIDE_SCOPE_NAMES       = NO
-VERBATIM_HEADERS       = YES
-SHOW_INCLUDE_FILES     = NO
-JAVADOC_AUTOBRIEF      = YES
-MULTILINE_CPP_IS_BRIEF = NO
-DETAILS_AT_TOP         = YES
-INHERIT_DOCS           = YES
-INLINE_INFO            = YES
-SORT_MEMBER_DOCS       = NO
-DISTRIBUTE_GROUP_DOC   = NO
-TAB_SIZE               = 2
-GENERATE_TODOLIST      = YES
-GENERATE_TESTLIST      = YES
-GENERATE_BUGLIST       = YES
-GENERATE_DEPRECATEDLIST= YES
-ALIASES                = 
-ENABLED_SECTIONS       = 
-MAX_INITIALIZER_LINES  = 30
-OPTIMIZE_OUTPUT_FOR_C  = NO
-OPTIMIZE_OUTPUT_JAVA   = NO
-SHOW_USED_FILES        = YES
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET                  = NO
-WARNINGS               = YES
-WARN_IF_UNDOCUMENTED   = YES
-WARN_IF_DOC_ERROR      = YES
-WARN_FORMAT            = "$file:$line: $text"
-WARN_LOGFILE           = 
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT                  = ../../libebml/src \
-                         ../../libebml/src/platform/win32 \
-                         ../../libebml/ebml \
-                         ../../libebml/ebml/c \
-                         ../src \
-												 ../matroska \
-                         ../matroska/c
-FILE_PATTERNS          = *.cpp \
-                         *.h
-RECURSIVE              = NO
-EXCLUDE                = 
-EXCLUDE_SYMLINKS       = NO
-EXCLUDE_PATTERNS       = 
-EXAMPLE_PATH           = 
-EXAMPLE_PATTERNS       = 
-EXAMPLE_RECURSIVE      = NO
-IMAGE_PATH             = 
-INPUT_FILTER           = 
-FILTER_SOURCE_FILES    = NO
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER         = YES
-INLINE_SOURCES         = NO
-STRIP_CODE_COMMENTS    = YES
-REFERENCED_BY_RELATION = NO
-REFERENCES_RELATION    = YES
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX     = NO
-COLS_IN_ALPHA_INDEX    = 5
-IGNORE_PREFIX          = 
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML          = YES
-HTML_OUTPUT            = html
-HTML_FILE_EXTENSION    = .html
-HTML_HEADER            = 
-HTML_FOOTER            = 
-HTML_STYLESHEET        = libmatroska.css
-HTML_ALIGN_MEMBERS     = YES
-GENERATE_HTMLHELP      = NO
-CHM_FILE               = 
-HHC_LOCATION           = 
-GENERATE_CHI           = NO
-BINARY_TOC             = NO
-TOC_EXPAND             = NO
-DISABLE_INDEX          = NO
-ENUM_VALUES_PER_LINE   = 4
-GENERATE_TREEVIEW      = NO
-TREEVIEW_WIDTH         = 250
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX         = YES
-LATEX_OUTPUT           = latex
-LATEX_CMD_NAME         = latex
-MAKEINDEX_CMD_NAME     = makeindex
-COMPACT_LATEX          = YES
-PAPER_TYPE             = a4wide
-EXTRA_PACKAGES         = 
-LATEX_HEADER           = 
-PDF_HYPERLINKS         = YES
-USE_PDFLATEX           = YES
-LATEX_BATCHMODE        = NO
-LATEX_HIDE_INDICES     = NO
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF           = YES
-RTF_OUTPUT             = rtf
-COMPACT_RTF            = NO
-RTF_HYPERLINKS         = YES
-RTF_STYLESHEET_FILE    = 
-RTF_EXTENSIONS_FILE    = 
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN           = NO
-MAN_OUTPUT             = man
-MAN_EXTENSION          = .3
-MAN_LINKS              = YES
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML           = NO
-XML_SCHEMA             = 
-XML_DTD                = 
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF   = NO
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD       = NO
-PERLMOD_LATEX          = NO
-PERLMOD_PRETTY         = YES
-PERLMOD_MAKEVAR_PREFIX = 
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING   = YES
-MACRO_EXPANSION        = NO
-EXPAND_ONLY_PREDEF     = NO
-SEARCH_INCLUDES        = YES
-INCLUDE_PATH           = 
-INCLUDE_FILE_PATTERNS  = 
-PREDEFINED             = 
-EXPAND_AS_DEFINED      = 
-SKIP_FUNCTION_MACROS   = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to external references   
-#---------------------------------------------------------------------------
-TAGFILES               = 
-GENERATE_TAGFILE       = 
-ALLEXTERNALS           = NO
-EXTERNAL_GROUPS        = YES
-PERL_PATH              = /usr/bin/perl
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS         = YES
-HIDE_UNDOC_RELATIONS   = YES
-HAVE_DOT               = NO
-CLASS_GRAPH            = YES
-COLLABORATION_GRAPH    = YES
-TEMPLATE_RELATIONS     = YES
-INCLUDE_GRAPH          = YES
-INCLUDED_BY_GRAPH      = YES
-GRAPHICAL_HIERARCHY    = YES
-DOT_IMAGE_FORMAT       = png
-DOT_PATH               = 
-DOTFILE_DIRS           = 
-MAX_DOT_GRAPH_WIDTH    = 1024
-MAX_DOT_GRAPH_HEIGHT   = 1024
-MAX_DOT_GRAPH_DEPTH    = 0
-GENERATE_LEGEND        = YES
-DOT_CLEANUP            = YES
-#---------------------------------------------------------------------------
-# Configuration::addtions related to the search engine   
-#---------------------------------------------------------------------------
-SEARCHENGINE           = NO
-CGI_NAME               = search.cgi
-CGI_URL                = 
-DOC_URL                = 
-DOC_ABSPATH            = 
-BIN_ABSPATH            = /usr/local/bin/
-EXT_DOC_PATHS          = 
+# Doxyfile 1.3
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = libmatroska
+PROJECT_NUMBER         = 0.5.0
+OUTPUT_DIRECTORY       = ../../doc/src
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = YES
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = NO
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = YES
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = YES
+SHORT_NAMES            = NO
+HIDE_SCOPE_NAMES       = NO
+VERBATIM_HEADERS       = YES
+SHOW_INCLUDE_FILES     = NO
+JAVADOC_AUTOBRIEF      = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = YES
+INHERIT_DOCS           = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = NO
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 2
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ALIASES                = 
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+OPTIMIZE_OUTPUT_FOR_C  = NO
+OPTIMIZE_OUTPUT_JAVA   = NO
+SHOW_USED_FILES        = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = ../../libebml/src \
+                         ../../libebml/src/platform/win32 \
+                         ../../libebml/ebml \
+                         ../../libebml/ebml/c \
+                         ../src \
+												 ../matroska \
+                         ../matroska/c
+FILE_PATTERNS          = *.cpp \
+                         *.h
+RECURSIVE              = NO
+EXCLUDE                = 
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION    = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = libmatroska.css
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = YES
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = YES
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = YES
+USE_PDFLATEX           = YES
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = YES
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = YES
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = YES
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_SCHEMA             = 
+XML_DTD                = 
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+TEMPLATE_RELATIONS     = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+GRAPHICAL_HIERARCHY    = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+CGI_NAME               = search.cgi
+CGI_URL                = 
+DOC_URL                = 
+DOC_ABSPATH            = 
+BIN_ABSPATH            = /usr/local/bin/
+EXT_DOC_PATHS          = 
diff --git a/make/cygwin/Makefile b/make/cygwin/Makefile
index b1fac6f..b0d8308 100644
--- a/make/cygwin/Makefile
+++ b/make/cygwin/Makefile
@@ -1,60 +1,60 @@
-# libmatroska core Makefile (used in cygwin)
-# $Id: Makefile 640 2004-07-09 21:05:36Z mosu $
-
-# Options
-EXTENSION=.cpp
-CXXFLAGS=-g -DDEBUG -Wall -Wno-unknown-pragmas -DWIN32 -DNO_NAMESPACE
-LDFLAGS=
-
-SRC_DIR=../../src/
-
-# Programs
-CXX=g++ -c
-LD=g++
-DEP=$(CXX) -MM
-DEPEND = makedepend
-AR = ar rcvu
-RANLIB = ranlib
-
-# Librarires
-INCLUDE=
-LIBS=
-
-# Names
-PROGRAM=libmatroska.a
-
-# source-files
-sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
-
-# header files; replace .cxx extension with .h
-headers:=$(patsubst %$(EXTENSION),%.hpp,$(sources))
-
-# files holding dependency information; replace .cxx extension with .dep
-dependencies:=$(patsubst %$(EXTENSION),%.dep,$(sources))
-
-# object files; replace .cxx extension with .o
-objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
-
-DEPENDFLAGS  = ${CXXFLAGS} ${INCLUDE}
-
-# Build rules
-%.o: %$(EXTENSION)
-	$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $<
-
-$(PROGRAM): $(objects)
-	$(AR) $@ $(objects)
-	$(RANLIB) $@
-#	$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
-#	${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
-
-clean:
-	rm -f ${SRC_DIR}$(objects)
-	rm -f ${SRC_DIR}$(dependencies)
-	rm -f ${SRC_DIR}$(PROGRAM)
-	rm -f CORE
-
-# what are the source dependencies
-depend: $(sources)
-	$(DEPEND) $(DEPENDFLAGS) $(sources)
-
-# DO NOT DELETE
+# libmatroska core Makefile (used in cygwin)
+# $Id: Makefile 640 2004-07-09 21:05:36Z mosu $
+
+# Options
+EXTENSION=.cpp
+CXXFLAGS=-g -DDEBUG -Wall -Wno-unknown-pragmas -DWIN32 -DNO_NAMESPACE
+LDFLAGS=
+
+SRC_DIR=../../src/
+
+# Programs
+CXX=g++ -c
+LD=g++
+DEP=$(CXX) -MM
+DEPEND = makedepend
+AR = ar rcvu
+RANLIB = ranlib
+
+# Librarires
+INCLUDE=
+LIBS=
+
+# Names
+PROGRAM=libmatroska.a
+
+# source-files
+sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
+
+# header files; replace .cxx extension with .h
+headers:=$(patsubst %$(EXTENSION),%.hpp,$(sources))
+
+# files holding dependency information; replace .cxx extension with .dep
+dependencies:=$(patsubst %$(EXTENSION),%.dep,$(sources))
+
+# object files; replace .cxx extension with .o
+objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
+
+DEPENDFLAGS  = ${CXXFLAGS} ${INCLUDE}
+
+# Build rules
+%.o: %$(EXTENSION)
+	$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $<
+
+$(PROGRAM): $(objects)
+	$(AR) $@ $(objects)
+	$(RANLIB) $@
+#	$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
+#	${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
+
+clean:
+	rm -f ${SRC_DIR}$(objects)
+	rm -f ${SRC_DIR}$(dependencies)
+	rm -f ${SRC_DIR}$(PROGRAM)
+	rm -f CORE
+
+# what are the source dependencies
+depend: $(sources)
+	$(DEPEND) $(DEPENDFLAGS) $(sources)
+
+# DO NOT DELETE
diff --git a/make/cygwin/Makefile.rule b/make/cygwin/Makefile.rule
index 21c2b5a..2b9b7e2 100644
--- a/make/cygwin/Makefile.rule
+++ b/make/cygwin/Makefile.rule
@@ -1,98 +1,98 @@
-##
-## This Makefile is made for cygwin, but might probably work on any standard UNIX too
-##
-
-#****************************************************************************
-
-# DEBUG can be set to YES to include debugging info, or NO otherwise
-DEBUG          = YES
-
-# PROFILE can be set to YES to include profiling info, or NO otherwise
-PROFILE        = NO
-
-#****************************************************************************
-
-CC     = gcc
-CXX    = g++
-LD     = gcc
-AR     = ar rcvu
-RANLIB = ranlib
-DEPEND = makedepend
-INDENT =indent --gnu-style -ut -ts6 -br -npsl -npcs
-DELETE =rm -f
-
-GLOBAL_CFLAGS   = -Wall -Wno-unknown-pragmas -Wno-format 
-DEBUG_CFLAGS    = -g -O0 -DDEBUG ${GLOBAL_CFLAGS}
-RELEASE_CFLAGS  =  -O2 ${GLOBAL_CFLAGS}
-
-P_OPTIONS = -pedantic
-
-LIBS =
-
-DEBUG_CXXFLAGS   = ${DEBUG_CFLAGS}
-RELEASE_CXXFLAGS = ${RELEASE_CFLAGS}
-
-DEBUG_LDFLAGS    = -g
-RELEASE_LDFLAGS  =
-
-ifeq (YES, ${DEBUG})
-   CFLAGS       = ${DEBUG_CFLAGS} ${INCS} ${P_OPTIONS}
-   CXXFLAGS     = ${DEBUG_CXXFLAGS} ${INCS} ${P_OPTIONS}
-   LDFLAGS      = ${DEBUG_LDFLAGS}
-   DEPENDFLAGS  = ${DEBUG_CFLAGS} ${INCS}
-else
-   CFLAGS       = ${RELEASE_CFLAGS} ${INCS} ${P_OPTIONS}
-   CXXFLAGS     = ${RELEASE_CXXFLAGS} ${INCS} ${P_OPTIONS}
-   LDFLAGS      = ${RELEASE_LDFLAGS}
-   DEPENDFLAGS  = ${RELEASE_CFLAGS} ${INCS}
-endif
-
-ifeq (YES, ${PROFILE})
-   CFLAGS   := ${CFLAGS} -pg
-   CXXFLAGS := ${CXXFLAGS} -pg
-   LDFLAGS  := ${LDFLAGS} -pg
-endif
-
-#****************************************************************************
-# Preprocessor directives
-#****************************************************************************
-
-ifeq (YES, ${PROFILE})
-  DEFS =
-else
-  DEFS =
-endif
-
-#****************************************************************************
-# Include paths
-#****************************************************************************
-
-#INCS := -I/usr/include/g++-2 -I/usr/local/include
-#INCS =
-
-
-#****************************************************************************
-# Makefile code common to all platforms
-#****************************************************************************
-
-CFLAGS   := ${CFLAGS}   ${DEFS}
-CXXFLAGS := ${CXXFLAGS} ${DEFS}
-
-#****************************************************************************
-# General rules
-#****************************************************************************
-
-indent:
-	$(INDENT) --line-length 100 ${SRCS} ${SRCS_HEADERS}
-	$(DELETE) *.*~
-
-indent80:
-	$(INDENT) --line-length 80 ${SRCS} ${SRCS_HEADERS}
-	$(DELETE) *.*~
-
-clean:
-	rm -f core *.o *.so *.a *.exe
-
-# what are the source dependencies
-depend: $(SRCS)
-	$(DEPEND) $(DEPENDFLAGS) $(SRCS)
+##
+## This Makefile is made for cygwin, but might probably work on any standard UNIX too
+##
+
+#****************************************************************************
+
+# DEBUG can be set to YES to include debugging info, or NO otherwise
+DEBUG          = YES
+
+# PROFILE can be set to YES to include profiling info, or NO otherwise
+PROFILE        = NO
+
+#****************************************************************************
+
+CC     = gcc
+CXX    = g++
+LD     = gcc
+AR     = ar rcvu
+RANLIB = ranlib
+DEPEND = makedepend
+INDENT =indent --gnu-style -ut -ts6 -br -npsl -npcs
+DELETE =rm -f
+
+GLOBAL_CFLAGS   = -Wall -Wno-unknown-pragmas -Wno-format 
+DEBUG_CFLAGS    = -g -O0 -DDEBUG ${GLOBAL_CFLAGS}
+RELEASE_CFLAGS  =  -O2 ${GLOBAL_CFLAGS}
+
+P_OPTIONS = -pedantic
+
+LIBS =
+
+DEBUG_CXXFLAGS   = ${DEBUG_CFLAGS}
+RELEASE_CXXFLAGS = ${RELEASE_CFLAGS}
+
+DEBUG_LDFLAGS    = -g
+RELEASE_LDFLAGS  =
+
+ifeq (YES, ${DEBUG})
+   CFLAGS       = ${DEBUG_CFLAGS} ${INCS} ${P_OPTIONS}
+   CXXFLAGS     = ${DEBUG_CXXFLAGS} ${INCS} ${P_OPTIONS}
+   LDFLAGS      = ${DEBUG_LDFLAGS}
+   DEPENDFLAGS  = ${DEBUG_CFLAGS} ${INCS}
+else
+   CFLAGS       = ${RELEASE_CFLAGS} ${INCS} ${P_OPTIONS}
+   CXXFLAGS     = ${RELEASE_CXXFLAGS} ${INCS} ${P_OPTIONS}
+   LDFLAGS      = ${RELEASE_LDFLAGS}
+   DEPENDFLAGS  = ${RELEASE_CFLAGS} ${INCS}
+endif
+
+ifeq (YES, ${PROFILE})
+   CFLAGS   := ${CFLAGS} -pg
+   CXXFLAGS := ${CXXFLAGS} -pg
+   LDFLAGS  := ${LDFLAGS} -pg
+endif
+
+#****************************************************************************
+# Preprocessor directives
+#****************************************************************************
+
+ifeq (YES, ${PROFILE})
+  DEFS =
+else
+  DEFS =
+endif
+
+#****************************************************************************
+# Include paths
+#****************************************************************************
+
+#INCS := -I/usr/include/g++-2 -I/usr/local/include
+#INCS =
+
+
+#****************************************************************************
+# Makefile code common to all platforms
+#****************************************************************************
+
+CFLAGS   := ${CFLAGS}   ${DEFS}
+CXXFLAGS := ${CXXFLAGS} ${DEFS}
+
+#****************************************************************************
+# General rules
+#****************************************************************************
+
+indent:
+	$(INDENT) --line-length 100 ${SRCS} ${SRCS_HEADERS}
+	$(DELETE) *.*~
+
+indent80:
+	$(INDENT) --line-length 80 ${SRCS} ${SRCS_HEADERS}
+	$(DELETE) *.*~
+
+clean:
+	rm -f core *.o *.so *.a *.exe
+
+# what are the source dependencies
+depend: $(SRCS)
+	$(DEPEND) $(DEPENDFLAGS) $(SRCS)
diff --git a/make/linux/Makefile b/make/linux/Makefile
index a20475e..feddae9 100644
--- a/make/linux/Makefile
+++ b/make/linux/Makefile
@@ -1,181 +1,178 @@
-# libmatroska core Makefile (used in cygwin)
-# $Id: Makefile 1254 2006-06-02 14:32:52Z mosu $
-# Author: Steve Lhomme <robux4 @ users.sf.net>
-# Author: Moritz Bunkus <moritz @ bunkus.org>
-
-#
-# The library is built without debug information. If you want
-# debug information to be included then compile with
-# 'make DEBUG=yes'.
-#
-
-# Paths
-# BeOS wants the libs and headers in /boot/home/config
-ifeq (BeOS,$(shell uname -s))
-prefix=/boot/home/config
-else
-prefix=/usr/local
-endif
-libdir=$(prefix)/lib
-includedir=$(prefix)/include/matroska
-
-# Programs
-CXX=g++
-LD=$(CXX)
-AR = ar rcvu
-RANLIB = ranlib
-INSTALL = install
-INSTALL_OPTS = -m 644
-INSTALL_OPTS_LIB = -m 644
-INSTALL_DIR_OPTS = -m 755
-
-ifneq (,$(shell $(CXX) -v 2>&1 | tail -n 1 | grep -i mingw))
-$(error Please use the Makefile in ../mingw32)
-endif
-
-CWD=$(shell pwd)
-
-# Options
-LIBEBML_INCLUDE_DIR=$(CWD)/../../../libebml
-LIBEBML_LIB_DIR=$(CWD)/../../../libebml/make/linux
-EXTENSION=.cpp
-
-ifeq (yes,$(DEBUG))
-DEBUGFLAGS=-g -DDEBUG
-endif
-
-SRC_DIR=$(CWD)/../../src/
-INCLUDE_DIR=$(CWD)/../../matroska
-MUX_SRC_DIR=$(CWD)/../../test/mux/
-TAG_SRC_DIR=$(CWD)/../../test/tags/
-
-# Librarires
-INCLUDE=-I$(CWD)/../.. -I$(LIBEBML_INCLUDE_DIR)
-LIBS=
-MUX_LIBS=-lmatroska -lebml $(LIBICONV)
-
-# Names
-LIBRARY=libmatroska.a
-LIBRARY_SO=libmatroska.so
-LIBRARY_SO_VER=libmatroska.so.0
-
-# source-files
-sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
-
-# header files; replace .cxx extension with .h
-headers:=$(patsubst %$(EXTENSION),%.h,$(sources))
-
-# object files; replace .cxx extension with .o
-objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
-
-objects_so:=$(patsubst %$(EXTENSION),%.lo,$(sources))
-
-WARNINGFLAGS=-Wall -Wno-unknown-pragmas -ansi -fno-gnu-keywords -D_GNU_SOURCE \
-		-Wshadow
-COMPILEFLAGS=$(DEBUGFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(WARNINGFLAGS) $(INCLUDE)
-LINKFLAGS=-L. -L$(LIBEBML_LIB_DIR) $(LDFLAGS)
-DEPENDFLAGS  = $(CXXFLAGS) $(INCLUDE)
-
-ifeq (Darwin,$(shell uname -s))
-all: staticlib
-else
-all: staticlib sharedlib
-endif
-
-staticlib: $(LIBRARY)
-
-sharedlib: $(LIBRARY_SO)
-
-lib:
-	@echo "Use the 'staticlib', 'sharedlib' or 'all' targets."
-	@false
-
-# Build rules
-%.o: %$(EXTENSION)
-	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
-
-%.lo: %$(EXTENSION)
-	$(CXX) -c $(COMPILEFLAGS) -fPIC -o $@ $<
-
-$(LIBRARY): $(objects)
-	$(AR) $@ $(objects)
-	$(RANLIB) $@
-
-$(LIBRARY_SO): $(objects_so)
-	$(CXX) -shared -Wl,-soname,$(LIBRARY_SO_VER) -o $(LIBRARY_SO_VER) $(objects_so) -lebml
-	rm -f $(LIBRARY_SO)
-	ln -s $(LIBRARY_SO_VER) $(LIBRARY_SO)
-
-clean:	cleantest
-	rm -f $(objects) $(objects_so)
-	rm -f $(LIBRARY)
-	rm -f $(LIBRARY_SO)
-	rm -f $(LIBRARY_SO_VER)
-	rm -f CORE
-
-cleantest:
-	rm -f test6 test8 test9 test6.o test8.o test9.o
-
-distclean dist-clean: clean
-	rm -f .depend
-
-depend:
-	@echo Calculating dependecies:
-	@rm -f .depend
-	@touch .depend
-	@for i in $(sources); do \
-		o="`echo $$i | sed -e 's/\.c$$/.o/' -e 's/\.cpp$$/.o/'`" ; \
-		echo '  ' $$i: $$o ; \
-		$(CXX) $(DEPENDFLAGS) -MM -MT $$o $$i >> .depend ; \
-	done
-
-test: test6 test9
-
-test6:	test6.o $(LIBRARY) $(LIBRARY_SO)
-	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
-
-test6.o: $(MUX_SRC_DIR)test6.cpp
-	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
-
-test8:	test8.o $(LIBRARY) $(LIBRARY_SO)
-	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
-
-test8.o: $(MUX_SRC_DIR)test8.cpp
-	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
-
-test9:	test9.o $(LIBRARY) $(LIBRARY_SO)
-	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
-
-test9.o: $(TAG_SRC_DIR)test9.cpp
-	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
-
-ifeq (Darwin,$(shell uname -s))
-install: install_staticlib install_headers
-else
-install: install_staticlib install_sharedlib install_headers
-endif
-
-install_headers:
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)
-	for i in $(INCLUDE_DIR)/*.h; do \
-		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir) ; \
-	done
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)/c
-	for i in $(INCLUDE_DIR)/c/*.h; do \
-		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir)/c ; \
-	done
-
-install_staticlib: $(LIBRARY)
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
-	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(libdir)
-
-install_sharedlib: $(LIBRARY_SO)
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
-	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO_VER) $(libdir)
-	ln -fs $(LIBRARY_SO_VER) $(libdir)/$(LIBRARY_SO)
-
-ifneq ($(wildcard .depend),)
-include .depend
-endif
-
-# DO NOT DELETE
+# libmatroska core Makefile (used in cygwin)
+# $Id: Makefile 1254 2006-06-02 14:32:52Z mosu $
+# Author: Steve Lhomme <robux4 @ users.sf.net>
+# Author: Moritz Bunkus <moritz @ bunkus.org>
+
+#
+# The library is built without debug information. If you want
+# debug information to be included then compile with
+# 'make DEBUG=yes'.
+#
+
+# Paths
+# BeOS wants the libs and headers in /boot/home/config
+ifeq (BeOS,$(shell uname -s))
+prefix=/boot/home/config
+else
+prefix=/usr/local
+endif
+libdir=$(prefix)/lib
+includedir=$(prefix)/include/matroska
+
+# Programs
+CROSS =
+CXX = $(CROSS)g++
+LD = $(CXX)
+AR = $(CROSS)ar
+RANLIB = $(CROSS)ranlib
+INSTALL = install
+INSTALL_OPTS = -m 644
+INSTALL_OPTS_LIB = -m 644
+INSTALL_DIR_OPTS = -m 755
+
+CWD=$(shell pwd)
+
+# Options
+LIBEBML_INCLUDE_DIR=$(CWD)/../../../libebml
+LIBEBML_LIB_DIR=$(CWD)/../../../libebml/make/linux
+EXTENSION=.cpp
+
+ifeq (yes,$(DEBUG))
+DEBUGFLAGS=-g -DDEBUG
+endif
+
+SRC_DIR=$(CWD)/../../src/
+INCLUDE_DIR=$(CWD)/../../matroska
+MUX_SRC_DIR=$(CWD)/../../test/mux/
+TAG_SRC_DIR=$(CWD)/../../test/tags/
+
+# Librarires
+INCLUDE=-I$(CWD)/../.. -I$(LIBEBML_INCLUDE_DIR)
+LIBS=
+MUX_LIBS=-lmatroska -lebml $(LIBICONV)
+
+# Names
+LIBRARY=libmatroska.a
+LIBRARY_SO=libmatroska.so
+LIBRARY_SO_VER=libmatroska.so.2
+
+# source-files
+sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
+
+# header files; replace .cxx extension with .h
+headers:=$(patsubst %$(EXTENSION),%.h,$(sources))
+
+# object files; replace .cxx extension with .o
+objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
+
+objects_so:=$(patsubst %$(EXTENSION),%.lo,$(sources))
+
+WARNINGFLAGS=-Wall -Wno-unknown-pragmas -ansi -fno-gnu-keywords -D_GNU_SOURCE \
+		-Wshadow
+COMPILEFLAGS=$(DEBUGFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(WARNINGFLAGS) $(INCLUDE)
+LINKFLAGS=-L. -L$(LIBEBML_LIB_DIR) $(LDFLAGS)
+DEPENDFLAGS  = $(CXXFLAGS) $(INCLUDE)
+
+ifeq (Darwin,$(shell uname -s))
+all: staticlib
+else
+all: staticlib sharedlib
+endif
+
+staticlib: $(LIBRARY)
+
+sharedlib: $(LIBRARY_SO)
+
+lib:
+	@echo "Use the 'staticlib', 'sharedlib' or 'all' targets."
+	@false
+
+# Build rules
+%.o: %$(EXTENSION)
+	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
+
+%.lo: %$(EXTENSION)
+	$(CXX) -c $(COMPILEFLAGS) -fPIC -o $@ $<
+
+$(LIBRARY): $(objects)
+	$(AR) rcvu $@ $(objects)
+	$(RANLIB) $@
+
+$(LIBRARY_SO): $(objects_so)
+	$(CXX) -shared -Wl,-soname,$(LIBRARY_SO_VER) -o $(LIBRARY_SO_VER) $(objects_so) -lebml
+	rm -f $(LIBRARY_SO)
+	ln -s $(LIBRARY_SO_VER) $(LIBRARY_SO)
+
+clean:	cleantest
+	rm -f $(objects) $(objects_so)
+	rm -f $(LIBRARY)
+	rm -f $(LIBRARY_SO)
+	rm -f $(LIBRARY_SO_VER)
+	rm -f CORE
+
+cleantest:
+	rm -f test6 test8 test9 test6.o test8.o test9.o
+
+distclean dist-clean: clean
+	rm -f .depend
+
+depend:
+	@echo Calculating dependecies:
+	@rm -f .depend
+	@touch .depend
+	@for i in $(sources); do \
+		o="`echo $$i | sed -e 's/\.c$$/.o/' -e 's/\.cpp$$/.o/'`" ; \
+		echo '  ' $$i: $$o ; \
+		$(CXX) $(DEPENDFLAGS) -MM -MT $$o $$i >> .depend ; \
+	done
+
+test: test6 test9
+
+test6:	test6.o $(LIBRARY) $(LIBRARY_SO)
+	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
+
+test6.o: $(MUX_SRC_DIR)test6.cpp
+	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
+
+test8:	test8.o $(LIBRARY) $(LIBRARY_SO)
+	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
+
+test8.o: $(MUX_SRC_DIR)test8.cpp
+	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
+
+test9:	test9.o $(LIBRARY) $(LIBRARY_SO)
+	$(LD) -o $@ $(LINKFLAGS) $< $(MUX_LIBS)
+
+test9.o: $(TAG_SRC_DIR)test9.cpp
+	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
+
+ifeq (Darwin,$(shell uname -s))
+install: install_staticlib install_headers
+else
+install: install_staticlib install_sharedlib install_headers
+endif
+
+install_headers:
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)
+	for i in $(INCLUDE_DIR)/*.h; do \
+		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir) ; \
+	done
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)/c
+	for i in $(INCLUDE_DIR)/c/*.h; do \
+		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir)/c ; \
+	done
+
+install_staticlib: $(LIBRARY)
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
+	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(libdir)
+
+install_sharedlib: $(LIBRARY_SO)
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
+	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO_VER) $(libdir)
+	ln -fs $(LIBRARY_SO_VER) $(libdir)/$(LIBRARY_SO)
+
+ifneq ($(wildcard .depend),)
+include .depend
+endif
+
+# DO NOT DELETE
diff --git a/make/linux/Makefile.rule b/make/linux/Makefile.rule
index 21c2b5a..2b9b7e2 100644
--- a/make/linux/Makefile.rule
+++ b/make/linux/Makefile.rule
@@ -1,98 +1,98 @@
-##
-## This Makefile is made for cygwin, but might probably work on any standard UNIX too
-##
-
-#****************************************************************************
-
-# DEBUG can be set to YES to include debugging info, or NO otherwise
-DEBUG          = YES
-
-# PROFILE can be set to YES to include profiling info, or NO otherwise
-PROFILE        = NO
-
-#****************************************************************************
-
-CC     = gcc
-CXX    = g++
-LD     = gcc
-AR     = ar rcvu
-RANLIB = ranlib
-DEPEND = makedepend
-INDENT =indent --gnu-style -ut -ts6 -br -npsl -npcs
-DELETE =rm -f
-
-GLOBAL_CFLAGS   = -Wall -Wno-unknown-pragmas -Wno-format 
-DEBUG_CFLAGS    = -g -O0 -DDEBUG ${GLOBAL_CFLAGS}
-RELEASE_CFLAGS  =  -O2 ${GLOBAL_CFLAGS}
-
-P_OPTIONS = -pedantic
-
-LIBS =
-
-DEBUG_CXXFLAGS   = ${DEBUG_CFLAGS}
-RELEASE_CXXFLAGS = ${RELEASE_CFLAGS}
-
-DEBUG_LDFLAGS    = -g
-RELEASE_LDFLAGS  =
-
-ifeq (YES, ${DEBUG})
-   CFLAGS       = ${DEBUG_CFLAGS} ${INCS} ${P_OPTIONS}
-   CXXFLAGS     = ${DEBUG_CXXFLAGS} ${INCS} ${P_OPTIONS}
-   LDFLAGS      = ${DEBUG_LDFLAGS}
-   DEPENDFLAGS  = ${DEBUG_CFLAGS} ${INCS}
-else
-   CFLAGS       = ${RELEASE_CFLAGS} ${INCS} ${P_OPTIONS}
-   CXXFLAGS     = ${RELEASE_CXXFLAGS} ${INCS} ${P_OPTIONS}
-   LDFLAGS      = ${RELEASE_LDFLAGS}
-   DEPENDFLAGS  = ${RELEASE_CFLAGS} ${INCS}
-endif
-
-ifeq (YES, ${PROFILE})
-   CFLAGS   := ${CFLAGS} -pg
-   CXXFLAGS := ${CXXFLAGS} -pg
-   LDFLAGS  := ${LDFLAGS} -pg
-endif
-
-#****************************************************************************
-# Preprocessor directives
-#****************************************************************************
-
-ifeq (YES, ${PROFILE})
-  DEFS =
-else
-  DEFS =
-endif
-
-#****************************************************************************
-# Include paths
-#****************************************************************************
-
-#INCS := -I/usr/include/g++-2 -I/usr/local/include
-#INCS =
-
-
-#****************************************************************************
-# Makefile code common to all platforms
-#****************************************************************************
-
-CFLAGS   := ${CFLAGS}   ${DEFS}
-CXXFLAGS := ${CXXFLAGS} ${DEFS}
-
-#****************************************************************************
-# General rules
-#****************************************************************************
-
-indent:
-	$(INDENT) --line-length 100 ${SRCS} ${SRCS_HEADERS}
-	$(DELETE) *.*~
-
-indent80:
-	$(INDENT) --line-length 80 ${SRCS} ${SRCS_HEADERS}
-	$(DELETE) *.*~
-
-clean:
-	rm -f core *.o *.so *.a *.exe
-
-# what are the source dependencies
-depend: $(SRCS)
-	$(DEPEND) $(DEPENDFLAGS) $(SRCS)
+##
+## This Makefile is made for cygwin, but might probably work on any standard UNIX too
+##
+
+#****************************************************************************
+
+# DEBUG can be set to YES to include debugging info, or NO otherwise
+DEBUG          = YES
+
+# PROFILE can be set to YES to include profiling info, or NO otherwise
+PROFILE        = NO
+
+#****************************************************************************
+
+CC     = gcc
+CXX    = g++
+LD     = gcc
+AR     = ar rcvu
+RANLIB = ranlib
+DEPEND = makedepend
+INDENT =indent --gnu-style -ut -ts6 -br -npsl -npcs
+DELETE =rm -f
+
+GLOBAL_CFLAGS   = -Wall -Wno-unknown-pragmas -Wno-format 
+DEBUG_CFLAGS    = -g -O0 -DDEBUG ${GLOBAL_CFLAGS}
+RELEASE_CFLAGS  =  -O2 ${GLOBAL_CFLAGS}
+
+P_OPTIONS = -pedantic
+
+LIBS =
+
+DEBUG_CXXFLAGS   = ${DEBUG_CFLAGS}
+RELEASE_CXXFLAGS = ${RELEASE_CFLAGS}
+
+DEBUG_LDFLAGS    = -g
+RELEASE_LDFLAGS  =
+
+ifeq (YES, ${DEBUG})
+   CFLAGS       = ${DEBUG_CFLAGS} ${INCS} ${P_OPTIONS}
+   CXXFLAGS     = ${DEBUG_CXXFLAGS} ${INCS} ${P_OPTIONS}
+   LDFLAGS      = ${DEBUG_LDFLAGS}
+   DEPENDFLAGS  = ${DEBUG_CFLAGS} ${INCS}
+else
+   CFLAGS       = ${RELEASE_CFLAGS} ${INCS} ${P_OPTIONS}
+   CXXFLAGS     = ${RELEASE_CXXFLAGS} ${INCS} ${P_OPTIONS}
+   LDFLAGS      = ${RELEASE_LDFLAGS}
+   DEPENDFLAGS  = ${RELEASE_CFLAGS} ${INCS}
+endif
+
+ifeq (YES, ${PROFILE})
+   CFLAGS   := ${CFLAGS} -pg
+   CXXFLAGS := ${CXXFLAGS} -pg
+   LDFLAGS  := ${LDFLAGS} -pg
+endif
+
+#****************************************************************************
+# Preprocessor directives
+#****************************************************************************
+
+ifeq (YES, ${PROFILE})
+  DEFS =
+else
+  DEFS =
+endif
+
+#****************************************************************************
+# Include paths
+#****************************************************************************
+
+#INCS := -I/usr/include/g++-2 -I/usr/local/include
+#INCS =
+
+
+#****************************************************************************
+# Makefile code common to all platforms
+#****************************************************************************
+
+CFLAGS   := ${CFLAGS}   ${DEFS}
+CXXFLAGS := ${CXXFLAGS} ${DEFS}
+
+#****************************************************************************
+# General rules
+#****************************************************************************
+
+indent:
+	$(INDENT) --line-length 100 ${SRCS} ${SRCS_HEADERS}
+	$(DELETE) *.*~
+
+indent80:
+	$(INDENT) --line-length 80 ${SRCS} ${SRCS_HEADERS}
+	$(DELETE) *.*~
+
+clean:
+	rm -f core *.o *.so *.a *.exe
+
+# what are the source dependencies
+depend: $(SRCS)
+	$(DEPEND) $(DEPENDFLAGS) $(SRCS)
diff --git a/make/linux/check_ids b/make/linux/check_ids
old mode 100755
new mode 100644
index 30767fc..26d27a9
--- a/make/linux/check_ids
+++ b/make/linux/check_ids
@@ -1,18 +1,18 @@
-#!/bin/sh
-
-# A small script that looks for duplicate EBML IDs in all of libmatroska's
-# source files.
-
-echo 'Duplicate IDs:'
-grep -h '^EbmlId.*_TheId' ../../src/*cpp | \
-  sed -e 's/TheId/TheId /' | \
-  awk '{ print $3 }' | \
-  sed -e 's/(//' -e 's/,//' | \
-  sort  | \
-  uniq -d | \
-( while read id ; do
-    echo ''
-    echo ${id}:
-    grep -i $id ../../src/*cpp
-  done )
-
+#!/bin/sh
+
+# A small script that looks for duplicate EBML IDs in all of libmatroska's
+# source files.
+
+echo 'Duplicate IDs:'
+grep -h '^EbmlId.*_TheId' ../../src/*cpp | \
+  sed -e 's/TheId/TheId /' | \
+  awk '{ print $3 }' | \
+  sed -e 's/(//' -e 's/,//' | \
+  sort  | \
+  uniq -d | \
+( while read id ; do
+    echo ''
+    echo ${id}:
+    grep -i $id ../../src/*cpp
+  done )
+
diff --git a/make/linux/fedora-core.spec b/make/linux/fedora-core.spec
index f62cbce..7683c1d 100644
--- a/make/linux/fedora-core.spec
+++ b/make/linux/fedora-core.spec
@@ -1,61 +1,61 @@
-# SPEC file for (at least) Fedora Core 1, 2, 3
-
-Name: 		libmatroska
-Version: 0.7.8
-Release: 1
-License: 	LGPL
-Summary:	Matroska Video Container
-Group:		System Environment/Libraries
-URL: 		http://www.matroska.org/
-Vendor:         Moritz Bunkus <moritz at bunkus.org>
-Source: 	http://dl.matroska.org/downloads/%{name}/%{name}-%{version}.tar.bz2
-BuildRoot: 	%{_tmppath}/%{name}-root
-
-%description
-Matroska aims to become THE Standard of Multimedia Container Formats.
-It was derived from a project called MCF, but differentiates from it
-significantly because it is based on  EBML (Extensible Binary Meta
-Language), a binary derivative of XML. EBML enables the Matroska
-Development Team to gain significant advantages in terms of future
-format extensibility, without breaking file support in old parsers.
-
-%package devel
-Summary:	Matroska Video Container headers/development files
-Group:		Development/Libraries
-
-%description devel
-Headers for libmatroska.
-
-%prep
-%setup -q
-
-%build
-cd make/linux
-CFLAGS="$RPM_OPT_FLAGS" \
-make \
-prefix="%{_prefix}" \
-LIBEBML_INCLUDE_DIR=%{_includedir} \
-LIBEBML_LIB_DIR=%{_libdir} \
-staticlib
-cd ../..
-
-%install
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-cd make/linux
-make prefix=$RPM_BUILD_ROOT/%{_prefix} install_staticlib install_headers
-cd ../..
-
-%clean
-[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
-
-%files devel
-%defattr(-, root, root)
-%{_includedir}/matroska/*.h
-%{_includedir}/matroska/c/*.h
-%{_libdir}/libmatroska.a
-
-%changelog
-* Sat Apr 16 2005 Moritz Bunkus <moritz at bunkus.org>
-- updated for the new libmatroska build targets
-* Fri May 15 2003 Ronald Bultje <rbultje at ronald.bitfreak.net>
-- create spec file
+# SPEC file for (at least) Fedora Core 1, 2, 3
+
+Name: 		libmatroska
+Version: 0.8.1
+Release: 1
+License: 	LGPL
+Summary:	Matroska Video Container
+Group:		System Environment/Libraries
+URL: 		http://www.matroska.org/
+Vendor:         Moritz Bunkus <moritz at bunkus.org>
+Source: 	http://dl.matroska.org/downloads/%{name}/%{name}-%{version}.tar.bz2
+BuildRoot: 	%{_tmppath}/%{name}-root
+
+%description
+Matroska aims to become THE Standard of Multimedia Container Formats.
+It was derived from a project called MCF, but differentiates from it
+significantly because it is based on  EBML (Extensible Binary Meta
+Language), a binary derivative of XML. EBML enables the Matroska
+Development Team to gain significant advantages in terms of future
+format extensibility, without breaking file support in old parsers.
+
+%package devel
+Summary:	Matroska Video Container headers/development files
+Group:		Development/Libraries
+
+%description devel
+Headers for libmatroska.
+
+%prep
+%setup -q
+
+%build
+cd make/linux
+CFLAGS="$RPM_OPT_FLAGS" \
+make \
+prefix="%{_prefix}" \
+LIBEBML_INCLUDE_DIR=%{_includedir} \
+LIBEBML_LIB_DIR=%{_libdir} \
+staticlib
+cd ../..
+
+%install
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+cd make/linux
+make prefix=$RPM_BUILD_ROOT/%{_prefix} libdir=$RPM_BUILD_ROOT/%{_libdir} install_staticlib install_headers
+cd ../..
+
+%clean
+[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
+
+%files devel
+%defattr(-, root, root)
+%{_includedir}/matroska/*.h
+%{_includedir}/matroska/c/*.h
+%{_libdir}/libmatroska.a
+
+%changelog
+* Sat Apr 16 2005 Moritz Bunkus <moritz at bunkus.org>
+- updated for the new libmatroska build targets
+* Fri May 15 2003 Ronald Bultje <rbultje at ronald.bitfreak.net>
+- create spec file
diff --git a/make/linux/suse.spec b/make/linux/suse.spec
index 77cd196..69cb69e 100644
--- a/make/linux/suse.spec
+++ b/make/linux/suse.spec
@@ -1,75 +1,73 @@
-#
-# spec file for package libmatroska for (at least) SuSE 9.0, 9.1
-#
-# Copyright (c) 2004 SUSE LINUX AG, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
-#
-# Please submit bugfixes or comments via http://www.suse.de/feedback/
-#
-
-# neededforbuild  gcc-c++ libebml libstdc++-devel
-
-BuildRequires: aaa_base acl attr bash bind-utils bison bzip2 coreutils cpio cpp cracklib db devs diffutils file filesystem fillup findutils flex gawk glibc glibc-devel glibc-locale gpm grep groff gzip info less libebml libgcc libstdc++ libxcrypt m4 make man mktemp ncurses net-tools netcfg openldap2-client openssl pam pam-modules patch permissions popt readline sed syslogd sysvinit tar timezone util-linux vim zlib zlib-devel autoconf automake binutils gcc gcc-c++ gdbm gettext libebml libstdc++-devel libtool perl rpm
-
-Name:         libmatroska
-URL:          http://dl.matroska.org/downloads/libmatroska/
-Version: 0.7.8
-Release: 1
-Summary:      library to deal with matroska files.
-License:      LGPL
-Group:        Development/Libraries/Other
-Source:       %{name}-%{version}.tar.bz2
-Patch:        suse-libmatroska-makefile.diff
-Summary:      library to deal with matroska files.
-BuildRoot:    %{_tmppath}/%{name}-%{version}-build
-Prefix:       /usr
-
-%description
-libmatroska is a C++ libary to parse Matroska files (.mkv and .mka). It
-depends on libebml to work. You only need this package to compile your
-own applications.
-
-
-
-Authors:
---------
-    Steve Lhomme <steve.lhomme at free.fr>
-    Moritz Bunkus <moritz at bunkus.org>
-
-%prep
-rm -rf $RPM_BUILD_ROOT
-%setup
-%patch -p1
-
-%build
-export CFLAGS="$RPM_OPT_FLAGS"
-cd make/linux
-make PREFIX=$RPM_BUILD_ROOT/usr LIBDIR=%{_libdir} staticlib
-
-%install
-cd make/linux
-make install_staticlib install_headers PREFIX=$RPM_BUILD_ROOT/usr LIBDIR=$RPM_BUILD_ROOT/%{_libdir}
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%post
-%run_ldconfig
-
-%postun
-%run_ldconfig
-
-%files
-%defattr (-,root,root)
-%{_libdir}/libmatroska.a
-/usr/include/matroska
-# /usr/include/ebml/*
-
-%changelog -n libmatroska
-* Sat Apr 16 2005 - moritz at bunkus.org
-- updated for the new libmatroska build targets
-* Thu Sep 02 2004 - seife at suse.de
-- add libebml to neededforbuild
-* Wed Sep 01 2004 - seife at suse.de
-- initial submission
+#
+# spec file for package libmatroska for (at least) SuSE 9.0, 9.1
+#
+# Copyright (c) 2004 SUSE LINUX AG, Nuernberg, Germany.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Please submit bugfixes or comments via http://www.suse.de/feedback/
+#
+
+# neededforbuild  gcc-c++ libebml libstdc++-devel
+
+BuildRequires: bzip2 cpp libebml make tar zlib zlib-devel binutils gcc gcc-c++ libstdc++-devel perl rpm
+
+Name:         libmatroska
+URL:          http://dl.matroska.org/downloads/libmatroska/
+Version: 0.8.1
+Release: 1
+Summary:      library to deal with matroska files.
+License:      LGPL
+Group:        Development/Libraries/Other
+Source:       %{name}-%{version}.tar.bz2
+Summary:      library to deal with matroska files.
+BuildRoot:    %{_tmppath}/%{name}-%{version}-build
+Prefix:       /usr
+
+%description
+libmatroska is a C++ libary to parse Matroska files (.mkv and .mka). It
+depends on libebml to work. You only need this package to compile your
+own applications.
+
+
+
+Authors:
+--------
+    Steve Lhomme <steve.lhomme at free.fr>
+    Moritz Bunkus <moritz at bunkus.org>
+
+%prep
+rm -rf $RPM_BUILD_ROOT
+%setup
+
+%build
+export CFLAGS="$RPM_OPT_FLAGS"
+cd make/linux
+make prefix=$RPM_BUILD_ROOT/usr libdir=$RPM_BUILD_ROOT/%{_libdir} staticlib
+
+%install
+cd make/linux
+make prefix=$RPM_BUILD_ROOT/usr libdir=$RPM_BUILD_ROOT/%{_libdir} install_staticlib install_headers
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+%run_ldconfig
+
+%postun
+%run_ldconfig
+
+%files
+%defattr (-,root,root)
+%{_libdir}/libmatroska.a
+/usr/include/matroska
+# /usr/include/ebml/*
+
+%changelog -n libmatroska
+* Sat Apr 16 2005 - moritz at bunkus.org
+- updated for the new libmatroska build targets
+* Thu Sep 02 2004 - seife at suse.de
+- add libebml to neededforbuild
+* Wed Sep 01 2004 - seife at suse.de
+- initial submission
diff --git a/make/makedoc.bat b/make/makedoc.bat
index e89a804..194f97f 100644
--- a/make/makedoc.bat
+++ b/make/makedoc.bat
@@ -1,8 +1,8 @@
- at echo off
-rem you should have DOXYGEN.EXE in your path
-rem http://www.doxygen.org/
-
-echo make Documentation
-
-
+ at echo off
+rem you should have DOXYGEN.EXE in your path
+rem http://www.doxygen.org/
+
+echo make Documentation
+
+
 doxygen Doxyfile > Doxygen.log.txt 2> Doxygen.err.txt
\ No newline at end of file
diff --git a/make/makedoc.sh b/make/makedoc.sh
index 6bdbdbc..13f8571 100644
--- a/make/makedoc.sh
+++ b/make/makedoc.sh
@@ -1,7 +1,7 @@
-#!/usr/bin/sh
-# you should have "doxygen" in your path
-# http://www.doxygen.org/
-
-echo make Documentation
-
-doxygen Doxyfile > Doxygen.log.txt 2> Doxygen.err.txt
+#!/usr/bin/sh
+# you should have "doxygen" in your path
+# http://www.doxygen.org/
+
+echo make Documentation
+
+doxygen Doxyfile > Doxygen.log.txt 2> Doxygen.err.txt
diff --git a/make/mingw32/Makefile b/make/mingw32/Makefile
index 36f63ef..c7cfec8 100644
--- a/make/mingw32/Makefile
+++ b/make/mingw32/Makefile
@@ -1,106 +1,112 @@
-# Project: libmatroska
-# Makefile created by Dev-C++ 4.9.7.0
-
-# Normally libmatroska is built as a static library.
-# Uncomment this if you want a shared library instead.
-# ATTENTION: Your app has to define MATROSKA_DLL !
-SHARED = yes
-
-# Compile with debug information?
-#DEBUG = yes
-
-# Where libebml resides
-EBML_DIR = ../../../libebml
-
-# Has libebml been compiled as a DLL?
-EBML_DLL = yes
-
-#
-# Don't change anything below this line.
-#
-ifeq (yes,$(DEBUG))
-DEBUGFLAGS=-g -DDEBUG
-endif
-CXX  = g++.exe
-LD = g++.exe
-WINDRES = windres.exe
-RES  = 
-SRC  = $(wildcard ../../src/*.cpp)
-OBJ  = $(patsubst %.cpp,%.o,$(SRC))
-ifeq (yes,$(SHARED))
-LIBS = libmatroska.dll
-CXXFLAGS = -DMATROSKA_DLL
-DLLFLAGS = -DMATROSKA_DLL_EXPORT
-else
-LIBS = libmatroska.a
-endif
-ifeq (yes,$(EBML_DLL))
-CXXFLAGS += -DEBML_DLL
-endif
-INCS = -I../.. -I$(EBML_DIR)
-LDFLAGS = -L. -L$(EBML_DIR)/make/mingw32
-CXXFLAGS += $(DEBUGFLAGS) $(INCS) 
-TESTS = test6 test8 test9
-
-.PHONY: all all-before all-after clean clean-custom
-
-.cpp.o:
-	$(CXX) $(DLLFLAGS) $(CXXFLAGS) -c -o $@ $<
-
-all: lib
-
-lib: $(LIBS)
-
-tests: $(TESTS)
-
-clean:
-	rm -f $(OBJ) libmatroska.a libmatroska.dll.a libmatroska.dll *.exe \
-		../../test/mux/*.o ../../test/tags/*.o
-
-distclean dist-clean: clean
-	rm -f .depend
-
-libmatroska.a: $(OBJ)
-	ar r $@ $(OBJ)
-	ranlib $@
-
-libmatroska.dll: $(OBJ)
-	$(CXX) -shared -Wl,--export-all -Wl,--out-implib=$@.a -o $@ $(OBJ) \
-		$(LDFLAGS) -lebml
-
-# Explicitely list these object files because for them
-# MATROSKA_DLL_EXPORT must NOT be defined.
-../../test/mux/test6.o: ../../test/mux/test6.cpp
-	$(CXX) $(CXXFLAGS) -c -o $@ $<
-
-test6:	../../test/mux/test6.o $(LIBS)
-	$(LD) -o $@ $(LDFLAGS) $< -lmatroska -lebml
-
-../../test/mux/test8.o: ../../test/mux/test8.cpp
-	$(CXX) $(CXXFLAGS) -c -o $@ $<
-
-test8:	../../test/mux/test8.o $(LIBS)
-	$(LD) -o $@ $(LDFLAGS) $< -lmatroska -lebml
-
-../../test/tags/test9.o: ../../test/tags/test9.cpp
-	$(CXX) $(CXXFLAGS) -c -o $@ $<
-
-test9:	../../test/tags/test9.o $(LIBS)
-	$(LD) -o $@ $(LDFLAGS) $< -lmatroska -lebml
-
-depend:
-	@echo Calculating dependecies:
-	@rm -f .depend
-	@touch .depend
-	@for i in $(SRC); do \
-		o="`echo $$i | sed -e 's/\.c$$/.o/' -e 's/\.cpp$$/.o/'`" ; \
-		echo '  ' $$i: $$o ; \
-		$(CXX) $(CXXFLAGS) -MM -MT $$o $$i >> .depend ; \
-	done
-
-#
-# include dependency files if they exist
-#
-ifneq ($(wildcard .depend),)
-include .depend
-endif
+# Project: libmatroska
+# Makefile created by Dev-C++ 4.9.7.0
+
+# Normally libmatroska is built as a static library.
+# Uncomment this if you want a shared library instead.
+# ATTENTION: Your app has to define MATROSKA_DLL !
+SHARED = yes
+
+# Compile with debug information?
+#DEBUG = yes
+
+# Where libebml resides
+EBML_DIR = ../../../libebml
+
+# Has libebml been compiled as a DLL?
+EBML_DLL = yes
+
+#
+# Don't change anything below this line.
+#
+ifeq (yes,$(DEBUG))
+DEBUGFLAGS=-g -DDEBUG
+endif
+CROSS   =
+CXX     = $(CROSS)g++
+CC      = $(CROSS)gcc
+WINDRES = $(CROSS)windres
+RANLIB  = $(CROSS)ranlib
+AR      = $(CROSS)ar
+RES  =
+SRC  = $(wildcard ../../src/*.cpp)
+OBJ  = $(patsubst %.cpp,%.o,$(SRC))
+ifeq (yes,$(SHARED))
+LIBS = libmatroska.dll
+FLAGS = -DMATROSKA_DLL
+DLLFLAGS = -DMATROSKA_DLL_EXPORT
+else
+LIBS = libmatroska.a
+endif
+ifeq (yes,$(SHARED))
+ifeq (yes,$(EBML_DLL))
+FLAGS += -DEBML_DLL
+endif
+endif
+CWD = $(shell pwd)
+INCS = -I$(CWD)/../.. -I$(EBML_DIR)
+LDFLAGS = -L. -L$(EBML_DIR)/make/mingw32
+COMPILEFLAGS = $(DEBUGFLAGS) $(INCS) $(FLAGS) $(CXXFLAGS)
+TESTS = test6 test8 test9
+
+.PHONY: all all-before all-after clean clean-custom
+
+.cpp.o:
+	$(CXX) $(DLLFLAGS) $(COMPILEFLAGS) -c -o $@ $<
+
+all: lib
+
+lib: $(LIBS)
+
+tests: $(TESTS)
+
+clean:
+	rm -f $(OBJ) libmatroska.a libmatroska.dll.a libmatroska.dll *.exe \
+		../../test/mux/*.o ../../test/tags/*.o
+
+distclean dist-clean: clean
+	rm -f .depend
+
+libmatroska.a: $(OBJ)
+	$(AR) rcvu $@ $(OBJ)
+	$(RANLIB) $@
+
+libmatroska.dll: $(OBJ)
+	$(CXX) -shared -Wl,--export-all -Wl,--out-implib=$@.a -o $@ $(OBJ) \
+		$(LDFLAGS) -lebml
+
+# Explicitely list these object files because for them
+# MATROSKA_DLL_EXPORT must NOT be defined.
+../../test/mux/test6.o: ../../test/mux/test6.cpp
+	$(CXX) $(COMPILEFLAGS) -c -o $@ $<
+
+test6:	../../test/mux/test6.o $(LIBS)
+	$(LD) -o $@ $(LDFLAGS) $< -lmatroska -lebml
+
+../../test/mux/test8.o: ../../test/mux/test8.cpp
+	$(CXX) $(COMPILEFLAGS) -c -o $@ $<
+
+test8:	../../test/mux/test8.o $(LIBS)
+	$(LD) -o $@ $(LDFLAGS) $< -lmatroska -lebml
+
+../../test/tags/test9.o: ../../test/tags/test9.cpp
+	$(CXX) $(COMPILEFLAGS) -c -o $@ $<
+
+test9:	../../test/tags/test9.o $(LIBS)
+	$(LD) -o $@ $(LDFLAGS) $< -lmatroska -lebml
+
+depend:
+	@echo Calculating dependecies:
+	@rm -f .depend
+	@touch .depend
+	@for i in $(SRC); do \
+		o="`echo $$i | sed -e 's/\.c$$/.o/' -e 's/\.cpp$$/.o/'`" ; \
+		echo '  ' $$i: $$o ; \
+		$(CXX) $(COMPILEFLAGS) -MM -MT $$o $$i >> .depend ; \
+	done
+
+#
+# include dependency files if they exist
+#
+ifneq ($(wildcard .depend),)
+include .depend
+endif
diff --git a/make/mingw32/test/Makefile b/make/mingw32/test/Makefile
index bca547b..73a3569 100644
--- a/make/mingw32/test/Makefile
+++ b/make/mingw32/test/Makefile
@@ -1,27 +1,27 @@
-# Project: test6
-# Makefile created by Dev-C++ 4.9.7.0
-
-CPP  = g++.exe
-CC   = gcc.exe
-WINDRES = windres.exe
-RES  = 
-OBJ  = ../../../test/mux/test6.o $(RES)
-LIBS =  -L"D:/DEV-CPP/lib" "../libmatroska.a" "../../../../libebml/make/mingw32/libebml.a"
-INCS =  -I"D:/DEV-CPP/include"  -I"D:/DEV-CPP/include/c++"  -I"D:/DEV-CPP/include"  -I"D:/Dev-Cpp/include/c++/mingw32"  -I"../../../../libebml/src"  -I"../../../src" 
-BIN  = test6.exe
-CXXFLAGS = $(INCS) 
-CFLAGS = $(INCS) 
-
-.PHONY: all all-before all-after clean clean-custom
-
-all: all-before test6.exe all-after
-
-
-clean: clean-custom
-	rm -f $(OBJ) $(BIN)
-
-$(BIN): $(OBJ)
-	$(CPP) $(OBJ) -o "test6.exe" $(LIBS) $(CXXFLAGS)
-
-../../../test/mux/test6.o: ../../../test/mux/test6.cpp
-	$(CPP) -c ../../../test/mux/test6.cpp -o ../../../test/mux/test6.o $(CXXFLAGS)
+# Project: test6
+# Makefile created by Dev-C++ 4.9.7.0
+
+CPP  = g++.exe
+CC   = gcc.exe
+WINDRES = windres.exe
+RES  = 
+OBJ  = ../../../test/mux/test6.o $(RES)
+LIBS =  -L"D:/DEV-CPP/lib" "../libmatroska.a" "../../../../libebml/make/mingw32/libebml.a"
+INCS =  -I"D:/DEV-CPP/include"  -I"D:/DEV-CPP/include/c++"  -I"D:/DEV-CPP/include"  -I"D:/Dev-Cpp/include/c++/mingw32"  -I"../../../../libebml/src"  -I"../../../src" 
+BIN  = test6.exe
+CXXFLAGS = $(INCS) 
+CFLAGS = $(INCS) 
+
+.PHONY: all all-before all-after clean clean-custom
+
+all: all-before test6.exe all-after
+
+
+clean: clean-custom
+	rm -f $(OBJ) $(BIN)
+
+$(BIN): $(OBJ)
+	$(CPP) $(OBJ) -o "test6.exe" $(LIBS) $(CXXFLAGS)
+
+../../../test/mux/test6.o: ../../../test/mux/test6.cpp
+	$(CPP) -c ../../../test/mux/test6.cpp -o ../../../test/mux/test6.o $(CXXFLAGS)
diff --git a/make/mingw32/test/test6.dev b/make/mingw32/test/test6.dev
index c8e883f..294c08e 100644
--- a/make/mingw32/test/test6.dev
+++ b/make/mingw32/test/test6.dev
@@ -1,54 +1,54 @@
-[Project]
-FileName=test6.dev
-Name=test6
-UnitCount=1
-Type=1
-Ver=1
-ObjFiles=
-Includes=..\..\..\..\libebml\src;..\..\..\src
-Libs=
-PrivateResource=
-ResourceIncludes=
-MakeIncludes=
-Resources=
-Compiler=
-Linker="..\libmatroska.a" "..\..\..\..\libebml\make\mingw32\libebml.a"
-IsCpp=1
-Icon=
-ExeOutput=
-ObjectOutput=
-OverrideOutput=0
-OverrideOutputName=test6.exe
-HostApplication=
-Folders=
-CommandLine=
-IncludeVersionInfo=0
-SupportXPThemes=0
-CompilerSet=0
-CompilerSettings=000000000000000000
-
-[Unit1]
-FileName=..\..\..\test\mux\test6.cpp
-Folder=test6
-Compile=1
-CompileCpp=1
-OverrideBuildCmd=0
-BuildCmd=
-
-[VersionInfo]
-Major=0
-Minor=1
-Release=1
-Build=1
-LanguageID=1033
-CharsetID=1252
-CompanyName=
-FileVersion=
-FileDescription=Developed using the Dev-C++ IDE
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=
-
+[Project]
+FileName=test6.dev
+Name=test6
+UnitCount=1
+Type=1
+Ver=1
+ObjFiles=
+Includes=..\..\..\..\libebml\src;..\..\..\src
+Libs=
+PrivateResource=
+ResourceIncludes=
+MakeIncludes=
+Resources=
+Compiler=
+Linker="..\libmatroska.a" "..\..\..\..\libebml\make\mingw32\libebml.a"
+IsCpp=1
+Icon=
+ExeOutput=
+ObjectOutput=
+OverrideOutput=0
+OverrideOutputName=test6.exe
+HostApplication=
+Folders=
+CommandLine=
+IncludeVersionInfo=0
+SupportXPThemes=0
+CompilerSet=0
+CompilerSettings=000000000000000000
+
+[Unit1]
+FileName=..\..\..\test\mux\test6.cpp
+Folder=test6
+Compile=1
+CompileCpp=1
+OverrideBuildCmd=0
+BuildCmd=
+
+[VersionInfo]
+Major=0
+Minor=1
+Release=1
+Build=1
+LanguageID=1033
+CharsetID=1252
+CompanyName=
+FileVersion=
+FileDescription=Developed using the Dev-C++ IDE
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=
+
diff --git a/make/mingw32/test/test8.dev b/make/mingw32/test/test8.dev
index 3d44b40..092778a 100644
--- a/make/mingw32/test/test8.dev
+++ b/make/mingw32/test/test8.dev
@@ -1,54 +1,54 @@
-[Project]
-FileName=test8.dev
-Name=test8
-UnitCount=1
-Type=1
-Ver=1
-ObjFiles=
-Includes=..\..\..\..\libebml\src;..\..\..\src
-Libs=
-PrivateResource=
-ResourceIncludes=
-MakeIncludes=
-Resources=
-Compiler=
-Linker="..\libmatroska.a" "..\..\..\..\libebml\make\mingw32\libebml.a"
-IsCpp=1
-Icon=
-ExeOutput=
-ObjectOutput=
-OverrideOutput=0
-OverrideOutputName=test8.exe
-HostApplication=
-Folders=
-CommandLine=
-IncludeVersionInfo=0
-SupportXPThemes=0
-CompilerSet=0
-CompilerSettings=000000000000000000
-
-[Unit1]
-FileName=..\..\..\test\mux\test8.cpp
-Folder=test8
-Compile=1
-CompileCpp=1
-OverrideBuildCmd=0
-BuildCmd=
-
-[VersionInfo]
-Major=0
-Minor=1
-Release=1
-Build=1
-LanguageID=1033
-CharsetID=1252
-CompanyName=
-FileVersion=
-FileDescription=Developed using the Dev-C++ IDE
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=
-
+[Project]
+FileName=test8.dev
+Name=test8
+UnitCount=1
+Type=1
+Ver=1
+ObjFiles=
+Includes=..\..\..\..\libebml\src;..\..\..\src
+Libs=
+PrivateResource=
+ResourceIncludes=
+MakeIncludes=
+Resources=
+Compiler=
+Linker="..\libmatroska.a" "..\..\..\..\libebml\make\mingw32\libebml.a"
+IsCpp=1
+Icon=
+ExeOutput=
+ObjectOutput=
+OverrideOutput=0
+OverrideOutputName=test8.exe
+HostApplication=
+Folders=
+CommandLine=
+IncludeVersionInfo=0
+SupportXPThemes=0
+CompilerSet=0
+CompilerSettings=000000000000000000
+
+[Unit1]
+FileName=..\..\..\test\mux\test8.cpp
+Folder=test8
+Compile=1
+CompileCpp=1
+OverrideBuildCmd=0
+BuildCmd=
+
+[VersionInfo]
+Major=0
+Minor=1
+Release=1
+Build=1
+LanguageID=1033
+CharsetID=1252
+CompanyName=
+FileVersion=
+FileDescription=Developed using the Dev-C++ IDE
+InternalName=
+LegalCopyright=
+LegalTrademarks=
+OriginalFilename=
+ProductName=
+ProductVersion=
+
diff --git a/matroska/FileKax.h b/matroska/FileKax.h
index 8160a89..af138e4 100644
--- a/matroska/FileKax.h
+++ b/matroska/FileKax.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -63,7 +63,7 @@ class MATROSKA_DLL_API FileMatroska {
 		FileMatroska(IOCallback & output);
 		~FileMatroska();
 #ifdef OLD
-	uint32 RenderHead(const std::string & aEncoderApp);
+	filepos_t RenderHead(const std::string & aEncoderApp);
 	uint32 ReadHead();
 	uint32 ReadTracks();
 	uint32 ReadCodec();
@@ -72,12 +72,12 @@ class MATROSKA_DLL_API FileMatroska {
 	inline void type_SetInfo(const std::string & aStr) {myMainHeader.type_SetInfo(aStr);}
 	inline void type_SetAds(const std::string & aStr) {myMainHeader.type_SetAds(aStr);}
 	inline void type_SetSize(const std::string & aStr) {myMainHeader.type_SetSize(aStr);}
-	inline void type_SetSize(const uint64 aSize) {myMainHeader.type_SetSize(aSize);}
+	inline void type_SetSize(uint64 aSize) {myMainHeader.type_SetSize(aSize);}
 
 	inline uint8 GetTrackNumber() const { return myTracks.size(); }
 
 	void track_SetName(Track * aTrack, const std::string & aName);
-	void track_SetLaced(Track * aTrack, const bool bLaced = true);
+	void track_SetLaced(Track * aTrack, bool bLaced = true);
 
 	Track * CreateTrack(const track_type aType);
 	inline Track * GetTrack(const uint8 aTrackNb) const
@@ -102,7 +102,7 @@ class MATROSKA_DLL_API FileMatroska {
 	    \return wether the frame has been added or not
 	*/
 	bool AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize,
-		     const bool aKeyFrame = true, const bool aBFrame = false);
+		     bool aKeyFrame = true, bool aBFrame = false);
 
 	/*!
 	    \return wether the frame has been read or not
@@ -149,4 +149,15 @@ class MATROSKA_DLL_API FileMatroska {
 
 END_LIBMATROSKA_NAMESPACE
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+MATROSKA_DLL_API void matroska_init();
+MATROSKA_DLL_API void matroska_done();
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif // FILE_KAX_HPP
diff --git a/matroska/KaxAttached.h b/matroska/KaxAttached.h
index 26c40f8..67f4437 100644
--- a/matroska/KaxAttached.h
+++ b/matroska/KaxAttached.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -41,100 +41,31 @@
 #include "ebml/EbmlString.h"
 #include "ebml/EbmlBinary.h"
 #include "ebml/EbmlUInteger.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxAttached : public EbmlMaster {
-	public:
-		KaxAttached();
-		KaxAttached(const KaxAttached & ElementToClone) : EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxAttached);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool IsYourId(const EbmlId & TestId) const;
-		EbmlElement * Clone() const {return new KaxAttached(*this);}
+DECLARE_MKX_MASTER(KaxAttached)
 };
 
-class MATROSKA_DLL_API KaxFileDescription : public EbmlUnicodeString {
-	public:
-		KaxFileDescription() {}
-		KaxFileDescription(const KaxFileDescription & ElementToClone) : EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxFileDescription);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool IsYourId(const EbmlId & TestId) const;
-		EbmlElement * Clone() const {return new KaxFileDescription(*this);}
+DECLARE_MKX_UNISTRING(KaxFileDescription)
 };
 
-class MATROSKA_DLL_API KaxFileName : public EbmlUnicodeString {
-	public:
-		KaxFileName() {}
-		KaxFileName(const KaxFileName & ElementToClone) : EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxFileName);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool IsYourId(const EbmlId & TestId) const;
-		EbmlElement * Clone() const {return new KaxFileName(*this);}
+DECLARE_MKX_UNISTRING(KaxFileName)
 };
 
-class MATROSKA_DLL_API KaxMimeType : public EbmlString {
-	public:
-		KaxMimeType() {}
-		KaxMimeType(const KaxMimeType & ElementToClone) : EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxMimeType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool IsYourId(const EbmlId & TestId) const;
-		EbmlElement * Clone() const {return new KaxMimeType(*this);}
+DECLARE_MKX_STRING(KaxMimeType)
 };
 
-class MATROSKA_DLL_API KaxFileData : public EbmlBinary {
-	public:
-		KaxFileData() {}
-		KaxFileData(const KaxFileData & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxFileData);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		static const EbmlCallbacks ClassInfos;
-
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool IsYourId(const EbmlId & TestId) const;
-		EbmlElement * Clone() const {return new KaxFileData(*this);}
+DECLARE_MKX_BINARY(KaxFileData)
 };
 
-class MATROSKA_DLL_API KaxFileReferral : public EbmlBinary {
-	public:
-		KaxFileReferral() {}
-		KaxFileReferral(const KaxFileReferral & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxFileReferral);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxFileReferral(*this);}
+DECLARE_MKX_BINARY(KaxFileReferral)
 };
 
-class MATROSKA_DLL_API KaxFileUID : public EbmlUInteger {
-	public:
-		KaxFileUID() {}
-		KaxFileUID(const KaxFileUID & ElementToClone) : EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxFileUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool IsYourId(const EbmlId & TestId) const;
-		EbmlElement * Clone() const {return new KaxFileUID(*this);}
+DECLARE_MKX_UINTEGER(KaxFileUID)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxAttachments.h b/matroska/KaxAttachments.h
index ead8cb1..68a8188 100644
--- a/matroska/KaxAttachments.h
+++ b/matroska/KaxAttachments.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -37,20 +37,13 @@
 
 #include "matroska/KaxTypes.h"
 #include "ebml/EbmlMaster.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxAttachments : public EbmlMaster {
-	public:
-		KaxAttachments();
-		KaxAttachments(const KaxAttachments & ElementToClone) : EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxAttachments);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxAttachments(*this);}
+DECLARE_MKX_MASTER(KaxAttachments)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxBlock.h b/matroska/KaxBlock.h
index 1ca08e3..e84944e 100644
--- a/matroska/KaxBlock.h
+++ b/matroska/KaxBlock.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -41,6 +41,7 @@
 #include "ebml/EbmlBinary.h"
 #include "ebml/EbmlMaster.h"
 #include "matroska/KaxTracks.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
@@ -122,16 +123,8 @@ class MATROSKA_DLL_API NotSoSimpleDataBuffer : public SimpleDataBuffer {
 };
 */
 
-class MATROSKA_DLL_API KaxBlockGroup : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxBlockGroup)
 	public:
-		KaxBlockGroup();
-		KaxBlockGroup(const KaxBlockGroup & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxBlockGroup);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxBlockGroup(*this);}
-
 		~KaxBlockGroup();
 
 		/*!
@@ -196,12 +189,12 @@ class MATROSKA_DLL_API KaxBlockGroup : public EbmlMaster {
 
 class KaxInternalBlock : public EbmlBinary {
 	public:
-		KaxInternalBlock( bool bSimple ) :bLocalTimecodeUsed(false), mLacing(LACING_AUTO), mInvisible(false)
+		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)
 			,ParentCluster(NULL), bIsSimple(bSimple), bIsKeyframe(true), bIsDiscardable(false)
 		{}
 		KaxInternalBlock(const KaxInternalBlock & ElementToClone);
 		~KaxInternalBlock();
-		bool ValidateSize() const;
+		virtual bool ValidateSize() const;
 
 		uint16 TrackNum() const {return TrackNumber;}
 		/*!
@@ -212,8 +205,8 @@ class KaxInternalBlock : public EbmlBinary {
 		/*!
 			\note override this function to generate the Data/Size on the fly, unlike the usual binary elements
 		*/
-		uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false);
-		uint64 ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA);
+		filepos_t UpdateSize(bool bSaveDefault = false, bool bForceRender = false);
+		filepos_t ReadData(IOCallback & input, ScopeMode ReadFully = SCOPE_ALL_DATA);
 		
 		/*!
 			\brief Only read the head of the Block (not internal data)
@@ -267,7 +260,7 @@ class KaxInternalBlock : public EbmlBinary {
 		bool       mInvisible;
 		uint64     FirstFrameLocation;
 
-		uint32 RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault = false);
+		filepos_t RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault = false);
 
 		KaxCluster * ParentCluster;
 		bool       bIsSimple;
@@ -275,25 +268,18 @@ class KaxInternalBlock : public EbmlBinary {
 		bool       bIsDiscardable;
 };
 
+DECLARE_MKX_CONTEXT(KaxBlock);
 class MATROSKA_DLL_API KaxBlock : public KaxInternalBlock {
 	public:
-		KaxBlock() :KaxInternalBlock(false) {}
-		static EbmlElement & Create() {return *(new KaxBlock);}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		EbmlElement * Clone() const {return new KaxBlock(*this);}
+		KaxBlock(EBML_EXTRA_PARAM) :KaxInternalBlock(EBML_DEF_BINARY_CTX(KaxBlock)EBML_DEF_SEP false EBML_DEF_SEP EBML_EXTRA_CALL) {}
+        EBML_CONCRETE_CLASS(KaxBlock)
 };
 
 #if MATROSKA_VERSION >= 2
+DECLARE_MKX_CONTEXT(KaxSimpleBlock);
 class MATROSKA_DLL_API KaxSimpleBlock : public KaxInternalBlock {
 	public:
-		KaxSimpleBlock() :KaxInternalBlock(true) {}
-		static EbmlElement & Create() {return *(new KaxSimpleBlock);}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		EbmlElement * Clone() const {return new KaxSimpleBlock(*this);}
+		KaxSimpleBlock(EBML_EXTRA_PARAM) :KaxInternalBlock(EBML_DEF_BINARY_CTX(KaxSimpleBlock)EBML_DEF_SEP true EBML_DEF_SEP EBML_EXTRA_CALL) {}
 
 		void SetKeyframe(bool b_keyframe) { bIsKeyframe = b_keyframe; }
 		void SetDiscardable(bool b_discard) { bIsDiscardable = b_discard; }
@@ -302,6 +288,8 @@ class MATROSKA_DLL_API KaxSimpleBlock : public KaxInternalBlock {
 		bool IsDiscardable() const { return bIsDiscardable; }
 
 		operator KaxInternalBlock &() { return *this; }
+        
+        EBML_CONCRETE_CLASS(KaxSimpleBlock)
 };
 #endif // MATROSKA_VERSION
 
@@ -351,37 +339,21 @@ protected:
 	BlockBlobType SimpleBlockMode;
 };
 
-class MATROSKA_DLL_API KaxBlockDuration : public EbmlUInteger {
-	public:
-		KaxBlockDuration() {}
-		KaxBlockDuration(const KaxBlockDuration & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxBlockDuration);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxBlockDuration(*this);}
+DECLARE_MKX_UINTEGER(KaxBlockDuration)
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxBlockVirtual : public EbmlBinary {
+DECLARE_MKX_BINARY_CONS(KaxBlockVirtual)
 	public:
-		KaxBlockVirtual() :ParentCluster(NULL) {Data = DataBlock; Size = countof(DataBlock);}
-		KaxBlockVirtual(const KaxBlockVirtual & ElementToClone);
-		static EbmlElement & Create() {return *(new KaxBlockVirtual);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool ValidateSize() const {return true;}
+		~KaxBlockVirtual();
 
 		/*!
 			\note override this function to generate the Data/Size on the fly, unlike the usual binary elements
 		*/
-		uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false);
+		filepos_t UpdateSize(bool bSaveDefault = false, bool bForceRender = false);
 
 		void SetParent(const KaxCluster & aParentCluster) {ParentCluster = &aParentCluster;}
 
-		EbmlElement * Clone() const {return new KaxBlockVirtual(*this);}
-
 	protected:
 		uint64 Timecode; // temporary timecode of the first frame if there are more than one
 		uint16 TrackNumber;
@@ -391,63 +363,19 @@ class MATROSKA_DLL_API KaxBlockVirtual : public EbmlBinary {
 };
 #endif // MATROSKA_VERSION
 
-class MATROSKA_DLL_API KaxBlockAdditional : public EbmlBinary {
-	public:
-		KaxBlockAdditional() {}
-		KaxBlockAdditional(const KaxBlockAdditional & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxBlockAdditional);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool ValidateSize() const {return true;}
-
-		EbmlElement * Clone() const {return new KaxBlockAdditional(*this);}
+DECLARE_MKX_BINARY(KaxBlockAdditional)
 };
 
-class MATROSKA_DLL_API KaxBlockAdditions : public EbmlMaster {
-	public:
-		KaxBlockAdditions();
-		KaxBlockAdditions(const KaxBlockAdditions & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxBlockAdditions);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxBlockAdditions(*this);}
+DECLARE_MKX_MASTER(KaxBlockAdditions)
 };
 
-class MATROSKA_DLL_API KaxBlockMore : public EbmlMaster {
-	public:
-		KaxBlockMore();
-		KaxBlockMore(const KaxBlockMore & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxBlockMore);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxBlockMore(*this);}
+DECLARE_MKX_MASTER(KaxBlockMore)
 };
 
-class MATROSKA_DLL_API KaxBlockAddID : public EbmlUInteger {
-	public:
-		KaxBlockAddID() :EbmlUInteger(1) {}
-		KaxBlockAddID(const KaxBlockAddID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxBlockAddID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxBlockAddID(*this);}
+DECLARE_MKX_UINTEGER(KaxBlockAddID)
 };
 
-class MATROSKA_DLL_API KaxCodecState : public EbmlBinary {
-	public:
-		KaxCodecState() {}
-		KaxCodecState(const KaxCodecState & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxCodecState);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool ValidateSize() const {return true;}
-
-		EbmlElement * Clone() const {return new KaxCodecState(*this);}
+DECLARE_MKX_BINARY(KaxCodecState)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxBlockData.h b/matroska/KaxBlockData.h
index b8749a9..c9c4b64 100644
--- a/matroska/KaxBlockData.h
+++ b/matroska/KaxBlockData.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -37,6 +37,7 @@
 #include "ebml/EbmlMaster.h"
 #include "ebml/EbmlUInteger.h"
 #include "ebml/EbmlSInteger.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
@@ -46,34 +47,18 @@ class KaxReferenceBlock;
 class KaxBlockGroup;
 class KaxBlockBlob;
 
-class MATROSKA_DLL_API KaxReferencePriority : public EbmlUInteger {
-	public:
-		KaxReferencePriority() :EbmlUInteger(0) {}
-		KaxReferencePriority(const KaxReferencePriority & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxReferencePriority);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxReferencePriority(*this);}
+DECLARE_MKX_UINTEGER(KaxReferencePriority)
 };
 
 /*!
 	\brief element used for B frame-likes
 */
-class MATROSKA_DLL_API KaxReferenceBlock : public EbmlSInteger {
+DECLARE_MKX_SINTEGER_CONS(KaxReferenceBlock)
 	public:
-		KaxReferenceBlock() :RefdBlock(NULL), ParentBlock(NULL) {bTimecodeSet = false;}
-		KaxReferenceBlock(const KaxReferenceBlock & ElementToClone) :EbmlSInteger(ElementToClone), bTimecodeSet(ElementToClone.bTimecodeSet) {}
-		static EbmlElement & Create() {return *(new KaxReferenceBlock);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxReferenceBlock(*this);}
-		
 		/*!
 			\brief override this method to compute the timecode value
 		*/
-		virtual uint64 UpdateSize(bool bSaveDefault = false, bool bForceRender = false);
+		virtual filepos_t UpdateSize(bool bSaveDefault = false, bool bForceRender = false);
 
 		const KaxBlockBlob & RefBlock() const;
 		void SetReferencedBlock(const KaxBlockBlob * aRefdBlock);
@@ -83,98 +68,34 @@ class MATROSKA_DLL_API KaxReferenceBlock : public EbmlSInteger {
 	protected:
 		const KaxBlockBlob * RefdBlock;
 		const KaxBlockGroup * ParentBlock;
-		void SetReferencedTimecode(int64 refTimecode) {Value = refTimecode; bTimecodeSet = true; bValueIsSet = true;};
+		void SetReferencedTimecode(int64 refTimecode) {*static_cast<EbmlSInteger*>(this) = refTimecode; bTimecodeSet = true;};
 		bool bTimecodeSet;
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxReferenceVirtual : public EbmlSInteger {
-	public:
-		KaxReferenceVirtual() {}
-		KaxReferenceVirtual(const KaxReferenceVirtual & ElementToClone) :EbmlSInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxReferenceVirtual);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxReferenceVirtual(*this);}
+DECLARE_MKX_SINTEGER(KaxReferenceVirtual)
 };
 #endif // MATROSKA_VERSION
 
-class MATROSKA_DLL_API KaxTimeSlice : public EbmlMaster {
-	public:
-		KaxTimeSlice();
-		KaxTimeSlice(const KaxTimeSlice & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTimeSlice);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTimeSlice(*this);}
+DECLARE_MKX_MASTER(KaxTimeSlice)
 };
 
-class MATROSKA_DLL_API KaxSlices : public EbmlMaster {
-	public:
-		KaxSlices();
-		KaxSlices(const KaxSlices & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSlices);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSlices(*this);}
+DECLARE_MKX_MASTER(KaxSlices)
 };
 
-class MATROSKA_DLL_API KaxSliceLaceNumber : public EbmlUInteger {
-	public:
-		KaxSliceLaceNumber() :EbmlUInteger(0) {}
-		KaxSliceLaceNumber(const KaxSliceLaceNumber & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSliceLaceNumber);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSliceLaceNumber(*this);}
+DECLARE_MKX_UINTEGER(KaxSliceLaceNumber)
 };
 
-class MATROSKA_DLL_API KaxSliceFrameNumber : public EbmlUInteger {
-	public:
-		KaxSliceFrameNumber() :EbmlUInteger(0) {}
-		KaxSliceFrameNumber(const KaxSliceFrameNumber & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSliceFrameNumber);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSliceFrameNumber(*this);}
+DECLARE_MKX_UINTEGER(KaxSliceFrameNumber)
 };
 
-class MATROSKA_DLL_API KaxSliceBlockAddID : public EbmlUInteger {
-	public:
-		KaxSliceBlockAddID() :EbmlUInteger(0) {}
-		KaxSliceBlockAddID(const KaxSliceBlockAddID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSliceBlockAddID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSliceBlockAddID(*this);}
+DECLARE_MKX_UINTEGER(KaxSliceBlockAddID)
 };
 
-class MATROSKA_DLL_API KaxSliceDelay : public EbmlUInteger {
-	public:
-		KaxSliceDelay() :EbmlUInteger(0) {}
-		KaxSliceDelay(const KaxSliceDelay & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSliceDelay);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSliceDelay(*this);}
+DECLARE_MKX_UINTEGER(KaxSliceDelay)
 };
 
-class MATROSKA_DLL_API KaxSliceDuration : public EbmlUInteger {
-	public:
-		KaxSliceDuration() {}
-		KaxSliceDuration(const KaxSliceDuration & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSliceDuration);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSliceDuration(*this);}
+DECLARE_MKX_UINTEGER(KaxSliceDuration)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxChapters.h b/matroska/KaxChapters.h
index 56474c0..968b820 100644
--- a/matroska/KaxChapters.h
+++ b/matroska/KaxChapters.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,7 +29,7 @@
 
 /*!
 	\file
-	\version \$Id: KaxChapters.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $
+	\version \$Id: KaxChapters.h 270 2010-05-25 12:02:30Z robux4 $
 	\author Steve Lhomme     <robux4 @ users.sf.net>
 */
 #ifndef LIBMATROSKA_CHAPTERS_H
@@ -41,310 +41,95 @@
 #include "ebml/EbmlUnicodeString.h"
 #include "ebml/EbmlString.h"
 #include "ebml/EbmlBinary.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxChapters : public EbmlMaster {
-	public:
-		KaxChapters();
-		KaxChapters(const KaxChapters & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxChapters);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxChapters(*this);}
+DECLARE_MKX_MASTER(KaxChapters)
 };
 
-class MATROSKA_DLL_API KaxEditionEntry : public EbmlMaster {
-	public:
-		KaxEditionEntry();
-		KaxEditionEntry(const KaxEditionEntry & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxEditionEntry);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxEditionEntry(*this);}
+DECLARE_MKX_MASTER(KaxEditionEntry)
 };
 
-class MATROSKA_DLL_API KaxEditionUID : public EbmlUInteger {
-public:
-    KaxEditionUID() {}
-	KaxEditionUID(const KaxEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxEditionUID);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxEditionUID(*this);}
+DECLARE_MKX_UINTEGER(KaxEditionUID)
 };
 
-class MATROSKA_DLL_API KaxEditionFlagHidden : public EbmlUInteger {
-public:
-    KaxEditionFlagHidden(): EbmlUInteger(0) {}
-	KaxEditionFlagHidden(const KaxEditionFlagHidden & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxEditionFlagHidden);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxEditionFlagHidden(*this);}
+DECLARE_MKX_UINTEGER(KaxEditionFlagHidden)
 };
 
-class MATROSKA_DLL_API KaxEditionFlagDefault : public EbmlUInteger {
-public:
-    KaxEditionFlagDefault(): EbmlUInteger(0) {}
-	KaxEditionFlagDefault(const KaxEditionFlagDefault & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxEditionFlagDefault);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxEditionFlagDefault(*this);}
+DECLARE_MKX_UINTEGER(KaxEditionFlagDefault)
 };
 
-class MATROSKA_DLL_API KaxEditionFlagOrdered : public EbmlUInteger {
-public:
-    KaxEditionFlagOrdered(): EbmlUInteger(0) {}
-	KaxEditionFlagOrdered(const KaxEditionFlagOrdered & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxEditionFlagOrdered);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxEditionFlagOrdered(*this);}
+DECLARE_MKX_UINTEGER(KaxEditionFlagOrdered)
 };
 
-class MATROSKA_DLL_API KaxChapterAtom : public EbmlMaster {
-public:
-    KaxChapterAtom();
-	KaxChapterAtom(const KaxChapterAtom & ElementToClone) :EbmlMaster(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterAtom);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterAtom(*this);}
+DECLARE_MKX_MASTER(KaxChapterAtom)
 };
 
-class MATROSKA_DLL_API KaxChapterUID : public EbmlUInteger {
-public:
-    KaxChapterUID() {}
-	KaxChapterUID(const KaxChapterUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterUID);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterUID(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterUID)
 };
 
-class MATROSKA_DLL_API KaxChapterTimeStart : public EbmlUInteger {
-public:
-    KaxChapterTimeStart() {}
-	KaxChapterTimeStart(const KaxChapterTimeStart & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterTimeStart);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterTimeStart(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterTimeStart)
 };
 
-class MATROSKA_DLL_API KaxChapterTimeEnd : public EbmlUInteger {
-public:
-    KaxChapterTimeEnd() {}
-	KaxChapterTimeEnd(const KaxChapterTimeEnd & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterTimeEnd);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterTimeEnd(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterTimeEnd)
 };
 
-class MATROSKA_DLL_API KaxChapterFlagHidden : public EbmlUInteger {
-public:
-	KaxChapterFlagHidden(): EbmlUInteger(0) {}
-	KaxChapterFlagHidden(const KaxChapterFlagHidden & ElementToClone) :EbmlUInteger(ElementToClone) {}
-	static EbmlElement & Create() {return *(new KaxChapterFlagHidden);}
-	const EbmlCallbacks & Generic() const {return ClassInfos;}
-	static const EbmlCallbacks ClassInfos;
-	operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterFlagHidden(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterFlagHidden)
 };
 
-class MATROSKA_DLL_API KaxChapterFlagEnabled : public EbmlUInteger {
-public:
-	KaxChapterFlagEnabled(): EbmlUInteger(1) {}
-	KaxChapterFlagEnabled(const KaxChapterFlagEnabled & ElementToClone) :EbmlUInteger(ElementToClone) {}
-	static EbmlElement & Create() {return *(new KaxChapterFlagEnabled);}
-	const EbmlCallbacks & Generic() const {return ClassInfos;}
-	static const EbmlCallbacks ClassInfos;
-	operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterFlagEnabled(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterFlagEnabled)
 };
 
-class MATROSKA_DLL_API KaxChapterSegmentUID : public EbmlBinary {
-public:
-    KaxChapterSegmentUID() {}
-	KaxChapterSegmentUID(const KaxChapterSegmentUID & ElementToClone) :EbmlBinary(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterSegmentUID);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterSegmentUID(*this);}
-	bool ValidateSize() const { return (Size == 16);}
+DECLARE_MKX_BINARY(KaxChapterSegmentUID)
+    public:
+	    virtual bool ValidateSize() const { return IsFiniteSize() && (GetSize() == 16);}
 };
 
-class MATROSKA_DLL_API KaxChapterSegmentEditionUID : public EbmlBinary {
-public:
-    KaxChapterSegmentEditionUID() {}
-	KaxChapterSegmentEditionUID(const KaxChapterSegmentEditionUID & ElementToClone) :EbmlBinary(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterSegmentEditionUID);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterSegmentEditionUID(*this);}
-	bool ValidateSize() const { return (Size == 16);}
+DECLARE_MKX_BINARY(KaxChapterSegmentEditionUID)
+    public:
+	    virtual bool ValidateSize() const { return IsFiniteSize() && (GetSize() == 16);}
 };
 
-class MATROSKA_DLL_API KaxChapterPhysicalEquiv : public EbmlUInteger {
-public:
-	KaxChapterPhysicalEquiv(): EbmlUInteger() {}
-	KaxChapterPhysicalEquiv(const KaxChapterPhysicalEquiv & ElementToClone) :EbmlUInteger(ElementToClone) {}
-	static EbmlElement & Create() {return *(new KaxChapterPhysicalEquiv);}
-	const EbmlCallbacks & Generic() const {return ClassInfos;}
-	static const EbmlCallbacks ClassInfos;
-	operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterPhysicalEquiv(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterPhysicalEquiv)
 };
 
-class MATROSKA_DLL_API KaxChapterTrack : public EbmlMaster {
-public:
-    KaxChapterTrack();
-	KaxChapterTrack(const KaxChapterTrack & ElementToClone) :EbmlMaster(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterTrack);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterTrack(*this);}
+DECLARE_MKX_MASTER(KaxChapterTrack)
 };
 
-class MATROSKA_DLL_API KaxChapterTrackNumber : public EbmlUInteger {
-public:
-    KaxChapterTrackNumber() {}
-	KaxChapterTrackNumber(const KaxChapterTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterTrackNumber);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterTrackNumber(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterTrackNumber)
 };
 
-class MATROSKA_DLL_API KaxChapterDisplay : public EbmlMaster {
-public:
-    KaxChapterDisplay();
-	KaxChapterDisplay(const KaxChapterDisplay & ElementToClone) :EbmlMaster(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterDisplay);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterDisplay(*this);}
+DECLARE_MKX_MASTER(KaxChapterDisplay)
 };
 
-class MATROSKA_DLL_API KaxChapterString : public EbmlUnicodeString {
-public:
-    KaxChapterString() {}
-	KaxChapterString(const KaxChapterString & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterString);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterString(*this);}
+DECLARE_MKX_UNISTRING(KaxChapterString)
 };
 
-class MATROSKA_DLL_API KaxChapterLanguage : public EbmlString {
-public:
-    KaxChapterLanguage() :EbmlString("eng") {}
-	KaxChapterLanguage(const KaxChapterLanguage & ElementToClone) :EbmlString(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterLanguage);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterLanguage(*this);}
+DECLARE_MKX_STRING(KaxChapterLanguage)
 };
 
-class MATROSKA_DLL_API KaxChapterCountry : public EbmlString {
-public:
-    KaxChapterCountry() :EbmlString() {}
-	KaxChapterCountry(const KaxChapterCountry & ElementToClone) :EbmlString(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterCountry);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterCountry(*this);}
+DECLARE_MKX_STRING(KaxChapterCountry)
 };
 
-class MATROSKA_DLL_API KaxChapterProcess : public EbmlMaster {
-public:
-    KaxChapterProcess();
-	KaxChapterProcess(const KaxChapterProcess & ElementToClone) :EbmlMaster(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterProcess);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterProcess(*this);}
+DECLARE_MKX_MASTER(KaxChapterProcess)
 };
 
-class MATROSKA_DLL_API KaxChapterProcessCodecID : public EbmlUInteger {
-public:
-    KaxChapterProcessCodecID() :EbmlUInteger(0) {}
-	KaxChapterProcessCodecID(const KaxChapterProcessCodecID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterProcessCodecID);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterProcessCodecID(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterProcessCodecID)
 };
 
-class MATROSKA_DLL_API KaxChapterProcessPrivate : public EbmlBinary {
-public:
-    KaxChapterProcessPrivate() {}
-	KaxChapterProcessPrivate(const KaxChapterProcessPrivate & ElementToClone) :EbmlBinary(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterProcessPrivate);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterProcessPrivate(*this);}
-	bool ValidateSize() const {return true;}
+DECLARE_MKX_BINARY(KaxChapterProcessPrivate)
 };
 
-class MATROSKA_DLL_API KaxChapterProcessCommand : public EbmlMaster {
-public:
-    KaxChapterProcessCommand();
-	KaxChapterProcessCommand(const KaxChapterProcessCommand & ElementToClone) :EbmlMaster(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterProcessCommand);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterProcessCommand(*this);}
+DECLARE_MKX_MASTER(KaxChapterProcessCommand)
 };
 
-class MATROSKA_DLL_API KaxChapterProcessTime : public EbmlUInteger {
-public:
-    KaxChapterProcessTime() {}
-	KaxChapterProcessTime(const KaxChapterProcessTime & ElementToClone) :EbmlUInteger(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterProcessTime);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterProcessTime(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterProcessTime)
 };
 
-class MATROSKA_DLL_API KaxChapterProcessData : public EbmlBinary {
-public:
-    KaxChapterProcessData() {}
-	KaxChapterProcessData(const KaxChapterProcessData & ElementToClone) :EbmlBinary(ElementToClone) {}
-    static EbmlElement & Create() {return *(new KaxChapterProcessData);}
-    const EbmlCallbacks & Generic() const {return ClassInfos;}
-    static const EbmlCallbacks ClassInfos;
-    operator const EbmlId &() const {return ClassInfos.GlobalId;}
-	EbmlElement * Clone() const {return new KaxChapterProcessData(*this);}
-	bool ValidateSize() const {return true;}
+DECLARE_MKX_BINARY(KaxChapterProcessData)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxCluster.h b/matroska/KaxCluster.h
index b8596a0..e5970b5 100644
--- a/matroska/KaxCluster.h
+++ b/matroska/KaxCluster.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** 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
@@ -41,6 +41,7 @@
 #include "matroska/KaxBlock.h"
 #include "matroska/KaxCues.h"
 #include "matroska/KaxClusterData.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
@@ -48,16 +49,8 @@ START_LIBMATROSKA_NAMESPACE
 
 class KaxSegment;
 
-class MATROSKA_DLL_API KaxCluster : public EbmlMaster {
+DECLARE_MKX_MASTER_CONS(KaxCluster)
 	public:
-		KaxCluster();
-		KaxCluster(const KaxCluster & ElementToClone);
-		static EbmlElement & Create() {return *(new KaxCluster);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCluster(*this);}
-
 		/*!
 			\brief Addition of a frame without references
 
@@ -81,7 +74,7 @@ class MATROSKA_DLL_API KaxCluster : public EbmlMaster {
 		/*!
 			\brief Render the data to the stream and retrieve the position of BlockGroups for later cue entries
 		*/
-		uint32 Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault = false);
+		filepos_t Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault = false);
 
 		/*!
 			\return the global timecode of this Cluster
@@ -135,7 +128,7 @@ class MATROSKA_DLL_API KaxCluster : public EbmlMaster {
 		bool SetSilentTrackUsed()
 		{
 			bSilentTracksUsed = true;
-			return FindFirstElt(KaxClusterSilentTracks::ClassInfos, true) != NULL;
+			return FindFirstElt(EBML_INFO(KaxClusterSilentTracks), true) != NULL;
 		}
 
 		bool AddBlockBlob(KaxBlockBlob * NewBlob);
@@ -160,7 +153,6 @@ class MATROSKA_DLL_API KaxCluster : public EbmlMaster {
 			\note method used internally
 		*/
 		bool AddFrameInternal(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, KaxBlockGroup * & MyNewBlock, const KaxBlockGroup * PastBlock, const KaxBlockGroup * ForwBlock, LacingType lacing);
-
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxClusterData.h b/matroska/KaxClusterData.h
index 0e26a37..3e06a08 100644
--- a/matroska/KaxClusterData.h
+++ b/matroska/KaxClusterData.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -38,64 +38,25 @@
 #include "matroska/KaxTypes.h"
 #include "ebml/EbmlMaster.h"
 #include "ebml/EbmlUInteger.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxClusterTimecode : public EbmlUInteger {
-	public:
-		KaxClusterTimecode() {}
-		KaxClusterTimecode(const KaxClusterTimecode & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxClusterTimecode);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxClusterTimecode(*this);}
+DECLARE_MKX_UINTEGER(KaxClusterTimecode)
 };
 
-class MATROSKA_DLL_API KaxClusterSilentTracks : public EbmlMaster {
-	public:
-		KaxClusterSilentTracks();
-		KaxClusterSilentTracks(const KaxClusterSilentTracks & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxClusterSilentTracks);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxClusterSilentTracks(*this);}
+DECLARE_MKX_MASTER(KaxClusterSilentTracks)
 };
 
-class MATROSKA_DLL_API KaxClusterSilentTrackNumber : public EbmlUInteger {
-	public:
-		KaxClusterSilentTrackNumber() {}
-		KaxClusterSilentTrackNumber(const KaxClusterSilentTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxClusterSilentTrackNumber);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxClusterSilentTrackNumber(*this);}
+DECLARE_MKX_UINTEGER(KaxClusterSilentTrackNumber)
 };
 
-class MATROSKA_DLL_API KaxClusterPosition : public EbmlUInteger {
-	public:
-		KaxClusterPosition() {}
-		KaxClusterPosition(const KaxClusterPosition & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxClusterPosition);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxClusterPosition(*this);}
+DECLARE_MKX_UINTEGER(KaxClusterPosition)
 };
 
-class MATROSKA_DLL_API KaxClusterPrevSize : public EbmlUInteger {
-	public:
-		KaxClusterPrevSize() {}
-		KaxClusterPrevSize(const KaxClusterPrevSize & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxClusterPrevSize);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxClusterPrevSize(*this);}
+DECLARE_MKX_UINTEGER(KaxClusterPrevSize)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxConfig.h b/matroska/KaxConfig.h
index 2896978..7740b66 100644
--- a/matroska/KaxConfig.h
+++ b/matroska/KaxConfig.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
diff --git a/matroska/KaxContentEncoding.h b/matroska/KaxContentEncoding.h
index d1b241c..fb83926 100644
--- a/matroska/KaxContentEncoding.h
+++ b/matroska/KaxContentEncoding.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -39,210 +39,55 @@
 #include "ebml/EbmlMaster.h"
 #include "ebml/EbmlUInteger.h"
 #include "ebml/EbmlBinary.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxContentEncodings: public EbmlMaster {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncodings();
-  KaxContentEncodings(const KaxContentEncodings &ElementToClone):
-    EbmlMaster(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncodings); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncodings(*this); }
+DECLARE_MKX_MASTER(KaxContentEncodings)
 };
 
-class MATROSKA_DLL_API KaxContentEncoding: public EbmlMaster {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncoding();
-  KaxContentEncoding(const KaxContentEncoding &ElementToClone):
-    EbmlMaster(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncoding); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncoding(*this); }
+DECLARE_MKX_MASTER(KaxContentEncoding)
 };
 
-class MATROSKA_DLL_API KaxContentEncodingOrder: public EbmlUInteger {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncodingOrder(): EbmlUInteger(0) {}
-  KaxContentEncodingOrder(const KaxContentEncodingOrder &ElementToClone):
-    EbmlUInteger(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncodingOrder); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncodingOrder(*this); }
+DECLARE_MKX_UINTEGER(KaxContentEncodingOrder)
 };
 
-class MATROSKA_DLL_API KaxContentEncodingScope: public EbmlUInteger {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncodingScope(): EbmlUInteger(1) {}
-  KaxContentEncodingScope(const KaxContentEncodingScope &ElementToClone):
-    EbmlUInteger(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncodingScope); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncodingScope(*this); }
+DECLARE_MKX_UINTEGER(KaxContentEncodingScope)
 };
 
-class MATROSKA_DLL_API KaxContentEncodingType: public EbmlUInteger {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncodingType(): EbmlUInteger(0) {}
-  KaxContentEncodingType(const KaxContentEncodingType &ElementToClone):
-    EbmlUInteger(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncodingType); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncodingType(*this); }
+DECLARE_MKX_UINTEGER(KaxContentEncodingType)
 };
 
-class MATROSKA_DLL_API KaxContentCompression: public EbmlMaster {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentCompression();
-  KaxContentCompression(const KaxContentCompression &ElementToClone):
-    EbmlMaster(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentCompression); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentCompression(*this); }
+DECLARE_MKX_MASTER(KaxContentCompression)
 };
 
-class MATROSKA_DLL_API KaxContentCompAlgo: public EbmlUInteger {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentCompAlgo(): EbmlUInteger(0) {}
-  KaxContentCompAlgo(const KaxContentCompAlgo &ElementToClone):
-    EbmlUInteger(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentCompAlgo); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentCompAlgo(*this); }
+DECLARE_MKX_UINTEGER(KaxContentCompAlgo)
 };
 
-class MATROSKA_DLL_API KaxContentCompSettings: public EbmlBinary {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentCompSettings() {}
-  KaxContentCompSettings(const KaxContentCompSettings &ElementToClone):
-    EbmlBinary(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentCompSettings); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const {
-    return new KaxContentCompSettings(*this);
-  }
-  bool ValidateSize(void) const { return true; }
+DECLARE_MKX_BINARY(KaxContentCompSettings)
 };
 
-class MATROSKA_DLL_API KaxContentEncryption: public EbmlMaster {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncryption();
-  KaxContentEncryption(const KaxContentEncryption &ElementToClone):
-    EbmlMaster(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncryption); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncryption(*this); }
+DECLARE_MKX_MASTER(KaxContentEncryption)
 };
 
-class MATROSKA_DLL_API KaxContentEncAlgo: public EbmlUInteger {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncAlgo(): EbmlUInteger(0) {}
-  KaxContentEncAlgo(const KaxContentEncAlgo &ElementToClone):
-    EbmlUInteger(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncAlgo); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncAlgo(*this); }
+DECLARE_MKX_UINTEGER(KaxContentEncAlgo)
 };
 
-class MATROSKA_DLL_API KaxContentEncKeyID: public EbmlBinary {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentEncKeyID() {}
-  KaxContentEncKeyID(const KaxContentEncKeyID &ElementToClone):
-    EbmlBinary(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentEncKeyID); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentEncKeyID(*this); }
-  bool ValidateSize(void) const { return true; }
+DECLARE_MKX_BINARY(KaxContentEncKeyID)
 };
 
-class MATROSKA_DLL_API KaxContentSignature: public EbmlBinary {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentSignature() {}
-  KaxContentSignature(const KaxContentSignature &ElementToClone):
-    EbmlBinary(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentSignature); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentSignature(*this); }
-  bool ValidateSize(void) const { return true; }
+DECLARE_MKX_BINARY(KaxContentSignature)
 };
 
-class MATROSKA_DLL_API KaxContentSigKeyID: public EbmlBinary {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentSigKeyID() {}
-  KaxContentSigKeyID(const KaxContentSigKeyID &ElementToClone):
-    EbmlBinary(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentSigKeyID); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentSigKeyID(*this); }
-  bool ValidateSize(void) const { return true; }
+DECLARE_MKX_BINARY(KaxContentSigKeyID)
 };
 
-class MATROSKA_DLL_API KaxContentSigAlgo: public EbmlUInteger {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentSigAlgo() {}
-  KaxContentSigAlgo(const KaxContentSigAlgo &ElementToClone):
-    EbmlUInteger(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentSigAlgo); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentSigAlgo(*this); }
+DECLARE_MKX_UINTEGER(KaxContentSigAlgo)
 };
 
-class MATROSKA_DLL_API KaxContentSigHashAlgo: public EbmlUInteger {
-public:
-  static const EbmlCallbacks ClassInfos;
-
-  KaxContentSigHashAlgo() {}
-  KaxContentSigHashAlgo(const KaxContentSigHashAlgo &ElementToClone):
-    EbmlUInteger(ElementToClone) {}
-  static EbmlElement &Create() { return *(new KaxContentSigHashAlgo); }
-  const EbmlCallbacks &Generic() const { return ClassInfos; }
-  operator const EbmlId &() const { return ClassInfos.GlobalId; }
-  EbmlElement *Clone() const { return new KaxContentSigHashAlgo(*this); }
+DECLARE_MKX_UINTEGER(KaxContentSigHashAlgo)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxContexts.h b/matroska/KaxContexts.h
index ced7740..d88bcff 100644
--- a/matroska/KaxContexts.h
+++ b/matroska/KaxContexts.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -79,8 +79,24 @@ extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDownloadURL_Context;
 extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDecodeAll_Context;
 extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackOverlay_Context;
 
+#define Context_KaxMatroska              KaxMatroska_Context
+#define Context_KaxSegment               KaxSegment_Context
+#define Context_KaxTrackEntry            KaxTrackEntry_Context
+#define Context_KaxTracks                KaxTracks_Context
+#define Context_KaxCluster               KaxCluster_Context
+#define Context_KaxBlockGroup            KaxBlockGroup_Context
+#define Context_KaxInfo                  KaxInfo_Context
+#define Context_KaxAttached              KaxAttached_Context
+#define Context_KaxAttachments           KaxAttachments_Context
+#define Context_KaxChapters              KaxChapters_Context
+#define Context_KaxCues                  KaxCues_Context
+#define Context_KaxTags                  KaxTags_Context
+#define Context_KaxSeekHead              KaxSeekHead_Context
+#define Context_KaxTag                   KaxTag_Context
+#define Context_KaxTagCommercial         KaxTagCommercial_Context
+
 extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxGlobal_Context();
-extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxTagsGlobal_Context();
+//extern const EbmlSemanticContext & MATROSKA_DLL_API GetKaxTagsGlobal_Context();
 
 END_LIBMATROSKA_NAMESPACE
 
diff --git a/matroska/KaxCues.h b/matroska/KaxCues.h
index c39c1af..b9da81a 100644
--- a/matroska/KaxCues.h
+++ b/matroska/KaxCues.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -47,16 +47,9 @@ START_LIBMATROSKA_NAMESPACE
 
 class KaxCuePoint;
 
-class MATROSKA_DLL_API KaxCues : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxCues)
 	public:
-		KaxCues();
-		KaxCues(const KaxCues & ElementToClone) :EbmlMaster(ElementToClone) {}
 		~KaxCues();
-		static EbmlElement & Create() {return *(new KaxCues);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCues(*this);}
 
 		bool AddBlockGroup(const KaxBlockGroup & BlockReference);
 		bool AddBlockBlob(const KaxBlockBlob & BlockReference);
@@ -70,7 +63,7 @@ class MATROSKA_DLL_API KaxCues : public EbmlMaster {
 		/*!
 			\brief override to sort by timecode/track
 		*/
-		uint32 Render(IOCallback & output, bool bSaveDefault = false) {
+		filepos_t Render(IOCallback & output, bool bSaveDefault = false) {
 			Sort();
 			return EbmlMaster::Render(output, bSaveDefault);
 		}
diff --git a/matroska/KaxCuesData.h b/matroska/KaxCuesData.h
index 4c2c069..46d70c2 100644
--- a/matroska/KaxCuesData.h
+++ b/matroska/KaxCuesData.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -36,6 +36,7 @@
 #include "matroska/KaxTypes.h"
 #include "ebml/EbmlUInteger.h"
 #include "ebml/EbmlMaster.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
@@ -46,150 +47,55 @@ class KaxBlockBlob;
 class KaxCueTrackPositions;
 class KaxInternalBlock;
 
-class MATROSKA_DLL_API KaxCuePoint : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxCuePoint)
 	public:
-		KaxCuePoint();
-		KaxCuePoint(const KaxCuePoint & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCuePoint);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCuePoint(*this);}
 		void PositionSet(const KaxBlockGroup & BlockReference, uint64 GlobalTimecodeScale);
 		void PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale);
 
-		bool operator<(const EbmlElement & EltB) const;
+		virtual bool IsSmallerThan(const EbmlElement *Cmp) const;
 
 		const KaxCueTrackPositions * GetSeekPosition() const;
 		bool Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const;
 };
 
-class MATROSKA_DLL_API KaxCueTime : public EbmlUInteger {
-	public:
-		KaxCueTime() {}
-		KaxCueTime(const KaxCueTime & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueTime);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueTime(*this);}
+DECLARE_MKX_UINTEGER(KaxCueTime)
 };
 
-class MATROSKA_DLL_API KaxCueTrackPositions : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxCueTrackPositions)
 	public:
-		KaxCueTrackPositions();
-		KaxCueTrackPositions(const KaxCueTrackPositions & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueTrackPositions);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueTrackPositions(*this);}
-
 		uint64 ClusterPosition() const;
 		uint16 TrackNumber() const;
 };
 
-class MATROSKA_DLL_API KaxCueTrack : public EbmlUInteger {
-	public:
-		KaxCueTrack() {}
-		KaxCueTrack(const KaxCueTrack & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueTrack);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueTrack(*this);}
+DECLARE_MKX_UINTEGER(KaxCueTrack)
 };
 
-class MATROSKA_DLL_API KaxCueClusterPosition : public EbmlUInteger {
-	public:
-		KaxCueClusterPosition() {}
-		KaxCueClusterPosition(const KaxCueClusterPosition & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueClusterPosition);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueClusterPosition(*this);}
+DECLARE_MKX_UINTEGER(KaxCueClusterPosition)
 };
 
-class MATROSKA_DLL_API KaxCueBlockNumber : public EbmlUInteger {
-	public:
-		KaxCueBlockNumber() :EbmlUInteger(1) {}
-		KaxCueBlockNumber(const KaxCueBlockNumber & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueBlockNumber);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueBlockNumber(*this);}
+DECLARE_MKX_UINTEGER(KaxCueBlockNumber)
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxCueCodecState : public EbmlUInteger {
-	public:
-		KaxCueCodecState() :EbmlUInteger(0) {}
-		KaxCueCodecState(const KaxCueCodecState & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueCodecState);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueCodecState(*this);}
+DECLARE_MKX_UINTEGER(KaxCueCodecState)
 };
 
-class MATROSKA_DLL_API KaxCueReference : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxCueReference)
 	public:
-		KaxCueReference();
-		KaxCueReference(const KaxCueReference & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueReference);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueReference(*this);}
-		
 		void AddReference(const KaxBlockGroup & BlockReferenced, uint64 GlobalTimecodeScale);
 		void AddReference(const KaxBlockBlob & BlockReferenced, uint64 GlobalTimecodeScale);
 };
 
-class MATROSKA_DLL_API KaxCueRefTime : public EbmlUInteger {
-	public:
-		KaxCueRefTime() {}
-		KaxCueRefTime(const KaxCueRefTime & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueRefTime);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueRefTime(*this);}
+DECLARE_MKX_UINTEGER(KaxCueRefTime)
 };
 
-class MATROSKA_DLL_API KaxCueRefCluster : public EbmlUInteger {
-	public:
-		KaxCueRefCluster() {}
-		KaxCueRefCluster(const KaxCueRefCluster & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueRefCluster);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueRefCluster(*this);}
+DECLARE_MKX_UINTEGER(KaxCueRefCluster)
 };
 
-class MATROSKA_DLL_API KaxCueRefNumber : public EbmlUInteger {
-	public:
-		KaxCueRefNumber() :EbmlUInteger(1) {}
-		KaxCueRefNumber(const KaxCueRefNumber & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueRefNumber);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueRefNumber(*this);}
+DECLARE_MKX_UINTEGER(KaxCueRefNumber)
 };
 
-class MATROSKA_DLL_API KaxCueRefCodecState : public EbmlUInteger {
-	public:
-		KaxCueRefCodecState() :EbmlUInteger(0) {}
-		KaxCueRefCodecState(const KaxCueRefCodecState & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCueRefCodecState);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCueRefCodecState(*this);}
+DECLARE_MKX_UINTEGER(KaxCueRefCodecState)
 };
 #endif // MATROSKA_VERSION
 
diff --git a/matroska/KaxDefines.h b/matroska/KaxDefines.h
new file mode 100644
index 0000000..c56db5c
--- /dev/null
+++ b/matroska/KaxDefines.h
@@ -0,0 +1,215 @@
+/****************************************************************************
+** 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 at matroska.org if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+/*!
+	\file
+	\version \$Id: KaxDefines.h 295 2010-06-04 11:03:46Z robux4 $
+	\author Steve Lhomme     <robux4 @ users.sf.net>
+*/
+#ifndef LIBMATROSKA_DEFINES_H
+#define LIBMATROSKA_DEFINES_H
+
+#include "ebml/EbmlVersion.h"
+#include "ebml/EbmlElement.h"
+
+#if defined(HAVE_EBML2)
+#define DEFINE_MKX_CONTEXT(a)                DEFINE_xxx_CONTEXT(a,EBML_SemanticGlobal)
+#define DEFINE_MKX_MASTER_CONS(a,b,c,d,e)    DEFINE_xxx_MASTER_CONS(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_MASTER(a,b,c,d,e)         DEFINE_xxx_MASTER(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_MASTER_ORPHAN(a,b,c,d)    DEFINE_xxx_MASTER_ORPHAN(a,b,d,EBML_SemanticGlobal)
+#define DEFINE_MKX_UINTEGER_DEF(a,b,c,d,e,v) DEFINE_xxx_UINTEGER_DEF(a,b,d,e,EBML_SemanticGlobal,v)
+#define DEFINE_MKX_UINTEGER(a,b,c,d,e)       DEFINE_xxx_UINTEGER(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_SINTEGER(a,b,c,d,e)       DEFINE_xxx_SINTEGER(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_SINTEGER_CONS(a,b,c,d,e)  DEFINE_xxx_SINTEGER_CONS(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_STRING_DEF(a,b,c,d,e,v)   DEFINE_xxx_STRING_DEF(a,b,d,e,EBML_SemanticGlobal,v)
+#define DEFINE_MKX_STRING(a,b,c,d,e)         DEFINE_xxx_STRING(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_UNISTRING(a,b,c,d,e)      DEFINE_xxx_UNISTRING(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_BINARY(a,b,c,d,e)         DEFINE_xxx_BINARY(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_BINARY_CONS(a,b,c,d,e)    DEFINE_xxx_BINARY_CONS(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_FLOAT_DEF(a,b,c,d,e,v)    DEFINE_xxx_FLOAT_DEF(a,b,d,e,EBML_SemanticGlobal,v)
+#define DEFINE_MKX_FLOAT(a,b,c,d,e)          DEFINE_xxx_FLOAT(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_FLOAT64(a,b,c,d,e)        DEFINE_xxx_FLOAT64(a,b,d,e,EBML_SemanticGlobal)
+#define DEFINE_MKX_DATE(a,b,c,d,e)           DEFINE_xxx_DATE(a,b,d,e,EBML_SemanticGlobal)
+
+#define DECLARE_MKX_CONTEXT(x)
+
+#define DECLARE_MKX_MASTER(x)     DECLARE_MKX_CONTEXT(x) \
+class MATROSKA_DLL_API x : public EbmlMaster { \
+    public: x(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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(EBML_EXTRA_PARAM); \
+    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
diff --git a/matroska/KaxInfo.h b/matroska/KaxInfo.h
index 5ba569b..723a4f1 100644
--- a/matroska/KaxInfo.h
+++ b/matroska/KaxInfo.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -38,42 +38,19 @@
 #include "matroska/KaxTypes.h"
 #include "ebml/EbmlMaster.h"
 #include "ebml/EbmlUnicodeString.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxInfo : public EbmlMaster {
-	public:
-		KaxInfo();
-		KaxInfo(const KaxInfo & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxInfo);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxInfo(*this);}
+DECLARE_MKX_MASTER(KaxInfo)
 };
 
-class MATROSKA_DLL_API KaxMuxingApp : public EbmlUnicodeString {
-	public:
-		KaxMuxingApp() {}
-		KaxMuxingApp(const KaxMuxingApp & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxMuxingApp);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxMuxingApp(*this);}
+DECLARE_MKX_UNISTRING(KaxMuxingApp)
 };
 
-class MATROSKA_DLL_API KaxWritingApp : public EbmlUnicodeString {
-	public:
-		KaxWritingApp() {}
-		KaxWritingApp(const KaxWritingApp & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxWritingApp);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxWritingApp(*this);}
+DECLARE_MKX_UNISTRING(KaxWritingApp)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxInfoData.h b/matroska/KaxInfoData.h
index ee185a7..720882a 100644
--- a/matroska/KaxInfoData.h
+++ b/matroska/KaxInfoData.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,7 +29,7 @@
 
 /*!
 	\file
-	\version \$Id: KaxInfoData.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $
+	\version \$Id: KaxInfoData.h 295 2010-06-04 11:03:46Z robux4 $
 	\author Steve Lhomme     <robux4 @ users.sf.net>
 	\author John Cannon      <spyder2555 @ users.sf.net>
 	\author Moritz Bunkus    <moritz @ bunkus.org>
@@ -44,179 +44,76 @@
 #include "ebml/EbmlBinary.h"
 #include "ebml/EbmlDate.h"
 #include "ebml/EbmlMaster.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxSegmentUID : public EbmlBinary {
+DECLARE_MKX_BINARY(KaxSegmentUID)
 	public:
-		KaxSegmentUID() {}
-		KaxSegmentUID(const KaxSegmentUID & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxSegmentUID);}
-		bool ValidateSize() const { return (Size == 16);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSegmentUID(*this);}
+#if defined(HAVE_EBML2)
+        KaxSegmentUID(EBML_DEF_CONS EBML_DEF_SEP EBML_EXTRA_PARAM);
+#endif
+		virtual bool ValidateSize() const { return IsFiniteSize() && (GetSize() == 16);}
 };
 
-class MATROSKA_DLL_API KaxSegmentFilename : public EbmlUnicodeString {
-	public:
-		KaxSegmentFilename() {}
-		KaxSegmentFilename(const KaxSegmentFilename & ElementToClone) :EbmlUnicodeString(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxSegmentFilename);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSegmentFilename(*this);}
+DECLARE_MKX_UNISTRING(KaxSegmentFilename)
 };
 
+DECLARE_MKX_CONTEXT(KaxPrevUID);
 class MATROSKA_DLL_API KaxPrevUID : public KaxSegmentUID {
 	public:
-		KaxPrevUID() {}
+		KaxPrevUID(EBML_EXTRA_PARAM);
 		KaxPrevUID(const KaxPrevUID & ElementToClone) :KaxSegmentUID(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxPrevUID);}
-		bool ValidateSize() const { return (Size == 16);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxPrevUID(*this);}
+		virtual bool ValidateSize() const { return IsFiniteSize() && (GetSize() == 16);}
+
+        EBML_CONCRETE_CLASS(KaxPrevUID)
 };
 
-class MATROSKA_DLL_API KaxPrevFilename : public EbmlUnicodeString {
-	public:
-		KaxPrevFilename() :EbmlUnicodeString() {}
-		KaxPrevFilename(const KaxPrevFilename & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxPrevFilename);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxPrevFilename(*this);}
+DECLARE_MKX_UNISTRING(KaxPrevFilename)
 };
 
+DECLARE_MKX_CONTEXT(KaxNextUID);
 class MATROSKA_DLL_API KaxNextUID : public KaxSegmentUID {
 	public:
-		KaxNextUID() {}
+		KaxNextUID(EBML_EXTRA_PARAM);
 		KaxNextUID(const KaxNextUID & ElementToClone) :KaxSegmentUID(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxNextUID);}
-		bool ValidateSize() const { return (Size == 16);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxNextUID(*this);}
+		virtual bool ValidateSize() const { return IsFiniteSize() && (GetSize() == 16);}
+
+        EBML_CONCRETE_CLASS(KaxNextUID)
 };
 
-class MATROSKA_DLL_API KaxNextFilename : public EbmlUnicodeString {
-	public:
-		KaxNextFilename() {}
-		KaxNextFilename(const KaxNextFilename & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxNextFilename);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxNextFilename(*this);}
+DECLARE_MKX_UNISTRING(KaxNextFilename)
 };
 
-class MATROSKA_DLL_API KaxSegmentFamily : public EbmlBinary {
+DECLARE_MKX_BINARY(KaxSegmentFamily)
 	public:
-		KaxSegmentFamily() {}
-		KaxSegmentFamily(const KaxSegmentFamily & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxSegmentFamily);}
-		bool ValidateSize() const { return (Size == 16);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSegmentFamily(*this);}
+		virtual bool ValidateSize() const { return IsFiniteSize() && (GetSize() == 16);}
 };
 
-class MATROSKA_DLL_API KaxChapterTranslate : public EbmlMaster {
-	public:
-		KaxChapterTranslate();
-		KaxChapterTranslate(const KaxChapterTranslate & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxChapterTranslate);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxChapterTranslate(*this);}
+DECLARE_MKX_MASTER(KaxChapterTranslate)
 };
 
-class MATROSKA_DLL_API KaxChapterTranslateCodec : public EbmlUInteger {
-	public:
-		KaxChapterTranslateCodec() {}
-		KaxChapterTranslateCodec(const KaxChapterTranslateCodec & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxChapterTranslateCodec);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxChapterTranslateCodec(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterTranslateCodec)
 };
 
-class MATROSKA_DLL_API KaxChapterTranslateEditionUID : public EbmlUInteger {
-	public:
-		KaxChapterTranslateEditionUID() {}
-		KaxChapterTranslateEditionUID(const KaxChapterTranslateEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxChapterTranslateEditionUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxChapterTranslateEditionUID(*this);}
+DECLARE_MKX_UINTEGER(KaxChapterTranslateEditionUID)
 };
 
-class MATROSKA_DLL_API KaxChapterTranslateID : public EbmlBinary {
-	public:
-		KaxChapterTranslateID() {}
-		KaxChapterTranslateID(const KaxChapterTranslateID & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxChapterTranslateID);}
-		bool ValidateSize() const { return true;}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxChapterTranslateID(*this);}
+DECLARE_MKX_BINARY(KaxChapterTranslateID)
 };
 
-class MATROSKA_DLL_API KaxTimecodeScale : public EbmlUInteger {
-	public:
-		KaxTimecodeScale() :EbmlUInteger(1000000) {}
-		KaxTimecodeScale(const KaxTimecodeScale & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTimecodeScale);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTimecodeScale(*this);}
+DECLARE_MKX_UINTEGER(KaxTimecodeScale)
 };
 
-class MATROSKA_DLL_API KaxDuration : public EbmlFloat {
-	public:
-		KaxDuration(): EbmlFloat(FLOAT_64) {}
-		KaxDuration(const KaxDuration & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxDuration);}		
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxDuration(*this);}
+DECLARE_MKX_FLOAT(KaxDuration)
 };
 
-class MATROSKA_DLL_API KaxDateUTC : public EbmlDate {
-	public:
-		KaxDateUTC() {}
-		KaxDateUTC(const KaxDateUTC & ElementToClone) :EbmlDate(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxDateUTC);}		
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxDateUTC(*this);}
+DECLARE_MKX_DATE(KaxDateUTC)
 };
 
-class MATROSKA_DLL_API KaxTitle : public EbmlUnicodeString {
-	public:
-		KaxTitle() {}
-		KaxTitle(const KaxTitle & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTitle);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTitle(*this);}
+DECLARE_MKX_UNISTRING(KaxTitle)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxSeekHead.h b/matroska/KaxSeekHead.h
index 1b269fc..2025fcd 100644
--- a/matroska/KaxSeekHead.h
+++ b/matroska/KaxSeekHead.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,7 +29,7 @@
 
 /*!
 	\file
-	\version \$Id: KaxSeekHead.h,v 1.7 2004/04/14 23:26:17 robux4 Exp $
+	\version \$Id: KaxSeekHead.h 270 2010-05-25 12:02:30Z robux4 $
 	\author Steve Lhomme     <robux4 @ users.sf.net>
 */
 #ifndef LIBMATROSKA_SEEK_HEAD_H
@@ -39,6 +39,7 @@
 #include "ebml/EbmlMaster.h"
 #include "ebml/EbmlBinary.h"
 #include "ebml/EbmlUInteger.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
@@ -47,16 +48,8 @@ START_LIBMATROSKA_NAMESPACE
 class KaxSegment;
 class KaxSeek;
 
-class MATROSKA_DLL_API KaxSeekHead : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxSeekHead)
 	public:
-		KaxSeekHead();
-		KaxSeekHead(const KaxSeekHead & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSeekHead);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSeekHead(*this);}
-
 		/*!
 			\brief add an element to index in the Meta Seek data
 			\note the element should already be written in the file
@@ -67,42 +60,19 @@ class MATROSKA_DLL_API KaxSeekHead : public EbmlMaster {
 		KaxSeek * FindNextOf(const KaxSeek &aPrev) const;
 };
 
-class MATROSKA_DLL_API KaxSeek : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxSeek)
 	public:
-		KaxSeek();
-		KaxSeek(const KaxSeek & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSeek);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSeek(*this);}
-
 		int64 Location() const;
 		bool IsEbmlId(const EbmlId & aId) const;
 		bool IsEbmlId(const KaxSeek & aPoint) const;
 };
 
-class MATROSKA_DLL_API KaxSeekID : public EbmlBinary {
+DECLARE_MKX_BINARY(KaxSeekID)
 	public:
-		KaxSeekID() {}
-		KaxSeekID(const KaxSeekID & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxSeekID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		bool ValidateSize() const {return Size <= 4;}
-		EbmlElement * Clone() const {return new KaxSeekID(*this);}
+		virtual bool ValidateSize() const {return IsFiniteSize() && GetSize() <= 4;}
 };
 
-class MATROSKA_DLL_API KaxSeekPosition : public EbmlUInteger {
-	public:
-		KaxSeekPosition() {}
-		KaxSeekPosition(const KaxSeekPosition & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxSeekPosition);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSeekPosition(*this);}
+DECLARE_MKX_UINTEGER(KaxSeekPosition)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxSegment.h b/matroska/KaxSegment.h
index 50fc6e0..84423b9 100644
--- a/matroska/KaxSegment.h
+++ b/matroska/KaxSegment.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -37,21 +37,14 @@
 
 #include "matroska/KaxTypes.h"
 #include "ebml/EbmlMaster.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxSegment : public EbmlMaster {
+DECLARE_MKX_MASTER_CONS(KaxSegment)
 	public:
-		KaxSegment();
-		KaxSegment(const KaxSegment & ElementToClone);
-		static EbmlElement & Create() {return *(new KaxSegment);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxSegment(*this);}
-
 		/*!
 			\brief give the position of the element in the segment
 		*/
diff --git a/matroska/KaxTag.h b/matroska/KaxTag.h
index 9f47fe0..c550fdb 100644
--- a/matroska/KaxTag.h
+++ b/matroska/KaxTag.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,7 +29,7 @@
 
 /*!
 	\file
-	\version \$Id: KaxTag.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $
+	\version \$Id: KaxTag.h 270 2010-05-25 12:02:30Z robux4 $
 	\author Jory Stone     <jcsston @ toughguy.net>
 	\author Steve Lhomme   <robux4 @ users.sf.net>
 */
@@ -44,654 +44,186 @@
 #include "ebml/EbmlString.h"
 #include "ebml/EbmlUnicodeString.h"
 #include "ebml/EbmlBinary.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxTag : public EbmlMaster {
-	public:
-		KaxTag();
-		KaxTag(const KaxTag & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTag);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTag(*this);}
+DECLARE_MKX_MASTER(KaxTag)
 };
 
-class MATROSKA_DLL_API KaxTagTargets : public EbmlMaster {
-	public:
-		KaxTagTargets();
-		KaxTagTargets(const KaxTagTargets & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagTargets);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagTargets(*this);}
+DECLARE_MKX_MASTER(KaxTagTargets)
 };
 
-class MATROSKA_DLL_API KaxTagGeneral : public EbmlMaster {
-	public:
-		KaxTagGeneral();
-		KaxTagGeneral(const KaxTagGeneral & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagGeneral);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagGeneral(*this);}
+DECLARE_MKX_MASTER(KaxTagGeneral)
 };
 
-class MATROSKA_DLL_API KaxTagGenres : public EbmlMaster {
-	public:
-		KaxTagGenres();
-		KaxTagGenres(const KaxTagGenres & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagGenres);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagGenres(*this);}
+DECLARE_MKX_MASTER(KaxTagGenres)
 };
 
-class MATROSKA_DLL_API KaxTagAudioSpecific : public EbmlMaster {
-	public:
-		KaxTagAudioSpecific();
-		KaxTagAudioSpecific(const KaxTagAudioSpecific & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagAudioSpecific);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAudioSpecific(*this);}
+DECLARE_MKX_MASTER(KaxTagAudioSpecific)
 };
 
-class MATROSKA_DLL_API KaxTagImageSpecific : public EbmlMaster {
-	public:
-		KaxTagImageSpecific();
-		KaxTagImageSpecific(const KaxTagImageSpecific & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagImageSpecific);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagImageSpecific(*this);}
+DECLARE_MKX_MASTER(KaxTagImageSpecific)
 };
 
-class MATROSKA_DLL_API KaxTagTargetTypeValue : public EbmlUInteger {
-	public:
-		KaxTagTargetTypeValue() :EbmlUInteger(50) {}
-		KaxTagTargetTypeValue(const KaxTagTargetTypeValue & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagTargetTypeValue);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagTargetTypeValue(*this);}
+DECLARE_MKX_UINTEGER(KaxTagTargetTypeValue)
 };
 
-class MATROSKA_DLL_API KaxTagTargetType : public EbmlString {
-	public:
-		KaxTagTargetType() {}
-		KaxTagTargetType(const KaxTagTargetType & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagTargetType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagTargetType(*this);}
+DECLARE_MKX_STRING(KaxTagTargetType)
 };
 
-class MATROSKA_DLL_API KaxTagTrackUID : public EbmlUInteger {
-	public:
-		KaxTagTrackUID() :EbmlUInteger(0) {}
-		KaxTagTrackUID(const KaxTagTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagTrackUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagTrackUID(*this);}
+DECLARE_MKX_UINTEGER(KaxTagTrackUID)
 };
 
-class MATROSKA_DLL_API KaxTagEditionUID : public EbmlUInteger {
-	public:
-		KaxTagEditionUID() :EbmlUInteger(0) {}
-		KaxTagEditionUID(const KaxTagEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagEditionUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagEditionUID(*this);}
+DECLARE_MKX_UINTEGER(KaxTagEditionUID)
 };
 
-class MATROSKA_DLL_API KaxTagChapterUID : public EbmlUInteger {
-	public:
-		KaxTagChapterUID() :EbmlUInteger(0) {}
-		KaxTagChapterUID(const KaxTagChapterUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagChapterUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagChapterUID(*this);}
+DECLARE_MKX_UINTEGER(KaxTagChapterUID)
 };
 
-class MATROSKA_DLL_API KaxTagAttachmentUID : public EbmlUInteger {
-	public:
-		KaxTagAttachmentUID() :EbmlUInteger(0) {}
-		KaxTagAttachmentUID(const KaxTagAttachmentUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagAttachmentUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAttachmentUID(*this);}
+DECLARE_MKX_UINTEGER(KaxTagAttachmentUID)
 };
 
-class MATROSKA_DLL_API KaxTagArchivalLocation : public EbmlUnicodeString {
-	public:
-		KaxTagArchivalLocation() {}
-		KaxTagArchivalLocation(const KaxTagArchivalLocation & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagArchivalLocation);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagArchivalLocation(*this);}
+DECLARE_MKX_UNISTRING(KaxTagArchivalLocation)
 };
 
-class MATROSKA_DLL_API KaxTagAudioEncryption : public EbmlBinary {
-	public:
-		KaxTagAudioEncryption() {}
-		KaxTagAudioEncryption(const KaxTagAudioEncryption & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagAudioEncryption);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAudioEncryption(*this);}
+DECLARE_MKX_BINARY(KaxTagAudioEncryption)
 };
 
-class MATROSKA_DLL_API KaxTagAudioGain : public EbmlFloat {
-	public:
-		KaxTagAudioGain() {}
-		KaxTagAudioGain(const KaxTagAudioGain & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagAudioGain);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAudioGain(*this);}
+DECLARE_MKX_FLOAT(KaxTagAudioGain)
 };
 
-class MATROSKA_DLL_API KaxTagAudioGenre : public EbmlString {
-	public:
-		KaxTagAudioGenre() {}
-		KaxTagAudioGenre(const KaxTagAudioGenre & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagAudioGenre);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAudioGenre(*this);}
+DECLARE_MKX_STRING(KaxTagAudioGenre)
 };
 
-class MATROSKA_DLL_API KaxTagAudioPeak : public EbmlFloat {
-	public:
-		KaxTagAudioPeak() {}
-		KaxTagAudioPeak(const KaxTagAudioPeak & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagAudioPeak);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAudioPeak(*this);}
+DECLARE_MKX_FLOAT(KaxTagAudioPeak)
 };
 
-class MATROSKA_DLL_API KaxTagBibliography : public EbmlUnicodeString {
-	public:
-		KaxTagBibliography() {}
-		KaxTagBibliography(const KaxTagBibliography & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagBibliography);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagBibliography(*this);}
+DECLARE_MKX_UNISTRING(KaxTagBibliography)
 };
 
-class MATROSKA_DLL_API KaxTagBPM : public EbmlFloat {
-	public:
-		KaxTagBPM() {}
-		KaxTagBPM(const KaxTagBPM & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagBPM);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagBPM(*this);}
+DECLARE_MKX_FLOAT(KaxTagBPM)
 };
 
-class MATROSKA_DLL_API KaxTagCaptureDPI : public EbmlUInteger {
-	public:
-		KaxTagCaptureDPI() {}
-		KaxTagCaptureDPI(const KaxTagCaptureDPI & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagCaptureDPI);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagCaptureDPI(*this);}
+DECLARE_MKX_UINTEGER(KaxTagCaptureDPI)
 };
 
-class MATROSKA_DLL_API KaxTagCaptureLightness : public EbmlBinary {
-	public:
-		KaxTagCaptureLightness() {}
-		KaxTagCaptureLightness(const KaxTagCaptureLightness & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagCaptureLightness);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagCaptureLightness(*this);}
+DECLARE_MKX_BINARY(KaxTagCaptureLightness)
 };
 
-class MATROSKA_DLL_API KaxTagCapturePaletteSetting : public EbmlUInteger {
-	public:
-		KaxTagCapturePaletteSetting() {}
-		KaxTagCapturePaletteSetting(const KaxTagCapturePaletteSetting & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagCapturePaletteSetting);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagCapturePaletteSetting(*this);}
+DECLARE_MKX_UINTEGER(KaxTagCapturePaletteSetting)
 };
 
-class MATROSKA_DLL_API KaxTagCaptureSharpness : public EbmlBinary {
-	public:
-		KaxTagCaptureSharpness() {}
-		KaxTagCaptureSharpness(const KaxTagCaptureSharpness & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagCaptureSharpness);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagCaptureSharpness(*this);}
+DECLARE_MKX_BINARY(KaxTagCaptureSharpness)
 };
 
-class MATROSKA_DLL_API KaxTagCropped : public EbmlUnicodeString {
-	public:
-		KaxTagCropped() {}
-		KaxTagCropped(const KaxTagCropped & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagCropped);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagCropped(*this);}
+DECLARE_MKX_UNISTRING(KaxTagCropped)
 };
 
-class MATROSKA_DLL_API KaxTagDiscTrack : public EbmlUInteger {
-	public:
-		KaxTagDiscTrack() {}
-		KaxTagDiscTrack(const KaxTagDiscTrack & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagDiscTrack);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagDiscTrack(*this);}
+DECLARE_MKX_UINTEGER(KaxTagDiscTrack)
 };
 
-class MATROSKA_DLL_API KaxTagEncoder : public EbmlUnicodeString {
-	public:
-		KaxTagEncoder() {}
-		KaxTagEncoder(const KaxTagEncoder & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagEncoder);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagEncoder(*this);}
+DECLARE_MKX_UNISTRING(KaxTagEncoder)
 };
 
-class MATROSKA_DLL_API KaxTagEncodeSettings : public EbmlUnicodeString {
-	public:
-		KaxTagEncodeSettings() {}
-		KaxTagEncodeSettings(const KaxTagEncodeSettings & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagEncodeSettings);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagEncodeSettings(*this);}
+DECLARE_MKX_UNISTRING(KaxTagEncodeSettings)
 };
 
-class MATROSKA_DLL_API KaxTagEqualisation : public EbmlBinary {
-	public:
-		KaxTagEqualisation() {}
-		KaxTagEqualisation(const KaxTagEqualisation & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagEqualisation);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagEqualisation(*this);}
+DECLARE_MKX_BINARY(KaxTagEqualisation)
 };
 
-class MATROSKA_DLL_API KaxTagFile : public EbmlUnicodeString {
-	public:
-		KaxTagFile() {}
-		KaxTagFile(const KaxTagFile & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagFile);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagFile(*this);}
+DECLARE_MKX_UNISTRING(KaxTagFile)
 };
 
-class MATROSKA_DLL_API KaxTagInitialKey : public EbmlString {
-	public:
-		KaxTagInitialKey() {}
-		KaxTagInitialKey(const KaxTagInitialKey & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagInitialKey);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagInitialKey(*this);}
+DECLARE_MKX_STRING(KaxTagInitialKey)
 };
 
-class MATROSKA_DLL_API KaxTagKeywords : public EbmlUnicodeString {
-	public:
-		KaxTagKeywords() {}
-		KaxTagKeywords(const KaxTagKeywords & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagKeywords);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagKeywords(*this);}
+DECLARE_MKX_UNISTRING(KaxTagKeywords)
 };
 
-class MATROSKA_DLL_API KaxTagLanguage : public EbmlString {
-	public:
-		KaxTagLanguage() {}
-		KaxTagLanguage(const KaxTagLanguage & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagLanguage);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagLanguage(*this);}
+DECLARE_MKX_STRING(KaxTagLanguage)
 };
 
-class MATROSKA_DLL_API KaxTagLength : public EbmlUInteger {
-	public:
-		KaxTagLength() {}
-		KaxTagLength(const KaxTagLength & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagLength);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagLength(*this);}
+DECLARE_MKX_UINTEGER(KaxTagLength)
 };
 
-class MATROSKA_DLL_API KaxTagMood : public EbmlUnicodeString {
-	public:
-		KaxTagMood() {}
-		KaxTagMood(const KaxTagMood & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMood);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMood(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMood)
 };
 
-class MATROSKA_DLL_API KaxTagOfficialAudioFileURL : public EbmlString {
-	public:
-		KaxTagOfficialAudioFileURL() {}
-		KaxTagOfficialAudioFileURL(const KaxTagOfficialAudioFileURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagOfficialAudioFileURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagOfficialAudioFileURL(*this);}
+DECLARE_MKX_STRING(KaxTagOfficialAudioFileURL)
 };
 
-class MATROSKA_DLL_API KaxTagOfficialAudioSourceURL : public EbmlString {
-	public:
-		KaxTagOfficialAudioSourceURL() {}
-		KaxTagOfficialAudioSourceURL(const KaxTagOfficialAudioSourceURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagOfficialAudioSourceURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagOfficialAudioSourceURL(*this);}
+DECLARE_MKX_STRING(KaxTagOfficialAudioSourceURL)
 };
 
-class MATROSKA_DLL_API KaxTagOriginalDimensions : public EbmlString {
-	public:
-		KaxTagOriginalDimensions() {}
-		KaxTagOriginalDimensions(const KaxTagOriginalDimensions & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagOriginalDimensions);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagOriginalDimensions(*this);}
+DECLARE_MKX_STRING(KaxTagOriginalDimensions)
 };
 
-class MATROSKA_DLL_API KaxTagOriginalMediaType : public EbmlUnicodeString {
-	public:
-		KaxTagOriginalMediaType() {}
-		KaxTagOriginalMediaType(const KaxTagOriginalMediaType & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagOriginalMediaType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagOriginalMediaType(*this);}
+DECLARE_MKX_UNISTRING(KaxTagOriginalMediaType)
 };
 
-class MATROSKA_DLL_API KaxTagPlayCounter : public EbmlUInteger {
-	public:
-		KaxTagPlayCounter() {}
-		KaxTagPlayCounter(const KaxTagPlayCounter & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagPlayCounter);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagPlayCounter(*this);}
+DECLARE_MKX_UINTEGER(KaxTagPlayCounter)
 };			 
 
-class MATROSKA_DLL_API KaxTagPlaylistDelay : public EbmlUInteger {
-	public:
-		KaxTagPlaylistDelay() {}
-		KaxTagPlaylistDelay(const KaxTagPlaylistDelay & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagPlaylistDelay);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagPlaylistDelay(*this);}
+DECLARE_MKX_UINTEGER(KaxTagPlaylistDelay)
 };
 
-class MATROSKA_DLL_API KaxTagPopularimeter : public EbmlSInteger {
-	public:
-		KaxTagPopularimeter() {}
-		KaxTagPopularimeter(const KaxTagPopularimeter & ElementToClone) :EbmlSInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagPopularimeter);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagPopularimeter(*this);}
+DECLARE_MKX_SINTEGER(KaxTagPopularimeter)
 };
 
-class MATROSKA_DLL_API KaxTagProduct : public EbmlUnicodeString {
-	public:
-		KaxTagProduct() {}
-		KaxTagProduct(const KaxTagProduct & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagProduct);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagProduct(*this);}
+DECLARE_MKX_UNISTRING(KaxTagProduct)
 };
 
-class MATROSKA_DLL_API KaxTagRating : public EbmlBinary {
-	public:
-		KaxTagRating() {}
-		KaxTagRating(const KaxTagRating & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagRating);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagRating(*this);}
+DECLARE_MKX_BINARY(KaxTagRating)
 };
 
-class MATROSKA_DLL_API KaxTagRecordLocation : public EbmlString {
-	public:
-		KaxTagRecordLocation() {}
-		KaxTagRecordLocation(const KaxTagRecordLocation & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagRecordLocation);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagRecordLocation(*this);}
+DECLARE_MKX_STRING(KaxTagRecordLocation)
 };
 
-class MATROSKA_DLL_API KaxTagSetPart : public EbmlUInteger {
-	public:
-		KaxTagSetPart() {}
-		KaxTagSetPart(const KaxTagSetPart & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagSetPart);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagSetPart(*this);}
+DECLARE_MKX_UINTEGER(KaxTagSetPart)
 };
 
-class MATROSKA_DLL_API KaxTagSource : public EbmlUnicodeString {
-	public:
-		KaxTagSource() {}
-		KaxTagSource(const KaxTagSource & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagSource);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagSource(*this);}
+DECLARE_MKX_UNISTRING(KaxTagSource)
 };
 
-class MATROSKA_DLL_API KaxTagSourceForm : public EbmlUnicodeString {
-	public:
-		KaxTagSourceForm() {}
-		KaxTagSourceForm(const KaxTagSourceForm & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagSourceForm);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagSourceForm(*this);}
+DECLARE_MKX_UNISTRING(KaxTagSourceForm)
 };
 
-class MATROSKA_DLL_API KaxTagSubGenre : public EbmlString {
-	public:
-		KaxTagSubGenre() {}
-		KaxTagSubGenre(const KaxTagSubGenre & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagSubGenre);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagSubGenre(*this);}
+DECLARE_MKX_STRING(KaxTagSubGenre)
 };
 
-class MATROSKA_DLL_API KaxTagSubject : public EbmlUnicodeString {
-	public:
-		KaxTagSubject() {}
-		KaxTagSubject(const KaxTagSubject & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagSubject);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagSubject(*this);}
+DECLARE_MKX_UNISTRING(KaxTagSubject)
 };
 
-class MATROSKA_DLL_API KaxTagUnsynchronisedText : public EbmlUnicodeString {
-	public:
-		KaxTagUnsynchronisedText() {}
-		KaxTagUnsynchronisedText(const KaxTagUnsynchronisedText & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagUnsynchronisedText);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagUnsynchronisedText(*this);}
+DECLARE_MKX_UNISTRING(KaxTagUnsynchronisedText)
 };
 
-class MATROSKA_DLL_API KaxTagUserDefinedURL : public EbmlString {
-	public:
-		KaxTagUserDefinedURL() {}
-		KaxTagUserDefinedURL(const KaxTagUserDefinedURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagUserDefinedURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagUserDefinedURL(*this);}
+DECLARE_MKX_STRING(KaxTagUserDefinedURL)
 };
 
-class MATROSKA_DLL_API KaxTagVideoGenre : public EbmlBinary {
+DECLARE_MKX_BINARY(KaxTagVideoGenre)
 	public:
-		KaxTagVideoGenre() {}
-		KaxTagVideoGenre(const KaxTagVideoGenre & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagVideoGenre);}
-		bool ValidateSize() const {return (Size >= 2);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagVideoGenre(*this);}
+		virtual bool ValidateSize() const {return IsFiniteSize() && (GetSize() >= 2);}
 };
 
-class MATROSKA_DLL_API KaxTagSimple : public EbmlMaster {
-	public:
-		KaxTagSimple();
-		KaxTagSimple(const KaxTagSimple & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagSimple);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagSimple(*this);}
+DECLARE_MKX_MASTER(KaxTagSimple)
 };
 
-class MATROSKA_DLL_API KaxTagName : public EbmlUnicodeString {
-	public:
-		KaxTagName() {}
-		KaxTagName(const KaxTagName & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagName);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagName(*this);}
+DECLARE_MKX_UNISTRING(KaxTagName)
 };
 
-class MATROSKA_DLL_API KaxTagLangue : public EbmlString {
-	public:
-		KaxTagLangue(): EbmlString("und") {}
-		KaxTagLangue(const KaxTagLangue & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagLangue);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagLangue(*this);}
+DECLARE_MKX_STRING(KaxTagLangue)
 };
 
-class MATROSKA_DLL_API KaxTagDefault : public EbmlUInteger {
-	public:
-		KaxTagDefault() :EbmlUInteger(1) {}
-		KaxTagDefault(const KaxTagTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagDefault);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagDefault(*this);}
+DECLARE_MKX_UINTEGER(KaxTagDefault)
 };
 
-class MATROSKA_DLL_API KaxTagString : public EbmlUnicodeString {
-	public:
-		KaxTagString() {}
-		KaxTagString(const KaxTagString & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagString);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagString(*this);}
+DECLARE_MKX_UNISTRING(KaxTagString)
 };
 
-class MATROSKA_DLL_API KaxTagBinary : public EbmlBinary {
-	public:
-		KaxTagBinary() {}
-		KaxTagBinary(const KaxTagBinary & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagBinary);}
-		bool ValidateSize() const {return (Size >= 0);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagBinary(*this);}
+DECLARE_MKX_BINARY(KaxTagBinary)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxTagMulti.h b/matroska/KaxTagMulti.h
index 3a4d99b..eb1c54b 100644
--- a/matroska/KaxTagMulti.h
+++ b/matroska/KaxTagMulti.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,7 +29,7 @@
 
 /*!
 	\file
-	\version \$Id: KaxTagMulti.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $
+	\version \$Id: KaxTagMulti.h 270 2010-05-25 12:02:30Z robux4 $
 	\author Jory Stone     <jcsston @ toughguy.net>
 	\author Steve Lhomme   <robux4 @ users.sf.net>
 */
@@ -45,6 +45,7 @@
 #include "ebml/EbmlString.h"
 #include "ebml/EbmlUnicodeString.h"
 #include "ebml/EbmlBinary.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
@@ -122,623 +123,181 @@ enum KaxTagMultiTitleTypes {
 	KaxTagMultiTitleType_Series  //This would be used to label a set of ID 3. For example, The Simpsons.
 };
 
-class MATROSKA_DLL_API KaxTagMultiComment : public EbmlMaster {
-	public:
-		KaxTagMultiComment();
-		KaxTagMultiComment(const KaxTagMultiComment & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiComment);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiComment(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiComment)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommentName : public EbmlString {
-	public:
-		KaxTagMultiCommentName() {}
-		KaxTagMultiCommentName(const KaxTagMultiCommentName & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommentName);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommentName(*this);}
+DECLARE_MKX_STRING(KaxTagMultiCommentName)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommentComments : public EbmlUnicodeString {
-	public:
-		KaxTagMultiCommentComments() {}
-		KaxTagMultiCommentComments(const KaxTagMultiCommentComments & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommentComments);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommentComments(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiCommentComments)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommentLanguage : public EbmlString {
-	public:
-		KaxTagMultiCommentLanguage() {}
-		KaxTagMultiCommentLanguage(const KaxTagMultiCommentLanguage & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommentLanguage);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommentLanguage(*this);}
+DECLARE_MKX_STRING(KaxTagMultiCommentLanguage)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommercial : public EbmlMaster {
-	public:
-		KaxTagMultiCommercial();
-		KaxTagMultiCommercial(const KaxTagMultiCommercial & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommercial);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommercial(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiCommercial)
 };
 
-class MATROSKA_DLL_API KaxTagCommercial : public EbmlMaster {
-	public:
-		KaxTagCommercial();
-		KaxTagCommercial(const KaxTagCommercial & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagCommercial);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagCommercial(*this);}
+DECLARE_MKX_MASTER(KaxTagCommercial)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommercialType : public EbmlUInteger {
-	public:
-		KaxTagMultiCommercialType() {}
-		KaxTagMultiCommercialType(const KaxTagMultiCommercialType & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommercialType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommercialType(*this);}
+DECLARE_MKX_UINTEGER(KaxTagMultiCommercialType)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommercialAddress : public EbmlUnicodeString {
-	public:
-		KaxTagMultiCommercialAddress() {}
-		KaxTagMultiCommercialAddress(const KaxTagMultiCommercialAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommercialAddress);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommercialAddress(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiCommercialAddress)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommercialURL : public EbmlString {
-	public:
-		KaxTagMultiCommercialURL() {}
-		KaxTagMultiCommercialURL(const KaxTagMultiCommercialURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommercialURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommercialURL(*this);}
+DECLARE_MKX_STRING(KaxTagMultiCommercialURL)
 };
 
-class MATROSKA_DLL_API KaxTagMultiCommercialEmail : public EbmlString {
-	public:
-		KaxTagMultiCommercialEmail() {}
-		KaxTagMultiCommercialEmail(const KaxTagMultiCommercialEmail & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiCommercialEmail);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiCommercialEmail(*this);}
+DECLARE_MKX_STRING(KaxTagMultiCommercialEmail)
 };
 
-class MATROSKA_DLL_API KaxTagMultiPrice : public EbmlMaster {
-	public:
-		KaxTagMultiPrice();
-		KaxTagMultiPrice(const KaxTagMultiPrice & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiPrice);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiPrice(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiPrice)
 };
 
-class MATROSKA_DLL_API KaxTagMultiPriceCurrency : public EbmlString {
-	public:
-		KaxTagMultiPriceCurrency() {}
-		KaxTagMultiPriceCurrency(const KaxTagMultiPriceCurrency & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiPriceCurrency);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiPriceCurrency(*this);}
+DECLARE_MKX_STRING(KaxTagMultiPriceCurrency)
 };
 
-class MATROSKA_DLL_API KaxTagMultiPriceAmount : public EbmlFloat {
-	public:
-		KaxTagMultiPriceAmount() :EbmlFloat() {}
-		KaxTagMultiPriceAmount(const KaxTagMultiPriceAmount & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiPriceAmount);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiPriceAmount(*this);}
+DECLARE_MKX_FLOAT(KaxTagMultiPriceAmount)
 };
 
-class MATROSKA_DLL_API KaxTagMultiPricePriceDate : public EbmlDate {
-	public:
-		KaxTagMultiPricePriceDate() :EbmlDate() {}
-		KaxTagMultiPricePriceDate(const KaxTagMultiPricePriceDate & ElementToClone) :EbmlDate(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiPricePriceDate);}		
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiPricePriceDate(*this);}
+DECLARE_MKX_DATE(KaxTagMultiPricePriceDate)
 };
 
-class MATROSKA_DLL_API KaxTagMultiDate : public EbmlMaster {
-	public:
-		KaxTagMultiDate();
-		KaxTagMultiDate(const KaxTagMultiDate & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiDate);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiDate(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiDate)
 };
 
-class MATROSKA_DLL_API KaxTagDate : public EbmlMaster {
-	public:
-		KaxTagDate();
-		KaxTagDate(const KaxTagDate & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagDate);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagDate(*this);}
+DECLARE_MKX_MASTER(KaxTagDate)
 };
 
-class MATROSKA_DLL_API KaxTagMultiDateType : public EbmlUInteger {
-	public:
-		KaxTagMultiDateType() {}
-		KaxTagMultiDateType(const KaxTagMultiDateType & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiDateType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiDateType(*this);}
+DECLARE_MKX_UINTEGER(KaxTagMultiDateType)
 };
 
-class MATROSKA_DLL_API KaxTagMultiDateDateBegin : public EbmlDate {
-	public:
-		KaxTagMultiDateDateBegin() :EbmlDate() {}
-		KaxTagMultiDateDateBegin(const KaxTagMultiDateDateBegin & ElementToClone) :EbmlDate(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiDateDateBegin);}		
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiDateDateBegin(*this);}
+DECLARE_MKX_DATE(KaxTagMultiDateDateBegin)
 };
 
-class MATROSKA_DLL_API KaxTagMultiDateDateEnd : public EbmlDate {
-	public:
-		KaxTagMultiDateDateEnd() :EbmlDate() {}
-		KaxTagMultiDateDateEnd(const KaxTagMultiDateDateEnd & ElementToClone) :EbmlDate(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiDateDateEnd);}		
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiDateDateEnd(*this);}
+DECLARE_MKX_DATE(KaxTagMultiDateDateEnd)
 };
 
-class MATROSKA_DLL_API KaxTagMultiEntity : public EbmlMaster {
-	public:
-		KaxTagMultiEntity();
-		KaxTagMultiEntity(const KaxTagMultiEntity & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiEntity);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiEntity(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiEntity)
 };
 
-class MATROSKA_DLL_API KaxTagEntity : public EbmlMaster {
-	public:
-		KaxTagEntity();
-		KaxTagEntity(const KaxTagEntity & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagEntity);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagEntity(*this);}
+DECLARE_MKX_MASTER(KaxTagEntity)
 };
 
-class MATROSKA_DLL_API KaxTagMultiEntityType : public EbmlUInteger {
-	public:
-		KaxTagMultiEntityType() {}
-		KaxTagMultiEntityType(const KaxTagMultiEntityType & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiEntityType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiEntityType(*this);}
+DECLARE_MKX_UINTEGER(KaxTagMultiEntityType)
 };
 
-class MATROSKA_DLL_API KaxTagMultiEntityName : public EbmlUnicodeString {
-	public:
-		KaxTagMultiEntityName() {}
-		KaxTagMultiEntityName(const KaxTagMultiEntityName & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiEntityName);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiEntityName(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiEntityName)
 };
 
-class MATROSKA_DLL_API KaxTagMultiEntityAddress : public EbmlUnicodeString {
-	public:
-		KaxTagMultiEntityAddress() {}
-		KaxTagMultiEntityAddress(const KaxTagMultiEntityAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiEntityAddress);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiEntityAddress(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiEntityAddress)
 };
 
-class MATROSKA_DLL_API KaxTagMultiEntityURL : public EbmlString {
-	public:
-		KaxTagMultiEntityURL() {}
-		KaxTagMultiEntityURL(const KaxTagMultiEntityURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiEntityURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiEntityURL(*this);}
+DECLARE_MKX_STRING(KaxTagMultiEntityURL)
 };
 
-class MATROSKA_DLL_API KaxTagMultiEntityEmail : public EbmlString {
-	public:
-		KaxTagMultiEntityEmail() {}
-		KaxTagMultiEntityEmail(const KaxTagMultiEntityEmail & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiEntityEmail);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiEntityEmail(*this);}
+DECLARE_MKX_STRING(KaxTagMultiEntityEmail)
 };
 
-class MATROSKA_DLL_API KaxTagMultiIdentifier : public EbmlMaster {
-	public:
-		KaxTagMultiIdentifier();
-		KaxTagMultiIdentifier(const KaxTagMultiIdentifier & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiIdentifier);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiIdentifier(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiIdentifier)
 };
 
-class MATROSKA_DLL_API KaxTagIdentifier : public EbmlMaster {
-	public:
-		KaxTagIdentifier();
-		KaxTagIdentifier(const KaxTagIdentifier & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagIdentifier);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagIdentifier(*this);}
+DECLARE_MKX_MASTER(KaxTagIdentifier)
 };
 
-class MATROSKA_DLL_API KaxTagMultiIdentifierType : public EbmlUInteger {
-	public:
-		KaxTagMultiIdentifierType() {}
-		KaxTagMultiIdentifierType(const KaxTagMultiIdentifierType & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiIdentifierType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiIdentifierType(*this);}
+DECLARE_MKX_UINTEGER(KaxTagMultiIdentifierType)
 };
 
-class MATROSKA_DLL_API KaxTagMultiIdentifierBinary : public EbmlBinary {
-	public:
-		KaxTagMultiIdentifierBinary() {}
-		KaxTagMultiIdentifierBinary(const KaxTagMultiIdentifierBinary & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTagMultiIdentifierBinary);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiIdentifierBinary(*this);}
+DECLARE_MKX_BINARY(KaxTagMultiIdentifierBinary)
 };
 
-class MATROSKA_DLL_API KaxTagMultiIdentifierString : public EbmlUnicodeString {
-	public:
-		KaxTagMultiIdentifierString() {}
-		KaxTagMultiIdentifierString(const KaxTagMultiIdentifierString & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiIdentifierString);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiIdentifierString(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiIdentifierString)
 };
 
-class MATROSKA_DLL_API KaxTagMultiLegal : public EbmlMaster {
-	public:
-		KaxTagMultiLegal();
-		KaxTagMultiLegal(const KaxTagMultiLegal & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiLegal);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiLegal(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiLegal)
 };
 
-class MATROSKA_DLL_API KaxTagLegal : public EbmlMaster {
-	public:
-		KaxTagLegal();
-		KaxTagLegal(const KaxTagLegal & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagLegal);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagLegal(*this);}
+DECLARE_MKX_MASTER(KaxTagLegal)
 };
 
-class MATROSKA_DLL_API KaxTagMultiLegalType : public EbmlUInteger {
-	public:
-		KaxTagMultiLegalType() {}
-		KaxTagMultiLegalType(const KaxTagMultiLegalType & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiLegalType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiLegalType(*this);}
+DECLARE_MKX_UINTEGER(KaxTagMultiLegalType)
 };
 
-class MATROSKA_DLL_API KaxTagMultiLegalContent : public EbmlUnicodeString {
-	public:
-		KaxTagMultiLegalContent() {}
-		KaxTagMultiLegalContent(const KaxTagMultiLegalContent & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiLegalContent);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiLegalContent(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiLegalContent)
 };
 
-class MATROSKA_DLL_API KaxTagMultiLegalURL : public EbmlString {
-	public:
-		KaxTagMultiLegalURL() {}
-		KaxTagMultiLegalURL(const KaxTagMultiLegalURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiLegalURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiLegalURL(*this);}
+DECLARE_MKX_STRING(KaxTagMultiLegalURL)
 };
 
-class MATROSKA_DLL_API KaxTagMultiLegalAddress : public EbmlUnicodeString {
-	public:
-		KaxTagMultiLegalAddress() {}
-		KaxTagMultiLegalAddress(const KaxTagMultiLegalAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiLegalAddress);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiLegalAddress(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiLegalAddress)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitle : public EbmlMaster {
-	public:
-		KaxTagMultiTitle();
-		KaxTagMultiTitle(const KaxTagMultiTitle & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitle);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitle(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiTitle)
 };
 
-class MATROSKA_DLL_API KaxTagTitle : public EbmlMaster {
-	public:
-		KaxTagTitle();
-		KaxTagTitle(const KaxTagTitle & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagTitle);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagTitle(*this);}
+DECLARE_MKX_MASTER(KaxTagTitle)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitleType : public EbmlUInteger {
-	public:
-		KaxTagMultiTitleType() {}
-		KaxTagMultiTitleType(const KaxTagMultiTitleType & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleType(*this);}
+DECLARE_MKX_UINTEGER(KaxTagMultiTitleType)
 };
 
 
-class MATROSKA_DLL_API KaxTagMultiTitleName : public EbmlUnicodeString {
-	public:
-		KaxTagMultiTitleName() {}
-		KaxTagMultiTitleName(const KaxTagMultiTitleName & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleName);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleName(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiTitleName)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitleSubTitle : public EbmlUnicodeString {
-	public:
-		KaxTagMultiTitleSubTitle() {}
-		KaxTagMultiTitleSubTitle(const KaxTagMultiTitleSubTitle & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleSubTitle);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleSubTitle(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiTitleSubTitle)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitleEdition : public EbmlUnicodeString {
-	public:
-		KaxTagMultiTitleEdition() {}
-		KaxTagMultiTitleEdition(const KaxTagMultiTitleEdition & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleEdition);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleEdition(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiTitleEdition)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitleAddress : public EbmlUnicodeString {
-	public:
-		KaxTagMultiTitleAddress() {}
-		KaxTagMultiTitleAddress(const KaxTagMultiTitleAddress & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleAddress);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleAddress(*this);}
+DECLARE_MKX_UNISTRING(KaxTagMultiTitleAddress)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitleURL : public EbmlString {
-	public:
-		KaxTagMultiTitleURL() {}
-		KaxTagMultiTitleURL(const KaxTagMultiTitleURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleURL(*this);}
+DECLARE_MKX_STRING(KaxTagMultiTitleURL)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitleEmail : public EbmlString {
-	public:
-		KaxTagMultiTitleEmail() {}
-		KaxTagMultiTitleEmail(const KaxTagMultiTitleEmail & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleEmail);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleEmail(*this);}
+DECLARE_MKX_STRING(KaxTagMultiTitleEmail)
 };
 
-class MATROSKA_DLL_API KaxTagMultiTitleLanguage : public EbmlString {
-	public:
-		KaxTagMultiTitleLanguage() {}
-		KaxTagMultiTitleLanguage(const KaxTagMultiTitleLanguage & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiTitleLanguage);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiTitleLanguage(*this);}
+DECLARE_MKX_STRING(KaxTagMultiTitleLanguage)
 };
 
-class MATROSKA_DLL_API KaxTagMultiAttachment : public EbmlMaster {
-	public:
-		KaxTagMultiAttachment();
-		KaxTagMultiAttachment(const KaxTagMultiAttachment & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagMultiAttachment);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagMultiAttachment(*this);}
+DECLARE_MKX_MASTER(KaxTagMultiAttachment)
 };
 
-class MATROSKA_DLL_API KaxTagAttachment : public EbmlMaster {
-	public:
-		KaxTagAttachment();
-		KaxTagAttachment(const KaxTagAttachment & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagAttachment);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAttachment(*this);}
+DECLARE_MKX_MASTER(KaxTagAttachment)
 };
 
-class MATROSKA_DLL_API KaxTagAttachmentID : public EbmlUInteger {
-	public:
-		KaxTagAttachmentID() {}
-		KaxTagAttachmentID(const KaxTagAttachmentID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTagAttachmentID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTagAttachmentID(*this);}
+DECLARE_MKX_UINTEGER(KaxTagAttachmentID)
 };
 
-/*
-class MATROSKA_DLL_API KaxTagBPM : public EbmlFloat {
-	public:
-		KaxTagBPM() :EbmlFloat() {}
-		static EbmlElement & Create() {return *(new KaxTagBPM);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
+#if 0
+DECLARE_MKX_FLOAT(KaxTagBPM)
 };
 
-class MATROSKA_DLL_API KaxTagPopularimeter : public EbmlSInteger {
-	public:
-		KaxTagPopularimeter() {}
-		static EbmlElement & Create() {return *(new KaxTagPopularimeter);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
+DECLARE_MKX_SINTEGER(KaxTagPopularimeter)
 };
 
-class MATROSKA_DLL_API KaxTagRating : public EbmlBinary {
-	public:
-		KaxTagRating() {}
-		static EbmlElement & Create() {return *(new KaxTagRating);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
+DECLARE_MKX_BINARY(KaxTagRating)
 };
 
-class MATROSKA_DLL_API KaxTagSetPart : public EbmlUInteger {
-	public:
-		KaxTagSetPart() {}
-		static EbmlElement & Create() {return *(new KaxTagSetPart);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
+DECLARE_MKX_UINTEGER(KaxTagSetPart)
 };
 
-class MATROSKA_DLL_API KaxTagUserDefinedURL : public EbmlString {
-	public:
-		KaxTagUserDefinedURL() {}
-		static EbmlElement & Create() {return *(new KaxTagUserDefinedURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
+DECLARE_MKX_STRING(KaxTagUserDefinedURL)
 };
 
-class MATROSKA_DLL_API KaxTagVideoSecondaryGenre : public EbmlBinary {
+DECLARE_MKX_BINARY(KaxTagVideoSecondaryGenre)
 	public:
-		KaxTagVideoSecondaryGenre() {}
-		static EbmlElement & Create() {return *(new KaxTagVideoSecondaryGenre);}
-		bool ValidateSize() const {return (Size >= 4);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
+		virtual bool ValidateSize() const {return IsFiniteSize() && (Size >= 4);
 };
 
-class MATROSKA_DLL_API KaxWritingApp : public EbmlUnicodeString {
-	public:
-		KaxWritingApp() {}
-		static EbmlElement & Create() {return *(new KaxWritingApp);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-};*/
+DECLARE_MKX_UNISTRING(KaxWritingApp)
+};
+#endif
 
 END_LIBMATROSKA_NAMESPACE
 
diff --git a/matroska/KaxTags.h b/matroska/KaxTags.h
index f6c4375..df05218 100644
--- a/matroska/KaxTags.h
+++ b/matroska/KaxTags.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -37,20 +37,13 @@
 
 #include "matroska/KaxTypes.h"
 #include "ebml/EbmlMaster.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxTags : public EbmlMaster {
-	public:
-		KaxTags();
-		KaxTags(const KaxTags & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTags);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTags(*this);}
+DECLARE_MKX_MASTER(KaxTags)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxTrackAudio.h b/matroska/KaxTrackAudio.h
index ffbe259..cade7c0 100644
--- a/matroska/KaxTrackAudio.h
+++ b/matroska/KaxTrackAudio.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -40,78 +40,30 @@
 #include "ebml/EbmlFloat.h"
 #include "ebml/EbmlUInteger.h"
 #include "ebml/EbmlBinary.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxTrackAudio : public EbmlMaster {
-	public:
-		KaxTrackAudio();
-		KaxTrackAudio(const KaxTrackAudio & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackAudio);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackAudio(*this);}
+DECLARE_MKX_MASTER(KaxTrackAudio)
 };
 
-class MATROSKA_DLL_API KaxAudioSamplingFreq : public EbmlFloat {
-	public:
-		KaxAudioSamplingFreq() :EbmlFloat(8000.0) {}
-		KaxAudioSamplingFreq(const KaxAudioSamplingFreq & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxAudioSamplingFreq);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxAudioSamplingFreq(*this);}
+DECLARE_MKX_FLOAT(KaxAudioSamplingFreq)
 };
 
-class MATROSKA_DLL_API KaxAudioOutputSamplingFreq : public EbmlFloat {
-	public:
-		KaxAudioOutputSamplingFreq() :EbmlFloat() {}
-		KaxAudioOutputSamplingFreq(const KaxAudioOutputSamplingFreq & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxAudioOutputSamplingFreq);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxAudioOutputSamplingFreq(*this);}
+DECLARE_MKX_FLOAT(KaxAudioOutputSamplingFreq)
 };
 
-class MATROSKA_DLL_API KaxAudioChannels : public EbmlUInteger {
-	public:
-		KaxAudioChannels() :EbmlUInteger(1) {}
-		KaxAudioChannels(const KaxAudioChannels & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxAudioChannels);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxAudioChannels(*this);}
+DECLARE_MKX_UINTEGER(KaxAudioChannels)
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxAudioPosition : public EbmlBinary {
-	public:
-		KaxAudioPosition() {}
-		KaxAudioPosition(const KaxAudioPosition & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxAudioPosition);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		bool ValidateSize(void) const {return true;}
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxAudioPosition(*this);}
+DECLARE_MKX_BINARY(KaxAudioPosition)
 };
 #endif // MATROSKA_VERSION
 
-class MATROSKA_DLL_API KaxAudioBitDepth : public EbmlUInteger {
-	public:
-		KaxAudioBitDepth() {}
-		KaxAudioBitDepth(const KaxAudioBitDepth & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxAudioBitDepth);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxAudioBitDepth(*this);}
+DECLARE_MKX_UINTEGER(KaxAudioBitDepth)
 };
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/matroska/KaxTrackEntryData.h b/matroska/KaxTrackEntryData.h
index 0203ac8..14659f1 100644
--- a/matroska/KaxTrackEntryData.h
+++ b/matroska/KaxTrackEntryData.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -43,312 +43,94 @@
 #include "ebml/EbmlUnicodeString.h"
 #include "ebml/EbmlBinary.h"
 #include "ebml/EbmlMaster.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxTrackNumber : public EbmlUInteger {
-	public:
-		KaxTrackNumber() {}
-		KaxTrackNumber(const KaxTrackNumber & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackNumber);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackNumber(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackNumber)
 };
 
-class MATROSKA_DLL_API KaxTrackUID : public EbmlUInteger {
-	public:
-		KaxTrackUID() {}
-		KaxTrackUID(const KaxTrackUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackUID(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackUID)
 };
 
-class MATROSKA_DLL_API KaxTrackType : public EbmlUInteger {
-	public:
-		KaxTrackType() {}
-		KaxTrackType(const KaxTrackType & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackType);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackType(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackType)
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxTrackFlagEnabled : public EbmlUInteger {
-	public:
-		KaxTrackFlagEnabled() :EbmlUInteger(1) {}
-		KaxTrackFlagEnabled(const KaxTrackFlagEnabled & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackFlagEnabled);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackFlagEnabled(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackFlagEnabled)
 };
 #endif // MATROSKA_VERSION
 
-class MATROSKA_DLL_API KaxTrackFlagDefault : public EbmlUInteger {
-	public:
-		KaxTrackFlagDefault() :EbmlUInteger(1) {}
-		KaxTrackFlagDefault(const KaxTrackFlagDefault & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackFlagDefault);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackFlagDefault(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackFlagDefault)
 };
 
-class MATROSKA_DLL_API KaxTrackFlagForced : public EbmlUInteger {
-	public:
-		KaxTrackFlagForced() :EbmlUInteger(0) {}
-		KaxTrackFlagForced(const KaxTrackFlagForced & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackFlagForced);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackFlagForced(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackFlagForced)
 };
 
-class MATROSKA_DLL_API KaxTrackFlagLacing : public EbmlUInteger {
-	public:
-		KaxTrackFlagLacing() :EbmlUInteger(1) {}
-		KaxTrackFlagLacing(const KaxTrackFlagLacing & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackFlagLacing);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackFlagLacing(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackFlagLacing)
 };
 
-class MATROSKA_DLL_API KaxTrackMinCache : public EbmlUInteger {
-	public:
-		KaxTrackMinCache() :EbmlUInteger(0) {}
-		KaxTrackMinCache(const KaxTrackMinCache & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackMinCache);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackMinCache(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackMinCache)
 };
 
-class MATROSKA_DLL_API KaxTrackMaxCache : public EbmlUInteger {
-	public:
-		KaxTrackMaxCache() {}
-		KaxTrackMaxCache(const KaxTrackMaxCache & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackMaxCache);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackMaxCache(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackMaxCache)
 };
 
-class MATROSKA_DLL_API KaxTrackDefaultDuration : public EbmlUInteger {
-	public:
-		KaxTrackDefaultDuration() {}
-		KaxTrackDefaultDuration(const KaxTrackDefaultDuration & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackDefaultDuration);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackDefaultDuration(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackDefaultDuration)
 };
 
-class MATROSKA_DLL_API KaxTrackTimecodeScale : public EbmlFloat {
-	public:
-		KaxTrackTimecodeScale() :EbmlFloat(1.0) {}
-		KaxTrackTimecodeScale(const KaxTrackTimecodeScale & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackTimecodeScale);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackTimecodeScale(*this);}
+DECLARE_MKX_FLOAT(KaxTrackTimecodeScale)
 };
 
-class MATROSKA_DLL_API KaxMaxBlockAdditionID : public EbmlUInteger {
-	public:
-		KaxMaxBlockAdditionID() :EbmlUInteger(0) {}
-		KaxMaxBlockAdditionID(const KaxMaxBlockAdditionID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxMaxBlockAdditionID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxMaxBlockAdditionID(*this);}
+DECLARE_MKX_UINTEGER(KaxMaxBlockAdditionID)
 };
 
-class MATROSKA_DLL_API KaxTrackName : public EbmlUnicodeString {
-	public:
-		KaxTrackName() {}
-		KaxTrackName(const KaxTrackName & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackName);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackName(*this);}
+DECLARE_MKX_UNISTRING(KaxTrackName)
 };
 
-class MATROSKA_DLL_API KaxTrackLanguage : public EbmlString {
-	public:
-		KaxTrackLanguage() :EbmlString("eng") {}
-		KaxTrackLanguage(const KaxTrackLanguage & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackLanguage);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackLanguage(*this);}
+DECLARE_MKX_STRING(KaxTrackLanguage)
 };
 
-class MATROSKA_DLL_API KaxCodecID : public EbmlString {
-	public:
-		KaxCodecID() {}
-		KaxCodecID(const KaxCodecID & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCodecID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCodecID(*this);}
+DECLARE_MKX_STRING(KaxCodecID)
 };
 
-class MATROSKA_DLL_API KaxCodecPrivate : public EbmlBinary {
-	public:
-		KaxCodecPrivate() {}
-		KaxCodecPrivate(const KaxCodecPrivate & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxCodecPrivate);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCodecPrivate(*this);}
+DECLARE_MKX_BINARY(KaxCodecPrivate)
 };
 
-class MATROSKA_DLL_API KaxCodecName : public EbmlUnicodeString {
-	public:
-		KaxCodecName() {}
-		KaxCodecName(const KaxCodecName & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCodecName);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCodecName(*this);}
+DECLARE_MKX_UNISTRING(KaxCodecName)
 };
 
-class MATROSKA_DLL_API KaxTrackAttachmentLink : public EbmlBinary {
-	public:
-		KaxTrackAttachmentLink() {}
-		KaxTrackAttachmentLink(const KaxTrackAttachmentLink & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTrackAttachmentLink);}
-		bool ValidateSize() const {return true;} // we don't mind about what's inside
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackAttachmentLink(*this);}
+DECLARE_MKX_BINARY(KaxTrackAttachmentLink)
 };
 
-class MATROSKA_DLL_API KaxTrackOverlay : public EbmlUInteger {
-	public:
-		KaxTrackOverlay() {}
-		KaxTrackOverlay(const KaxTrackOverlay & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackOverlay);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackOverlay(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackOverlay)
 };
 
-class MATROSKA_DLL_API KaxTrackTranslate : public EbmlMaster {
-	public:
-		KaxTrackTranslate();
-		KaxTrackTranslate(const KaxTrackTranslate & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackTranslate);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackTranslate(*this);}
+DECLARE_MKX_MASTER(KaxTrackTranslate)
 };
 
-class MATROSKA_DLL_API KaxTrackTranslateCodec : public EbmlUInteger {
-	public:
-		KaxTrackTranslateCodec() {}
-		KaxTrackTranslateCodec(const KaxTrackTranslateCodec & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackTranslateCodec);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackTranslateCodec(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackTranslateCodec)
 };
 
-class MATROSKA_DLL_API KaxTrackTranslateEditionUID : public EbmlUInteger {
-	public:
-		KaxTrackTranslateEditionUID() {}
-		KaxTrackTranslateEditionUID(const KaxTrackTranslateEditionUID & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackTranslateEditionUID);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackTranslateEditionUID(*this);}
+DECLARE_MKX_UINTEGER(KaxTrackTranslateEditionUID)
 };
 
-class MATROSKA_DLL_API KaxTrackTranslateTrackID : public EbmlBinary {
-	public:
-		KaxTrackTranslateTrackID() {}
-		KaxTrackTranslateTrackID(const KaxTrackTranslateTrackID & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxTrackTranslateTrackID);}
-		bool ValidateSize() const { return true;}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackTranslateTrackID(*this);}
+DECLARE_MKX_BINARY(KaxTrackTranslateTrackID)
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxCodecSettings : public EbmlUnicodeString {
-	public:
-		KaxCodecSettings() {}
-		KaxCodecSettings(const KaxCodecSettings & ElementToClone) :EbmlUnicodeString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCodecSettings);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCodecSettings(*this);}
+DECLARE_MKX_UNISTRING(KaxCodecSettings)
 };
 
-class MATROSKA_DLL_API KaxCodecInfoURL : public EbmlString {
-	public:
-		KaxCodecInfoURL() {}
-		KaxCodecInfoURL(const KaxCodecInfoURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCodecInfoURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCodecInfoURL(*this);}
+DECLARE_MKX_STRING(KaxCodecInfoURL)
 };
 
-class MATROSKA_DLL_API KaxCodecDownloadURL : public EbmlString {
-	public:
-		KaxCodecDownloadURL() {}
-		KaxCodecDownloadURL(const KaxCodecDownloadURL & ElementToClone) :EbmlString(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCodecDownloadURL);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCodecDownloadURL(*this);}
+DECLARE_MKX_STRING(KaxCodecDownloadURL)
 };
 
-class MATROSKA_DLL_API KaxCodecDecodeAll : public EbmlUInteger {
-	public:
-		KaxCodecDecodeAll() :EbmlUInteger(1) {}
-		KaxCodecDecodeAll(const KaxCodecDecodeAll & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxCodecDecodeAll);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxCodecDecodeAll(*this);}
+DECLARE_MKX_UINTEGER(KaxCodecDecodeAll)
 };
 #endif // MATROSKA_VERSION
 
diff --git a/matroska/KaxTrackVideo.h b/matroska/KaxTrackVideo.h
index 92c0cf3..836ca03 100644
--- a/matroska/KaxTrackVideo.h
+++ b/matroska/KaxTrackVideo.h
@@ -3,7 +3,7 @@
 **
 ** <file/class MATROSKA_DLL_API description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,7 +29,7 @@
 
 /*!
 	\file
-	\version \$Id: KaxTrackVideo.h,v 1.9 2004/04/14 23:26:17 robux4 Exp $
+	\version \$Id: KaxTrackVideo.h 270 2010-05-25 12:02:30Z robux4 $
 	\author Steve Lhomme     <robux4 @ users.sf.net>
 */
 #ifndef LIBMATROSKA_TRACK_VIDEO_H
@@ -40,193 +40,68 @@
 #include "ebml/EbmlUInteger.h"
 #include "ebml/EbmlBinary.h"
 #include "ebml/EbmlFloat.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxTrackVideo : public EbmlMaster {
-	public:
-		KaxTrackVideo();
-		KaxTrackVideo(const KaxTrackVideo & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackVideo);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackVideo(*this);}
+DECLARE_MKX_MASTER(KaxTrackVideo)
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxVideoFlagInterlaced : public EbmlUInteger {
-	public:
-		KaxVideoFlagInterlaced() :EbmlUInteger(0) {}
-		KaxVideoFlagInterlaced(const KaxVideoFlagInterlaced & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoFlagInterlaced);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoFlagInterlaced(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoFlagInterlaced)
 };
 
-class MATROSKA_DLL_API KaxVideoStereoMode : public EbmlUInteger {
-	public:
-		KaxVideoStereoMode() :EbmlUInteger(0) {}
-		KaxVideoStereoMode(const KaxVideoStereoMode & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoStereoMode);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoStereoMode(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoStereoMode)
 };
 #endif // MATROSKA_VERSION
 
-class MATROSKA_DLL_API KaxVideoPixelWidth : public EbmlUInteger {
-	public:
-		KaxVideoPixelWidth() {}
-		KaxVideoPixelWidth(const KaxVideoPixelWidth & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoPixelWidth);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoPixelWidth(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoPixelWidth)
 };
 
-class MATROSKA_DLL_API KaxVideoPixelHeight : public EbmlUInteger {
-	public:
-		KaxVideoPixelHeight() {}
-		KaxVideoPixelHeight(const KaxVideoPixelHeight & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoPixelHeight);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoPixelHeight(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoPixelHeight)
 };
 
-class MATROSKA_DLL_API KaxVideoPixelCropBottom : public EbmlUInteger {
-	public:
-		KaxVideoPixelCropBottom(): EbmlUInteger(0) {}
-		KaxVideoPixelCropBottom(const KaxVideoPixelCropBottom & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoPixelCropBottom);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoPixelCropBottom(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoPixelCropBottom)
 };
 
-class MATROSKA_DLL_API KaxVideoPixelCropTop : public EbmlUInteger {
-	public:
-		KaxVideoPixelCropTop(): EbmlUInteger(0) {}
-		KaxVideoPixelCropTop(const KaxVideoPixelCropTop & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoPixelCropTop);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoPixelCropTop(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoPixelCropTop)
 };
 
-class MATROSKA_DLL_API KaxVideoPixelCropLeft : public EbmlUInteger {
-	public:
-		KaxVideoPixelCropLeft(): EbmlUInteger(0) {}
-		KaxVideoPixelCropLeft(const KaxVideoPixelCropLeft & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoPixelCropLeft);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoPixelCropLeft(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoPixelCropLeft)
 };
 
-class MATROSKA_DLL_API KaxVideoPixelCropRight : public EbmlUInteger {
-	public:
-		KaxVideoPixelCropRight(): EbmlUInteger(0) {}
-		KaxVideoPixelCropRight(const KaxVideoPixelCropRight & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoPixelCropRight);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoPixelCropRight(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoPixelCropRight)
 };
 
-class MATROSKA_DLL_API KaxVideoDisplayWidth : public EbmlUInteger {
-	public:
-		KaxVideoDisplayWidth() {}
-		KaxVideoDisplayWidth(const KaxVideoDisplayWidth & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoDisplayWidth);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoDisplayWidth(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoDisplayWidth)
 };
 
-class MATROSKA_DLL_API KaxVideoDisplayHeight : public EbmlUInteger {
-	public:
-		KaxVideoDisplayHeight() {}
-		KaxVideoDisplayHeight(const KaxVideoDisplayHeight & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoDisplayHeight);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoDisplayHeight(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoDisplayHeight)
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxVideoDisplayUnit : public EbmlUInteger {
-	public:
-		KaxVideoDisplayUnit() {}
-		KaxVideoDisplayUnit(const KaxVideoDisplayUnit & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoDisplayUnit);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoDisplayUnit(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoDisplayUnit)
 };
 
-class MATROSKA_DLL_API KaxVideoAspectRatio : public EbmlUInteger {
-	public:
-		KaxVideoAspectRatio() {}
-		KaxVideoAspectRatio(const KaxVideoAspectRatio & ElementToClone) :EbmlUInteger(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoAspectRatio);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoAspectRatio(*this);}
+DECLARE_MKX_UINTEGER(KaxVideoAspectRatio)
 };
 #endif // MATROSKA_VERSION
 
-class MATROSKA_DLL_API KaxVideoColourSpace : public EbmlBinary {
+DECLARE_MKX_BINARY(KaxVideoColourSpace)
 	public:
-		KaxVideoColourSpace() {}
-		KaxVideoColourSpace(const KaxVideoColourSpace & ElementToClone) :EbmlBinary(ElementToClone){}
-		static EbmlElement & Create() {return *(new KaxVideoColourSpace);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		bool ValidateSize(void) const {return (Size == 4);}
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoColourSpace(*this);}
+        bool ValidateSize(void) const {return IsFiniteSize() && (GetSize() == 4);}
 };
 
 #if MATROSKA_VERSION >= 2
-class MATROSKA_DLL_API KaxVideoGamma : public EbmlFloat {
-	public:
-		KaxVideoGamma() {}
-		KaxVideoGamma(const KaxVideoGamma & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoGamma);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxVideoGamma(*this);}
+DECLARE_MKX_FLOAT(KaxVideoGamma)
 };
 #endif // MATROSKA_VERSION
 
-class MATROSKA_DLL_API KaxVideoFrameRate : public EbmlFloat {
+DECLARE_MKX_FLOAT(KaxVideoFrameRate)
 	public:
-		KaxVideoFrameRate() {}
-		KaxVideoFrameRate(const KaxVideoFrameRate & ElementToClone) :EbmlFloat(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxVideoFrameRate);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		uint32 RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault);
-		EbmlElement * Clone() const {return new KaxVideoFrameRate(*this);}
+		filepos_t RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault);
 };
 
 
diff --git a/matroska/KaxTracks.h b/matroska/KaxTracks.h
index 408736d..2ecf095 100644
--- a/matroska/KaxTracks.h
+++ b/matroska/KaxTracks.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -39,33 +39,18 @@
 #include "ebml/EbmlMaster.h"
 #include "ebml/EbmlUInteger.h"
 #include "matroska/KaxTrackEntryData.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-class MATROSKA_DLL_API KaxTracks : public EbmlMaster {
-	public:
-		KaxTracks();
-		KaxTracks(const KaxTracks & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTracks);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTracks(*this);}
+DECLARE_MKX_MASTER(KaxTracks)
 };
 
-class MATROSKA_DLL_API KaxTrackEntry : public EbmlMaster {
+DECLARE_MKX_MASTER(KaxTrackEntry)
 	public:
-		KaxTrackEntry();
-		KaxTrackEntry(const KaxTrackEntry & ElementToClone) :EbmlMaster(ElementToClone) {}
-		static EbmlElement & Create() {return *(new KaxTrackEntry);}
-		const EbmlCallbacks & Generic() const {return ClassInfos;}
-		static const EbmlCallbacks ClassInfos;
-		operator const EbmlId &() const {return ClassInfos.GlobalId;}
-		EbmlElement * Clone() const {return new KaxTrackEntry(*this);}
-
-		EbmlUInteger & TrackNumber() const { return *(static_cast<EbmlUInteger *>(FindElt(KaxTrackNumber::ClassInfos))); }
+		EbmlUInteger & TrackNumber() const { return *(static_cast<EbmlUInteger *>(FindElt(EBML_INFO(KaxTrackNumber)))); }
 
 		void EnableLacing(bool bEnable = true);
 
@@ -73,7 +58,7 @@ class MATROSKA_DLL_API KaxTrackEntry : public EbmlMaster {
 			\note lacing set by default
 		*/
 		inline bool LacingEnabled() const {
-			KaxTrackFlagLacing * myLacing = static_cast<KaxTrackFlagLacing *>(FindFirstElt(KaxTrackFlagLacing::ClassInfos));
+			KaxTrackFlagLacing * myLacing = static_cast<KaxTrackFlagLacing *>(FindFirstElt(EBML_INFO(KaxTrackFlagLacing)));
 			return((myLacing == NULL) || (uint8(*myLacing) != 0));
 		}
 
diff --git a/matroska/KaxTypes.h b/matroska/KaxTypes.h
index cbb90b9..0a90361 100644
--- a/matroska/KaxTypes.h
+++ b/matroska/KaxTypes.h
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
diff --git a/matroska/KaxVersion.h b/matroska/KaxVersion.h
index 58add0d..ceb7099 100644
--- a/matroska/KaxVersion.h
+++ b/matroska/KaxVersion.h
@@ -1,7 +1,7 @@
 /****************************************************************************
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -9,12 +9,12 @@
 ** 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
@@ -40,9 +40,9 @@
 
 START_LIBMATROSKA_NAMESPACE
 
-#define LIBMATROSKA_VERSION 0x000801
+#define LIBMATROSKA_VERSION 0x010000
 
-static const std::string KaxCodeVersion = "0.8.1";
+static const std::string KaxCodeVersion = "1.0.0";
 static const std::string KaxCodeDate    = __TIMESTAMP__;
 
 /*!
diff --git a/src/FileKax.cpp b/src/FileKax.cpp
index 0385d1e..4f4efab 100644
--- a/src/FileKax.cpp
+++ b/src/FileKax.cpp
@@ -29,11 +29,13 @@
 
 /*!
     \file
-    \version \$Id: FileKax.cpp 640 2004-07-09 21:05:36Z mosu $
+    \version \$Id: FileKax.cpp 295 2010-06-04 11:03:46Z robux4 $
     \author Steve Lhomme     <robux4 @ users.sf.net>
 */
 //#include "StdInclude.h"
 #include "matroska/FileKax.h"
+#include "ebml/EbmlVersion.h"
+#include "ebml/EbmlContexts.h"
 //#include "Cluster.h"
 //#include "Track.h"
 //#include "Block.h"
@@ -114,7 +116,7 @@ void FileMatroska::Close(const uint32 aTimeLength)
 /*!
     \warning after rendering the head, some parameters are locked
 */
-uint32 FileMatroska::RenderHead(const std::string & aEncoderApp)
+filepos_t FileMatroska::RenderHead(const std::string & aEncoderApp)
 {
     try {
 	uint32 track_entries_size = 0;
@@ -141,7 +143,7 @@ uint32 FileMatroska::RenderHead(const std::string & aEncoderApp)
 	}
 
 	// Main Header
-	uint32 result = myMainHeader.Render(myFile, myStreamInfo);
+	filepos_t result = myMainHeader.Render(myFile, myStreamInfo);
 
 	// Track Entries
 	for (i=0; i<myTracks.size(); i++)
@@ -189,7 +191,7 @@ void FileMatroska::track_SetName(Track * aTrack, const std::string & aName)
     }
 }
 
-void FileMatroska::track_SetLaced(Track * aTrack, const bool bLaced)
+void FileMatroska::track_SetLaced(Track * aTrack, bool bLaced)
 {
     if (IsMyTrack(aTrack))
     {
@@ -198,7 +200,7 @@ void FileMatroska::track_SetLaced(Track * aTrack, const bool bLaced)
 }
 
 bool FileMatroska::AddFrame(Track * aTrack, const uint32 aTimecode, const binary *aFrame, const uint32 aFrameSize,
-					   const bool aKeyFrame, const bool aBFrame)
+					   bool aKeyFrame, bool aBFrame)
 {
     try {
 	// make sure we know that track
@@ -447,3 +449,17 @@ bool FileMatroska::ReadFrame(Track * & aTrack, uint32 & aTimecode, const binary
 #endif // OLD
 
 END_LIBMATROSKA_NAMESPACE
+
+void matroska_init()
+{
+#if defined(HAVE_EBML2)
+    ebml_init();
+#endif
+}
+
+void matroska_done()
+{
+#if defined(HAVE_EBML2)
+    ebml_done();
+#endif
+}
diff --git a/src/KaxAttached.cpp b/src/KaxAttached.cpp
index d725e39..08e1d9b 100644
--- a/src/KaxAttached.cpp
+++ b/src/KaxAttached.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -34,6 +34,7 @@
 */
 #include "matroska/KaxAttached.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 // sub elements
 
@@ -41,54 +42,29 @@ using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-#if MATROSKA_VERSION == 1
-EbmlSemantic KaxAttached_ContextList[5] =
-#else // MATROSKA_VERSION
-EbmlSemantic KaxAttached_ContextList[6] =
-#endif // MATROSKA_VERSION
-{
-	EbmlSemantic(true,  true, KaxFileName::ClassInfos),
-	EbmlSemantic(true,  true, KaxMimeType::ClassInfos),
-	EbmlSemantic(true,  true, KaxFileData::ClassInfos),
-	EbmlSemantic(false, true, KaxFileDescription::ClassInfos),
-	EbmlSemantic(true,  true, KaxFileUID::ClassInfos),
-#if MATROSKA_VERSION >= 2
-	EbmlSemantic(false, true, KaxFileReferral::ClassInfos),
-#endif // MATROSKA_VERSION
-};
-
-EbmlId KaxAttached_TheId       (0x61A7, 2);
-EbmlId KaxFileDescription_TheId(0x467E, 2);
-EbmlId KaxFileName_TheId       (0x466E, 2);
-EbmlId KaxMimeType_TheId       (0x4660, 2);
-EbmlId KaxFileData_TheId       (0x465C, 2);
-EbmlId KaxFileUID_TheId        (0x46AE, 2);
+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
-EbmlId KaxFileReferral_TheId   (0x4675, 2);
+DEFINE_SEMANTIC_ITEM(false, true, KaxFileReferral)
 #endif // MATROSKA_VERSION
+DEFINE_END_SEMANTIC(KaxAttached)
 
-const EbmlSemanticContext KaxAttached_Context = EbmlSemanticContext(countof(KaxAttached_ContextList), KaxAttached_ContextList, &KaxAttachments_Context, *GetKaxGlobal_Context, &KaxAttached::ClassInfos);
-const EbmlSemanticContext KaxFileDescription_Context = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &KaxFileDescription::ClassInfos);
-const EbmlSemanticContext KaxFileName_Context        = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &KaxFileName::ClassInfos);
-const EbmlSemanticContext KaxMimeType_Context        = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &KaxMimeType::ClassInfos);
-const EbmlSemanticContext KaxFileData_Context        = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &KaxFileData::ClassInfos);
-const EbmlSemanticContext KaxFileUID_Context         = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &KaxFileUID::ClassInfos);
+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
-const EbmlSemanticContext KaxFileReferral_Context    = EbmlSemanticContext(0, NULL, &KaxAttachments_Context, *GetKaxGlobal_Context, &KaxFileReferral::ClassInfos);
-#endif // MATROSKA_VERSION
-
-const EbmlCallbacks KaxAttached::ClassInfos(KaxAttached::Create, KaxAttached_TheId, "AttachedFile", KaxAttached_Context);
-const EbmlCallbacks KaxFileDescription::ClassInfos(KaxFileDescription::Create, KaxFileDescription_TheId, "FileDescription", KaxFileDescription_Context);
-const EbmlCallbacks KaxFileName::ClassInfos(KaxFileName::Create, KaxFileName_TheId, "FileName", KaxFileName_Context);
-const EbmlCallbacks KaxMimeType::ClassInfos(KaxMimeType::Create, KaxMimeType_TheId, "FileMimeType", KaxMimeType_Context);
-const EbmlCallbacks KaxFileData::ClassInfos(KaxFileData::Create, KaxFileData_TheId, "FileData", KaxFileData_Context);
-const EbmlCallbacks KaxFileUID::ClassInfos(KaxFileUID::Create, KaxFileUID_TheId, "FileUID", KaxFileUID_Context);
-#if MATROSKA_VERSION >= 2
-const EbmlCallbacks KaxFileReferral::ClassInfos(KaxFileReferral::Create, KaxFileReferral_TheId, "FileReferral", KaxFileReferral_Context);
-#endif // MATROSKA_VERSION
+DEFINE_MKX_BINARY     (KaxFileReferral,    0x4675, 2, KaxAttachments, "FileReferral");
+#endif
 
-KaxAttached::KaxAttached()
- :EbmlMaster(KaxAttached_Context)
+KaxAttached::KaxAttached(EBML_EXTRA_DEF)
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttached) EBML_DEF_SEP EBML_EXTRA_CALL)
 {
 	SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)
 }
diff --git a/src/KaxAttachments.cpp b/src/KaxAttachments.cpp
index 4a654fa..6dee14b 100644
--- a/src/KaxAttachments.cpp
+++ b/src/KaxAttachments.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -35,24 +35,21 @@
 #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
 
-EbmlSemantic KaxAttachments_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxAttached::ClassInfos),        ///< EBMLVersion
-};
-
-const EbmlSemanticContext KaxAttachments_Context = EbmlSemanticContext(countof(KaxAttachments_ContextList), KaxAttachments_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxAttachments::ClassInfos);
+DEFINE_START_SEMANTIC(KaxAttachments)
+DEFINE_SEMANTIC_ITEM(true, false, KaxAttached)        ///< EBMLVersion
+DEFINE_END_SEMANTIC(KaxAttachments)
 
-EbmlId KaxAttachments_TheId(0x1941A469, 4);
-const EbmlCallbacks KaxAttachments::ClassInfos(KaxAttachments::Create, KaxAttachments_TheId, "Attachments", KaxAttachments_Context);
+DEFINE_MKX_MASTER_CONS(KaxAttachments, 0x1941A469, 4, KaxSegment, "Attachments");
 
-KaxAttachments::KaxAttachments()
- :EbmlMaster(KaxAttachments_Context)
+KaxAttachments::KaxAttachments(EBML_EXTRA_DEF)
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxAttachments) EBML_DEF_SEP EBML_EXTRA_CALL)
 {
 	SetSizeLength(2); // mandatory min size support (for easier updating) (2^(7*2)-2 = 16Ko)
 }
diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp
index 9b121ab..38bfde3 100644
--- a/src/KaxBlock.cpp
+++ b/src/KaxBlock.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -39,79 +39,48 @@
 #include "matroska/KaxContexts.h"
 #include "matroska/KaxBlockData.h"
 #include "matroska/KaxCluster.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-#if MATROSKA_VERSION == 1
-const EbmlSemantic KaxBlockGroup_ContextList[6] =
-#else // MATROSKA_VERSION
-const EbmlSemantic KaxBlockGroup_ContextList[9] =
-#endif // MATROSKA_VERSION
-{
-	EbmlSemantic(true,  true,  KaxBlock::ClassInfos),
+DEFINE_START_SEMANTIC(KaxBlockGroup)
+DEFINE_SEMANTIC_ITEM(true, true, KaxBlock)
 #if MATROSKA_VERSION >= 2
-	EbmlSemantic(false, true,  KaxBlockVirtual::ClassInfos),
+DEFINE_SEMANTIC_ITEM(false, true, KaxBlockVirtual)
 #endif // MATROSKA_VERSION
-	EbmlSemantic(false, true,  KaxBlockDuration::ClassInfos),
-	EbmlSemantic(false, true,  KaxSlices::ClassInfos),
-	EbmlSemantic(true,  true,  KaxReferencePriority::ClassInfos),
-	EbmlSemantic(false, false, KaxReferenceBlock::ClassInfos),
+DEFINE_SEMANTIC_ITEM(false, true, KaxBlockDuration)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSlices)
+DEFINE_SEMANTIC_ITEM(true, true, KaxReferencePriority)
+DEFINE_SEMANTIC_ITEM(false, false, KaxReferenceBlock)
 #if MATROSKA_VERSION >= 2
-	EbmlSemantic(false, true,  KaxReferenceVirtual::ClassInfos),
-	EbmlSemantic(false, true,  KaxCodecState::ClassInfos),
+DEFINE_SEMANTIC_ITEM(false, true, KaxReferenceVirtual)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCodecState)
 #endif // MATROSKA_VERSION
-	EbmlSemantic(false, true,  KaxBlockAdditions::ClassInfos),
-};
+DEFINE_SEMANTIC_ITEM(false, true, KaxBlockAdditions)
+DEFINE_END_SEMANTIC(KaxBlockGroup)
 
-const EbmlSemantic KaxBlockAdditions_ContextList[1] =
-{
-	EbmlSemantic(true,  false,  KaxBlockMore::ClassInfos)
-};
+DEFINE_START_SEMANTIC(KaxBlockAdditions)
+DEFINE_SEMANTIC_ITEM(true,  false,  KaxBlockMore)
+DEFINE_END_SEMANTIC(KaxBlockAdditions)
 
-const EbmlSemantic KaxBlockMore_ContextList[2] =
-{
-	EbmlSemantic(true,  true,  KaxBlockAddID::ClassInfos),
-	EbmlSemantic(true,  true,  KaxBlockAdditional::ClassInfos)
-};
-
-EbmlId KaxBlockGroup_TheId     (0xA0, 1);
-EbmlId KaxBlock_TheId          (0xA1, 1);
-EbmlId KaxSimpleBlock_TheId    (0xA3, 1);
-EbmlId KaxBlockDuration_TheId  (0x9B, 1);
-#if MATROSKA_VERSION >= 2
-EbmlId KaxBlockVirtual_TheId   (0xA2, 1);
-EbmlId KaxCodecState_TheId     (0xA4, 1);
-#endif // MATROSKA_VERSION
-EbmlId KaxBlockAdditions_TheId (0x75A1, 2);
-EbmlId KaxBlockMore_TheId      (0xA6, 1);
-EbmlId KaxBlockAddID_TheId     (0xEE, 1);
-EbmlId KaxBlockAdditional_TheId(0xA5, 1);
-
-const EbmlSemanticContext KaxBlockGroup_Context = EbmlSemanticContext(countof(KaxBlockGroup_ContextList), KaxBlockGroup_ContextList, &KaxCluster_Context, *GetKaxGlobal_Context, &KaxBlockGroup::ClassInfos);
-const EbmlSemanticContext KaxBlock_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxBlock::ClassInfos);
-const EbmlSemanticContext KaxBlockDuration_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxBlockDuration::ClassInfos);
-#if MATROSKA_VERSION >= 2
-const EbmlSemanticContext KaxSimpleBlock_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &KaxSimpleBlock::ClassInfos);
-const EbmlSemanticContext KaxBlockVirtual_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxBlockVirtual::ClassInfos);
-const EbmlSemanticContext KaxCodecState_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxCodecState::ClassInfos);
-#endif // MATROSKA_VERSION
-const EbmlSemanticContext KaxBlockAdditions_Context = EbmlSemanticContext(countof(KaxBlockAdditions_ContextList), KaxBlockAdditions_ContextList, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxBlockAdditions::ClassInfos);
-const EbmlSemanticContext KaxBlockMore_Context = EbmlSemanticContext(countof(KaxBlockMore_ContextList), KaxBlockMore_ContextList, &KaxBlockAdditions_Context, *GetKaxGlobal_Context, &KaxBlockMore::ClassInfos);
-const EbmlSemanticContext KaxBlockAddID_Context = EbmlSemanticContext(0, NULL, &KaxBlockMore_Context, *GetKaxGlobal_Context, &KaxBlockAddID::ClassInfos);
-const EbmlSemanticContext KaxBlockAdditional_Context = EbmlSemanticContext(0, NULL, &KaxBlockMore_Context, *GetKaxGlobal_Context, &KaxBlockAdditional::ClassInfos);
-
-const EbmlCallbacks KaxBlockGroup::ClassInfos(KaxBlockGroup::Create, KaxBlockGroup_TheId, "BlockGroup", KaxBlockGroup_Context);
-const EbmlCallbacks KaxBlock::ClassInfos(KaxBlock::Create, KaxBlock_TheId, "Block", KaxBlock_Context);
-const EbmlCallbacks KaxBlockDuration::ClassInfos(KaxBlockDuration::Create, KaxBlockDuration_TheId, "BlockDuration", KaxBlockDuration_Context);
+DEFINE_START_SEMANTIC(KaxBlockMore)
+DEFINE_SEMANTIC_ITEM(true, true, KaxBlockAddID)
+DEFINE_SEMANTIC_ITEM(true,  true,  KaxBlockAdditional)
+DEFINE_END_SEMANTIC(KaxBlockMore)
+
+DEFINE_MKX_MASTER_CONS (KaxBlockGroup,       0xA0, 1, KaxCluster, "BlockGroup");
+DEFINE_MKX_BINARY_CONS (KaxBlock,            0xA1, 1, KaxBlockGroup, "Block");
+DEFINE_MKX_UINTEGER    (KaxBlockDuration,    0x9B, 1, KaxBlockGroup, "BlockDuration");
 #if MATROSKA_VERSION >= 2
-const EbmlCallbacks KaxSimpleBlock::ClassInfos(KaxSimpleBlock::Create, KaxSimpleBlock_TheId, "SimpleBlock", KaxSimpleBlock_Context);
-const EbmlCallbacks KaxBlockVirtual::ClassInfos(KaxBlockVirtual::Create, KaxBlockVirtual_TheId, "BlockVirtual", KaxBlockVirtual_Context);
-const EbmlCallbacks KaxCodecState::ClassInfos(KaxCodecState::Create, KaxCodecState_TheId, "CodecState", KaxCodecState_Context);
-#endif // MATROSKA_VERSION
-const EbmlCallbacks KaxBlockAdditions::ClassInfos(KaxBlockAdditions::Create, KaxBlockAdditions_TheId, "BlockAdditions", KaxBlockAdditions_Context);
-const EbmlCallbacks KaxBlockMore::ClassInfos(KaxBlockMore::Create, KaxBlockMore_TheId, "BlockMore", KaxBlockMore_Context);
-const EbmlCallbacks KaxBlockAddID::ClassInfos(KaxBlockAddID::Create, KaxBlockAddID_TheId, "BlockAddID", KaxBlockAddID_Context);
-const EbmlCallbacks KaxBlockAdditional::ClassInfos(KaxBlockAdditional::Create, KaxBlockAdditional_TheId, "BlockAdditional", KaxBlockAdditional_Context);
+DEFINE_MKX_BINARY_CONS (KaxSimpleBlock,      0xA3, 1, KaxCluster, "SimpleBlock");
+DEFINE_MKX_BINARY_CONS (KaxBlockVirtual,     0xA2, 1, KaxBlockGroup, "BlockVirtual");
+DEFINE_MKX_BINARY      (KaxCodecState,       0xA4, 1, KaxBlockGroup, "CodecState");
+#endif
+DEFINE_MKX_MASTER      (KaxBlockAdditions, 0x75A1, 2, KaxBlockGroup, "BlockAdditions");
+DEFINE_MKX_MASTER      (KaxBlockMore,        0xA6, 1, KaxBlockAdditions, "BlockMore");
+DEFINE_MKX_UINTEGER_DEF(KaxBlockAddID,       0xEE, 1, KaxBlockMore, "BlockAddID", 1);
+DEFINE_MKX_BINARY      (KaxBlockAdditional,  0xA5, 1, KaxBlockMore, "BlockAdditional");
+
 
 DataBuffer * DataBuffer::Clone()
 {
@@ -134,7 +103,7 @@ SimpleDataBuffer::SimpleDataBuffer(const SimpleDataBuffer & ToClone)
 
 bool KaxInternalBlock::ValidateSize() const
 {
-	return (Size >= 4); /// for the moment
+	return (GetSize() >= 4); /// for the moment
 }
 
 KaxInternalBlock::~KaxInternalBlock()
@@ -167,20 +136,12 @@ KaxBlockGroup::~KaxBlockGroup()
 //NOTE("KaxBlockGroup::~KaxBlockGroup");
 }
 
-KaxBlockGroup::KaxBlockGroup()
- :EbmlMaster(KaxBlockGroup_Context)
+KaxBlockGroup::KaxBlockGroup(EBML_EXTRA_DEF)
+ :EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxBlockGroup) EBML_DEF_SEP EBML_EXTRA_CALL)
  ,ParentCluster(NULL)
  ,ParentTrack(NULL)
 {}
 
-KaxBlockAdditions::KaxBlockAdditions()
- :EbmlMaster(KaxBlockAdditions_Context)
-{}
-
-KaxBlockMore::KaxBlockMore()
- :EbmlMaster(KaxBlockMore_Context)
-{}
-
 /*!
 	\todo handle flags
 	\todo hardcoded limit of the number of frames in a lace should be a parameter
@@ -188,7 +149,7 @@ KaxBlockMore::KaxBlockMore()
 */
 bool KaxInternalBlock::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuffer & buffer, LacingType lacing, bool invisible)
 {
-	bValueIsSet = true;
+	SetValueIsSet();
 	if (myBuffers.size() == 0) {
 		// first frame
 		Timecode = timecode;
@@ -228,7 +189,7 @@ LacingType KaxInternalBlock::GetBestLacingType() const {
 			SameSize = false;
 		XiphLacingSize += myBuffers[i]->Size() / 255 + 1;
 	}
-	EbmlLacingSize += CodedSizeLength(myBuffers[0]->Size(), 0, bSizeIsFinite);
+	EbmlLacingSize += CodedSizeLength(myBuffers[0]->Size(), 0, IsFiniteSize());
 	for (i = 1; i < (int)myBuffers.size() - 1; i++)
 		EbmlLacingSize += CodedSizeLengthSigned(int64(myBuffers[i]->Size()) - int64(myBuffers[i - 1]->Size()), 0);
 	if (SameSize)
@@ -239,23 +200,23 @@ LacingType KaxInternalBlock::GetBestLacingType() const {
 		return LACING_EBML;
 }
 
-uint64 KaxInternalBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
+filepos_t KaxInternalBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
 {
 	LacingType LacingHere;
-	assert(Data == NULL); // Data is not used for KaxInternalBlock
+    assert(EbmlBinary::GetBuffer() == NULL); // Data is not used for KaxInternalBlock
 	assert(TrackNumber < 0x4000); // no more allowed for the moment
 	unsigned int i;
 
 	// compute the final size of the data
 	switch (myBuffers.size()) {
 		case 0:
-			Size = 0;
+			SetSize_(0);
 			break;
 		case 1:
-			Size = 4 + myBuffers[0]->Size();
+			SetSize_(4 + myBuffers[0]->Size());
 			break;
 		default:
-			Size = 4 + 1; // 1 for the lacing head
+			SetSize_(4 + 1); // 1 for the lacing head
 			if (mLacing == LACING_AUTO)
 				LacingHere = GetBestLacingType();
 			else
@@ -264,33 +225,32 @@ uint64 KaxInternalBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
 			{
 			case LACING_XIPH:
 				for (i=0; i<myBuffers.size()-1; i++) {
-					Size += myBuffers[i]->Size() + (myBuffers[i]->Size() / 0xFF + 1);
+					SetSize_(GetSize() + myBuffers[i]->Size() + (myBuffers[i]->Size() / 0xFF + 1));
 				}
 				break;
 			case LACING_EBML:
-				Size += myBuffers[0]->Size() + CodedSizeLength(myBuffers[0]->Size(), 0, bSizeIsFinite);
+				SetSize_(GetSize() + myBuffers[0]->Size() + CodedSizeLength(myBuffers[0]->Size(), 0, IsFiniteSize()));
 				for (i=1; i<myBuffers.size()-1; i++) {
-					Size += myBuffers[i]->Size() 
-						+ CodedSizeLengthSigned(int64(myBuffers[i]->Size()) - int64(myBuffers[i-1]->Size()), 0);;
+					SetSize_(GetSize() + myBuffers[i]->Size() + CodedSizeLengthSigned(int64(myBuffers[i]->Size()) - int64(myBuffers[i-1]->Size()), 0));
 				}
 				break;
 			case LACING_FIXED:
 				for (i=0; i<myBuffers.size()-1; i++) {
-					Size += myBuffers[i]->Size();
+					SetSize_(GetSize() + myBuffers[i]->Size());
 				}
 				break;
 			default:
 				assert(0);
 			}
 			// Size of the last frame (not in lace)
-			Size += myBuffers[i]->Size();
+			SetSize_(GetSize() + myBuffers[i]->Size());
 			break;
 	}
 
 	if (TrackNumber >= 0x80)
-		Size++; // the size will be coded with one more octet
+		SetSize_(GetSize() + 1); // the size will be coded with one more octet
 
-	return Size;
+	return GetSize();
 }
 
 #if MATROSKA_VERSION >= 2
@@ -300,17 +260,33 @@ KaxBlockVirtual::KaxBlockVirtual(const KaxBlockVirtual & ElementToClone)
  ,TrackNumber(ElementToClone.TrackNumber)
  ,ParentCluster(ElementToClone.ParentCluster) ///< \todo not exactly
 {
-	Data = DataBlock;
+    SetBuffer(DataBlock,sizeof(DataBlock));
+    SetValueIsSet(false);
+}
+
+KaxBlockVirtual::KaxBlockVirtual(EBML_EXTRA_DEF)
+:EBML_DEF_BINARY(KaxBlockVirtual)EBML_DEF_SEP ParentCluster(NULL)
+{
+    SetBuffer(DataBlock,sizeof(DataBlock));
+    SetValueIsSet(false);
+}
+
+KaxBlockVirtual::~KaxBlockVirtual()
+{
+    if(GetBuffer() == DataBlock)
+        SetBuffer( NULL, 0 ); 
 }
 
-uint64 KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender)
+filepos_t KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender)
 {
 	assert(TrackNumber < 0x4000);
-	binary *cursor = Data;
+	binary *cursor = EbmlBinary::GetBuffer();
 	// fill data
 	if (TrackNumber < 0x80) {
+        assert(GetSize() >= 4);
 		*cursor++ = TrackNumber | 0x80; // set the first bit to 1 
 	} else {
+        assert(GetSize() >= 5);
 		*cursor++ = (TrackNumber >> 8) | 0x40; // set the second bit to 1
 		*cursor++ = TrackNumber & 0xFF;
 	}
@@ -323,7 +299,7 @@ uint64 KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender)
 
 	*cursor++ = 0; // flags
 
-	return Size;
+	return GetSize();
 }
 #endif // MATROSKA_VERSION
 
@@ -331,7 +307,7 @@ uint64 KaxBlockVirtual::UpdateSize(bool bSaveDefault, bool bForceRender)
 	\todo more optimisation is possible (render the Block head and don't copy the buffer in memory, care should be taken with the allocation of Data)
 	\todo the actual timecode to write should be retrieved from the Cluster from here
 */
-uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault)
+filepos_t KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault)
 {
 	if (myBuffers.size() == 0) {
 		return 0;
@@ -341,15 +317,15 @@ uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool
 		unsigned int i;
 
 		if (myBuffers.size() == 1) {
-			Size = 4;
+			SetSize_(4);
 			mLacing = LACING_NONE;
 		} else {
 			if (mLacing == LACING_NONE)
 				mLacing = LACING_EBML; // supposedly the best of all
-			Size = 4 + 1; // 1 for the lacing head (number of laced elements)
+			SetSize_(4 + 1); // 1 for the lacing head (number of laced elements)
 		}
 		if (TrackNumber > 0x80)
-			Size++;
+			SetSize_(GetSize() + 1);
 
 		// write Block Head
 		if (TrackNumber < 0x80) {
@@ -416,12 +392,12 @@ uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool
 				uint16 tmpSize = myBuffers[i]->Size();
 				while (tmpSize >= 0xFF) {
 					output.writeFully(&tmpValue, 1);
-					Size++;
+					SetSize_(GetSize() + 1);
 					tmpSize -= 0xFF;
 				}
 				tmpValue = binary(tmpSize);
 				output.writeFully(&tmpValue, 1);
-				Size++;
+				SetSize_(GetSize() + 1);
 			}
 			break;
 		case LACING_EBML:
@@ -436,12 +412,12 @@ uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool
 
 				_Size = myBuffers[0]->Size();
 
-				_CodedSize = CodedSizeLength(_Size, 0, bSizeIsFinite);
+				_CodedSize = CodedSizeLength(_Size, 0, IsFiniteSize());
 
 				// first size in the lace is not a signed
 				CodedValueLength(_Size, _CodedSize, _FinalHead);
 				output.writeFully(_FinalHead, _CodedSize);
-				Size += _CodedSize;
+				SetSize_(GetSize() + _CodedSize);
 
 				// set the size of each member in the lace
 				for (i=1; i<myBuffers.size()-1; i++) {
@@ -449,7 +425,7 @@ uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool
 					_CodedSize = CodedSizeLengthSigned(_Size, 0);
 					CodedValueLengthSigned(_Size, _CodedSize, _FinalHead);
 					output.writeFully(_FinalHead, _CodedSize);
-					Size += _CodedSize;
+					SetSize_(GetSize() + _CodedSize);
 				}
 			}
 			break;
@@ -467,11 +443,11 @@ uint32 KaxInternalBlock::RenderData(IOCallback & output, bool bForceRender, bool
 		// put the data of each frame
 		for (i=0; i<myBuffers.size(); i++) {
 			output.writeFully(myBuffers[i]->Buffer(), myBuffers[i]->Size());
-			Size += myBuffers[i]->Size();
+			SetSize_(GetSize() + myBuffers[i]->Size());
 		}
 	}
 
-	return Size;
+	return GetSize();
 }
 
 uint64 KaxInternalBlock::ReadInternalHead(IOCallback & input)
@@ -510,16 +486,16 @@ uint64 KaxInternalBlock::ReadInternalHead(IOCallback & input)
 /*!
 	\todo better zero copy handling
 */
-uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
+filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 {
-	uint64 Result;
+	filepos_t Result;
 
 	FirstFrameLocation = input.getFilePointer(); // will be updated accordingly below
 
 	if (ReadFully == SCOPE_ALL_DATA)
 	{
 		Result = EbmlBinary::ReadData(input, ReadFully);
-		binary *cursor = Data;
+        binary *cursor = EbmlBinary::GetBuffer();
 		uint8 BlockHeadSize = 4;
 
 		// update internal values
@@ -543,7 +519,7 @@ uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 		bLocalTimecodeUsed = true;
 		cursor += 2;
 
-		if (EbmlId(*this) == KaxSimpleBlock::ClassInfos.GlobalId) {
+		if (EbmlId(*this) == EBML_ID(KaxSimpleBlock)) {
 			bIsKeyframe = (*cursor & 0x80) != 0;
 			bIsDiscardable = (*cursor & 0x01) != 0;
 		}
@@ -552,14 +528,14 @@ uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 
 		// put all Frames in the list
 		if (mLacing == LACING_NONE) {
-			FirstFrameLocation += cursor - Data;
-			DataBuffer * soloFrame = new DataBuffer(cursor, Size - BlockHeadSize);
+			FirstFrameLocation += cursor - EbmlBinary::GetBuffer();
+			DataBuffer * soloFrame = new DataBuffer(cursor, GetSize() - BlockHeadSize);
 			myBuffers.push_back(soloFrame);
 			SizeList.resize(1);
-			SizeList[0] = Size - BlockHeadSize;
+			SizeList[0] = GetSize() - BlockHeadSize;
 		} else {
 			// read the number of frames in the lace
-			uint32 LastBufferSize = Size - BlockHeadSize - 1; // 1 for number of frame
+			uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame
 			uint8 FrameNum = *cursor++; // number of frames in the lace - 1
 			// read the list of frame sizes
 			uint8 Index;
@@ -611,7 +587,7 @@ uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 				assert(0);
 			}
 
-			FirstFrameLocation += cursor - Data;
+			FirstFrameLocation += cursor - EbmlBinary::GetBuffer();
 
 			for (Index=0; Index<=FrameNum; Index++) {
 				DataBuffer * lacedFrame = new DataBuffer(cursor, SizeList[Index]);
@@ -619,7 +595,7 @@ uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 				cursor += SizeList[Index];
 			}
 		}
-		bValueIsSet = true;
+		SetValueIsSet();
 	}
 	else if (ReadFully == SCOPE_PARTIAL_DATA)
 	{
@@ -650,7 +626,7 @@ uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 		bLocalTimecodeUsed = true;
 		cursor += 2;
 
-		if (EbmlId(*this) == KaxSimpleBlock::ClassInfos.GlobalId) {
+		if (EbmlId(*this) == EBML_ID(KaxSimpleBlock)) {
 			bIsKeyframe = (*cursor & 0x80) != 0;
 			bIsDiscardable = (*cursor & 0x01) != 0;
 		}
@@ -668,7 +644,7 @@ uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 		// put all Frames in the list
 		if (mLacing != LACING_NONE) {
 			// read the number of frames in the lace
-			uint32 LastBufferSize = Size - BlockHeadSize - 1; // 1 for number of frame
+			uint32 LastBufferSize = GetSize() - BlockHeadSize - 1; // 1 for number of frame
 			uint8 FrameNum = _TempHead[0]; // number of frames in the lace - 1
 			// read the list of frame sizes
 			uint8 Index;
@@ -732,13 +708,13 @@ uint64 KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully)
 			}
 		} else {
 			SizeList.resize(1);
-			SizeList[0] = Size - BlockHeadSize;
+			SizeList[0] = GetSize() - BlockHeadSize;
 		}
-		bValueIsSet = false;
-		Result = Size;
+		SetValueIsSet(false);
+		Result = GetSize();
 	} else {
-		bValueIsSet = false;
-		Result = Size;
+		SetValueIsSet(false);
+		Result = GetSize();
 	}
 
 	return Result;
@@ -824,14 +800,14 @@ bool KaxBlockGroup::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataB
 uint64 KaxBlockGroup::GlobalTimecode() const
 {
 	assert(ParentCluster != NULL); // impossible otherwise
-	KaxInternalBlock & MyBlock = *static_cast<KaxBlock *>(this->FindElt(KaxBlock::ClassInfos));
+	KaxInternalBlock & MyBlock = *static_cast<KaxBlock *>(this->FindElt(EBML_INFO(KaxBlock)));
 	return MyBlock.GlobalTimecode();
 
 }
 
 uint16 KaxBlockGroup::TrackNumber() const
 {
-	KaxInternalBlock & MyBlock = *static_cast<KaxBlock *>(this->FindElt(KaxBlock::ClassInfos));
+	KaxInternalBlock & MyBlock = *static_cast<KaxBlock *>(this->FindElt(EBML_INFO(KaxBlock)));
 	return MyBlock.TrackNum();
 }
 
@@ -850,7 +826,7 @@ uint64 KaxInternalBlock::ClusterPosition() const
 unsigned int KaxBlockGroup::ReferenceCount() const
 {
 	unsigned int Result = 0;
-	KaxReferenceBlock * MyBlockAdds = static_cast<KaxReferenceBlock *>(FindFirstElt(KaxReferenceBlock::ClassInfos));
+	KaxReferenceBlock * MyBlockAdds = static_cast<KaxReferenceBlock *>(FindFirstElt(EBML_INFO(KaxReferenceBlock)));
 	if (MyBlockAdds != NULL) {
 		Result++;
 		while ((MyBlockAdds = static_cast<KaxReferenceBlock *>(FindNextElt(*MyBlockAdds))) != NULL)
@@ -863,7 +839,7 @@ unsigned int KaxBlockGroup::ReferenceCount() const
 
 const KaxReferenceBlock & KaxBlockGroup::Reference(unsigned int Index) const
 {
-	KaxReferenceBlock * MyBlockAdds = static_cast<KaxReferenceBlock *>(FindFirstElt(KaxReferenceBlock::ClassInfos));
+	KaxReferenceBlock * MyBlockAdds = static_cast<KaxReferenceBlock *>(FindFirstElt(EBML_INFO(KaxReferenceBlock)));
 	assert(MyBlockAdds != NULL); // call of a non existing reference
 	
 	while (Index != 0) {
@@ -876,7 +852,7 @@ const KaxReferenceBlock & KaxBlockGroup::Reference(unsigned int Index) const
 
 void KaxBlockGroup::ReleaseFrames()
 {
-	KaxInternalBlock & MyBlock = *static_cast<KaxBlock *>(this->FindElt(KaxBlock::ClassInfos));
+	KaxInternalBlock & MyBlock = *static_cast<KaxBlock *>(this->FindElt(EBML_INFO(KaxBlock)));
 	MyBlock.ReleaseFrames();
 }
 
@@ -897,13 +873,13 @@ void KaxBlockGroup::SetBlockDuration(uint64 TimeLength)
 {
 	assert(ParentTrack != NULL);
 	int64 scale = ParentTrack->GlobalTimecodeScale();
-	KaxBlockDuration & myDuration = *static_cast<KaxBlockDuration *>(FindFirstElt(KaxBlockDuration::ClassInfos, true));
+	KaxBlockDuration & myDuration = *static_cast<KaxBlockDuration *>(FindFirstElt(EBML_INFO(KaxBlockDuration), true));
 	*(static_cast<EbmlUInteger *>(&myDuration)) = TimeLength / uint64(scale);
 }
 
 bool KaxBlockGroup::GetBlockDuration(uint64 &TheTimecode) const
 {
-	KaxBlockDuration * myDuration = static_cast<KaxBlockDuration *>(FindElt(KaxBlockDuration::ClassInfos));
+	KaxBlockDuration * myDuration = static_cast<KaxBlockDuration *>(FindElt(EBML_INFO(KaxBlockDuration)));
 	if (myDuration == NULL) {
 		return false;
 	}
@@ -937,7 +913,7 @@ int64 KaxInternalBlock::GetDataPosition(size_t FrameNumber)
 {
 	int64 _Result = -1;
 
-	if (bValueIsSet && FrameNumber < SizeList.size())
+	if (ValueIsSet() && FrameNumber < SizeList.size())
 	{
 		_Result = FirstFrameLocation;
 	
diff --git a/src/KaxBlockData.cpp b/src/KaxBlockData.cpp
index b204f27..5aba776 100644
--- a/src/KaxBlockData.cpp
+++ b/src/KaxBlockData.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -35,71 +35,37 @@
 #include "matroska/KaxBlockData.h"
 #include "matroska/KaxContexts.h"
 #include "matroska/KaxBlock.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-const EbmlSemantic KaxSlices_ContextList[1] =
-{
-	EbmlSemantic(false, false,  KaxTimeSlice::ClassInfos),
-};
-
-const EbmlSemantic KaxTimeSlice_ContextList[5] =
-{
-	EbmlSemantic(false, true,  KaxSliceLaceNumber::ClassInfos),
-	EbmlSemantic(false, true,  KaxSliceFrameNumber::ClassInfos),
-	EbmlSemantic(false, true,  KaxSliceBlockAddID::ClassInfos),
-	EbmlSemantic(false, true,  KaxSliceDelay::ClassInfos),
-	EbmlSemantic(false, true,  KaxSliceDuration::ClassInfos),
-};
-
-EbmlId KaxReferencePriority_TheId(0xFA, 1);
-EbmlId KaxReferenceBlock_TheId   (0xFB, 1);
-EbmlId KaxSlices_TheId           (0x8E, 1);
-EbmlId KaxTimeSlice_TheId        (0xE8, 1);
-EbmlId KaxSliceLaceNumber_TheId  (0xCC, 1);
-EbmlId KaxSliceFrameNumber_TheId (0xCD, 1);
-EbmlId KaxSliceBlockAddID_TheId  (0xCB, 1);
-EbmlId KaxSliceDelay_TheId       (0xCE, 1);
-EbmlId KaxSliceDuration_TheId    (0xCF, 1);
+DEFINE_START_SEMANTIC(KaxSlices)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTimeSlice)
+DEFINE_END_SEMANTIC(KaxSlices)
+
+DEFINE_START_SEMANTIC(KaxTimeSlice)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSliceLaceNumber)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSliceFrameNumber)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSliceBlockAddID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSliceDelay)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSliceDuration)
+DEFINE_END_SEMANTIC(KaxTimeSlice)
+
+DEFINE_MKX_UINTEGER_DEF (KaxReferencePriority, 0xFA, 1, KaxBlockGroup, "FlagReferenced", 0);
+DEFINE_MKX_SINTEGER_CONS(KaxReferenceBlock,    0xFB, 1, KaxBlockGroup, "ReferenceBlock");
+DEFINE_MKX_MASTER       (KaxSlices,            0x8E, 1, KaxBlockGroup, "Slices");
+DEFINE_MKX_MASTER       (KaxTimeSlice,         0xE8, 1, KaxSlices, "TimeSlice");
+DEFINE_MKX_UINTEGER_DEF (KaxSliceLaceNumber,   0xCC, 1, KaxTimeSlice, "SliceLaceNumber", 0);
+DEFINE_MKX_UINTEGER_DEF (KaxSliceFrameNumber,  0xCD, 1, KaxTimeSlice, "SliceFrameNumber", 0);
+DEFINE_MKX_UINTEGER_DEF (KaxSliceBlockAddID,   0xCB, 1, KaxTimeSlice, "SliceBlockAddID", 0);
+DEFINE_MKX_UINTEGER     (KaxSliceDelay,        0xCE, 1, KaxTimeSlice, "SliceDelay");
+DEFINE_MKX_UINTEGER_DEF (KaxSliceDuration,     0xCF, 1, KaxTimeSlice, "SliceDuration", 0);
 #if MATROSKA_VERSION >= 2
-EbmlId KaxReferenceVirtual_TheId (0xFD, 1);
-#endif // MATROSKA_VERSION
-
-const EbmlSemanticContext KaxReferencePriority_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxReferencePriority::ClassInfos);
-const EbmlSemanticContext KaxReferenceBlock_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxReferenceBlock::ClassInfos);
-const EbmlSemanticContext KaxSlices_Context = EbmlSemanticContext(countof(KaxSlices_ContextList), KaxSlices_ContextList, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxSlices::ClassInfos);
-const EbmlSemanticContext KaxTimeSlice_Context = EbmlSemanticContext(countof(KaxTimeSlice_ContextList), KaxTimeSlice_ContextList, &KaxSlices_Context, *GetKaxGlobal_Context, &KaxTimeSlice::ClassInfos);
-const EbmlSemanticContext KaxSliceLaceNumber_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &KaxSliceLaceNumber::ClassInfos);
-const EbmlSemanticContext KaxSliceFrameNumber_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &KaxSliceFrameNumber::ClassInfos);
-const EbmlSemanticContext KaxSliceBlockAddID_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &KaxSliceBlockAddID::ClassInfos);
-const EbmlSemanticContext KaxSliceDelay_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &KaxSliceDelay::ClassInfos);
-const EbmlSemanticContext KaxSliceDuration_Context = EbmlSemanticContext(0, NULL, &KaxTimeSlice_Context, *GetKaxGlobal_Context, &KaxSliceDuration::ClassInfos);
-#if MATROSKA_VERSION >= 2
-const EbmlSemanticContext KaxReferenceVirtual_Context = EbmlSemanticContext(0, NULL, &KaxBlockGroup_Context, *GetKaxGlobal_Context, &KaxReferenceVirtual::ClassInfos);
-#endif // MATROSKA_VERSION
-
-const EbmlCallbacks KaxReferencePriority::ClassInfos(KaxReferencePriority::Create, KaxReferencePriority_TheId, "FlagReferenced", KaxReferencePriority_Context);
-const EbmlCallbacks KaxReferenceBlock::ClassInfos(KaxReferenceBlock::Create, KaxReferenceBlock_TheId, "ReferenceBlock", KaxReferenceBlock_Context);
-const EbmlCallbacks KaxSlices::ClassInfos(KaxSlices::Create, KaxSlices_TheId, "Slices", KaxSlices_Context);
-const EbmlCallbacks KaxTimeSlice::ClassInfos(KaxTimeSlice::Create, KaxTimeSlice_TheId, "TimeSlice", KaxTimeSlice_Context);
-const EbmlCallbacks KaxSliceLaceNumber::ClassInfos(KaxSliceLaceNumber::Create, KaxSliceLaceNumber_TheId, "SliceLaceNumber", KaxSliceLaceNumber_Context);
-const EbmlCallbacks KaxSliceFrameNumber::ClassInfos(KaxSliceFrameNumber::Create, KaxSliceFrameNumber_TheId, "SliceFrameNumber", KaxSliceFrameNumber_Context);
-const EbmlCallbacks KaxSliceBlockAddID::ClassInfos(KaxSliceBlockAddID::Create, KaxSliceBlockAddID_TheId, "SliceBlockAddID", KaxSliceBlockAddID_Context);
-const EbmlCallbacks KaxSliceDelay::ClassInfos(KaxSliceDelay::Create, KaxSliceDelay_TheId, "SliceDelay", KaxSliceDelay_Context);
-const EbmlCallbacks KaxSliceDuration::ClassInfos(KaxSliceDuration::Create, KaxSliceDuration_TheId, "SliceDuration", KaxSliceDuration_Context);
-#if MATROSKA_VERSION >= 2
-const EbmlCallbacks KaxReferenceVirtual::ClassInfos(KaxReferenceVirtual::Create, KaxReferenceVirtual_TheId, "ReferenceVirtual", KaxReferenceVirtual_Context);
-#endif // MATROSKA_VERSION
-
-KaxSlices::KaxSlices()
- :EbmlMaster(KaxSlices_Context)
-{}
+DEFINE_MKX_SINTEGER     (KaxReferenceVirtual,  0xFD, 1, KaxBlockGroup, "ReferenceVirtual");
+#endif
 
-KaxTimeSlice::KaxTimeSlice()
- :EbmlMaster(KaxTimeSlice_Context)
-{}
 
 const KaxBlockBlob & KaxReferenceBlock::RefBlock() const
 {
@@ -107,14 +73,28 @@ const KaxBlockBlob & KaxReferenceBlock::RefBlock() const
 	return *RefdBlock;
 }
 
-uint64 KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
+KaxReferenceBlock::KaxReferenceBlock(EBML_EXTRA_DEF)
+:EBML_DEF_SINTEGER(KaxReferenceBlock)EBML_DEF_SEP
+RefdBlock(NULL)
+,ParentBlock(NULL)
+{
+    bTimecodeSet = false;
+}
+
+KaxReferenceBlock::KaxReferenceBlock(const KaxReferenceBlock & ElementToClone)
+:EbmlSInteger(ElementToClone)
+,bTimecodeSet(ElementToClone.bTimecodeSet)
+{
+}
+
+filepos_t KaxReferenceBlock::UpdateSize(bool bSaveDefault, bool bForceRender)
 {
 	if (!bTimecodeSet) {
 		assert(RefdBlock != NULL);
 		assert(ParentBlock != NULL);
 
 		const KaxInternalBlock &block = *RefdBlock;
-		Value = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale());
+		*static_cast<EbmlSInteger*>(this) = (int64(block.GlobalTimecode()) - int64(ParentBlock->GlobalTimecode())) / int64(ParentBlock->GlobalTimecodeScale());
 	}
 	return EbmlSInteger::UpdateSize(bSaveDefault, bForceRender);
 }
@@ -124,7 +104,7 @@ void KaxReferenceBlock::SetReferencedBlock(const KaxBlockBlob * aRefdBlock)
 	assert(RefdBlock == NULL);
 	assert(aRefdBlock != NULL);
 	RefdBlock = aRefdBlock; 
-	bValueIsSet = true;
+	SetValueIsSet();
 }
 
 void KaxReferenceBlock::SetReferencedBlock(const KaxBlockGroup & aRefdBlock)
@@ -132,7 +112,7 @@ void KaxReferenceBlock::SetReferencedBlock(const KaxBlockGroup & aRefdBlock)
 	KaxBlockBlob *block_blob = new KaxBlockBlob(BLOCK_BLOB_NO_SIMPLE);
 	block_blob->SetBlockGroup(*const_cast<KaxBlockGroup*>(&aRefdBlock));
 	RefdBlock = block_blob; 
-	bValueIsSet = true;
+	SetValueIsSet();
 }
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxChapters.cpp b/src/KaxChapters.cpp
index cbb163c..532c522 100644
--- a/src/KaxChapters.cpp
+++ b/src/KaxChapters.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -34,175 +34,85 @@
 */
 #include "matroska/KaxChapters.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 // sub elements
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxChapters_ContextList[1] =
-{
-    EbmlSemantic(true, false,  KaxEditionEntry::ClassInfos),
-};
-
-EbmlSemantic KaxEditionEntry_ContextList[5] =
-{
-    EbmlSemantic(false, true , KaxEditionUID::ClassInfos),
-    EbmlSemantic(true , true , KaxEditionFlagHidden::ClassInfos),
-    EbmlSemantic(true , true , KaxEditionFlagDefault::ClassInfos),
-    EbmlSemantic(false, true , KaxEditionFlagOrdered::ClassInfos),
-    EbmlSemantic(true , false, KaxChapterAtom::ClassInfos),
-};
-
-EbmlSemantic KaxChapterAtom_ContextList[12] =
-{
-    EbmlSemantic(false, false, KaxChapterAtom::ClassInfos),
-    EbmlSemantic(true,  true,  KaxChapterUID::ClassInfos),
-    EbmlSemantic(true,  true,  KaxChapterTimeStart::ClassInfos),
-    EbmlSemantic(false, true,  KaxChapterTimeEnd::ClassInfos),
-    EbmlSemantic(true , true,  KaxChapterFlagHidden::ClassInfos),
-    EbmlSemantic(true , true,  KaxChapterFlagEnabled::ClassInfos),
-    EbmlSemantic(false, true,  KaxChapterSegmentUID::ClassInfos),
-    EbmlSemantic(false, true,  KaxChapterSegmentEditionUID::ClassInfos),
-    EbmlSemantic(false, true,  KaxChapterPhysicalEquiv::ClassInfos),
-    EbmlSemantic(false, true,  KaxChapterTrack::ClassInfos),
-    EbmlSemantic(false, false, KaxChapterDisplay::ClassInfos),
-    EbmlSemantic(false, false, KaxChapterProcess::ClassInfos),
-};
-
-EbmlSemantic KaxChapterTrack_ContextList[1] =
-{
-    EbmlSemantic(true, false, KaxChapterTrackNumber::ClassInfos),
-};
-
-EbmlSemantic KaxChapterDisplay_ContextList[3] =
-{
-    EbmlSemantic(true,  true,  KaxChapterString::ClassInfos),
-    EbmlSemantic(true,  false, KaxChapterLanguage::ClassInfos),
-    EbmlSemantic(false, false, KaxChapterCountry::ClassInfos),
-};
-
-EbmlSemantic KaxChapterProcess_ContextList[3] =
-{
-    EbmlSemantic(true,  true,  KaxChapterProcessCodecID::ClassInfos),
-    EbmlSemantic(false, true,  KaxChapterProcessPrivate::ClassInfos),
-    EbmlSemantic(false, false, KaxChapterProcessCommand::ClassInfos),
-};
-
-EbmlSemantic KaxChapterProcessCommand_ContextList[2] =
-{
-    EbmlSemantic(true,  true,  KaxChapterProcessTime::ClassInfos),
-    EbmlSemantic(true,  true,  KaxChapterProcessData::ClassInfos),
-};
-
-const EbmlSemanticContext KaxChapters_Context = EbmlSemanticContext(countof(KaxChapters_ContextList), KaxChapters_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxChapters::ClassInfos);
-const EbmlSemanticContext KaxEditionEntry_Context = EbmlSemanticContext(countof(KaxEditionEntry_ContextList), KaxEditionEntry_ContextList, &KaxChapters_Context, *GetKaxGlobal_Context, &KaxEditionEntry::ClassInfos);
-const EbmlSemanticContext KaxEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &KaxEditionUID::ClassInfos);
-const EbmlSemanticContext KaxEditionFlagHidden_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &KaxEditionFlagHidden::ClassInfos);
-const EbmlSemanticContext KaxEditionFlagDefault_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &KaxEditionFlagDefault::ClassInfos);
-const EbmlSemanticContext KaxEditionFlagOrdered_Context = EbmlSemanticContext(0, NULL, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &KaxEditionFlagOrdered::ClassInfos);
-const EbmlSemanticContext KaxChapterAtom_Context = EbmlSemanticContext(countof(KaxChapterAtom_ContextList), KaxChapterAtom_ContextList, &KaxEditionEntry_Context, *GetKaxGlobal_Context, &KaxChapterAtom::ClassInfos);
-const EbmlSemanticContext KaxChapterTrack_Context = EbmlSemanticContext(countof(KaxChapterTrack_ContextList), KaxChapterTrack_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterTrack::ClassInfos);
-const EbmlSemanticContext KaxChapterDisplay_Context = EbmlSemanticContext(countof(KaxChapterDisplay_ContextList), KaxChapterDisplay_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterDisplay::ClassInfos);
-const EbmlSemanticContext KaxChapterUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterUID::ClassInfos);
-const EbmlSemanticContext KaxChapterTimeStart_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterTimeStart::ClassInfos);
-const EbmlSemanticContext KaxChapterTimeEnd_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterTimeEnd::ClassInfos);
-const EbmlSemanticContext KaxChapterFlagHidden_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterFlagHidden::ClassInfos);
-const EbmlSemanticContext KaxChapterFlagEnabled_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterFlagEnabled::ClassInfos);
-const EbmlSemanticContext KaxChapterSegmentUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterSegmentUID::ClassInfos);
-const EbmlSemanticContext KaxChapterSegmentEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterSegmentEditionUID::ClassInfos);
-const EbmlSemanticContext KaxChapterPhysicalEquiv_Context = EbmlSemanticContext(0, NULL, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterPhysicalEquiv::ClassInfos);
-const EbmlSemanticContext KaxChapterTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxChapterTrack_Context, *GetKaxGlobal_Context, &KaxChapterTrackNumber::ClassInfos);
-const EbmlSemanticContext KaxChapterString_Context = EbmlSemanticContext(0, NULL, &KaxChapterDisplay_Context, *GetKaxGlobal_Context, &KaxChapterString::ClassInfos);
-const EbmlSemanticContext KaxChapterLanguage_Context = EbmlSemanticContext(0, NULL, &KaxChapterLanguage_Context, *GetKaxGlobal_Context, &KaxChapterLanguage::ClassInfos);
-const EbmlSemanticContext KaxChapterCountry_Context = EbmlSemanticContext(0, NULL, &KaxChapterCountry_Context, *GetKaxGlobal_Context, &KaxChapterCountry::ClassInfos);
-const EbmlSemanticContext KaxChapterProcess_Context = EbmlSemanticContext(countof(KaxChapterProcess_ContextList), KaxChapterProcess_ContextList, &KaxChapterAtom_Context, *GetKaxGlobal_Context, &KaxChapterProcess::ClassInfos);
-const EbmlSemanticContext KaxChapterProcessCodecID_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &KaxChapterProcessCodecID::ClassInfos);
-const EbmlSemanticContext KaxChapterProcessPrivate_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &KaxChapterProcessPrivate::ClassInfos);
-const EbmlSemanticContext KaxChapterProcessCommand_Context = EbmlSemanticContext(countof(KaxChapterProcessCommand_ContextList), KaxChapterProcessCommand_ContextList, &KaxChapterProcess_Context, *GetKaxGlobal_Context, &KaxChapterProcessCommand::ClassInfos);
-const EbmlSemanticContext KaxChapterProcessTime_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcessCommand_Context, *GetKaxGlobal_Context, &KaxChapterProcessTime::ClassInfos);
-const EbmlSemanticContext KaxChapterProcessData_Context = EbmlSemanticContext(0, NULL, &KaxChapterProcessCommand_Context, *GetKaxGlobal_Context, &KaxChapterProcessData::ClassInfos);
-
-EbmlId KaxChapters_TheId               (0x1043A770, 4);
-EbmlId KaxEditionEntry_TheId           (0x45B9, 2);
-EbmlId KaxEditionUID_TheId             (0x45BC, 2);
-EbmlId KaxEditionFlagHidden_TheId      (0x45BD, 2);
-EbmlId KaxEditionFlagDefault_TheId     (0x45DB, 2);
-EbmlId KaxEditionFlagOrdered_TheId     (0x45DD, 2);
-EbmlId KaxChapterAtom_TheId            (0xB6, 1);
-EbmlId KaxChapterUID_TheId             (0x73C4, 2);
-EbmlId KaxChapterTimeStart_TheId       (0x91, 1);
-EbmlId KaxChapterTimeEnd_TheId         (0x92, 1);
-EbmlId KaxChapterFlagHidden_TheId      (0x98, 1);
-EbmlId KaxChapterFlagEnabled_TheId     (0x4598, 2);
-EbmlId KaxChapterSegmentUID_TheId      (0x6E67, 2);
-EbmlId KaxChapterSegmentEditionUID_TheId(0x6EBC, 2);
-EbmlId KaxChapterPhysicalEquiv_TheId   (0x63C3, 2);
-EbmlId KaxChapterTrack_TheId           (0x8F, 1);
-EbmlId KaxChapterTrackNumber_TheId     (0x89, 1);
-EbmlId KaxChapterDisplay_TheId         (0x80, 1);
-EbmlId KaxChapterString_TheId          (0x85, 1);
-EbmlId KaxChapterLanguage_TheId        (0x437C, 2);
-EbmlId KaxChapterCountry_TheId         (0x437E, 2);
-EbmlId KaxChapterProcess_TheId         (0x6944, 2);
-EbmlId KaxChapterProcessCodecID_TheId  (0x6955, 2);
-EbmlId KaxChapterProcessPrivate_TheId  (0x450D, 2);
-EbmlId KaxChapterProcessCommand_TheId  (0x6911, 2);
-EbmlId KaxChapterProcessTime_TheId     (0x6922, 2);
-EbmlId KaxChapterProcessData_TheId     (0x6933, 2);
-
-const EbmlCallbacks KaxChapters::ClassInfos(KaxChapters::Create, KaxChapters_TheId, "Chapters", KaxChapters_Context);
-const EbmlCallbacks KaxEditionEntry::ClassInfos(KaxEditionEntry::Create, KaxEditionEntry_TheId, "EditionEntry", KaxEditionEntry_Context);
-const EbmlCallbacks KaxEditionUID::ClassInfos(KaxEditionUID::Create, KaxEditionUID_TheId, "EditionUID", KaxEditionUID_Context);
-const EbmlCallbacks KaxEditionFlagHidden::ClassInfos(KaxEditionFlagHidden::Create, KaxEditionFlagHidden_TheId, "EditionFlagHidden", KaxEditionFlagHidden_Context);
-const EbmlCallbacks KaxEditionFlagDefault::ClassInfos(KaxEditionFlagDefault::Create, KaxEditionFlagDefault_TheId, "EditionFlagDefault", KaxEditionFlagDefault_Context);
-const EbmlCallbacks KaxEditionFlagOrdered::ClassInfos(KaxEditionFlagOrdered::Create, KaxEditionFlagOrdered_TheId, "EditionFlagOrdered", KaxEditionFlagOrdered_Context);
-const EbmlCallbacks KaxChapterAtom::ClassInfos(KaxChapterAtom::Create, KaxChapterAtom_TheId, "ChapterAtom", KaxChapterAtom_Context);
-const EbmlCallbacks KaxChapterUID::ClassInfos(KaxChapterUID::Create, KaxChapterUID_TheId, "ChapterUID", KaxChapterUID_Context);
-const EbmlCallbacks KaxChapterTimeStart::ClassInfos(KaxChapterTimeStart::Create, KaxChapterTimeStart_TheId, "ChapterTimeStart", KaxChapterTimeStart_Context);
-const EbmlCallbacks KaxChapterTimeEnd::ClassInfos(KaxChapterTimeEnd::Create, KaxChapterTimeEnd_TheId, "ChapterTimeEnd", KaxChapterTimeEnd_Context);
-const EbmlCallbacks KaxChapterFlagHidden::ClassInfos(KaxChapterFlagHidden::Create, KaxChapterFlagHidden_TheId, "ChapterFlagHidden", KaxChapterFlagHidden_Context);
-const EbmlCallbacks KaxChapterFlagEnabled::ClassInfos(KaxChapterFlagEnabled::Create, KaxChapterFlagEnabled_TheId, "ChapterFlagEnabled", KaxChapterFlagEnabled_Context);
-const EbmlCallbacks KaxChapterSegmentUID::ClassInfos(KaxChapterSegmentUID::Create, KaxChapterSegmentUID_TheId, "ChapterSegmentUID", KaxChapterSegmentUID_Context);
-const EbmlCallbacks KaxChapterSegmentEditionUID::ClassInfos(KaxChapterSegmentEditionUID::Create, KaxChapterSegmentEditionUID_TheId, "ChapterSegmentEditionUID", KaxChapterSegmentEditionUID_Context);
-const EbmlCallbacks KaxChapterPhysicalEquiv::ClassInfos(KaxChapterPhysicalEquiv::Create, KaxChapterPhysicalEquiv_TheId, "ChapterPhysicalEquiv", KaxChapterPhysicalEquiv_Context);
-const EbmlCallbacks KaxChapterTrack::ClassInfos(KaxChapterTrack::Create, KaxChapterTrack_TheId, "ChapterTrack", KaxChapterTrack_Context);
-const EbmlCallbacks KaxChapterTrackNumber::ClassInfos(KaxChapterTrackNumber::Create, KaxChapterTrackNumber_TheId, "ChapterTrackNumber", KaxChapterTrackNumber_Context);
-const EbmlCallbacks KaxChapterDisplay::ClassInfos(KaxChapterDisplay::Create, KaxChapterDisplay_TheId, "ChapterDisplay", KaxChapterDisplay_Context);
-const EbmlCallbacks KaxChapterString::ClassInfos(KaxChapterString::Create, KaxChapterString_TheId, "ChapterString", KaxChapterString_Context);
-const EbmlCallbacks KaxChapterLanguage::ClassInfos(KaxChapterLanguage::Create, KaxChapterLanguage_TheId, "ChapterLanguage", KaxChapterLanguage_Context);
-const EbmlCallbacks KaxChapterCountry::ClassInfos(KaxChapterCountry::Create, KaxChapterCountry_TheId, "ChapterCountry", KaxChapterCountry_Context);
-const EbmlCallbacks KaxChapterProcess::ClassInfos(KaxChapterProcess::Create, KaxChapterProcess_TheId, "ChapterProcess", KaxChapterProcess_Context);
-const EbmlCallbacks KaxChapterProcessCodecID::ClassInfos(KaxChapterProcessCodecID::Create, KaxChapterProcessCodecID_TheId, "ChapterProcessCodecID", KaxChapterProcessCodecID_Context);
-const EbmlCallbacks KaxChapterProcessPrivate::ClassInfos(KaxChapterProcessPrivate::Create, KaxChapterProcessPrivate_TheId, "ChapterProcessPrivate", KaxChapterProcessPrivate_Context);
-const EbmlCallbacks KaxChapterProcessCommand::ClassInfos(KaxChapterProcessCommand::Create, KaxChapterProcessCommand_TheId, "ChapterProcessCommand", KaxChapterProcessCommand_Context);
-const EbmlCallbacks KaxChapterProcessTime::ClassInfos(KaxChapterProcessTime::Create, KaxChapterProcessTime_TheId, "ChapterProcessTime", KaxChapterProcessTime_Context);
-const EbmlCallbacks KaxChapterProcessData::ClassInfos(KaxChapterProcessData::Create, KaxChapterProcessData_TheId, "ChapterProcessData", KaxChapterProcessData_Context);
-
-KaxChapters::KaxChapters()
- :EbmlMaster(KaxChapters_Context)
-{}
-
-KaxEditionEntry::KaxEditionEntry()
-:EbmlMaster(KaxEditionEntry_Context)
-{}
-
-KaxChapterAtom::KaxChapterAtom()
-:EbmlMaster(KaxChapterAtom_Context)
-{}
-
-KaxChapterTrack::KaxChapterTrack()
-:EbmlMaster(KaxChapterTrack_Context)
-{}
-
-KaxChapterDisplay::KaxChapterDisplay()
-:EbmlMaster(KaxChapterDisplay_Context)
-{}
-
-KaxChapterProcess::KaxChapterProcess()
-:EbmlMaster(KaxChapterProcess_Context)
-{}
-
-KaxChapterProcessCommand::KaxChapterProcessCommand()
-:EbmlMaster(KaxChapterProcessCommand_Context)
-{}
+DEFINE_START_SEMANTIC(KaxChapters)
+DEFINE_SEMANTIC_ITEM(true, false, KaxEditionEntry)
+DEFINE_END_SEMANTIC(KaxChapters)
+
+DEFINE_START_SEMANTIC(KaxEditionEntry)
+DEFINE_SEMANTIC_ITEM(false, true, KaxEditionUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxEditionFlagHidden)
+DEFINE_SEMANTIC_ITEM(true, true, KaxEditionFlagDefault)
+DEFINE_SEMANTIC_ITEM(false, true, KaxEditionFlagOrdered)
+DEFINE_SEMANTIC_ITEM(true, false, KaxChapterAtom)
+DEFINE_END_SEMANTIC(KaxEditionEntry)
+
+DEFINE_START_SEMANTIC(KaxChapterAtom)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterAtom)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTimeStart)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTimeEnd)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagHidden)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterFlagEnabled)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterSegmentEditionUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterPhysicalEquiv)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterTrack)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterDisplay)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterProcess)
+DEFINE_END_SEMANTIC(KaxChapterAtom)
+
+DEFINE_START_SEMANTIC(KaxChapterTrack)
+DEFINE_SEMANTIC_ITEM(true, false, KaxChapterTrackNumber)
+DEFINE_END_SEMANTIC(KaxChapterTrack)
+
+DEFINE_START_SEMANTIC(KaxChapterDisplay)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterString)
+DEFINE_SEMANTIC_ITEM(true, false, KaxChapterLanguage)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterCountry)
+DEFINE_END_SEMANTIC(KaxChapterDisplay)
+
+DEFINE_START_SEMANTIC(KaxChapterProcess)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessCodecID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxChapterProcessPrivate)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterProcessCommand)
+DEFINE_END_SEMANTIC(KaxChapterProcess)
+
+DEFINE_START_SEMANTIC(KaxChapterProcessCommand)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessTime)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterProcessData)
+DEFINE_END_SEMANTIC(KaxChapterProcessCommand)
+
+DEFINE_MKX_MASTER      (KaxChapters,             0x1043A770, 4, KaxSegment, "Chapters");
+DEFINE_MKX_MASTER      (KaxEditionEntry,             0x45B9, 2, KaxChapters, "EditionEntry");
+DEFINE_MKX_UINTEGER    (KaxEditionUID,               0x45BC, 2, KaxEditionEntry, "EditionUID");
+DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagHidden,        0x45BD, 2, KaxEditionEntry, "EditionFlagHidden", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagDefault,       0x45DB, 2, KaxEditionEntry, "EditionFlagDefault", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxEditionFlagOrdered,       0x45DD, 2, KaxEditionEntry, "EditionFlagOrdered", 0);
+DEFINE_MKX_MASTER      (KaxChapterAtom,                0xB6, 1, KaxEditionEntry, "ChapterAtom");
+DEFINE_MKX_UINTEGER    (KaxChapterUID,               0x73C4, 2, KaxChapterAtom, "ChapterUID");
+DEFINE_MKX_UINTEGER    (KaxChapterTimeStart,           0x91, 1, KaxChapterAtom, "ChapterTimeStart");
+DEFINE_MKX_UINTEGER    (KaxChapterTimeEnd,             0x92, 1, KaxChapterAtom, "ChapterTimeEnd");
+DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagHidden,          0x98, 1, KaxChapterAtom, "ChapterFlagHidden", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxChapterFlagEnabled,       0x4598, 2, KaxChapterAtom, "ChapterFlagEnabled", 1);
+DEFINE_MKX_BINARY      (KaxChapterSegmentUID,        0x6E67, 2, KaxChapterAtom, "ChapterSegmentUID");
+DEFINE_MKX_BINARY      (KaxChapterSegmentEditionUID, 0x6EBC, 2, KaxChapterAtom, "ChapterSegmentEditionUID");
+DEFINE_MKX_UINTEGER    (KaxChapterPhysicalEquiv,     0x63C3, 2, KaxChapterAtom, "ChapterPhysicalEquiv");
+DEFINE_MKX_MASTER      (KaxChapterTrack,               0x8F, 1, KaxChapterAtom, "ChapterTrack");
+DEFINE_MKX_UINTEGER    (KaxChapterTrackNumber,         0x89, 1, KaxChapterTrack, "ChapterTrackNumber");
+DEFINE_MKX_MASTER      (KaxChapterDisplay,             0x80, 1, KaxChapterAtom, "ChapterDisplay");
+DEFINE_MKX_UNISTRING   (KaxChapterString,              0x85, 1, KaxChapterDisplay, "ChapterString");
+DEFINE_MKX_STRING_DEF  (KaxChapterLanguage,          0x437C, 2, KaxChapterLanguage, "ChapterLanguage", "eng"); // parent context ?
+DEFINE_MKX_STRING      (KaxChapterCountry,           0x437E, 2, KaxChapterCountry, "ChapterCountry"); // parent context ?
+DEFINE_MKX_MASTER      (KaxChapterProcess,           0x6944, 2, KaxChapterAtom, "ChapterProcess");
+DEFINE_MKX_UINTEGER_DEF(KaxChapterProcessCodecID,    0x6955, 2, KaxChapterProcess, "ChapterProcessCodecID", 0);
+DEFINE_MKX_BINARY      (KaxChapterProcessPrivate,    0x450D, 2, KaxChapterProcess, "ChapterProcessPrivate");
+DEFINE_MKX_MASTER      (KaxChapterProcessCommand,    0x6911, 2, KaxChapterProcess, "ChapterProcessCommand");
+DEFINE_MKX_UINTEGER    (KaxChapterProcessTime,       0x6922, 2, KaxChapterProcessCommand, "ChapterProcessTime");
+DEFINE_MKX_BINARY      (KaxChapterProcessData,       0x6933, 2, KaxChapterProcessCommand, "ChapterProcessData");
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxCluster.cpp b/src/KaxCluster.cpp
index d520e7a..b246065 100644
--- a/src/KaxCluster.cpp
+++ b/src/KaxCluster.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -35,33 +35,26 @@
 #include "matroska/KaxBlock.h"
 #include "matroska/KaxContexts.h"
 #include "matroska/KaxSegment.h"
+#include "matroska/KaxDefines.h"
 
 // sub elements
 START_LIBMATROSKA_NAMESPACE
 
-#if MATROSKA_VERSION == 1
-EbmlSemantic KaxCluster_ContextList[5] =
-#else // MATROSKA_VERSION
-EbmlSemantic KaxCluster_ContextList[6] =
-#endif // MATROSKA_VERSION
-{
-	EbmlSemantic(true,  true,  KaxClusterTimecode::ClassInfos),
-	EbmlSemantic(false, true,  KaxClusterSilentTracks::ClassInfos),
-	EbmlSemantic(false, true,  KaxClusterPrevSize::ClassInfos),
-	EbmlSemantic(false, false, KaxBlockGroup::ClassInfos),
+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
-	EbmlSemantic(false, false, KaxSimpleBlock::ClassInfos),
+DEFINE_SEMANTIC_ITEM(false, false, KaxSimpleBlock)
 #endif
-	EbmlSemantic(false, true,  KaxClusterPosition::ClassInfos),
-};
+DEFINE_SEMANTIC_ITEM(false, true, KaxClusterPosition)
+DEFINE_END_SEMANTIC(KaxCluster)
 
-const EbmlSemanticContext KaxCluster_Context = EbmlSemanticContext(countof(KaxCluster_ContextList), KaxCluster_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxCluster::ClassInfos);
+DEFINE_MKX_MASTER_CONS(KaxCluster, 0x1F43B675, 4, KaxSegment, "Cluster");
 
-EbmlId KaxCluster_TheId(0x1F43B675, 4);
-const EbmlCallbacks KaxCluster::ClassInfos(KaxCluster::Create, KaxCluster_TheId, "Cluster", KaxCluster_Context);
-
-KaxCluster::KaxCluster()
-	:EbmlMaster(KaxCluster_Context)
+KaxCluster::KaxCluster(EBML_EXTRA_DEF)
+	:EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxCluster) EBML_DEF_SEP EBML_EXTRA_CALL)
 	,currentNewBlock(NULL)
 	,ParentSegment(NULL)
 	,bFirstFrameInside(false)
@@ -75,18 +68,19 @@ KaxCluster::KaxCluster(const KaxCluster & ElementToClone)
  ,bSilentTracksUsed(ElementToClone.bSilentTracksUsed)
 {
 	// update the parent of each children
-	std::vector<EbmlElement *>::const_iterator Itr = ElementList.begin();
-	while (Itr != ElementList.end())
+	EBML_MASTER_ITERATOR Itr = begin();
+	while (Itr != end())
 	{
-		if (EbmlId(**Itr) == KaxBlockGroup::ClassInfos.GlobalId) {
+		if (EbmlId(**Itr) == EBML_ID(KaxBlockGroup)) {
 			static_cast<KaxBlockGroup   *>(*Itr)->SetParent(*this);
-		} else if (EbmlId(**Itr) == KaxBlock::ClassInfos.GlobalId) {
+		} else if (EbmlId(**Itr) == EBML_ID(KaxBlock)) {
 			static_cast<KaxBlock        *>(*Itr)->SetParent(*this);
 #if MATROSKA_VERSION >= 2
-		} else if (EbmlId(**Itr) == KaxBlockVirtual::ClassInfos.GlobalId) {
+		} else if (EbmlId(**Itr) == EBML_ID(KaxBlockVirtual)) {
 			static_cast<KaxBlockVirtual *>(*Itr)->SetParent(*this);
 #endif // MATROSKA_VERSION
 		}
+        ++Itr;
 	}
 }
 
@@ -171,13 +165,14 @@ bool KaxCluster::AddFrame(const KaxTrackEntry & track, uint64 timecode, DataBuff
 /*!
 	\todo only put the Blocks written in the cue entries
 */
-uint32 KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault)
+filepos_t KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSaveDefault)
 {
-	uint32 Result = 0;
-	size_t TrkIndex, Index;
+	filepos_t Result = 0;
+    size_t Index;
+    EBML_MASTER_ITERATOR TrkItr, Itr;
 
 	// update the Timecode of the Cluster before writing
-	KaxClusterTimecode * Timecode = static_cast<KaxClusterTimecode *>(this->FindElt(KaxClusterTimecode::ClassInfos));
+	KaxClusterTimecode * Timecode = static_cast<KaxClusterTimecode *>(this->FindElt(EBML_INFO(KaxClusterTimecode)));
 	*static_cast<EbmlUInteger *>(Timecode) = GlobalTimecode() / GlobalTimecodeScale();
 
 	if (Blobs.size() == 0) {
@@ -187,25 +182,27 @@ uint32 KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSave
 		// 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(KaxTracks::ClassInfos));
-			for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) {
-				if (EbmlId(*MyTracks[TrkIndex]) == KaxTrackEntry::ClassInfos.GlobalId)
+			KaxTracks & MyTracks = *static_cast<KaxTracks *>(ParentSegment->FindElt(EBML_INFO(KaxTracks)));
+	        for (TrkItr = MyTracks.begin(); TrkItr != MyTracks.end(); ++TrkItr)
+            {
+				if (EbmlId(*(*TrkItr)) == EBML_ID(KaxTrackEntry))
 				{
-					KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(MyTracks[TrkIndex]);
+					KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(*TrkItr);
 					uint32 tracknum = entry.TrackNumber();
-					for (Index = 0; Index < ElementList.size(); Index++) {
-						if (EbmlId(*ElementList[Index]) == KaxBlockGroup::ClassInfos.GlobalId) {
-							KaxBlockGroup & group = *static_cast<KaxBlockGroup *>(ElementList[Index]);
+	                for (Itr = begin(); Itr != end(); ++Itr)
+                    {
+						if (EbmlId(*(*Itr)) == EBML_ID(KaxBlockGroup)) {
+							KaxBlockGroup & group = *static_cast<KaxBlockGroup *>(*Itr);
 							if (group.TrackNumber() == tracknum)
 								break; // this track is used
 						}
 					}
 					// the track wasn't found in this cluster
-					if (Index == ElementList.size())
+					if (Itr == end())
 					{
-						KaxClusterSilentTracks * SilentTracks = static_cast<KaxClusterSilentTracks *>(this->FindFirstElt(KaxClusterSilentTracks::ClassInfos));
+						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(KaxClusterSilentTrackNumber::ClassInfos));
+						KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));
 						*static_cast<EbmlUInteger *>(trackelt) = tracknum;
 					}
 				}
@@ -215,9 +212,10 @@ uint32 KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSave
 		Result = EbmlMaster::Render(output, bSaveDefault);
 		// For all Blocks add their position on the CueEntry
 		
-		for (Index = 0; Index < ElementList.size(); Index++) {
-			if (EbmlId(*ElementList[Index]) == KaxBlockGroup::ClassInfos.GlobalId) {
-				CueToUpdate.PositionSet(*static_cast<const KaxBlockGroup *>(ElementList[Index]));
+        for (Itr = begin(); Itr != end(); ++Itr)
+        {
+			if (EbmlId(*(*Itr)) == EBML_ID(KaxBlockGroup)) {
+				CueToUpdate.PositionSet(*static_cast<const KaxBlockGroup *>(*Itr));
 			}
 		}
 	} else {
@@ -226,32 +224,33 @@ uint32 KaxCluster::Render(IOCallback & output, KaxCues & CueToUpdate, bool bSave
 		{
 #if MATROSKA_VERSION >= 2
 			if (Blobs[Index]->IsSimpleBlock())
-				ElementList.push_back( &(KaxSimpleBlock&) *Blobs[Index] );
+				PushElement( (KaxSimpleBlock&) *Blobs[Index] );
 			else
 #endif
-				ElementList.push_back( &(KaxBlockGroup&) *Blobs[Index] );
+				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(KaxTracks::ClassInfos));
-			for (TrkIndex = 0; TrkIndex < MyTracks.ListSize(); TrkIndex++) {
-				if (EbmlId(*MyTracks[TrkIndex]) == KaxTrackEntry::ClassInfos.GlobalId)
+			KaxTracks & MyTracks = *static_cast<KaxTracks *>(ParentSegment->FindElt(EBML_INFO(KaxTracks)));
+	        for (TrkItr = MyTracks.begin(); TrkItr != MyTracks.end(); ++TrkItr)
+            {
+				if (EbmlId(*(*TrkItr)) == EBML_ID(KaxTrackEntry))
 				{
-					KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(MyTracks[TrkIndex]);
+					KaxTrackEntry & entry = *static_cast<KaxTrackEntry *>(*TrkItr);
 					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 == ElementList.size())
+					if (Index == ListSize())
 					{
-						KaxClusterSilentTracks * SilentTracks = static_cast<KaxClusterSilentTracks *>(this->FindFirstElt(KaxClusterSilentTracks::ClassInfos));
+						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(KaxClusterSilentTrackNumber::ClassInfos));
+						KaxClusterSilentTrackNumber * trackelt = static_cast<KaxClusterSilentTrackNumber *>(SilentTracks->AddNewElt(EBML_INFO(KaxClusterSilentTrackNumber)));
 						*static_cast<EbmlUInteger *>(trackelt) = tracknum;
 					}
 				}
@@ -299,7 +298,7 @@ int16 KaxCluster::GetBlockLocalTimecode(uint64 aGlobalTimecode) const
 uint64 KaxCluster::GetBlockGlobalTimecode(int16 GlobalSavedTimecode)
 {
 	if (!bFirstFrameInside) {
-		KaxClusterTimecode * Timecode = static_cast<KaxClusterTimecode *>(this->FindElt(KaxClusterTimecode::ClassInfos));
+		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;
@@ -317,11 +316,11 @@ KaxBlockGroup & KaxCluster::GetNewBlock()
 
 void KaxCluster::ReleaseFrames()
 {
-	size_t Index;
-	
-	for (Index = 0; Index < ElementList.size(); Index++) {
-		if (EbmlId(*ElementList[Index]) == KaxBlockGroup::ClassInfos.GlobalId) {
-			static_cast<KaxBlockGroup*>(ElementList[Index])->ReleaseFrames();
+    EBML_MASTER_ITERATOR Itr;
+    for (Itr = begin(); Itr != end(); ++Itr)
+    {
+		if (EbmlId(*(*Itr)) == EBML_ID(KaxBlockGroup)) {
+			static_cast<KaxBlockGroup*>(*Itr)->ReleaseFrames();
 		}
 	}
 }
diff --git a/src/KaxClusterData.cpp b/src/KaxClusterData.cpp
index ec195dd..a7e5686 100644
--- a/src/KaxClusterData.cpp
+++ b/src/KaxClusterData.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -34,34 +34,18 @@
 */
 #include "matroska/KaxClusterData.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-EbmlId KaxClusterTimecode_TheId         (0xE7, 1);
-EbmlId KaxClusterSilentTracks_TheId     (0x5854, 2);
-EbmlId KaxClusterSilentTrackNumber_TheId(0x58D7, 2);
-EbmlId KaxClusterPrevSize_TheId         (0xAB, 1);
-EbmlId KaxClusterPosition_TheId         (0xA7, 1);
+DEFINE_START_SEMANTIC(KaxClusterSilentTracks)
+DEFINE_SEMANTIC_ITEM(false, false, KaxClusterSilentTrackNumber)
+DEFINE_END_SEMANTIC(KaxClusterSilentTracks)
 
-EbmlSemantic KaxClusterSilentTracks_ContextList[1] =
-{
-	EbmlSemantic(false,  false, KaxClusterSilentTrackNumber::ClassInfos),
-};
-
-const EbmlSemanticContext KaxClusterTimecode_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &KaxClusterTimecode::ClassInfos);
-const EbmlSemanticContext KaxClusterSilentTracks_Context = EbmlSemanticContext(countof(KaxClusterSilentTracks_ContextList), KaxClusterSilentTracks_ContextList, &KaxCluster_Context, *GetKaxGlobal_Context, &KaxClusterSilentTracks::ClassInfos);
-const EbmlSemanticContext KaxClusterSilentTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxClusterSilentTracks_Context, *GetKaxGlobal_Context, &KaxClusterSilentTrackNumber::ClassInfos);
-const EbmlSemanticContext KaxClusterPosition_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &KaxClusterPosition::ClassInfos);
-const EbmlSemanticContext KaxClusterPrevSize_Context = EbmlSemanticContext(0, NULL, &KaxCluster_Context, *GetKaxGlobal_Context, &KaxClusterPrevSize::ClassInfos);
-
-const EbmlCallbacks KaxClusterTimecode::ClassInfos(KaxClusterTimecode::Create, KaxClusterTimecode_TheId, "ClusterTimecode", KaxClusterTimecode_Context);
-const EbmlCallbacks KaxClusterSilentTracks::ClassInfos(KaxClusterSilentTracks::Create, KaxClusterSilentTracks_TheId, "ClusterSilentTracks", KaxClusterSilentTracks_Context);
-const EbmlCallbacks KaxClusterSilentTrackNumber::ClassInfos(KaxClusterSilentTrackNumber::Create, KaxClusterSilentTrackNumber_TheId, "ClusterSilentTrackNumber", KaxClusterSilentTrackNumber_Context);
-const EbmlCallbacks KaxClusterPrevSize::ClassInfos(KaxClusterPrevSize::Create, KaxClusterPrevSize_TheId, "ClusterPrevSize", KaxClusterPrevSize_Context);
-const EbmlCallbacks KaxClusterPosition::ClassInfos(KaxClusterPosition::Create, KaxClusterPosition_TheId, "ClusterPosition", KaxClusterPosition_Context);
-
-KaxClusterSilentTracks::KaxClusterSilentTracks()
-:EbmlMaster(KaxClusterSilentTracks_Context)
-{}
+DEFINE_MKX_UINTEGER(KaxClusterTimecode,            0xE7, 1, KaxCluster, "ClusterTimecode");
+DEFINE_MKX_MASTER  (KaxClusterSilentTracks,      0x5854, 2, KaxCluster, "ClusterSilentTracks")
+DEFINE_MKX_UINTEGER(KaxClusterSilentTrackNumber, 0x58D7, 2, KaxClusterSilentTracks, "ClusterSilentTrackNumber");
+DEFINE_MKX_UINTEGER(KaxClusterPosition,            0xA7, 1, KaxCluster, "ClusterPosition");
+DEFINE_MKX_UINTEGER(KaxClusterPrevSize,            0xAB, 1, KaxCluster, "ClusterPrevSize");
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxContentEncoding.cpp b/src/KaxContentEncoding.cpp
index f46e87b..b65f5a9 100644
--- a/src/KaxContentEncoding.cpp
+++ b/src/KaxContentEncoding.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -34,221 +34,50 @@
 */
 #include "matroska/KaxContentEncoding.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-const EbmlSemantic KaxContentEncodings_ContextList[1] = {
-  EbmlSemantic(true, true, KaxContentEncoding::ClassInfos),
-};
-
-const EbmlSemantic KaxContentEncoding_ContextList[5] = {
-  EbmlSemantic(true, true, KaxContentEncodingOrder::ClassInfos),
-  EbmlSemantic(true, true, KaxContentEncodingScope::ClassInfos),
-  EbmlSemantic(true, true, KaxContentEncodingType::ClassInfos),
-  EbmlSemantic(false, true, KaxContentCompression::ClassInfos),
-  EbmlSemantic(false, true, KaxContentEncryption::ClassInfos),
-};
-
-const EbmlSemantic KaxContentCompression_ContextList[2] = {
-  EbmlSemantic(true, true, KaxContentCompAlgo::ClassInfos),
-  EbmlSemantic(false, true, KaxContentCompSettings::ClassInfos),
-};
-
-const EbmlSemantic KaxContentEncryption_ContextList[6] = {
-  EbmlSemantic(false, true, KaxContentEncAlgo::ClassInfos),
-  EbmlSemantic(false, true, KaxContentEncKeyID::ClassInfos),
-  EbmlSemantic(false, true, KaxContentSignature::ClassInfos),
-  EbmlSemantic(false, true, KaxContentSigKeyID::ClassInfos),
-  EbmlSemantic(false, true, KaxContentSigAlgo::ClassInfos),
-  EbmlSemantic(false, true, KaxContentSigHashAlgo::ClassInfos),
-};
-
-EbmlId KaxContentEncodings_TheId       (0x6d80, 2);
-EbmlId KaxContentEncoding_TheId        (0x6240, 2);
-EbmlId KaxContentEncodingOrder_TheId   (0x5031, 2);
-EbmlId KaxContentEncodingScope_TheId   (0x5032, 2);
-EbmlId KaxContentEncodingType_TheId    (0x5033, 2);
-EbmlId KaxContentCompression_TheId     (0x5034, 2);
-EbmlId KaxContentCompAlgo_TheId        (0x4254, 2);
-EbmlId KaxContentCompSettings_TheId    (0x4255, 2);
-EbmlId KaxContentEncryption_TheId      (0x5035, 2);
-EbmlId KaxContentEncAlgo_TheId         (0x47e1, 2);
-EbmlId KaxContentEncKeyID_TheId        (0x47e2, 2);
-EbmlId KaxContentSignature_TheId       (0x47e3, 2);
-EbmlId KaxContentSigKeyID_TheId        (0x47e4, 2);
-EbmlId KaxContentSigAlgo_TheId         (0x47e5, 2);
-EbmlId KaxContentSigHashAlgo_TheId     (0x47e6, 2);
- 
-const EbmlSemanticContext KaxContentEncodings_Context =
-EbmlSemanticContext(countof(KaxContentEncodings_ContextList),
-                    KaxContentEncodings_ContextList, &KaxTrackEntry_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentEncodings::ClassInfos);
-
-const EbmlSemanticContext KaxContentEncoding_Context =
-EbmlSemanticContext(countof(KaxContentEncoding_ContextList),
-                    KaxContentEncoding_ContextList,
-                    &KaxContentEncodings_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentEncoding::ClassInfos);
-
-const EbmlSemanticContext KaxContentEncodingOrder_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentEncodingOrder::ClassInfos);
-
-const EbmlSemanticContext KaxContentEncodingScope_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentEncodingScope::ClassInfos);
-
-const EbmlSemanticContext KaxContentEncodingType_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncoding_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentEncodingType::ClassInfos);
-
-const EbmlSemanticContext KaxContentCompression_Context =
-EbmlSemanticContext(countof(KaxContentCompression_ContextList),
-                    KaxContentCompression_ContextList,
-                    &KaxContentEncoding_Context, *GetKaxGlobal_Context,
-                    &KaxContentCompression::ClassInfos);
-
-const EbmlSemanticContext KaxContentCompAlgo_Context =
-EbmlSemanticContext(0, NULL, &KaxContentCompression_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentCompAlgo::ClassInfos);
-
-const EbmlSemanticContext KaxContentCompSettings_Context =
-EbmlSemanticContext(0, NULL, &KaxContentCompression_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentCompSettings::ClassInfos);
-
-const EbmlSemanticContext KaxContentEncryption_Context =
-EbmlSemanticContext(countof(KaxContentEncryption_ContextList),
-                    KaxContentEncryption_ContextList,
-                    &KaxContentEncoding_Context, *GetKaxGlobal_Context,
-                    &KaxContentEncryption::ClassInfos);
-
-const EbmlSemanticContext KaxContentEncAlgo_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentEncAlgo::ClassInfos);
-
-const EbmlSemanticContext KaxContentEncKeyID_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentEncKeyID::ClassInfos);
-
-const EbmlSemanticContext KaxContentSignature_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentSignature::ClassInfos);
-
-const EbmlSemanticContext KaxContentSigAlgo_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentSigKeyID::ClassInfos);
-
-const EbmlSemanticContext KaxContentSigHashAlgo_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentSigKeyID::ClassInfos);
-
-const EbmlSemanticContext KaxContentSigKeyID_Context =
-EbmlSemanticContext(0, NULL, &KaxContentEncryption_Context,
-                    *GetKaxGlobal_Context,
-                    &KaxContentSigKeyID::ClassInfos);
-
-const EbmlCallbacks
-KaxContentEncodings::ClassInfos(KaxContentEncodings::Create,
-                                KaxContentEncodings_TheId,
-                                "ContentEncodings",
-                                KaxContentEncodings_Context);
-const EbmlCallbacks
-KaxContentEncoding::ClassInfos(KaxContentEncoding::Create,
-                               KaxContentEncoding_TheId,
-                               "ContentEncoding",
-                               KaxContentEncoding_Context);
-const EbmlCallbacks
-KaxContentEncodingOrder::ClassInfos(KaxContentEncodingOrder::Create,
-                                    KaxContentEncodingOrder_TheId,
-                                    "ContentEncodingOrder",
-                                    KaxContentEncodingOrder_Context);
-const EbmlCallbacks
-KaxContentEncodingScope::ClassInfos(KaxContentEncodingScope::Create,
-                                    KaxContentEncodingScope_TheId,
-                                    "ContentEncodingScope",
-                                    KaxContentEncodingScope_Context);
-const EbmlCallbacks
-KaxContentEncodingType::ClassInfos(KaxContentEncodingType::Create,
-                                   KaxContentEncodingType_TheId,
-                                   "ContentEncodingType",
-                                   KaxContentEncodingType_Context);
-const EbmlCallbacks
-KaxContentCompression::ClassInfos(KaxContentCompression::Create,
-                                  KaxContentCompression_TheId,
-                                  "ContentCompression",
-                                  KaxContentCompression_Context);
-const EbmlCallbacks
-KaxContentCompAlgo::ClassInfos(KaxContentCompAlgo::Create,
-                               KaxContentCompAlgo_TheId,
-                               "ContentCompAlgo",
-                               KaxContentCompAlgo_Context);
-const EbmlCallbacks
-KaxContentCompSettings::ClassInfos(KaxContentCompSettings::Create,
-                                   KaxContentCompSettings_TheId,
-                                   "ContentCompSettings",
-                                   KaxContentCompSettings_Context);
-const EbmlCallbacks
-KaxContentEncryption::ClassInfos(KaxContentEncryption::Create,
-                                 KaxContentEncryption_TheId,
-                                 "ContentEncryption",
-                                 KaxContentEncryption_Context);
-const EbmlCallbacks
-KaxContentEncAlgo::ClassInfos(KaxContentEncAlgo::Create,
-                              KaxContentEncAlgo_TheId,
-                              "ContentEncAlgo",
-                              KaxContentEncAlgo_Context);
-const EbmlCallbacks
-KaxContentEncKeyID::ClassInfos(KaxContentEncKeyID::Create,
-                               KaxContentEncKeyID_TheId,
-                               "ContentEncKeyID",
-                               KaxContentEncKeyID_Context);
-const EbmlCallbacks
-KaxContentSignature::ClassInfos(KaxContentSignature::Create,
-                                KaxContentSignature_TheId,
-                                "ContentSignature",
-                                KaxContentSignature_Context);
-const EbmlCallbacks
-KaxContentSigAlgo::ClassInfos(KaxContentSigAlgo::Create,
-                              KaxContentSigAlgo_TheId,
-                              "ContentSigAlgo",
-                              KaxContentSigAlgo_Context);
-const EbmlCallbacks
-KaxContentSigHashAlgo::ClassInfos(KaxContentSigHashAlgo::Create,
-                                  KaxContentSigHashAlgo_TheId,
-                                  "ContentSigHashAlgo",
-                                  KaxContentSigHashAlgo_Context);
-const EbmlCallbacks
-KaxContentSigKeyID::ClassInfos(KaxContentSigKeyID::Create,
-                               KaxContentSigKeyID_TheId,
-                               "ContentSigKeyID",
-                               KaxContentSigKeyID_Context);
-
-KaxContentEncodings::KaxContentEncodings():
-  EbmlMaster(KaxContentEncodings_Context) {
-}
-
-KaxContentEncoding::KaxContentEncoding():
-  EbmlMaster(KaxContentEncoding_Context) {
-}
-
-KaxContentCompression::KaxContentCompression():
-  EbmlMaster(KaxContentCompression_Context) {
-}
-
-KaxContentEncryption::KaxContentEncryption():
-  EbmlMaster(KaxContentEncryption_Context) {
-}
+DEFINE_START_SEMANTIC(KaxContentEncodings)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncoding)
+DEFINE_END_SEMANTIC(KaxContentEncodings)
+
+DEFINE_START_SEMANTIC(KaxContentEncoding)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingOrder)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingScope)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentEncodingType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentCompression)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncryption)
+DEFINE_END_SEMANTIC(KaxContentEncoding)
+
+DEFINE_START_SEMANTIC(KaxContentCompression)
+DEFINE_SEMANTIC_ITEM(true, true, KaxContentCompAlgo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentCompSettings)
+DEFINE_END_SEMANTIC(KaxContentCompression)
+
+DEFINE_START_SEMANTIC(KaxContentEncryption)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncAlgo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentEncKeyID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSignature)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigKeyID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigAlgo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxContentSigHashAlgo)
+DEFINE_END_SEMANTIC(KaxContentEncryption)
+
+DEFINE_MKX_MASTER      (KaxContentEncodings,     0x6d80, 2, KaxTrackEntry, "ContentEncodings");
+DEFINE_MKX_MASTER      (KaxContentEncoding,      0x6240, 2, KaxContentEncodings, "ContentEncoding");
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingOrder, 0x5031, 2, KaxContentEncoding, "ContentEncodingOrder", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingScope, 0x5032, 2, KaxContentEncoding, "ContentEncodingScope", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncodingType,  0x5033, 2, KaxContentEncoding, "ContentEncodingType", 0);
+DEFINE_MKX_MASTER      (KaxContentCompression,   0x5034, 2, KaxContentEncoding, "ContentCompression");
+DEFINE_MKX_UINTEGER_DEF(KaxContentCompAlgo,      0x4254, 2, KaxContentCompression, "ContentCompAlgo", 0);
+DEFINE_MKX_BINARY      (KaxContentCompSettings,  0x4255, 2, KaxContentCompression, "ContentCompSettings");
+DEFINE_MKX_MASTER      (KaxContentEncryption,    0x5035, 2, KaxContentEncoding, "ContentEncryption");
+DEFINE_MKX_UINTEGER_DEF(KaxContentEncAlgo,       0x47e1, 2, KaxContentEncryption, "ContentEncAlgo", 0);
+DEFINE_MKX_BINARY      (KaxContentEncKeyID,      0x47e2, 2, KaxContentEncryption, "ContentEncKeyID");
+DEFINE_MKX_BINARY      (KaxContentSignature,     0x47e3, 2, KaxContentEncryption, "ContentSignature");
+DEFINE_MKX_BINARY      (KaxContentSigKeyID,      0x47e4, 2, KaxContentEncryption, "ContentSigKeyID");
+DEFINE_MKX_UINTEGER_DEF(KaxContentSigAlgo,       0x47e5, 2, KaxContentEncryption, "ContentSigAlgo", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxContentSigHashAlgo,   0x47e6, 2, KaxContentEncryption, "ContentSigHashAlgo", 0);
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxContexts.cpp b/src/KaxContexts.cpp
index 2e128ce..1bd3eb0 100644
--- a/src/KaxContexts.cpp
+++ b/src/KaxContexts.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -34,11 +34,24 @@
 */
 #include "ebml/EbmlContexts.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxAttached.h"
+#include "matroska/KaxAttachments.h"
+#include "matroska/KaxBlock.h"
+#include "matroska/KaxCluster.h"
+#include "matroska/KaxSegment.h"
+#include "matroska/KaxTracks.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
+DEFINE_SEMANTIC_CONTEXT(KaxSegment)
+DEFINE_SEMANTIC_CONTEXT(KaxAttached)
+DEFINE_SEMANTIC_CONTEXT(KaxAttachments)
+DEFINE_SEMANTIC_CONTEXT(KaxBlockGroup)
+DEFINE_SEMANTIC_CONTEXT(KaxCluster)
+DEFINE_SEMANTIC_CONTEXT(KaxTrackEntry)
+
 // for the moment
 const EbmlSemanticContext & GetKaxGlobal_Context()
 {
diff --git a/src/KaxCues.cpp b/src/KaxCues.cpp
index 7aee21c..9fd123b 100644
--- a/src/KaxCues.cpp
+++ b/src/KaxCues.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -36,23 +36,16 @@
 #include "matroska/KaxCuesData.h"
 #include "matroska/KaxContexts.h"
 #include "ebml/EbmlStream.h"
+#include "matroska/KaxDefines.h"
 
 // sub elements
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxCues_ContextList[1] = 
-{
-	EbmlSemantic(true,  false,  KaxCuePoint::ClassInfos),
-};
-
-const EbmlSemanticContext KaxCues_Context = EbmlSemanticContext(countof(KaxCues_ContextList), KaxCues_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxCues::ClassInfos);
-
-EbmlId KaxCues_TheId(0x1C53BB6B, 4);
-const EbmlCallbacks KaxCues::ClassInfos(KaxCues::Create, KaxCues_TheId, "Cues", KaxCues_Context);
+DEFINE_START_SEMANTIC(KaxCues) 
+DEFINE_SEMANTIC_ITEM(true, false, KaxCuePoint)
+DEFINE_END_SEMANTIC(KaxCues) 
 
-KaxCues::KaxCues()
-	:EbmlMaster(KaxCues_Context)
-{}
+DEFINE_MKX_MASTER(KaxCues, 0x1C53BB6B, 4, KaxSegment, "Cues");
 
 KaxCues::~KaxCues()
 {
@@ -132,12 +125,13 @@ const KaxCuePoint * KaxCues::GetTimecodePoint(uint64 aTimecode) const
 	const KaxCuePoint * aPointNext = NULL;
 	uint64 aNextTime = EBML_PRETTYLONGINT(0xFFFFFFFFFFFF);
 
-	for (unsigned int i=0; i<ListSize(); i++)
-	{
-		if (EbmlId(*(*this)[i]) == KaxCuePoint::ClassInfos.GlobalId) {
-			const KaxCuePoint *tmp = static_cast<const KaxCuePoint *>((*this)[i]);
+    EBML_MASTER_CONST_ITERATOR Itr;
+	for (Itr = begin(); Itr != end(); ++Itr)
+    {
+		if (EbmlId(*(*Itr)) == EBML_ID(KaxCuePoint)) {
+			const KaxCuePoint *tmp = static_cast<const KaxCuePoint *>(*Itr);
 			// check the tile
-			const KaxCueTime *aTime = static_cast<const KaxCueTime *>(tmp->FindFirstElt(KaxCueTime::ClassInfos));
+			const KaxCueTime *aTime = static_cast<const KaxCueTime *>(tmp->FindFirstElt(EBML_INFO(KaxCueTime)));
 			if (aTime != NULL)
 			{
 				uint64 _Time = uint64(*aTime);
diff --git a/src/KaxCuesData.cpp b/src/KaxCuesData.cpp
index 17b688c..419986a 100644
--- a/src/KaxCuesData.cpp
+++ b/src/KaxCuesData.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** 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
@@ -38,98 +38,48 @@
 #include "matroska/KaxBlockData.h"
 #include "matroska/KaxCluster.h"
 #include "matroska/KaxSegment.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxCuePoint_ContextList[2] =
-{
-	EbmlSemantic(true,  true,  KaxCueTime::ClassInfos),
-	EbmlSemantic(true,  false, KaxCueTrackPositions::ClassInfos),
-};
-
-#if MATROSKA_VERSION == 1
-EbmlSemantic KaxCueTrackPositions_ContextList[3] =
-#else // MATROSKA_VERSION
-EbmlSemantic KaxCueTrackPositions_ContextList[5] =
-#endif // MATROSKA_VERSION
-{
-	EbmlSemantic(true,  true,  KaxCueTrack::ClassInfos),
-	EbmlSemantic(true,  true,  KaxCueClusterPosition::ClassInfos),
-	EbmlSemantic(false, true,  KaxCueBlockNumber::ClassInfos),
-#if MATROSKA_VERSION >= 2
-	EbmlSemantic(false, true,  KaxCueCodecState::ClassInfos),
-	EbmlSemantic(false, false, KaxCueReference::ClassInfos),
-#endif // MATROSKA_VERSION
-};
-
-#if MATROSKA_VERSION >= 2
-EbmlSemantic KaxCueReference_ContextList[4] =
-{
-	EbmlSemantic(true,  true,  KaxCueRefTime::ClassInfos),
-	EbmlSemantic(true,  true,  KaxCueRefCluster::ClassInfos),
-	EbmlSemantic(false, true,  KaxCueRefNumber::ClassInfos),
-	EbmlSemantic(false, true,  KaxCueRefCodecState::ClassInfos),
-};
-#endif // MATROSKA_VERSION
-
-EbmlId KaxCuePoint_TheId          (0xBB, 1);
-EbmlId KaxCueTime_TheId           (0xB3, 1);
-EbmlId KaxCueTrackPositions_TheId (0xB7, 1);
-EbmlId KaxCueTrack_TheId          (0xF7, 1);
-EbmlId KaxCueClusterPosition_TheId(0xF1, 1);
-EbmlId KaxCueBlockNumber_TheId    (0x5378, 2);
-#if MATROSKA_VERSION >= 2
-EbmlId KaxCueCodecState_TheId     (0xEA, 1);
-EbmlId KaxCueReference_TheId      (0xDB, 1);
-EbmlId KaxCueRefTime_TheId        (0x96, 1);
-EbmlId KaxCueRefCluster_TheId     (0x97, 1);
-EbmlId KaxCueRefNumber_TheId      (0x535F, 2);
-EbmlId KaxCueRefCodecState_TheId  (0xEB, 1);
-#endif // MATROSKA_VERSION
+DEFINE_START_SEMANTIC(KaxCuePoint)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueTime)
+DEFINE_SEMANTIC_ITEM(true, false, KaxCueTrackPositions)
+DEFINE_END_SEMANTIC(KaxCuePoint)
 
-const EbmlSemanticContext KaxCuePoint_Context = EbmlSemanticContext(countof(KaxCuePoint_ContextList), KaxCuePoint_ContextList, &KaxCues_Context, *GetKaxGlobal_Context, &KaxCuePoint::ClassInfos);
-const EbmlSemanticContext KaxCueTime_Context = EbmlSemanticContext(0, NULL, &KaxCuePoint_Context, *GetKaxGlobal_Context, &KaxCueTime::ClassInfos);
-const EbmlSemanticContext KaxCueTrackPositions_Context = EbmlSemanticContext(countof(KaxCueTrackPositions_ContextList), KaxCueTrackPositions_ContextList, &KaxCuePoint_Context, *GetKaxGlobal_Context, &KaxCueTrackPositions::ClassInfos);
-const EbmlSemanticContext KaxCueTrack_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &KaxCueTrack::ClassInfos);
-const EbmlSemanticContext KaxCueClusterPosition_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &KaxCueClusterPosition::ClassInfos);
-const EbmlSemanticContext KaxCueBlockNumber_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &KaxCueBlockNumber::ClassInfos);
+DEFINE_START_SEMANTIC(KaxCueTrackPositions)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueTrack)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueClusterPosition)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueBlockNumber)
 #if MATROSKA_VERSION >= 2
-const EbmlSemanticContext KaxCueCodecState_Context = EbmlSemanticContext(0, NULL, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &KaxCueCodecState::ClassInfos);
-const EbmlSemanticContext KaxCueReference_Context = EbmlSemanticContext(countof(KaxCueReference_ContextList), KaxCueReference_ContextList, &KaxCueTrackPositions_Context, *GetKaxGlobal_Context, &KaxCueReference::ClassInfos);
-const EbmlSemanticContext KaxCueRefTime_Context = EbmlSemanticContext(0, NULL, &KaxCueReference_Context, *GetKaxGlobal_Context, &KaxCueRefTime::ClassInfos);
-const EbmlSemanticContext KaxCueRefCluster_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &KaxCueRefCluster::ClassInfos);
-const EbmlSemanticContext KaxCueRefNumber_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &KaxCueRefNumber::ClassInfos);
-const EbmlSemanticContext KaxCueRefCodecState_Context = EbmlSemanticContext(0, NULL, &KaxCueRefTime_Context, *GetKaxGlobal_Context, &KaxCueRefCodecState::ClassInfos);
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueCodecState)
+DEFINE_SEMANTIC_ITEM(false, false, KaxCueReference)
 #endif // MATROSKA_VERSION
+DEFINE_END_SEMANTIC(KaxCueTrackPositions)
 
-const EbmlCallbacks KaxCuePoint::ClassInfos(KaxCuePoint::Create, KaxCuePoint_TheId, "CuePoint", KaxCuePoint_Context);
-const EbmlCallbacks KaxCueTime::ClassInfos(KaxCueTime::Create, KaxCueTime_TheId, "CueTime", KaxCueTime_Context);
-const EbmlCallbacks KaxCueTrackPositions::ClassInfos(KaxCueTrackPositions::Create, KaxCueTrackPositions_TheId, "CueTrackPositions", KaxCueTrackPositions_Context);
-const EbmlCallbacks KaxCueTrack::ClassInfos(KaxCueTrack::Create, KaxCueTrack_TheId, "CueTrack", KaxCueTrack_Context);
-const EbmlCallbacks KaxCueClusterPosition::ClassInfos(KaxCueClusterPosition::Create, KaxCueClusterPosition_TheId, "CueClusterPosition", KaxCueClusterPosition_Context);
-const EbmlCallbacks KaxCueBlockNumber::ClassInfos(KaxCueBlockNumber::Create, KaxCueBlockNumber_TheId, "CueBlockNumber", KaxCueBlockNumber_Context);
 #if MATROSKA_VERSION >= 2
-const EbmlCallbacks KaxCueCodecState::ClassInfos(KaxCueCodecState::Create, KaxCueCodecState_TheId, "CueCodecState", KaxCueCodecState_Context);
-const EbmlCallbacks KaxCueReference::ClassInfos(KaxCueReference::Create, KaxCueReference_TheId, "CueReference", KaxCueReference_Context);
-const EbmlCallbacks KaxCueRefTime::ClassInfos(KaxCueRefTime::Create, KaxCueRefTime_TheId, "CueRefTime", KaxCueRefTime_Context);
-const EbmlCallbacks KaxCueRefCluster::ClassInfos(KaxCueRefCluster::Create, KaxCueRefCluster_TheId, "CueRefCluster", KaxCueRefCluster_Context);
-const EbmlCallbacks KaxCueRefNumber::ClassInfos(KaxCueRefNumber::Create, KaxCueRefNumber_TheId, "CueRefNumber", KaxCueRefNumber_Context);
-const EbmlCallbacks KaxCueRefCodecState::ClassInfos(KaxCueRefCodecState::Create, KaxCueRefCodecState_TheId, "CueRefCodecState", KaxCueRefCodecState_Context);
+DEFINE_START_SEMANTIC(KaxCueReference)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueRefTime)
+DEFINE_SEMANTIC_ITEM(true, true, KaxCueRefCluster)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueRefNumber)
+DEFINE_SEMANTIC_ITEM(false, true, KaxCueRefCodecState)
+DEFINE_END_SEMANTIC(KaxCueReference)
 #endif // MATROSKA_VERSION
 
-KaxCuePoint::KaxCuePoint() 
- :EbmlMaster(KaxCuePoint_Context)
-{}
-
-KaxCueTrackPositions::KaxCueTrackPositions()
- :EbmlMaster(KaxCueTrackPositions_Context)
-{}
-
+DEFINE_MKX_MASTER      (KaxCuePoint,           0xBB, 1, KaxCues, "CuePoint");
+DEFINE_MKX_UINTEGER    (KaxCueTime,            0xB3, 1, KaxCuePoint, "CueTime");
+DEFINE_MKX_MASTER      (KaxCueTrackPositions,  0xB7, 1, KaxCuePoint, "CueTrackPositions");
+DEFINE_MKX_UINTEGER    (KaxCueTrack,           0xF7, 1, KaxCueTrackPositions, "CueTrack");
+DEFINE_MKX_UINTEGER    (KaxCueClusterPosition, 0xF1, 1, KaxCueTrackPositions, "CueClusterPosition");
+DEFINE_MKX_UINTEGER_DEF(KaxCueBlockNumber,   0x5378, 2, KaxCueTrackPositions, "CueBlockNumber", 1);
 #if MATROSKA_VERSION >= 2
-KaxCueReference::KaxCueReference()
- :EbmlMaster(KaxCueReference_Context)
-{}
-#endif // MATROSKA_VERSION
+DEFINE_MKX_UINTEGER_DEF(KaxCueCodecState,      0xEA, 1, KaxCueTrackPositions, "CueCodecState", 0);
+DEFINE_MKX_MASTER      (KaxCueReference,       0xDB, 1, KaxCueTrackPositions, "CueReference");
+DEFINE_MKX_UINTEGER    (KaxCueRefTime,         0x96, 1, KaxCueReference, "CueRefTime");
+DEFINE_MKX_UINTEGER    (KaxCueRefCluster,      0x97, 1, KaxCueRefTime, "CueRefCluster");
+DEFINE_MKX_UINTEGER_DEF(KaxCueRefNumber,     0x535F, 2, KaxCueRefTime, "CueRefNumber", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxCueRefCodecState,   0xEB, 1, KaxCueRefTime, "CueRefCodecState", 0);
+#endif
 
 /*!
 	\todo handle codec state checking
@@ -159,14 +109,14 @@ void KaxCuePoint::PositionSet(const KaxBlockGroup & BlockReference, uint64 Globa
 		}
 	}
 
-	KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockReference.FindFirstElt(KaxCodecState::ClassInfos));
+	KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockReference.FindFirstElt(EBML_INFO(KaxCodecState)));
 	if (CodecState != NULL) {
 		KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);
 		*static_cast<EbmlUInteger*>(&CueCodecState) = BlockReference.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());
 	}
 #endif // MATROSKA_VERSION
 
-	bValueIsSet = true;
+	SetValueIsSet();
 }
 
 void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalTimecodeScale)
@@ -199,7 +149,7 @@ void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalT
 #if MATROSKA_VERSION >= 2
 	if (!BlobReference.IsSimpleBlock()) {
 		const KaxBlockGroup &BlockGroup = BlobReference;
-		const KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockGroup.FindFirstElt(KaxCodecState::ClassInfos));
+		const KaxCodecState *CodecState = static_cast<KaxCodecState *>(BlockGroup.FindFirstElt(EBML_INFO(KaxCodecState)));
 		if (CodecState != NULL) {
 			KaxCueCodecState &CueCodecState = AddNewChild<KaxCueCodecState>(NewPositions);
 			*static_cast<EbmlUInteger*>(&CueCodecState) = BlockGroup.GetParentCluster()->GetParentSegment()->GetRelativePosition(CodecState->GetElementPosition());
@@ -207,7 +157,7 @@ void KaxCuePoint::PositionSet(const KaxBlockBlob & BlobReference, uint64 GlobalT
 	}
 #endif // MATROSKA_VERSION
 
-	bValueIsSet = true;
+	SetValueIsSet();
 }
 
 #if MATROSKA_VERSION >= 2
@@ -236,41 +186,41 @@ void KaxCueReference::AddReference(const KaxBlockBlob & BlockReference, uint64 G
 }
 #endif
 
-bool KaxCuePoint::operator<(const EbmlElement & EltB) const
+bool KaxCuePoint::IsSmallerThan(const EbmlElement * EltB) const
 {
-	assert(EbmlId(*this) == KaxCuePoint_TheId);
-	assert(EbmlId(EltB) == KaxCuePoint_TheId);
+	assert(EbmlId(*this) == EBML_ID(KaxCuePoint));
+	assert(EbmlId(*EltB) == EBML_ID(KaxCuePoint));
 
-	const KaxCuePoint & theEltB = *static_cast<const KaxCuePoint *>(&EltB);
+	const KaxCuePoint & theEltB = *static_cast<const KaxCuePoint *>(EltB);
 
 	// compare timecode
-	const KaxCueTime * TimeCodeA = static_cast<const KaxCueTime *>(FindElt(KaxCueTime::ClassInfos));
+	const KaxCueTime * TimeCodeA = static_cast<const KaxCueTime *>(FindElt(EBML_INFO(KaxCueTime)));
 	if (TimeCodeA == NULL)
 		return false;
 
-	const KaxCueTime * TimeCodeB = static_cast<const KaxCueTime *>(theEltB.FindElt(KaxCueTime::ClassInfos));
+	const KaxCueTime * TimeCodeB = static_cast<const KaxCueTime *>(theEltB.FindElt(EBML_INFO(KaxCueTime)));
 	if (TimeCodeB == NULL)
 		return false;
 
-	if (*TimeCodeA < *TimeCodeB)
+	if (TimeCodeA->IsSmallerThan(TimeCodeB))
 		return true;
 
-	if (*TimeCodeB < *TimeCodeA)
+	if (TimeCodeB->IsSmallerThan(TimeCodeA))
 		return false;
 
 	// compare tracks (timecodes are equal)
-	const KaxCueTrack * TrackA = static_cast<const KaxCueTrack *>(FindElt(KaxCueTrack::ClassInfos));
+	const KaxCueTrack * TrackA = static_cast<const KaxCueTrack *>(FindElt(EBML_INFO(KaxCueTrack)));
 	if (TrackA == NULL)
 		return false;
 
-	const KaxCueTrack * TrackB = static_cast<const KaxCueTrack *>(theEltB.FindElt(KaxCueTrack::ClassInfos));
+	const KaxCueTrack * TrackB = static_cast<const KaxCueTrack *>(theEltB.FindElt(EBML_INFO(KaxCueTrack)));
 	if (TrackB == NULL)
 		return false;
 
-	if (*TrackA < *TrackB)
+	if (TrackA->IsSmallerThan(TrackB))
 		return true;
 
-	if (*TrackB < *TrackA)
+	if (TrackB->IsSmallerThan(TrackA))
 		return false;
 
 	return false;
@@ -278,7 +228,7 @@ bool KaxCuePoint::operator<(const EbmlElement & EltB) const
 
 bool KaxCuePoint::Timecode(uint64 & aTimecode, uint64 GlobalTimecodeScale) const
 {
-	const KaxCueTime *aTime = static_cast<const KaxCueTime *>(FindFirstElt(KaxCueTime::ClassInfos));
+	const KaxCueTime *aTime = static_cast<const KaxCueTime *>(FindFirstElt(EBML_INFO(KaxCueTime)));
 	if (aTime == NULL)
 		return false;
 	aTimecode = uint64(*aTime) * GlobalTimecodeScale;
@@ -293,10 +243,10 @@ const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const
 	const KaxCueTrackPositions * result = NULL;
 	uint64 aPosition = EBML_PRETTYLONGINT(0xFFFFFFFFFFFFFFF);
 	// find the position of the "earlier" Cluster
-	const KaxCueTrackPositions *aPoss = static_cast<const KaxCueTrackPositions *>(FindFirstElt(KaxCueTrackPositions::ClassInfos));
+	const KaxCueTrackPositions *aPoss = static_cast<const KaxCueTrackPositions *>(FindFirstElt(EBML_INFO(KaxCueTrackPositions)));
 	while (aPoss != NULL)
 	{
-		const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(aPoss->FindFirstElt(KaxCueClusterPosition::ClassInfos));
+		const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(aPoss->FindFirstElt(EBML_INFO(KaxCueClusterPosition)));
 		if (aPos != NULL && uint64(*aPos) < aPosition) {
 			aPosition = uint64(*aPos);
 			result = aPoss;
@@ -309,7 +259,7 @@ const KaxCueTrackPositions * KaxCuePoint::GetSeekPosition() const
 
 uint64 KaxCueTrackPositions::ClusterPosition() const
 {
-	const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(FindFirstElt(KaxCueClusterPosition::ClassInfos));
+	const KaxCueClusterPosition *aPos = static_cast<const KaxCueClusterPosition *>(FindFirstElt(EBML_INFO(KaxCueClusterPosition)));
 	if (aPos == NULL)
 		return 0;
 
@@ -318,7 +268,7 @@ uint64 KaxCueTrackPositions::ClusterPosition() const
 
 uint16 KaxCueTrackPositions::TrackNumber() const
 {
-	const KaxCueTrack *aTrack = static_cast<const KaxCueTrack *>(FindFirstElt(KaxCueTrack::ClassInfos));
+	const KaxCueTrack *aTrack = static_cast<const KaxCueTrack *>(FindFirstElt(EBML_INFO(KaxCueTrack)));
 	if (aTrack == NULL)
 		return 0;
 
diff --git a/src/KaxInfo.cpp b/src/KaxInfo.cpp
index 8b8242d..8a6e614 100644
--- a/src/KaxInfo.cpp
+++ b/src/KaxInfo.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -36,42 +36,30 @@
 #include "matroska/KaxInfoData.h"
 
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 // sub elements
 START_LIBMATROSKA_NAMESPACE
 
-const EbmlSemantic KaxInfo_ContextList[14] =
-{
-	EbmlSemantic(false, true,  KaxSegmentUID::ClassInfos),
-	EbmlSemantic(false, true,  KaxSegmentFilename::ClassInfos),
-	EbmlSemantic(false, true,  KaxPrevUID::ClassInfos),
-	EbmlSemantic(false, true,  KaxPrevFilename::ClassInfos),
-	EbmlSemantic(false, true,  KaxNextUID::ClassInfos),
-	EbmlSemantic(false, true,  KaxNextFilename::ClassInfos),
-	EbmlSemantic(false, false, KaxSegmentFamily::ClassInfos),
-	EbmlSemantic(false, false, KaxChapterTranslate::ClassInfos),
-	EbmlSemantic(true,  true,  KaxTimecodeScale::ClassInfos),
-	EbmlSemantic(false, true,  KaxDuration::ClassInfos),
-	EbmlSemantic(false, true,  KaxDateUTC::ClassInfos),
-	EbmlSemantic(false, true,  KaxTitle::ClassInfos),
-	EbmlSemantic(true,  true,  KaxMuxingApp::ClassInfos),
-	EbmlSemantic(true,  true,  KaxWritingApp::ClassInfos),
-};
+DEFINE_START_SEMANTIC(KaxInfo)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSegmentUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxSegmentFilename)
+DEFINE_SEMANTIC_ITEM(false, true, KaxPrevUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxPrevFilename)
+DEFINE_SEMANTIC_ITEM(false, true, KaxNextUID)
+DEFINE_SEMANTIC_ITEM(false, true, KaxNextFilename)
+DEFINE_SEMANTIC_ITEM(false, false, KaxSegmentFamily)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterTranslate)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTimecodeScale)
+DEFINE_SEMANTIC_ITEM(false, true, KaxDuration)
+DEFINE_SEMANTIC_ITEM(false, true, KaxDateUTC)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTitle)
+DEFINE_SEMANTIC_ITEM(true, true, KaxMuxingApp)
+DEFINE_SEMANTIC_ITEM(true, true, KaxWritingApp)
+DEFINE_END_SEMANTIC(KaxInfo)
 
-const EbmlSemanticContext KaxInfo_Context = EbmlSemanticContext(countof(KaxInfo_ContextList), KaxInfo_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxInfo::ClassInfos);
-const EbmlSemanticContext KaxMuxingApp_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxMuxingApp::ClassInfos);
-const EbmlSemanticContext KaxWritingApp_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxWritingApp::ClassInfos);
-
-EbmlId KaxInfo_TheId      (0x1549A966, 4);
-EbmlId KaxMuxingApp_TheId (0x4D80, 2);
-EbmlId KaxWritingApp_TheId(0x5741, 2);
-
-const EbmlCallbacks KaxInfo::ClassInfos(KaxInfo::Create, KaxInfo_TheId, "Info", KaxInfo_Context);
-const EbmlCallbacks KaxMuxingApp::ClassInfos(KaxMuxingApp::Create, KaxMuxingApp_TheId, "MuxingApp", KaxMuxingApp_Context);
-const EbmlCallbacks KaxWritingApp::ClassInfos(KaxWritingApp::Create, KaxWritingApp_TheId, "WritingApp", KaxWritingApp_Context);
-
-KaxInfo::KaxInfo()
-	:EbmlMaster(KaxInfo_Context)
-{}
+DEFINE_MKX_MASTER   (KaxInfo,   0x1549A966, 4, KaxSegment, "Info");
+DEFINE_MKX_UNISTRING(KaxMuxingApp,  0x4D80, 2, KaxInfo, "MuxingApp");
+DEFINE_MKX_UNISTRING(KaxWritingApp, 0x5741, 2, KaxInfo, "WritingApp");
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxInfoData.cpp b/src/KaxInfoData.cpp
index 5a1b597..ec12f16 100644
--- a/src/KaxInfoData.cpp
+++ b/src/KaxInfoData.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,73 +29,53 @@
 
 /*!
 	\file
-	\version \$Id: KaxInfoData.cpp 1078 2005-03-03 13:13:04Z robux4 $
+	\version \$Id: KaxInfoData.cpp 295 2010-06-04 11:03:46Z robux4 $
 	\author Steve Lhomme     <robux4 @ users.sf.net>
 	\author John Cannon      <spyder2555 @ users.sf.net>
 */
 #include "matroska/KaxInfoData.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-const EbmlSemantic KaxChapterTranslate_ContextList[3] =
-{
-	EbmlSemantic(false, false, KaxChapterTranslateEditionUID::ClassInfos),
-	EbmlSemantic(true,  true,  KaxChapterTranslateCodec::ClassInfos),
-	EbmlSemantic(true,  true,  KaxChapterTranslateID::ClassInfos),
-};
-
-EbmlId KaxSegmentUID_TheId      (0x73A4, 2);
-EbmlId KaxSegmentFilename_TheId (0x7384, 2);
-EbmlId KaxPrevUID_TheId         (0x3CB923, 3);
-EbmlId KaxPrevFilename_TheId    (0x3C83AB, 3);
-EbmlId KaxNextUID_TheId         (0x3EB923, 3);
-EbmlId KaxNextFilename_TheId    (0x3E83BB, 3);
-EbmlId KaxSegmentFamily_TheId   (0x4444, 2);
-EbmlId KaxChapterTranslate_TheId(0x6924, 2);
-EbmlId KaxChapterTranslateEditionUID_TheId(0x69FC, 2);
-EbmlId KaxChapterTranslateCodec_TheId(0x69BF, 2);
-EbmlId KaxChapterTranslateID_TheId(0x69A5, 2);
-EbmlId KaxTimecodeScale_TheId   (0x2AD7B1, 3);
-EbmlId KaxDuration_TheId        (0x4489, 2);
-EbmlId KaxDateUTC_TheId         (0x4461, 2);
-EbmlId KaxTitle_TheId           (0x7BA9, 2);
+DEFINE_START_SEMANTIC(KaxChapterTranslate)
+DEFINE_SEMANTIC_ITEM(false, false, KaxChapterTranslateEditionUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTranslateCodec)
+DEFINE_SEMANTIC_ITEM(true, true, KaxChapterTranslateID)
+DEFINE_END_SEMANTIC(KaxChapterTranslate)
 
-const EbmlSemanticContext KaxSegmentUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxSegmentUID::ClassInfos);
-const EbmlSemanticContext KaxSegmentFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxSegmentFilename::ClassInfos);
-const EbmlSemanticContext KaxPrevUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxPrevUID::ClassInfos);
-const EbmlSemanticContext KaxPrevFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxPrevFilename::ClassInfos);
-const EbmlSemanticContext KaxNextUID_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxNextUID::ClassInfos);
-const EbmlSemanticContext KaxNextFilename_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxNextFilename::ClassInfos);
-const EbmlSemanticContext KaxSegmentFamily_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxSegmentFamily::ClassInfos);
-const EbmlSemanticContext KaxChapterTranslate_Context = EbmlSemanticContext(countof(KaxChapterTranslate_ContextList), KaxChapterTranslate_ContextList, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxChapterTranslate::ClassInfos);
-const EbmlSemanticContext KaxChapterTranslateEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &KaxChapterTranslateEditionUID::ClassInfos);
-const EbmlSemanticContext KaxChapterTranslateCodec_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &KaxChapterTranslateCodec::ClassInfos);
-const EbmlSemanticContext KaxChapterTranslateID_Context = EbmlSemanticContext(0, NULL, &KaxChapterTranslate_Context, *GetKaxGlobal_Context, &KaxChapterTranslateID::ClassInfos);
-const EbmlSemanticContext KaxTimecodeScale_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxTimecodeScale::ClassInfos);
-const EbmlSemanticContext KaxDuration_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxDuration::ClassInfos);
-const EbmlSemanticContext KaxDateUTC_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxDateUTC::ClassInfos);
-const EbmlSemanticContext KaxTitle_Context = EbmlSemanticContext(0, NULL, &KaxInfo_Context, *GetKaxGlobal_Context, &KaxTitle::ClassInfos);
+DEFINE_MKX_BINARY       (KaxSegmentUID,                 0x73A4, 2, KaxInfo, "SegmentUID");
+DEFINE_MKX_UNISTRING    (KaxSegmentFilename,            0x7384, 2, KaxInfo, "SegmentFilename");
+DEFINE_MKX_BINARY_CONS  (KaxPrevUID,                  0x3CB923, 3, KaxInfo, "PrevUID");
+DEFINE_MKX_UNISTRING    (KaxPrevFilename,             0x3C83AB, 3, KaxInfo, "PrevFilename");
+DEFINE_MKX_BINARY_CONS  (KaxNextUID,                  0x3EB923, 3, KaxInfo, "NextUID");
+DEFINE_MKX_UNISTRING    (KaxNextFilename,             0x3E83BB, 3, KaxInfo, "NextFilename");
+DEFINE_MKX_BINARY       (KaxSegmentFamily,              0x4444, 2, KaxInfo, "SegmentFamily");
+DEFINE_MKX_MASTER       (KaxChapterTranslate,           0x6924, 2, KaxInfo, "ChapterTranslate");
+DEFINE_MKX_UINTEGER     (KaxChapterTranslateEditionUID, 0x69FC, 2, KaxChapterTranslate, "ChapterTranslateEditionUID");
+DEFINE_MKX_UINTEGER     (KaxChapterTranslateCodec,      0x69BF, 2, KaxChapterTranslate, "ChapterTranslateCodec");
+DEFINE_MKX_BINARY       (KaxChapterTranslateID,         0x69A5, 2, KaxChapterTranslate, "ChapterTranslateID");
+DEFINE_MKX_UINTEGER_DEF(KaxTimecodeScale,            0x2AD7B1, 3, KaxInfo, "TimecodeScale", 1000000);
+DEFINE_MKX_FLOAT        (KaxDuration,                   0x4489, 2, KaxInfo, "Duration");
+DEFINE_MKX_DATE         (KaxDateUTC,                    0x4461, 2, KaxInfo, "DateUTC");
+DEFINE_MKX_UNISTRING    (KaxTitle,                      0x7BA9, 2, KaxInfo, "Title");
 
+KaxPrevUID::KaxPrevUID(EBML_EXTRA_DEF)
+:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxPrevUID) EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+}
 
-const EbmlCallbacks KaxSegmentUID::ClassInfos(KaxSegmentUID::Create, KaxSegmentUID_TheId, "SegmentUID", KaxSegmentUID_Context);
-const EbmlCallbacks KaxSegmentFilename::ClassInfos(KaxSegmentFilename::Create, KaxSegmentFilename_TheId, "SegmentFilename", KaxSegmentFilename_Context);
-const EbmlCallbacks KaxPrevUID::ClassInfos(KaxPrevUID::Create, KaxPrevUID_TheId, "PrevUID", KaxPrevUID_Context);
-const EbmlCallbacks KaxPrevFilename::ClassInfos(KaxPrevFilename::Create, KaxPrevFilename_TheId, "PrevFilename", KaxPrevFilename_Context);
-const EbmlCallbacks KaxNextUID::ClassInfos(KaxNextUID::Create, KaxNextUID_TheId, "NextUID", KaxNextUID_Context);
-const EbmlCallbacks KaxNextFilename::ClassInfos(KaxNextFilename::Create, KaxNextFilename_TheId, "NextFilename", KaxNextFilename_Context);
-const EbmlCallbacks KaxSegmentFamily::ClassInfos(KaxSegmentFamily::Create, KaxSegmentFamily_TheId, "SegmentFamily", KaxSegmentFamily_Context);
-const EbmlCallbacks KaxChapterTranslate::ClassInfos(KaxChapterTranslate::Create, KaxChapterTranslate_TheId, "ChapterTranslate", KaxChapterTranslate_Context);
-const EbmlCallbacks KaxChapterTranslateEditionUID::ClassInfos(KaxChapterTranslateEditionUID::Create, KaxChapterTranslateEditionUID_TheId, "ChapterTranslateEditionUID", KaxChapterTranslateEditionUID_Context);
-const EbmlCallbacks KaxChapterTranslateCodec::ClassInfos(KaxChapterTranslateCodec::Create, KaxChapterTranslateCodec_TheId, "ChapterTranslateCodec", KaxChapterTranslateCodec_Context);
-const EbmlCallbacks KaxChapterTranslateID::ClassInfos(KaxChapterTranslateID::Create, KaxChapterTranslateID_TheId, "ChapterTranslateID", KaxChapterTranslateID_Context);
-const EbmlCallbacks KaxTimecodeScale::ClassInfos(KaxTimecodeScale::Create, KaxTimecodeScale_TheId, "TimecodeScale", KaxTimecodeScale_Context);
-const EbmlCallbacks KaxDuration::ClassInfos(KaxDuration::Create, KaxDuration_TheId, "Duration", KaxDuration_Context);
-const EbmlCallbacks KaxDateUTC::ClassInfos(KaxDateUTC::Create, KaxDateUTC_TheId, "DateUTC", KaxDateUTC_Context);
-const EbmlCallbacks KaxTitle::ClassInfos(KaxTitle::Create, KaxTitle_TheId, "Title", KaxTitle_Context);
+KaxNextUID::KaxNextUID(EBML_EXTRA_DEF)
+:KaxSegmentUID(EBML_DEF_BINARY_CTX(KaxNextUID) EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+}
 
-KaxChapterTranslate::KaxChapterTranslate()
-	:EbmlMaster(KaxChapterTranslate_Context)
-{}
+#if defined(HAVE_EBML2)
+KaxSegmentUID::KaxSegmentUID(EBML_DEF_CONS EBML_DEF_SEP EBML_EXTRA_DEF)
+:EbmlBinary(EBML_DEF_PARAM EBML_DEF_SEP EBML_EXTRA_CALL)
+{
+}
+#endif
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxSeekHead.cpp b/src/KaxSeekHead.cpp
index 571a4b9..f653cb1 100644
--- a/src/KaxSeekHead.cpp
+++ b/src/KaxSeekHead.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -36,45 +36,26 @@
 #include "matroska/KaxContexts.h"
 #include "matroska/KaxSegment.h"
 #include "matroska/KaxCues.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 // sub elements
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxSeekHead_ContextList[1] = 
-{
-	EbmlSemantic(true,  false,  KaxSeek::ClassInfos),
-};
-
-EbmlSemantic KaxSeek_ContextList[2] = 
-{
-	EbmlSemantic(true,  true,  KaxSeekID::ClassInfos),
-	EbmlSemantic(true,  true,  KaxSeekPosition::ClassInfos),
-};
-
-const EbmlSemanticContext KaxSeekHead_Context = EbmlSemanticContext(countof(KaxSeekHead_ContextList), KaxSeekHead_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxSeekHead::ClassInfos);
-const EbmlSemanticContext KaxSeek_Context = EbmlSemanticContext(countof(KaxSeek_ContextList), KaxSeek_ContextList, &KaxSeekHead_Context, *GetKaxGlobal_Context, &KaxSeek::ClassInfos);
-const EbmlSemanticContext KaxSeekID_Context = EbmlSemanticContext(0, NULL, &KaxSeek_Context, *GetKaxGlobal_Context, &KaxSeekID::ClassInfos);
-const EbmlSemanticContext KaxSeekPosition_Context = EbmlSemanticContext(0, NULL, &KaxSeek_Context, *GetKaxGlobal_Context, &KaxSeekPosition::ClassInfos);
+DEFINE_START_SEMANTIC(KaxSeekHead)
+DEFINE_SEMANTIC_ITEM(true, false, KaxSeek)
+DEFINE_END_SEMANTIC(KaxSeekHead)
 
-EbmlId KaxSeekHead_TheId    (0x114D9B74, 4);
-EbmlId KaxSeek_TheId        (0x4DBB, 2);
-EbmlId KaxSeekID_TheId      (0x53AB, 2);
-EbmlId KaxSeekPosition_TheId(0x53AC, 2);
+DEFINE_START_SEMANTIC(KaxSeek) 
+DEFINE_SEMANTIC_ITEM(true, true, KaxSeekID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxSeekPosition)
+DEFINE_END_SEMANTIC(KaxSeek) 
 
-const EbmlCallbacks KaxSeekHead::ClassInfos(KaxSeekHead::Create, KaxSeekHead_TheId, "SeekHeader", KaxSeekHead_Context);
-const EbmlCallbacks KaxSeek::ClassInfos(KaxSeek::Create, KaxSeek_TheId, "SeekPoint", KaxSeek_Context);
-const EbmlCallbacks KaxSeekID::ClassInfos(KaxSeekID::Create, KaxSeekID_TheId, "SeekID", KaxSeekID_Context);
-const EbmlCallbacks KaxSeekPosition::ClassInfos(KaxSeekPosition::Create, KaxSeekPosition_TheId, "SeekPosition", KaxSeekPosition_Context);
-
-KaxSeekHead::KaxSeekHead()
-	:EbmlMaster(KaxSeekHead_Context)
-{}
-
-KaxSeek::KaxSeek()
-	:EbmlMaster(KaxSeek_Context)
-{}
+DEFINE_MKX_MASTER  (KaxSeekHead, 0x114D9B74, 4, KaxSegment, "SeekHeader");
+DEFINE_MKX_MASTER  (KaxSeek,         0x4DBB, 2, KaxSeekHead, "SeekPoint");
+DEFINE_MKX_BINARY  (KaxSeekID,       0x53AB, 2, KaxSeek, "SeekID");
+DEFINE_MKX_UINTEGER(KaxSeekPosition, 0x53AC, 2, KaxSeek, "SeekPosition");
 
 /*!
 	\todo verify that the element is not already in the list
@@ -90,24 +71,24 @@ void KaxSeekHead::IndexThis(const EbmlElement & aElt, const KaxSegment & ParentS
 
 	KaxSeekID & aNewID = GetChild<KaxSeekID>(aNewPoint);
 	binary ID[4];
-	for (int i=aElt.Generic().GlobalId.Length; i>0; i--) {
-		ID[4-i] = (aElt.Generic().GlobalId.Value >> 8*(i-1)) & 0xFF;
-	}
-	aNewID.CopyBuffer(ID, aElt.Generic().GlobalId.Length);
+    ((const EbmlId&)aElt).Fill(ID);
+	aNewID.CopyBuffer(ID, EBML_ID_LENGTH((const EbmlId&)aElt));
 }
 
 KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const
 {
 	// parse all the Entries and find the first to match the type
-	KaxSeek * aElt = static_cast<KaxSeek *>(FindFirstElt(KaxSeek::ClassInfos));
+	KaxSeek * aElt = static_cast<KaxSeek *>(FindFirstElt(EBML_INFO(KaxSeek)));
 	while (aElt != NULL)
 	{
 		KaxSeekID * aId = NULL;
-		for (unsigned int i = 0; i<aElt->ListSize(); i++) {
-			if (EbmlId(*(*aElt)[i]) == KaxSeekID::ClassInfos.GlobalId) {
-				aId = static_cast<KaxSeekID*>((*aElt)[i]);
+        EBML_MASTER_ITERATOR Itr;
+		for (Itr = aElt->begin(); Itr != aElt->end(); ++Itr)
+        {
+			if (EbmlId(*(*Itr)) == EBML_ID(KaxSeekID)) {
+				aId = static_cast<KaxSeekID*>(*Itr);
 				EbmlId aEbmlId(aId->GetBuffer(), aId->GetSize());
-				if (aEbmlId == Callbacks.GlobalId)
+				if (aEbmlId == EBML_INFO_ID(Callbacks))
 				{
 					return aElt;
 				}
@@ -122,23 +103,24 @@ KaxSeek * KaxSeekHead::FindFirstOf(const EbmlCallbacks & Callbacks) const
 
 KaxSeek * KaxSeekHead::FindNextOf(const KaxSeek &aPrev) const
 {
-	unsigned int iIndex;
+    EBML_MASTER_CONST_ITERATOR Itr;
 	KaxSeek *tmp;
 	
 	// look for the previous in the list
-	for (iIndex = 0; iIndex<ElementList.size(); iIndex++)
-	{
-		if (ElementList[iIndex] == static_cast<const EbmlElement*>(&aPrev))
+	for (Itr = begin(); Itr != end(); ++Itr)
+    {
+		if (*Itr == static_cast<const EbmlElement*>(&aPrev))
 			break;
 	}
 
-	if (iIndex <ElementList.size()) {
-		iIndex++;
-		for (; iIndex<ElementList.size(); iIndex++)
-		{
-			if (EbmlId(*(ElementList[iIndex])) == KaxSeek::ClassInfos.GlobalId)
+	if (Itr != end())
+    {
+		++Itr;
+	    for (; Itr != end(); ++Itr)
+        {
+			if (EbmlId(*(*Itr)) == EBML_ID(KaxSeek))
 			{
-				tmp = static_cast<KaxSeek *>(ElementList[iIndex]);
+				tmp = (KaxSeek *)(*Itr);
 				if (tmp->IsEbmlId(aPrev))
 					return tmp;
 			}
@@ -150,7 +132,7 @@ KaxSeek * KaxSeekHead::FindNextOf(const KaxSeek &aPrev) const
 
 int64 KaxSeek::Location() const
 {
-	KaxSeekPosition *aPos = static_cast<KaxSeekPosition*>(FindFirstElt(KaxSeekPosition::ClassInfos));
+	KaxSeekPosition *aPos = static_cast<KaxSeekPosition*>(FindFirstElt(EBML_INFO(KaxSeekPosition)));
 	if (aPos == NULL)
 		return 0;
 	return uint64(*aPos);
@@ -158,7 +140,7 @@ int64 KaxSeek::Location() const
 
 bool KaxSeek::IsEbmlId(const EbmlId & aId) const
 {
-	KaxSeekID *_Id = static_cast<KaxSeekID*>(FindFirstElt(KaxSeekID::ClassInfos));
+	KaxSeekID *_Id = static_cast<KaxSeekID*>(FindFirstElt(EBML_INFO(KaxSeekID)));
 	if (_Id == NULL)
 		return false;
 	EbmlId aEbmlId(_Id->GetBuffer(), _Id->GetSize());
@@ -167,10 +149,10 @@ bool KaxSeek::IsEbmlId(const EbmlId & aId) const
 
 bool KaxSeek::IsEbmlId(const KaxSeek & aPoint) const
 {
-	KaxSeekID *_IdA = static_cast<KaxSeekID*>(FindFirstElt(KaxSeekID::ClassInfos));
+	KaxSeekID *_IdA = static_cast<KaxSeekID*>(FindFirstElt(EBML_INFO(KaxSeekID)));
 	if (_IdA == NULL)
 		return false;
-	KaxSeekID *_IdB = static_cast<KaxSeekID*>(aPoint.FindFirstElt(KaxSeekID::ClassInfos));
+	KaxSeekID *_IdB = static_cast<KaxSeekID*>(aPoint.FindFirstElt(EBML_INFO(KaxSeekID)));
 	if (_IdB == NULL)
 		return false;
 	EbmlId aEbmlIdA(_IdA->GetBuffer(), _IdA->GetSize());
diff --git a/src/KaxSegment.cpp b/src/KaxSegment.cpp
index 4bafab1..074f586 100644
--- a/src/KaxSegment.cpp
+++ b/src/KaxSegment.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -45,35 +45,32 @@
 #include "matroska/KaxAttachments.h"
 #include "matroska/KaxTags.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxMatroska_ContextList[2] =
-{
-	EbmlSemantic(true, true,  EbmlHead::ClassInfos),
-	EbmlSemantic(true, false, KaxSegment::ClassInfos),
-};
+DEFINE_START_SEMANTIC(KaxMatroska)
+DEFINE_SEMANTIC_ITEM(true, true, EbmlHead)
+DEFINE_SEMANTIC_ITEM(true, false, KaxSegment)
+DEFINE_END_SEMANTIC(KaxMatroska)
 
-EbmlSemantic KaxSegment_ContextList[8] =
-{
-	EbmlSemantic(false, false, KaxCluster::ClassInfos),
-	EbmlSemantic(false, false, KaxSeekHead::ClassInfos),
-	EbmlSemantic(false, true,  KaxCues::ClassInfos),
-	EbmlSemantic(false, false, KaxTracks::ClassInfos),
-	EbmlSemantic(true,  true,  KaxInfo::ClassInfos),
-	EbmlSemantic(false, true,  KaxChapters::ClassInfos),
-	EbmlSemantic(false, true,  KaxAttachments::ClassInfos),
-	EbmlSemantic(false, true,  KaxTags::ClassInfos),
-};
+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)
 
-const EbmlSemanticContext KaxMatroska_Context = EbmlSemanticContext(countof(KaxMatroska_ContextList), KaxMatroska_ContextList, NULL, *GetKaxGlobal_Context, NULL);
-const EbmlSemanticContext KaxSegment_Context = EbmlSemanticContext(countof(KaxSegment_ContextList), KaxSegment_ContextList, NULL, *GetKaxGlobal_Context, &KaxSegment::ClassInfos);
+DEFINE_MKX_CONTEXT(KaxMatroska);
 
-EbmlId KaxSegment_TheId(0x18538067, 4);
-const EbmlCallbacks KaxSegment::ClassInfos(KaxSegment::Create, KaxSegment_TheId, "Segment\0rotomopogo", KaxSegment_Context);
+DEFINE_MKX_MASTER_ORPHAN(KaxSegment, 0x18538067, 4, "Segment\0rotomopogo");
 
-KaxSegment::KaxSegment()
-	:EbmlMaster(KaxSegment_Context)
+KaxSegment::KaxSegment(EBML_EXTRA_DEF)
+	:EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxSegment) EBML_DEF_SEP EBML_EXTRA_CALL)
 {
 	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
@@ -83,12 +80,13 @@ KaxSegment::KaxSegment(const KaxSegment & ElementToClone)
  :EbmlMaster(ElementToClone)
 {
 	// update the parent of each children
-	std::vector<EbmlElement *>::const_iterator Itr = ElementList.begin();
-	while (Itr != ElementList.end())
+	EBML_MASTER_ITERATOR Itr = begin();
+	while (Itr != end())
 	{
-		if (EbmlId(**Itr) == KaxCluster::ClassInfos.GlobalId) {
+		if (EbmlId(**Itr) == EBML_ID(KaxCluster)) {
 			static_cast<KaxCluster *>(*Itr)->SetParent(*this);
 		}
+        ++Itr;
 	}
 }
 
diff --git a/src/KaxTag.cpp b/src/KaxTag.cpp
index 722f418..3342d2f 100644
--- a/src/KaxTag.cpp
+++ b/src/KaxTag.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,319 +29,165 @@
 
 /*!
 	\file
-	\version \$Id: KaxTag.cpp 733 2004-08-27 12:25:01Z robux4 $
+	\version \$Id: KaxTag.cpp 1325 2009-03-30 07:56:54Z robux4 $
 	\author Jory Stone       <jcsston @ toughguy.net>
 	\author Steve Lhomme     <robux4 @ users.sf.net>
 */
 #include "matroska/KaxTag.h"
 #include "matroska/KaxTagMulti.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 // sub elements
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxTag_ContextList[14] =
-{	
-	EbmlSemantic(true,  true,  KaxTagTargets::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagGeneral::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagGenres::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagAudioSpecific::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagImageSpecific::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiCommercial::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiDate::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiEntity::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiIdentifier::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiLegal::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiTitle::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiAttachment::ClassInfos),
-//	EbmlSemantic(false, false, KaxTagLength::ClassInfos),
-//	EbmlSemantic(false, false, KaxTagPlaylistDelay::ClassInfos),
-//	EbmlSemantic(false, false, KaxTagUnsynchronisedText::ClassInfos),
-//	EbmlSemantic(false, false, KaxTagUserDefinedURL::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiComment::ClassInfos),
-	EbmlSemantic(true,  false, KaxTagSimple::ClassInfos),
-};
-
-EbmlSemantic KaxTagTargets_ContextList[6] =
-{	
-	EbmlSemantic(false, true,  KaxTagTargetTypeValue::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagTargetType::ClassInfos),
-	EbmlSemantic(false, false, KaxTagTrackUID::ClassInfos),
-	EbmlSemantic(false, false, KaxTagEditionUID::ClassInfos),
-	EbmlSemantic(false, false, KaxTagChapterUID::ClassInfos),
-	EbmlSemantic(false, false, KaxTagAttachmentUID::ClassInfos),
-};
-
-EbmlSemantic KaxTagGeneral_ContextList[17] =
-{	
-	EbmlSemantic(false, true,  KaxTagArchivalLocation::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagFile::ClassInfos),
-	EbmlSemantic(false, false, KaxTagKeywords::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMood::ClassInfos),
-	EbmlSemantic(false, false, KaxTagRecordLocation::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagSource::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagSourceForm::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagProduct::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagOriginalMediaType::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagPlayCounter::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagPopularimeter::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagSubject::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagBibliography::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagLanguage::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagRating::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagEncoder::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagEncodeSettings::ClassInfos),
-};
-
-EbmlSemantic KaxTagGenres_ContextList[3] =
-{	
-	EbmlSemantic(false, false, KaxTagAudioGenre::ClassInfos),
-	EbmlSemantic(false, false, KaxTagVideoGenre::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagSubGenre::ClassInfos),
-};
-
-EbmlSemantic KaxTagAudioSpecific_ContextList[10] =
-{	
-	EbmlSemantic(false, true, KaxTagAudioPeak::ClassInfos),
-	EbmlSemantic(false, true, KaxTagAudioEncryption::ClassInfos),
-	EbmlSemantic(false, true, KaxTagAudioGain::ClassInfos),
-	EbmlSemantic(false, true, KaxTagBPM::ClassInfos),
-	EbmlSemantic(false, true, KaxTagDiscTrack::ClassInfos),
-	EbmlSemantic(false, true, KaxTagSetPart::ClassInfos),
-	EbmlSemantic(false, true, KaxTagEqualisation::ClassInfos),
-	EbmlSemantic(false, true, KaxTagInitialKey::ClassInfos),
-	EbmlSemantic(false, true, KaxTagOfficialAudioFileURL::ClassInfos),
-	EbmlSemantic(false, true, KaxTagOfficialAudioSourceURL::ClassInfos),
-};
-
-EbmlSemantic KaxTagImageSpecific_ContextList[6] =
-{
-	EbmlSemantic(false, true, KaxTagCaptureDPI::ClassInfos),
-	EbmlSemantic(false, true, KaxTagCaptureLightness::ClassInfos),
-	EbmlSemantic(false, true, KaxTagCapturePaletteSetting::ClassInfos),
-	EbmlSemantic(false, true, KaxTagCaptureSharpness::ClassInfos),
-	EbmlSemantic(false, true, KaxTagCropped::ClassInfos),
-	EbmlSemantic(false, true, KaxTagOriginalDimensions::ClassInfos),
-};
-
-EbmlSemantic KaxTagSimple_ContextList[6] =
-{	
-	EbmlSemantic(true,  true,  KaxTagName::ClassInfos),
-	EbmlSemantic(true,  true,  KaxTagLangue::ClassInfos),
-	EbmlSemantic(true,  true,  KaxTagDefault::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagString::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagBinary::ClassInfos),
-	EbmlSemantic(false, false, KaxTagSimple::ClassInfos),
-};
-
-const EbmlSemanticContext KaxTag_Context = EbmlSemanticContext(countof(KaxTag_ContextList), KaxTag_ContextList, &KaxTags_Context, *GetKaxTagsGlobal_Context, &KaxTag::ClassInfos);
-const EbmlSemanticContext KaxTagTargets_Context = EbmlSemanticContext(countof(KaxTagTargets_ContextList), KaxTagTargets_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagTargets::ClassInfos);
-const EbmlSemanticContext KaxTagGeneral_Context = EbmlSemanticContext(countof(KaxTagGeneral_ContextList), KaxTagGeneral_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagGeneral::ClassInfos);
-const EbmlSemanticContext KaxTagGenres_Context = EbmlSemanticContext(countof(KaxTagGenres_ContextList), KaxTagGenres_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagGenres::ClassInfos);
-const EbmlSemanticContext KaxTagAudioSpecific_Context = EbmlSemanticContext(countof(KaxTagAudioSpecific_ContextList), KaxTagAudioSpecific_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagAudioSpecific::ClassInfos);
-const EbmlSemanticContext KaxTagImageSpecific_Context = EbmlSemanticContext(countof(KaxTagImageSpecific_ContextList), KaxTagImageSpecific_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagImageSpecific::ClassInfos);
-const EbmlSemanticContext KaxTagBibliography_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagBibliography::ClassInfos);
-const EbmlSemanticContext KaxTagEncoder_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagEncoder::ClassInfos);
-const EbmlSemanticContext KaxTagEncodeSettings_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagEncodeSettings::ClassInfos);
-const EbmlSemanticContext KaxTagLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagLanguage::ClassInfos);
-const EbmlSemanticContext KaxTagLength_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagLength::ClassInfos);
-const EbmlSemanticContext KaxTagPlaylistDelay_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagPlaylistDelay::ClassInfos);
-const EbmlSemanticContext KaxTagRating_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagRating::ClassInfos);
-const EbmlSemanticContext KaxTagSubject_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagSubject::ClassInfos);
-const EbmlSemanticContext KaxTagUnsynchronisedText_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagUnsynchronisedText::ClassInfos);
-const EbmlSemanticContext KaxTagUserDefinedURL_Context = EbmlSemanticContext(0, NULL, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagUserDefinedURL::ClassInfos);
-const EbmlSemanticContext KaxTagTargetTypeValue_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &KaxTagTargetTypeValue::ClassInfos);
-const EbmlSemanticContext KaxTagTargetType_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &KaxTagTargetType::ClassInfos);
-const EbmlSemanticContext KaxTagTrackUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &KaxTagTrackUID::ClassInfos);
-const EbmlSemanticContext KaxTagEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &KaxTagEditionUID::ClassInfos);
-const EbmlSemanticContext KaxTagChapterUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &KaxTagChapterUID::ClassInfos);
-const EbmlSemanticContext KaxTagAttachmentUID_Context = EbmlSemanticContext(0, NULL, &KaxTagTargets_Context, *GetKaxGlobal_Context, &KaxTagAttachmentUID::ClassInfos);
-const EbmlSemanticContext KaxTagArchivalLocation_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagArchivalLocation::ClassInfos);
-const EbmlSemanticContext KaxTagFile_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagFile::ClassInfos);
-const EbmlSemanticContext KaxTagKeywords_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagKeywords::ClassInfos);
-const EbmlSemanticContext KaxTagMood_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagMood::ClassInfos);
-const EbmlSemanticContext KaxTagRecordLocation_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagRecordLocation::ClassInfos);
-const EbmlSemanticContext KaxTagSource_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagSource::ClassInfos);
-const EbmlSemanticContext KaxTagSourceForm_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagSourceForm::ClassInfos);
-const EbmlSemanticContext KaxTagProduct_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagProduct::ClassInfos);
-const EbmlSemanticContext KaxTagOriginalMediaType_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagOriginalMediaType::ClassInfos);
-const EbmlSemanticContext KaxTagPlayCounter_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagPlayCounter::ClassInfos);
-const EbmlSemanticContext KaxTagPopularimeter_Context = EbmlSemanticContext(0, NULL, &KaxTagGeneral_Context, *GetKaxGlobal_Context, &KaxTagPopularimeter::ClassInfos);
-const EbmlSemanticContext KaxTagAudioGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &KaxTagAudioGenre::ClassInfos);
-const EbmlSemanticContext KaxTagVideoGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &KaxTagVideoGenre::ClassInfos);
-const EbmlSemanticContext KaxTagSubGenre_Context = EbmlSemanticContext(0, NULL, &KaxTagGenres_Context, *GetKaxGlobal_Context, &KaxTagSubGenre::ClassInfos);
-const EbmlSemanticContext KaxTagAudioEncryption_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagAudioEncryption::ClassInfos);
-const EbmlSemanticContext KaxTagAudioGain_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagAudioGain::ClassInfos);
-const EbmlSemanticContext KaxTagAudioPeak_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagAudioPeak::ClassInfos);
-const EbmlSemanticContext KaxTagBPM_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagBPM::ClassInfos);
-const EbmlSemanticContext KaxTagDiscTrack_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagDiscTrack::ClassInfos);
-const EbmlSemanticContext KaxTagSetPart_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagSetPart::ClassInfos);
-const EbmlSemanticContext KaxTagEqualisation_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagEqualisation::ClassInfos);
-const EbmlSemanticContext KaxTagInitialKey_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagInitialKey::ClassInfos);
-const EbmlSemanticContext KaxTagOfficialAudioFileURL_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagOfficialAudioFileURL::ClassInfos);
-const EbmlSemanticContext KaxTagOfficialAudioSourceURL_Context = EbmlSemanticContext(0, NULL, &KaxTagAudioSpecific_Context, *GetKaxGlobal_Context, &KaxTagOfficialAudioSourceURL::ClassInfos);
-const EbmlSemanticContext KaxTagCaptureDPI_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &KaxTagCaptureDPI::ClassInfos);
-const EbmlSemanticContext KaxTagCaptureLightness_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &KaxTagCaptureLightness::ClassInfos);
-const EbmlSemanticContext KaxTagCapturePaletteSetting_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &KaxTagCapturePaletteSetting::ClassInfos);
-const EbmlSemanticContext KaxTagCaptureSharpness_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &KaxTagCaptureSharpness::ClassInfos);
-const EbmlSemanticContext KaxTagCropped_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &KaxTagCropped::ClassInfos);
-const EbmlSemanticContext KaxTagOriginalDimensions_Context = EbmlSemanticContext(0, NULL, &KaxTagImageSpecific_Context, *GetKaxGlobal_Context, &KaxTagOriginalDimensions::ClassInfos);
-
-const EbmlSemanticContext KaxTagSimple_Context = EbmlSemanticContext(countof(KaxTagSimple_ContextList), KaxTagSimple_ContextList, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagSimple::ClassInfos);
-const EbmlSemanticContext KaxTagName_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &KaxTagName::ClassInfos);
-const EbmlSemanticContext KaxTagLangue_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &KaxTagLangue::ClassInfos);
-const EbmlSemanticContext KaxTagDefault_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &KaxTagDefault::ClassInfos);
-const EbmlSemanticContext KaxTagString_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &KaxTagString::ClassInfos);
-const EbmlSemanticContext KaxTagBinary_Context = EbmlSemanticContext(0, NULL, &KaxTagSimple_Context, *GetKaxGlobal_Context, &KaxTagBinary::ClassInfos);
-
-EbmlId KaxTag_TheId                      (0x7373, 2);
-EbmlId KaxTagTargets_TheId               (0x63C0, 2);
-EbmlId KaxTagGeneral_TheId               (0x67C9, 2);
-EbmlId KaxTagGenres_TheId                (0x6583, 2);
-EbmlId KaxTagAudioSpecific_TheId         (0x41C5, 2);
-EbmlId KaxTagImageSpecific_TheId         (0x4990, 2);
-EbmlId KaxTagBibliography_TheId          (0x4488, 2);
-EbmlId KaxTagEncoder_TheId               (0x4431, 2);
-EbmlId KaxTagEncodeSettings_TheId        (0x6526, 2);
-EbmlId KaxTagLanguage_TheId              (0x22B59F, 3);
-EbmlId KaxTagLength_TheId                (0x5243, 2);
-EbmlId KaxTagPlaylistDelay_TheId         (0x72CC, 2);
-EbmlId KaxTagRating_TheId                (0x52BC, 2);
-EbmlId KaxTagSubject_TheId               (0x49C1, 2);
-EbmlId KaxTagUnsynchronisedText_TheId    (0x874B, 2);
-EbmlId KaxTagUserDefinedURL_TheId        (0x434A, 2);
-EbmlId KaxTagTargetTypeValue_TheId       (0x68CA, 2);
-EbmlId KaxTagTargetType_TheId            (0x63CA, 2);
-EbmlId KaxTagTrackUID_TheId              (0x63C5, 2);
-EbmlId KaxTagEditionUID_TheId            (0x63C9, 2);
-EbmlId KaxTagChapterUID_TheId            (0x63C4, 2);
-EbmlId KaxTagAttachmentUID_TheId         (0x63C6, 2);
-EbmlId KaxTagAudioGenre_TheId            (0x65C2, 2);
-EbmlId KaxTagVideoGenre_TheId            (0x65A1, 2);
-EbmlId KaxTagSubGenre_TheId              (0x65AC, 2);
-EbmlId KaxTagAudioEncryption_TheId       (0x41B4, 2);
-EbmlId KaxTagAudioGain_TheId             (0x4199, 2);
-EbmlId KaxTagAudioPeak_TheId             (0x4189, 2);
-EbmlId KaxTagBPM_TheId                   (0x41A1, 2);
-EbmlId KaxTagDiscTrack_TheId             (0x41B6, 2);
-EbmlId KaxTagSetPart_TheId               (0x416E, 2);
-EbmlId KaxTagEqualisation_TheId          (0x41B1, 2);
-EbmlId KaxTagInitialKey_TheId            (0x413A, 2);
-EbmlId KaxTagOfficialAudioFileURL_TheId	 (0x4133, 2);
-EbmlId KaxTagOfficialAudioSourceURL_TheId(0x413E, 2);
-EbmlId KaxTagArchivalLocation_TheId      (0x45A4, 2);
-EbmlId KaxTagFile_TheId                  (0x454E, 2);
-EbmlId KaxTagKeywords_TheId              (0x458C, 2);
-EbmlId KaxTagMood_TheId                  (0x45AE, 2);
-EbmlId KaxTagRecordLocation_TheId        (0x457E, 2);
-EbmlId KaxTagSource_TheId                (0x458A, 2);
-EbmlId KaxTagSourceForm_TheId            (0x45B5, 2);
-EbmlId KaxTagProduct_TheId               (0x45E3, 2);
-EbmlId KaxTagOriginalMediaType_TheId     (0x45A7, 2);
-EbmlId KaxTagPlayCounter_TheId           (0x4566, 2);
-EbmlId KaxTagPopularimeter_TheId         (0x4532, 2);
-EbmlId KaxTagCaptureDPI_TheId            (0x49C7, 2);
-EbmlId KaxTagCaptureLightness_TheId      (0x49E1, 2);
-EbmlId KaxTagCapturePaletteSetting_TheId (0x4934, 2);
-EbmlId KaxTagCaptureSharpness_TheId      (0x4922, 2);
-EbmlId KaxTagCropped_TheId               (0x4987, 2);
-EbmlId KaxTagOriginalDimensions_TheId    (0x4933, 2);
-
-EbmlId KaxTagSimple_TheId								 (0x67C8, 2);
-EbmlId KaxTagName_TheId									 (0x45A3, 2);
-EbmlId KaxTagLangue_TheId								 (0x447A, 2);
-EbmlId KaxTagDefault_TheId								 (0x44B4, 2);
-EbmlId KaxTagString_TheId								 (0x4487, 2);
-EbmlId KaxTagBinary_TheId								 (0x4485, 2);
-
-const EbmlCallbacks KaxTag::ClassInfos(KaxTag::Create, KaxTag_TheId, "Tag", KaxTag_Context);
-const EbmlCallbacks KaxTagTargets::ClassInfos(KaxTagTargets::Create, KaxTagTargets_TheId, "TagTargets", KaxTagTargets_Context);
-const EbmlCallbacks KaxTagGeneral::ClassInfos(KaxTagGeneral::Create, KaxTagGeneral_TheId, "TagGeneral", KaxTagGeneral_Context);
-const EbmlCallbacks KaxTagGenres::ClassInfos(KaxTagGenres::Create, KaxTagGenres_TheId, "TagGenres", KaxTagGenres_Context);
-const EbmlCallbacks KaxTagAudioSpecific::ClassInfos(KaxTagAudioSpecific::Create, KaxTagAudioSpecific_TheId, "TagAudioSpecific", KaxTagAudioSpecific_Context);
-const EbmlCallbacks KaxTagImageSpecific::ClassInfos(KaxTagImageSpecific::Create, KaxTagImageSpecific_TheId, "TagImageSpecific", KaxTagImageSpecific_Context);
-const EbmlCallbacks KaxTagBibliography::ClassInfos(KaxTagBibliography::Create, KaxTagBibliography_TheId, "Bibliography", KaxTagBibliography_Context);
-const EbmlCallbacks KaxTagCaptureDPI::ClassInfos(KaxTagCaptureDPI::Create, KaxTagCaptureDPI_TheId, "CaptureDPI", KaxTagCaptureDPI_Context);
-const EbmlCallbacks KaxTagCaptureLightness::ClassInfos(KaxTagCaptureLightness::Create, KaxTagCaptureLightness_TheId, "CaptureLightness", KaxTagCaptureLightness_Context);
-const EbmlCallbacks KaxTagCapturePaletteSetting::ClassInfos(KaxTagCapturePaletteSetting::Create, KaxTagCapturePaletteSetting_TheId, "CapturePaletteSetting", KaxTagCapturePaletteSetting_Context);
-const EbmlCallbacks KaxTagCaptureSharpness::ClassInfos(KaxTagCaptureSharpness::Create, KaxTagCaptureSharpness_TheId, "CaptureSharpness", KaxTagCaptureSharpness_Context);
-const EbmlCallbacks KaxTagCropped::ClassInfos(KaxTagCropped::Create, KaxTagCropped_TheId, "Cropped", KaxTagCropped_Context);
-const EbmlCallbacks KaxTagEncoder::ClassInfos(KaxTagEncoder::Create, KaxTagEncoder_TheId, "Encoder", KaxTagEncoder_Context);
-const EbmlCallbacks KaxTagEncodeSettings::ClassInfos(KaxTagEncodeSettings::Create, KaxTagEncodeSettings_TheId, "EncodeSettings", KaxTagEncodeSettings_Context);
-const EbmlCallbacks KaxTagLanguage::ClassInfos(KaxTagLanguage::Create, KaxTagLanguage_TheId, "Language", KaxTagLanguage_Context);
-const EbmlCallbacks KaxTagLength::ClassInfos(KaxTagLength::Create, KaxTagLength_TheId, "Length", KaxTagLength_Context);
-const EbmlCallbacks KaxTagOriginalDimensions::ClassInfos(KaxTagOriginalDimensions::Create, KaxTagOriginalDimensions_TheId, "OriginalDimensions", KaxTagOriginalDimensions_Context);
-const EbmlCallbacks KaxTagPlaylistDelay::ClassInfos(KaxTagPlaylistDelay::Create, KaxTagPlaylistDelay_TheId, "PlaylistDelay", KaxTagPlaylistDelay_Context);
-const EbmlCallbacks KaxTagRating::ClassInfos(KaxTagRating::Create, KaxTagRating_TheId, "Rating", KaxTagRating_Context);
-const EbmlCallbacks KaxTagSubject::ClassInfos(KaxTagSubject::Create, KaxTagSubject_TheId, "Subject", KaxTagSubject_Context);
-const EbmlCallbacks KaxTagUnsynchronisedText::ClassInfos(KaxTagUnsynchronisedText::Create, KaxTagUnsynchronisedText_TheId, "UnsynchronisedText", KaxTagUnsynchronisedText_Context);
-const EbmlCallbacks KaxTagUserDefinedURL::ClassInfos(KaxTagUserDefinedURL::Create, KaxTagUserDefinedURL_TheId, "UserDefinedURL", KaxTagUserDefinedURL_Context);
-const EbmlCallbacks KaxTagTargetTypeValue::ClassInfos(KaxTagTargetTypeValue::Create, KaxTagTargetTypeValue_TheId, "TagTargetTypeValue", KaxTagTargetTypeValue_Context);
-const EbmlCallbacks KaxTagTargetType::ClassInfos(KaxTagTargetType::Create, KaxTagTargetType_TheId, "TagTargetType", KaxTagTargetType_Context);
-const EbmlCallbacks KaxTagTrackUID::ClassInfos(KaxTagTrackUID::Create, KaxTagTrackUID_TheId, "TagTrackUID", KaxTagTrackUID_Context);
-const EbmlCallbacks KaxTagEditionUID::ClassInfos(KaxTagEditionUID::Create, KaxTagEditionUID_TheId, "TagEditionUID", KaxTagEditionUID_Context);
-const EbmlCallbacks KaxTagChapterUID::ClassInfos(KaxTagChapterUID::Create, KaxTagChapterUID_TheId, "TagChapterUID", KaxTagChapterUID_Context);
-const EbmlCallbacks KaxTagAttachmentUID::ClassInfos(KaxTagAttachmentUID::Create, KaxTagAttachmentUID_TheId, "TagAttachmentUID", KaxTagAttachmentUID_Context);
-const EbmlCallbacks KaxTagAudioGenre::ClassInfos(KaxTagAudioGenre::Create, KaxTagAudioGenre_TheId, "AudioGenre", KaxTagAudioGenre_Context);
-const EbmlCallbacks KaxTagVideoGenre::ClassInfos(KaxTagVideoGenre::Create, KaxTagVideoGenre_TheId, "VideoGenre", KaxTagVideoGenre_Context);
-const EbmlCallbacks KaxTagSubGenre::ClassInfos(KaxTagSubGenre::Create, KaxTagSubGenre_TheId, "SubGenre", KaxTagSubGenre_Context);
-const EbmlCallbacks KaxTagAudioEncryption::ClassInfos(KaxTagAudioEncryption::Create, KaxTagAudioEncryption_TheId, "AudioEncryption", KaxTagAudioEncryption_Context);
-const EbmlCallbacks KaxTagAudioGain::ClassInfos(KaxTagAudioGain::Create, KaxTagAudioGain_TheId, "AudioGain", KaxTagAudioGain_Context);
-const EbmlCallbacks KaxTagAudioPeak::ClassInfos(KaxTagAudioPeak::Create, KaxTagAudioPeak_TheId, "AudioPeak", KaxTagAudioPeak_Context);
-const EbmlCallbacks KaxTagBPM::ClassInfos(KaxTagBPM::Create, KaxTagBPM_TheId, "BPM", KaxTagBPM_Context);
-const EbmlCallbacks KaxTagDiscTrack::ClassInfos(KaxTagDiscTrack::Create, KaxTagDiscTrack_TheId, "DiscTrack", KaxTagDiscTrack_Context);
-const EbmlCallbacks KaxTagSetPart::ClassInfos(KaxTagSetPart::Create, KaxTagSetPart_TheId, "SetPart", KaxTagSetPart_Context);
-const EbmlCallbacks KaxTagEqualisation::ClassInfos(KaxTagEqualisation::Create, KaxTagEqualisation_TheId, "Equalisation", KaxTagEqualisation_Context);
-const EbmlCallbacks KaxTagInitialKey::ClassInfos(KaxTagInitialKey::Create, KaxTagInitialKey_TheId, "InitialKey", KaxTagInitialKey_Context);
-const EbmlCallbacks KaxTagOfficialAudioFileURL::ClassInfos(KaxTagOfficialAudioFileURL::Create, KaxTagOfficialAudioFileURL_TheId, "OfficialAudioFileURL", KaxTagOfficialAudioFileURL_Context);
-const EbmlCallbacks KaxTagOfficialAudioSourceURL::ClassInfos(KaxTagOfficialAudioSourceURL::Create, KaxTagOfficialAudioSourceURL_TheId, "AudioSourceURL", KaxTagOfficialAudioSourceURL_Context);
-const EbmlCallbacks KaxTagArchivalLocation::ClassInfos(KaxTagArchivalLocation::Create, KaxTagArchivalLocation_TheId, "ArchivalLocation", KaxTagArchivalLocation_Context);
-const EbmlCallbacks KaxTagFile::ClassInfos(KaxTagFile::Create, KaxTagFile_TheId, "File", KaxTagFile_Context);
-const EbmlCallbacks KaxTagKeywords::ClassInfos(KaxTagKeywords::Create, KaxTagKeywords_TheId, "Keywords", KaxTagKeywords_Context);
-const EbmlCallbacks KaxTagMood::ClassInfos(KaxTagMood::Create, KaxTagMood_TheId, "Mood", KaxTagMood_Context);
-const EbmlCallbacks KaxTagRecordLocation::ClassInfos(KaxTagRecordLocation::Create, KaxTagRecordLocation_TheId, "RecordLocation", KaxTagRecordLocation_Context);
-const EbmlCallbacks KaxTagSource::ClassInfos(KaxTagSource::Create, KaxTagSource_TheId, "Source", KaxTagSource_Context);
-const EbmlCallbacks KaxTagSourceForm::ClassInfos(KaxTagSourceForm::Create, KaxTagSourceForm_TheId, "SourceForm", KaxTagSourceForm_Context);
-const EbmlCallbacks KaxTagProduct::ClassInfos(KaxTagProduct::Create, KaxTagProduct_TheId, "Product", KaxTagProduct_Context);
-const EbmlCallbacks KaxTagOriginalMediaType::ClassInfos(KaxTagOriginalMediaType::Create, KaxTagOriginalMediaType_TheId, "OriginalMediaType", KaxTagOriginalMediaType_Context);
-const EbmlCallbacks KaxTagPlayCounter::ClassInfos(KaxTagPlayCounter::Create, KaxTagPlayCounter_TheId, "PlayCounter", KaxTagPlayCounter_Context);
-const EbmlCallbacks KaxTagPopularimeter::ClassInfos(KaxTagPopularimeter::Create, KaxTagPopularimeter_TheId, "Popularimeter", KaxTagPopularimeter_Context);
-
-const EbmlCallbacks KaxTagSimple::ClassInfos(KaxTagSimple::Create, KaxTagSimple_TheId, "TagSimple", KaxTagSimple_Context);
-const EbmlCallbacks KaxTagName::ClassInfos(KaxTagName::Create, KaxTagName_TheId, "TagName", KaxTagName_Context);
-const EbmlCallbacks KaxTagLangue::ClassInfos(KaxTagLangue::Create, KaxTagLangue_TheId, "TagLanguage", KaxTagLangue_Context);
-const EbmlCallbacks KaxTagDefault::ClassInfos(KaxTagDefault::Create, KaxTagDefault_TheId, "TagDefault", KaxTagDefault_Context);
-const EbmlCallbacks KaxTagString::ClassInfos(KaxTagString::Create, KaxTagString_TheId, "TagString", KaxTagString_Context);
-const EbmlCallbacks KaxTagBinary::ClassInfos(KaxTagBinary::Create, KaxTagBinary_TheId, "TagBinary", KaxTagBinary_Context);
-
-KaxTag::KaxTag()
-	:EbmlMaster(KaxTag_Context)
-{}
-
-KaxTagTargets::KaxTagTargets()
-	:EbmlMaster(KaxTagTargets_Context)
-{}
-
-KaxTagGeneral::KaxTagGeneral()
-	:EbmlMaster(KaxTagGeneral_Context)
-{}
-
-KaxTagGenres::KaxTagGenres()
-	:EbmlMaster(KaxTagGenres_Context)
-{}
-
-KaxTagAudioSpecific::KaxTagAudioSpecific()
-	:EbmlMaster(KaxTagAudioSpecific_Context)
-{}
-
-KaxTagImageSpecific::KaxTagImageSpecific()
-	:EbmlMaster(KaxTagImageSpecific_Context)
-{}
-
-KaxTagSimple::KaxTagSimple()
-	:EbmlMaster(KaxTagSimple_Context)
-{}
+DEFINE_START_SEMANTIC(KaxTag)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagTargets)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagGeneral)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagGenres)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagAudioSpecific)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagImageSpecific)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommercial)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiDate)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiEntity)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiIdentifier)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiLegal)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitle)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiAttachment)
+//DEFINE_SEMANTIC_ITEM(false, false, KaxTagLength)
+//DEFINE_SEMANTIC_ITEM(false, false, KaxTagPlaylistDelay)
+//DEFINE_SEMANTIC_ITEM(false, false, KaxTagUnsynchronisedText)
+//DEFINE_SEMANTIC_ITEM(false, false, KaxTagUserDefinedURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiComment)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagSimple)
+DEFINE_END_SEMANTIC(KaxTag)
+
+DEFINE_START_SEMANTIC(KaxTagTargets)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagTargetTypeValue)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagTargetType)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagTrackUID)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagEditionUID)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagChapterUID)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagAttachmentUID)
+DEFINE_END_SEMANTIC(KaxTagTargets)
+
+DEFINE_START_SEMANTIC(KaxTagGeneral)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagArchivalLocation)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagFile)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagKeywords)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMood)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagRecordLocation)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagSource)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagSourceForm)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagProduct)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagOriginalMediaType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagPlayCounter)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagPopularimeter)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagSubject)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagBibliography)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagLanguage)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagRating)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagEncoder)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagEncodeSettings)
+DEFINE_END_SEMANTIC(KaxTagGeneral)
+
+DEFINE_START_SEMANTIC(KaxTagGenres)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagAudioGenre)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagVideoGenre)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagSubGenre)
+DEFINE_END_SEMANTIC(KaxTagGenres)
+
+DEFINE_START_SEMANTIC(KaxTagAudioSpecific)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagAudioPeak)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagAudioEncryption)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagAudioGain)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagBPM)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagDiscTrack)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagSetPart)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagEqualisation)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagInitialKey)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagOfficialAudioFileURL)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagOfficialAudioSourceURL)
+DEFINE_END_SEMANTIC(KaxTagAudioSpecific)
+
+DEFINE_START_SEMANTIC(KaxTagImageSpecific)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagCaptureDPI)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagCaptureLightness)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagCapturePaletteSetting)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagCaptureSharpness)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagCropped)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagOriginalDimensions)
+DEFINE_END_SEMANTIC(KaxTagImageSpecific)
+
+DEFINE_START_SEMANTIC(KaxTagSimple)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagName)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagLangue)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagDefault)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagString)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagBinary)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagSimple)
+DEFINE_END_SEMANTIC(KaxTagSimple)
+
+DEFINE_MKX_MASTER      (KaxTag,                       0x7373, 2, KaxTags, "Tag");
+DEFINE_MKX_MASTER      (KaxTagTargets,                0x63C0, 2, KaxTag, "TagTargets");
+DEFINE_MKX_MASTER      (KaxTagGeneral,                0x67C9, 2, KaxTag, "TagGeneral");
+DEFINE_MKX_MASTER      (KaxTagGenres,                 0x6583, 2, KaxTag, "TagGenres");
+DEFINE_MKX_MASTER      (KaxTagAudioSpecific,          0x41C5, 2, KaxTag, "TagAudioSpecific");
+DEFINE_MKX_MASTER      (KaxTagImageSpecific,          0x4990, 2, KaxTag, "TagImageSpecific");
+DEFINE_MKX_UNISTRING   (KaxTagBibliography,           0x4488, 2, KaxTag, "Bibliography");
+DEFINE_MKX_UNISTRING   (KaxTagEncoder,                0x4431, 2, KaxTag, "Encoder");
+DEFINE_MKX_UNISTRING   (KaxTagEncodeSettings,         0x6526, 2, KaxTag, "EncodeSettings");
+DEFINE_MKX_STRING      (KaxTagLanguage,             0x22B59F, 3, KaxTag, "Language");
+DEFINE_MKX_UINTEGER    (KaxTagLength,                 0x5243, 2, KaxTag, "Length");
+DEFINE_MKX_UINTEGER    (KaxTagPlaylistDelay,          0x72CC, 2, KaxTag, "PlaylistDelay");
+DEFINE_MKX_BINARY      (KaxTagRating,                 0x52BC, 2, KaxTag, "Rating");
+DEFINE_MKX_UNISTRING   (KaxTagSubject,                0x49C1, 2, KaxTag, "Subject");
+DEFINE_MKX_UNISTRING   (KaxTagUnsynchronisedText,     0x874B, 2, KaxTag, "UnsynchronisedText");
+DEFINE_MKX_STRING      (KaxTagUserDefinedURL,         0x434A, 2, KaxTag, "UserDefinedURL");
+DEFINE_MKX_UINTEGER_DEF(KaxTagTargetTypeValue,        0x68CA, 2, KaxTagTargets, "TagTargetTypeValue", 50);
+DEFINE_MKX_STRING      (KaxTagTargetType,             0x63CA, 2, KaxTagTargets, "TagTargetType");
+DEFINE_MKX_UINTEGER_DEF(KaxTagTrackUID,               0x63C5, 2, KaxTagTargets, "TagTrackUID", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxTagEditionUID,             0x63C9, 2, KaxTagTargets, "TagEditionUID", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxTagChapterUID,             0x63C4, 2, KaxTagTargets, "TagChapterUID", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxTagAttachmentUID,          0x63C6, 2, KaxTagTargets, "TagAttachmentUID", 0);
+DEFINE_MKX_UNISTRING   (KaxTagArchivalLocation,       0x45A4, 2, KaxTagGeneral, "ArchivalLocation");
+DEFINE_MKX_UNISTRING   (KaxTagFile,                   0x454E, 2, KaxTagGeneral, "File");
+DEFINE_MKX_UNISTRING   (KaxTagKeywords,               0x458C, 2, KaxTagGeneral, "Keywords");
+DEFINE_MKX_UNISTRING   (KaxTagMood,                   0x45AE, 2, KaxTagGeneral, "Mood");
+DEFINE_MKX_STRING      (KaxTagRecordLocation,         0x457E, 2, KaxTagGeneral, "RecordLocation");
+DEFINE_MKX_UNISTRING   (KaxTagSource,                 0x458A, 2, KaxTagGeneral, "Source");
+DEFINE_MKX_UNISTRING   (KaxTagSourceForm,             0x45B5, 2, KaxTagGeneral, "SourceForm");
+DEFINE_MKX_UNISTRING   (KaxTagProduct,                0x45E3, 2, KaxTagGeneral, "Product");
+DEFINE_MKX_UNISTRING   (KaxTagOriginalMediaType,      0x45A7, 2, KaxTagGeneral, "OriginalMediaType");
+DEFINE_MKX_UINTEGER    (KaxTagPlayCounter,            0x4566, 2, KaxTagTargets, "PlayCounter");
+DEFINE_MKX_SINTEGER    (KaxTagPopularimeter,          0x4532, 2, KaxTagTargets, "Popularimeter");
+DEFINE_MKX_STRING      (KaxTagAudioGenre,             0x65C2, 2, KaxTagGenres, "AudioGenre");
+DEFINE_MKX_BINARY      (KaxTagVideoGenre,             0x65A1, 2, KaxTagGenres, "VideoGenre");
+DEFINE_MKX_STRING      (KaxTagSubGenre,               0x65AC, 2, KaxTagGenres, "SubGenre");
+DEFINE_MKX_BINARY      (KaxTagAudioEncryption,        0x41B4, 2, KaxTagAudioSpecific, "AudioEncryption");
+DEFINE_MKX_FLOAT       (KaxTagAudioGain,              0x4199, 2, KaxTagAudioSpecific, "AudioGain");
+DEFINE_MKX_FLOAT       (KaxTagAudioPeak,              0x4189, 2, KaxTagAudioSpecific, "AudioPeak");
+DEFINE_MKX_FLOAT       (KaxTagBPM,                    0x41A1, 2, KaxTagAudioSpecific, "BPM");
+DEFINE_MKX_UINTEGER    (KaxTagDiscTrack,              0x41B6, 2, KaxTagAudioSpecific, "DiscTrack");
+DEFINE_MKX_UINTEGER    (KaxTagSetPart,                0x416E, 2, KaxTagAudioSpecific, "SetPart");
+DEFINE_MKX_BINARY      (KaxTagEqualisation,           0x41B1, 2, KaxTagAudioSpecific, "Equalisation");
+DEFINE_MKX_STRING      (KaxTagInitialKey,             0x413A, 2, KaxTagAudioSpecific, "InitialKey");
+DEFINE_MKX_STRING      (KaxTagOfficialAudioFileURL,   0x4133, 2, KaxTagAudioSpecific, "OfficialAudioFileURL");
+DEFINE_MKX_STRING      (KaxTagOfficialAudioSourceURL, 0x413E, 2, KaxTagAudioSpecific, "AudioSourceURL");
+DEFINE_MKX_UINTEGER    (KaxTagCaptureDPI,             0x49C7, 2, KaxTagImageSpecific, "CaptureDPI");
+DEFINE_MKX_BINARY      (KaxTagCaptureLightness,       0x49E1, 2, KaxTagImageSpecific, "CaptureLightness");
+DEFINE_MKX_UINTEGER    (KaxTagCapturePaletteSetting,  0x4934, 2, KaxTagImageSpecific, "CapturePaletteSetting");
+DEFINE_MKX_BINARY      (KaxTagCaptureSharpness,       0x4922, 2, KaxTagImageSpecific, "CaptureSharpness");
+DEFINE_MKX_UNISTRING   (KaxTagCropped,                0x4987, 2, KaxTagImageSpecific, "Cropped");
+DEFINE_MKX_STRING      (KaxTagOriginalDimensions,     0x4933, 2, KaxTagImageSpecific, "OriginalDimensions");
+
+DEFINE_MKX_MASTER      (KaxTagSimple,                 0x67C8, 2, KaxTag, "TagSimple");
+DEFINE_MKX_UNISTRING   (KaxTagName,                   0x45A3, 2, KaxTagSimple, "TagName");
+DEFINE_MKX_STRING_DEF  (KaxTagLangue,                 0x447A, 2, KaxTagSimple, "TagLanguage", "und");
+DEFINE_MKX_UINTEGER_DEF(KaxTagDefault,                0x4484, 2, KaxTagSimple, "TagDefault", 1);
+DEFINE_MKX_UNISTRING   (KaxTagString,                 0x4487, 2, KaxTagSimple, "TagString");
+DEFINE_MKX_BINARY      (KaxTagBinary,                 0x4485, 2, KaxTagSimple, "TagBinary");
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxTagMulti.cpp b/src/KaxTagMulti.cpp
index 42e1618..7f77201 100644
--- a/src/KaxTagMulti.cpp
+++ b/src/KaxTagMulti.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -29,376 +29,184 @@
 
 /*!
 	\file
-	\version \$Id: KaxTagMulti.cpp 640 2004-07-09 21:05:36Z mosu $
+	\version \$Id: KaxTagMulti.cpp 295 2010-06-04 11:03:46Z robux4 $
 	\author Jory Stone       <jcsston @ toughguy.net>
 	\author Steve Lhomme     <robux4 @ users.sf.net>
 */
 #include "matroska/KaxTagMulti.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxTagMultiGlobal_ContextList[1] =
-{
-	EbmlSemantic(false, false, KaxTagMultiComment::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiComment_ContextList[3] =
-{
-	EbmlSemantic(false, true, KaxTagMultiCommentName::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiCommentComments::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiCommentLanguage::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiCommercial_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTagCommercial::ClassInfos),
-};
-
-EbmlSemantic KaxTagCommercial_ContextList[5] =
-{
-	EbmlSemantic(true,  true,  KaxTagMultiCommercialType::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiCommercialAddress::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiCommercialURL::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiCommercialEmail::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiPrice::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiPrice_ContextList[3] =
-{
-	EbmlSemantic(false, true, KaxTagMultiPriceCurrency::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiPriceAmount::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiPricePriceDate::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiDate_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTagDate::ClassInfos),
-};
-
-EbmlSemantic KaxTagDate_ContextList[3] =
-{
-	EbmlSemantic(true,  true, KaxTagMultiDateType::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiDateDateBegin::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiDateDateEnd::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiEntity_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTagEntity::ClassInfos),
-};
-
-EbmlSemantic KaxTagEntity_ContextList[5] =
-{
-	EbmlSemantic(true,  true,  KaxTagMultiEntityType::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiEntityName::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiEntityURL::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiEntityEmail::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiEntityAddress::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiIdentifier_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTagIdentifier::ClassInfos),
-};
-
-EbmlSemantic KaxTagIdentifier_ContextList[3] =
-{
-	EbmlSemantic(true,  true, KaxTagMultiIdentifierType::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiIdentifierBinary::ClassInfos),
-	EbmlSemantic(false, true, KaxTagMultiIdentifierString::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiLegal_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTagLegal::ClassInfos),
-};
-
-EbmlSemantic KaxTagLegal_ContextList[4] =
-{
-	EbmlSemantic(true,  true,  KaxTagMultiLegalType::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiLegalContent::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiLegalURL::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiLegalAddress::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiTitle_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTagTitle::ClassInfos),
-};
-
-EbmlSemantic KaxTagTitle_ContextList[8] =
-{
-	EbmlSemantic(true,  true,  KaxTagMultiTitleType::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiTitleName::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiTitleSubTitle::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiTitleEdition::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiTitleAddress::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiTitleURL::ClassInfos),
-	EbmlSemantic(false, false, KaxTagMultiTitleEmail::ClassInfos),
-	EbmlSemantic(false, true,  KaxTagMultiTitleLanguage::ClassInfos),
-};
-
-EbmlSemantic KaxTagMultiAttachment_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTagAttachment::ClassInfos),
-};
-
-EbmlSemantic KaxTagAttachment_ContextList[1] =
-{
-	EbmlSemantic(false, true,  KaxTagAttachmentID::ClassInfos),
-};
-
-const EbmlSemanticContext KaxTagMultiGlobal_Context = EbmlSemanticContext(countof(KaxTagMultiGlobal_ContextList), KaxTagMultiGlobal_ContextList, NULL, *GetKaxGlobal_Context, NULL);
-
-const EbmlSemanticContext KaxTagMultiComment_Context = EbmlSemanticContext(countof(KaxTagMultiComment_ContextList), KaxTagMultiComment_ContextList, &KaxTag_Context, *GetKaxGlobal_Context, &KaxTagMultiComment::ClassInfos);
-const EbmlSemanticContext KaxTagMultiCommentName_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &KaxTagMultiCommentName::ClassInfos);
-const EbmlSemanticContext KaxTagMultiCommentComments_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &KaxTagMultiCommentComments::ClassInfos);
-const EbmlSemanticContext KaxTagMultiCommentLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiComment_Context, *GetKaxGlobal_Context, &KaxTagMultiCommentLanguage::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiCommercial_Context = EbmlSemanticContext(countof(KaxTagMultiCommercial_ContextList), KaxTagMultiCommercial_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiCommercial::ClassInfos);
-const EbmlSemanticContext KaxTagCommercial_Context = EbmlSemanticContext(countof(KaxTagCommercial_ContextList), KaxTagCommercial_ContextList, &KaxTagMultiCommercial_Context, *GetKaxTagsGlobal_Context, &KaxTagCommercial::ClassInfos);
-const EbmlSemanticContext KaxTagMultiCommercialType_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &KaxTagMultiCommercialType::ClassInfos);
-const EbmlSemanticContext KaxTagMultiCommercialAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &KaxTagMultiCommercialAddress::ClassInfos);
-const EbmlSemanticContext KaxTagMultiCommercialURL_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &KaxTagMultiCommercialURL::ClassInfos);
-const EbmlSemanticContext KaxTagMultiCommercialEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagCommercial_Context, *GetKaxGlobal_Context, &KaxTagMultiCommercialEmail::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiPrice_Context = EbmlSemanticContext(countof(KaxTagMultiPrice_ContextList), KaxTagMultiPrice_ContextList, &KaxTagCommercial_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiPrice::ClassInfos);
-const EbmlSemanticContext KaxTagMultiPriceCurrency_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &KaxTagMultiPriceCurrency::ClassInfos);
-const EbmlSemanticContext KaxTagMultiPriceAmount_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &KaxTagMultiPriceAmount::ClassInfos);
-const EbmlSemanticContext KaxTagMultiPricePriceDate_Context = EbmlSemanticContext(0, NULL, &KaxTagMultiPrice_Context, *GetKaxGlobal_Context, &KaxTagMultiPricePriceDate::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiDate_Context = EbmlSemanticContext(countof(KaxTagMultiDate_ContextList), KaxTagMultiDate_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiDate::ClassInfos);
-const EbmlSemanticContext KaxTagDate_Context = EbmlSemanticContext(countof(KaxTagDate_ContextList), KaxTagDate_ContextList, &KaxTagMultiDate_Context, *GetKaxTagsGlobal_Context, &KaxTagDate::ClassInfos);
-const EbmlSemanticContext KaxTagMultiDateType_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &KaxTagMultiDateType::ClassInfos);
-const EbmlSemanticContext KaxTagMultiDateDateBegin_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &KaxTagMultiDateDateBegin::ClassInfos);
-const EbmlSemanticContext KaxTagMultiDateDateEnd_Context = EbmlSemanticContext(0, NULL, &KaxTagDate_Context, *GetKaxGlobal_Context, &KaxTagMultiDateDateEnd::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiEntity_Context = EbmlSemanticContext(countof(KaxTagMultiEntity_ContextList), KaxTagMultiEntity_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiEntity::ClassInfos);
-const EbmlSemanticContext KaxTagEntity_Context = EbmlSemanticContext(countof(KaxTagEntity_ContextList), KaxTagEntity_ContextList, &KaxTagMultiEntity_Context, *GetKaxTagsGlobal_Context, &KaxTagEntity::ClassInfos);
-const EbmlSemanticContext KaxTagMultiEntityType_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &KaxTagMultiEntityType::ClassInfos);
-const EbmlSemanticContext KaxTagMultiEntityName_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &KaxTagMultiEntityName::ClassInfos);
-const EbmlSemanticContext KaxTagMultiEntityURL_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &KaxTagMultiEntityURL::ClassInfos);
-const EbmlSemanticContext KaxTagMultiEntityEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &KaxTagMultiEntityEmail::ClassInfos);
-const EbmlSemanticContext KaxTagMultiEntityAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagEntity_Context, *GetKaxGlobal_Context, &KaxTagMultiEntityAddress::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiIdentifier_Context = EbmlSemanticContext(countof(KaxTagMultiIdentifier_ContextList), KaxTagMultiIdentifier_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiIdentifier::ClassInfos);
-const EbmlSemanticContext KaxTagIdentifier_Context = EbmlSemanticContext(countof(KaxTagIdentifier_ContextList), KaxTagIdentifier_ContextList, &KaxTagMultiIdentifier_Context, *GetKaxTagsGlobal_Context, &KaxTagIdentifier::ClassInfos);
-const EbmlSemanticContext KaxTagMultiIdentifierType_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &KaxTagMultiIdentifierType::ClassInfos);
-const EbmlSemanticContext KaxTagMultiIdentifierBinary_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &KaxTagMultiIdentifierBinary::ClassInfos);
-const EbmlSemanticContext KaxTagMultiIdentifierString_Context = EbmlSemanticContext(0, NULL, &KaxTagIdentifier_Context, *GetKaxGlobal_Context, &KaxTagMultiIdentifierString::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiLegal_Context = EbmlSemanticContext(countof(KaxTagMultiLegal_ContextList), KaxTagMultiLegal_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiLegal::ClassInfos);
-const EbmlSemanticContext KaxTagLegal_Context = EbmlSemanticContext(countof(KaxTagLegal_ContextList), KaxTagLegal_ContextList, &KaxTagMultiLegal_Context, *GetKaxTagsGlobal_Context, &KaxTagLegal::ClassInfos);
-const EbmlSemanticContext KaxTagMultiLegalType_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &KaxTagMultiLegalType::ClassInfos);
-const EbmlSemanticContext KaxTagMultiLegalContent_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &KaxTagMultiLegalContent::ClassInfos);
-const EbmlSemanticContext KaxTagMultiLegalURL_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &KaxTagMultiLegalURL::ClassInfos);
-const EbmlSemanticContext KaxTagMultiLegalAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagLegal_Context, *GetKaxGlobal_Context, &KaxTagMultiLegalAddress::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiTitle_Context = EbmlSemanticContext(countof(KaxTagMultiTitle_ContextList), KaxTagMultiTitle_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiTitle::ClassInfos);
-const EbmlSemanticContext KaxTagTitle_Context = EbmlSemanticContext(countof(KaxTagTitle_ContextList), KaxTagTitle_ContextList, &KaxTagMultiTitle_Context, *GetKaxTagsGlobal_Context, &KaxTagTitle::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleType_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleType::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleName_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleName::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleSubTitle_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleSubTitle::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleEdition_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleEdition::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleAddress_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleAddress::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleURL_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleURL::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleEmail_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleEmail::ClassInfos);
-const EbmlSemanticContext KaxTagMultiTitleLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTagTitle_Context, *GetKaxGlobal_Context, &KaxTagMultiTitleLanguage::ClassInfos);
-
-const EbmlSemanticContext KaxTagMultiAttachment_Context = EbmlSemanticContext(countof(KaxTagMultiAttachment_ContextList), KaxTagMultiAttachment_ContextList, &KaxTag_Context, *GetKaxTagsGlobal_Context, &KaxTagMultiAttachment::ClassInfos);
-const EbmlSemanticContext KaxTagAttachment_Context = EbmlSemanticContext(countof(KaxTagAttachment_ContextList), KaxTagAttachment_ContextList, &KaxTagMultiAttachment_Context, *GetKaxTagsGlobal_Context, &KaxTagAttachment::ClassInfos);
-const EbmlSemanticContext KaxTagAttachmentID_Context = EbmlSemanticContext(0, NULL, &KaxTagAttachment_Context, *GetKaxGlobal_Context, &KaxTagAttachmentID::ClassInfos);
-
-//The Muti Elements
-EbmlId KaxTagMultiComment_TheId             (0x5B7B, 2);
-EbmlId KaxTagMultiCommentName_TheId         (0x5F7D, 2);
-EbmlId KaxTagMultiCommentComments_TheId     (0x5F7C, 2);
-EbmlId KaxTagMultiCommentLanguage_TheId     (0x22B59D, 3);
-
-EbmlId KaxTagMultiCommercial_TheId          (0x4DC7, 2);
-EbmlId KaxTagCommercial_TheId               (0x4EC7, 2);
-EbmlId KaxTagMultiCommercialType_TheId      (0x5BD7, 2);
-EbmlId KaxTagMultiCommercialAddress_TheId   (0x5BBB, 2);
-EbmlId KaxTagMultiCommercialURL_TheId       (0x5BDA, 2);
-EbmlId KaxTagMultiCommercialEmail_TheId     (0x5BC0, 2);
-
-EbmlId KaxTagMultiPrice_TheId               (0x5BC3, 2);
-EbmlId KaxTagMultiPriceCurrency_TheId       (0x5B6C, 2);
-EbmlId KaxTagMultiPriceAmount_TheId         (0x5B6E, 2);
-EbmlId KaxTagMultiPricePriceDate_TheId      (0x5B6F, 2);
-
-EbmlId KaxTagMultiDate_TheId                (0x4DC8, 2);
-EbmlId KaxTagDate_TheId                     (0x4EC8, 2);
-EbmlId KaxTagMultiDateType_TheId            (0x5BD8, 2);
-EbmlId KaxTagMultiDateDateBegin_TheId       (0x4460, 2);
-EbmlId KaxTagMultiDateDateEnd_TheId         (0x4462, 2);
-
-EbmlId KaxTagMultiEntity_TheId              (0x4DC9, 2);
-EbmlId KaxTagEntity_TheId                   (0x4EC9, 2);
-EbmlId KaxTagMultiEntityType_TheId          (0x5BD9, 2);
-EbmlId KaxTagMultiEntityName_TheId          (0x5BED, 2);
-EbmlId KaxTagMultiEntityAddress_TheId       (0x5BDC, 2);
-EbmlId KaxTagMultiEntityURL_TheId           (0x5BDB, 2);
-EbmlId KaxTagMultiEntityEmail_TheId         (0x5BC1, 2);
-
-EbmlId KaxTagMultiIdentifier_TheId          (0x4DC6, 2);
-EbmlId KaxTagIdentifier_TheId               (0x4EC6, 2);
-EbmlId KaxTagMultiIdentifierType_TheId      (0x5BAD, 2);
-EbmlId KaxTagMultiIdentifierBinary_TheId    (0x6B67, 2);
-EbmlId KaxTagMultiIdentifierString_TheId    (0x6B68, 2);
-
-EbmlId KaxTagMultiLegal_TheId               (0x4DC5, 2);
-EbmlId KaxTagLegal_TheId                    (0x4EC5, 2);
-EbmlId KaxTagMultiLegalType_TheId           (0x5BBD, 2);
-EbmlId KaxTagMultiLegalContent_TheId        (0x5BB2, 2);
-EbmlId KaxTagMultiLegalURL_TheId            (0x5B34, 2);
-EbmlId KaxTagMultiLegalAddress_TheId        (0x5B9B, 2);
-
-EbmlId KaxTagMultiTitle_TheId               (0x4DC4, 2);
-EbmlId KaxTagTitle_TheId                    (0x4EC4, 2);
-EbmlId KaxTagMultiTitleType_TheId           (0x5B7D, 2);
-EbmlId KaxTagMultiTitleName_TheId           (0x5BB9, 2);
-EbmlId KaxTagMultiTitleSubTitle_TheId       (0x5B5B, 2);
-EbmlId KaxTagMultiTitleEdition_TheId        (0x5BAE, 2);
-EbmlId KaxTagMultiTitleAddress_TheId        (0x5B33, 2);
-EbmlId KaxTagMultiTitleURL_TheId            (0x5BA9, 2);
-EbmlId KaxTagMultiTitleEmail_TheId          (0x5BC9, 2);
-EbmlId KaxTagMultiTitleLanguage_TheId       (0x22B59E, 3);
-
-EbmlId KaxTagMultiAttachment_TheId          (0x4DC3, 2);
-EbmlId KaxTagAttachment_TheId               (0x4EC3, 2);
-EbmlId KaxTagAttachmentID_TheId             (0x5BA0, 2);
-
-const EbmlCallbacks KaxTagMultiComment::ClassInfos(KaxTagMultiComment::Create, KaxTagMultiComment_TheId, "MultiComment", KaxTagMultiComment_Context);
-const EbmlCallbacks KaxTagMultiCommentName::ClassInfos(KaxTagMultiCommentName::Create, KaxTagMultiCommentName_TheId, "MultiCommentName", KaxTagMultiCommentName_Context);
-const EbmlCallbacks KaxTagMultiCommentComments::ClassInfos(KaxTagMultiCommentComments::Create, KaxTagMultiCommentComments_TheId, "MultiCommentComments", KaxTagMultiCommentComments_Context);
-const EbmlCallbacks KaxTagMultiCommentLanguage::ClassInfos(KaxTagMultiCommentLanguage::Create, KaxTagMultiCommentLanguage_TheId, "MultiCommentLanguage", KaxTagMultiCommentLanguage_Context);
-
-const EbmlCallbacks KaxTagMultiCommercial::ClassInfos(KaxTagMultiCommercial::Create, KaxTagMultiCommercial_TheId, "MultiCommercial", KaxTagMultiCommercial_Context);
-const EbmlCallbacks KaxTagCommercial::ClassInfos(KaxTagCommercial::Create, KaxTagCommercial_TheId, "Commercial", KaxTagCommercial_Context);
-const EbmlCallbacks KaxTagMultiCommercialType::ClassInfos(KaxTagMultiCommercialType::Create, KaxTagMultiCommercialType_TheId, "MultiCommercialType", KaxTagMultiCommercialType_Context);
-const EbmlCallbacks KaxTagMultiCommercialAddress::ClassInfos(KaxTagMultiCommercialAddress::Create, KaxTagMultiCommercialAddress_TheId, "MultiCommercialAddress", KaxTagMultiCommercialAddress_Context);
-const EbmlCallbacks KaxTagMultiCommercialURL::ClassInfos(KaxTagMultiCommercialURL::Create, KaxTagMultiCommercialURL_TheId, "MultiCommercialURL", KaxTagMultiCommercialURL_Context);
-const EbmlCallbacks KaxTagMultiCommercialEmail::ClassInfos(KaxTagMultiCommercialEmail::Create, KaxTagMultiCommercialEmail_TheId, "MultiCommercialEmail", KaxTagMultiCommercialEmail_Context);
-
-const EbmlCallbacks KaxTagMultiPrice::ClassInfos(KaxTagMultiPrice::Create, KaxTagMultiPrice_TheId, "MultiPrice", KaxTagMultiPrice_Context);
-const EbmlCallbacks KaxTagMultiPriceCurrency::ClassInfos(KaxTagMultiPriceCurrency::Create, KaxTagMultiPriceCurrency_TheId, "MultiPriceCurrency", KaxTagMultiPriceCurrency_Context);
-const EbmlCallbacks KaxTagMultiPriceAmount::ClassInfos(KaxTagMultiPriceAmount::Create, KaxTagMultiPriceAmount_TheId, "MultiPriceAmount", KaxTagMultiPriceAmount_Context);
-const EbmlCallbacks KaxTagMultiPricePriceDate::ClassInfos(KaxTagMultiPricePriceDate::Create, KaxTagMultiPricePriceDate_TheId, "MultiPricePriceDate", KaxTagMultiPricePriceDate_Context);
-
-const EbmlCallbacks KaxTagMultiDate::ClassInfos(KaxTagMultiDate::Create, KaxTagMultiDate_TheId, "MultiDate", KaxTagMultiDate_Context);
-const EbmlCallbacks KaxTagDate::ClassInfos(KaxTagDate::Create, KaxTagDate_TheId, "Date", KaxTagDate_Context);
-const EbmlCallbacks KaxTagMultiDateType::ClassInfos(KaxTagMultiDateType::Create, KaxTagMultiDateType_TheId, "MultiDateType", KaxTagMultiDateType_Context);
-const EbmlCallbacks KaxTagMultiDateDateBegin::ClassInfos(KaxTagMultiDateDateBegin::Create, KaxTagMultiDateDateBegin_TheId, "MultiDateDateBegin", KaxTagMultiDateDateBegin_Context);
-const EbmlCallbacks KaxTagMultiDateDateEnd::ClassInfos(KaxTagMultiDateDateEnd::Create, KaxTagMultiDateDateEnd_TheId, "MultiDateDateEnd", KaxTagMultiDateDateEnd_Context);
-
-const EbmlCallbacks KaxTagMultiEntity::ClassInfos(KaxTagMultiEntity::Create, KaxTagMultiEntity_TheId, "MultiEntity", KaxTagMultiEntity_Context);
-const EbmlCallbacks KaxTagEntity::ClassInfos(KaxTagEntity::Create, KaxTagEntity_TheId, "Entity", KaxTagEntity_Context);
-const EbmlCallbacks KaxTagMultiEntityType::ClassInfos(KaxTagMultiEntityType::Create, KaxTagMultiEntityType_TheId, "MultiEntityType", KaxTagMultiEntityType_Context);
-const EbmlCallbacks KaxTagMultiEntityName::ClassInfos(KaxTagMultiEntityName::Create, KaxTagMultiEntityName_TheId, "MultiEntityName", KaxTagMultiEntityName_Context);
-const EbmlCallbacks KaxTagMultiEntityURL::ClassInfos(KaxTagMultiEntityURL::Create, KaxTagMultiEntityURL_TheId, "MultiEntityURL", KaxTagMultiEntityURL_Context);
-const EbmlCallbacks KaxTagMultiEntityEmail::ClassInfos(KaxTagMultiEntityEmail::Create, KaxTagMultiEntityEmail_TheId, "MultiEntityEmail", KaxTagMultiEntityEmail_Context);
-const EbmlCallbacks KaxTagMultiEntityAddress::ClassInfos(KaxTagMultiEntityAddress::Create, KaxTagMultiEntityAddress_TheId, "MultiEntityAddress", KaxTagMultiEntityAddress_Context);
-
-const EbmlCallbacks KaxTagMultiIdentifier::ClassInfos(KaxTagMultiIdentifier::Create, KaxTagMultiIdentifier_TheId, "MultiIdentifier", KaxTagMultiIdentifier_Context);
-const EbmlCallbacks KaxTagIdentifier::ClassInfos(KaxTagIdentifier::Create, KaxTagIdentifier_TheId, "Identifier", KaxTagIdentifier_Context);
-const EbmlCallbacks KaxTagMultiIdentifierType::ClassInfos(KaxTagMultiIdentifierType::Create, KaxTagMultiIdentifierType_TheId, "TagMultiIdentifierType", KaxTagMultiIdentifierType_Context);
-const EbmlCallbacks KaxTagMultiIdentifierBinary::ClassInfos(KaxTagMultiIdentifierBinary::Create, KaxTagMultiIdentifierBinary_TheId, "MultiIdentifierBinary", KaxTagMultiIdentifierBinary_Context);
-const EbmlCallbacks KaxTagMultiIdentifierString::ClassInfos(KaxTagMultiIdentifierString::Create, KaxTagMultiIdentifierString_TheId, "MultiIdentifierString", KaxTagMultiIdentifierString_Context);
-
-const EbmlCallbacks KaxTagMultiLegal::ClassInfos(KaxTagMultiLegal::Create, KaxTagMultiLegal_TheId, "MultiLegal", KaxTagMultiLegal_Context);
-const EbmlCallbacks KaxTagLegal::ClassInfos(KaxTagLegal::Create, KaxTagLegal_TheId, "Legal", KaxTagLegal_Context);
-const EbmlCallbacks KaxTagMultiLegalType::ClassInfos(KaxTagMultiLegalType::Create, KaxTagMultiLegalType_TheId, "KaxTagMultiLegalType", KaxTagMultiLegalType_Context);
-const EbmlCallbacks KaxTagMultiLegalContent::ClassInfos(KaxTagMultiLegalContent::Create, KaxTagMultiLegalContent_TheId, "TagMultiLegalContent", KaxTagMultiLegalContent_Context);
-const EbmlCallbacks KaxTagMultiLegalURL::ClassInfos(KaxTagMultiLegalURL::Create, KaxTagMultiLegalURL_TheId, "KaxTagMultiLegalURL", KaxTagMultiLegalURL_Context);
-const EbmlCallbacks KaxTagMultiLegalAddress::ClassInfos(KaxTagMultiLegalAddress::Create, KaxTagMultiLegalAddress_TheId, "KaxTagMultiLegalAddress", KaxTagMultiLegalAddress_Context);
-
-const EbmlCallbacks KaxTagMultiTitle::ClassInfos(KaxTagMultiTitle::Create, KaxTagMultiTitle_TheId, "MultiEntity", KaxTagMultiTitle_Context);
-const EbmlCallbacks KaxTagTitle::ClassInfos(KaxTagTitle::Create, KaxTagTitle_TheId, "Entity", KaxTagTitle_Context);
-const EbmlCallbacks KaxTagMultiTitleType::ClassInfos(KaxTagMultiTitleType::Create, KaxTagMultiTitleType_TheId, "MultiTitleType", KaxTagMultiTitleType_Context);
-const EbmlCallbacks KaxTagMultiTitleName::ClassInfos(KaxTagMultiTitleName::Create, KaxTagMultiTitleName_TheId, "MultiTitleName", KaxTagMultiTitleName_Context);
-const EbmlCallbacks KaxTagMultiTitleSubTitle::ClassInfos(KaxTagMultiTitleSubTitle::Create, KaxTagMultiTitleSubTitle_TheId, "MultiTitleSubTitle", KaxTagMultiTitleSubTitle_Context);
-const EbmlCallbacks KaxTagMultiTitleEdition::ClassInfos(KaxTagMultiTitleEdition::Create, KaxTagMultiTitleEdition_TheId, "MultiTitleEdition", KaxTagMultiTitleEdition_Context);
-const EbmlCallbacks KaxTagMultiTitleAddress::ClassInfos(KaxTagMultiTitleAddress::Create, KaxTagMultiTitleAddress_TheId, "MultiTitleAddress", KaxTagMultiTitleAddress_Context);
-const EbmlCallbacks KaxTagMultiTitleURL::ClassInfos(KaxTagMultiTitleURL::Create, KaxTagMultiTitleURL_TheId, "MultiTitleURL", KaxTagMultiTitleURL_Context);
-const EbmlCallbacks KaxTagMultiTitleEmail::ClassInfos(KaxTagMultiTitleEmail::Create, KaxTagMultiTitleEmail_TheId, "MultiTitleEmail", KaxTagMultiTitleEmail_Context);
-const EbmlCallbacks KaxTagMultiTitleLanguage::ClassInfos(KaxTagMultiTitleLanguage::Create, KaxTagMultiTitleLanguage_TheId, "MultiTitleLanguage", KaxTagMultiTitleLanguage_Context);
-
-const EbmlCallbacks KaxTagMultiAttachment::ClassInfos(KaxTagMultiAttachment::Create, KaxTagMultiAttachment_TheId, "TagMultiAttachment", KaxTagMultiAttachment_Context);
-const EbmlCallbacks KaxTagAttachment::ClassInfos(KaxTagAttachment::Create, KaxTagAttachment_TheId, "TagAttachment", KaxTagAttachment_Context);
-const EbmlCallbacks KaxTagAttachmentID::ClassInfos(KaxTagAttachmentID::Create, KaxTagAttachmentID_TheId, "TagAttachmentID", KaxTagAttachmentID_Context);
-
-KaxTagMultiComment::KaxTagMultiComment()
-	:EbmlMaster(KaxTagMultiComment_Context)
-{}
-
-
-KaxTagMultiCommercial::KaxTagMultiCommercial()
-	:EbmlMaster(KaxTagMultiCommercial_Context)
-{}
-
-KaxTagCommercial::KaxTagCommercial()
-	:EbmlMaster(KaxTagCommercial_Context)
-{}
-
-KaxTagMultiPrice::KaxTagMultiPrice()
-	:EbmlMaster(KaxTagMultiPrice_Context)
-{}
-
-KaxTagMultiDate::KaxTagMultiDate()
-	:EbmlMaster(KaxTagMultiDate_Context)
-{}
-
-KaxTagDate::KaxTagDate()
-	:EbmlMaster(KaxTagDate_Context)
-{}
-
-KaxTagMultiEntity::KaxTagMultiEntity()
-	:EbmlMaster(KaxTagMultiEntity_Context)
-{}
-	
-KaxTagEntity::KaxTagEntity()
-	:EbmlMaster(KaxTagEntity_Context)
-{}
-	
-KaxTagMultiLegal::KaxTagMultiLegal()
-	:EbmlMaster(KaxTagMultiLegal_Context)
-{}
-
-KaxTagLegal::KaxTagLegal()
-	:EbmlMaster(KaxTagLegal_Context)
-{}
-
-KaxTagMultiIdentifier::KaxTagMultiIdentifier()
-	:EbmlMaster(KaxTagMultiIdentifier_Context)
-{}
-
-KaxTagIdentifier::KaxTagIdentifier()
-	:EbmlMaster(KaxTagIdentifier_Context)
-{}
-
-KaxTagMultiTitle::KaxTagMultiTitle()
-	:EbmlMaster(KaxTagMultiTitle_Context)
-{}
-
-KaxTagTitle::KaxTagTitle()
-	:EbmlMaster(KaxTagTitle_Context)
-{}
-
-KaxTagMultiAttachment::KaxTagMultiAttachment()
-	:EbmlMaster(KaxTagMultiAttachment_Context)
-{}
-
-KaxTagAttachment::KaxTagAttachment()
-	:EbmlMaster(KaxTagAttachment_Context)
-{}
+DEFINE_START_SEMANTIC(KaxTagMultiGlobal)
+// TODO: have the default EBML global semantic as well
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiComment)
+DEFINE_END_SEMANTIC(KaxTagMultiGlobal)
+
+DEFINE_START_SEMANTIC(KaxTagMultiComment)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentName)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentComments)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommentLanguage)
+DEFINE_END_SEMANTIC(KaxTagMultiComment)
+
+DEFINE_START_SEMANTIC(KaxTagMultiCommercial)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagCommercial)
+DEFINE_END_SEMANTIC(KaxTagMultiCommercial)
+
+DEFINE_START_SEMANTIC(KaxTagCommercial)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiCommercialType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiCommercialAddress)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiCommercialURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiCommercialEmail)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiPrice)
+DEFINE_END_SEMANTIC(KaxTagCommercial)
+
+DEFINE_START_SEMANTIC(KaxTagMultiPrice)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPriceCurrency)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPriceAmount)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiPricePriceDate)
+DEFINE_END_SEMANTIC(KaxTagMultiPrice)
+
+DEFINE_START_SEMANTIC(KaxTagMultiDate)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagDate)
+DEFINE_END_SEMANTIC(KaxTagMultiDate)
+
+DEFINE_START_SEMANTIC(KaxTagDate)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiDateType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiDateDateBegin)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiDateDateEnd)
+DEFINE_END_SEMANTIC(KaxTagDate)
+
+DEFINE_START_SEMANTIC(KaxTagMultiEntity)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagEntity)
+DEFINE_END_SEMANTIC(KaxTagMultiEntity)
+
+DEFINE_START_SEMANTIC(KaxTagEntity)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiEntityType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiEntityName)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiEntityURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiEntityEmail)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiEntityAddress)
+DEFINE_END_SEMANTIC(KaxTagEntity)
+
+DEFINE_START_SEMANTIC(KaxTagMultiIdentifier)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagIdentifier)
+DEFINE_END_SEMANTIC(KaxTagMultiIdentifier)
+
+DEFINE_START_SEMANTIC(KaxTagIdentifier)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiIdentifierType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiIdentifierBinary)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiIdentifierString)
+DEFINE_END_SEMANTIC(KaxTagIdentifier)
+
+DEFINE_START_SEMANTIC(KaxTagMultiLegal)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagLegal)
+DEFINE_END_SEMANTIC(KaxTagMultiLegal)
+
+DEFINE_START_SEMANTIC(KaxTagLegal)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiLegalType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiLegalContent)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiLegalURL)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiLegalAddress)
+DEFINE_END_SEMANTIC(KaxTagLegal)
+
+DEFINE_START_SEMANTIC(KaxTagMultiTitle)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagTitle)
+DEFINE_END_SEMANTIC(KaxTagMultiTitle)
+
+DEFINE_START_SEMANTIC(KaxTagTitle)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTagMultiTitleType)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleName)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleSubTitle)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleEdition)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleAddress)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiTitleURL)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTagMultiTitleEmail)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagMultiTitleLanguage)
+DEFINE_END_SEMANTIC(KaxTagTitle)
+
+DEFINE_START_SEMANTIC(KaxTagMultiAttachment)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTagAttachment)
+DEFINE_END_SEMANTIC(KaxTagMultiAttachment)
+
+DEFINE_START_SEMANTIC(KaxTagAttachment)
+DEFINE_SEMANTIC_ITEM(false, true, KaxTagAttachmentID)
+DEFINE_END_SEMANTIC(KaxTagAttachment)
+
+
+DEFINE_MKX_CONTEXT(KaxTagMultiGlobal);
 
 const EbmlSemanticContext & GetKaxTagsGlobal_Context()
 {
-	return KaxTagMultiGlobal_Context;
+    return EBML_CLASS_SEMCONTEXT(KaxTagMultiGlobal);
 }
 
+#if defined(HAVE_EBML2)
+#define DEFINE_TAG_MASTER(a,b,c,d,e)   DEFINE_xxx_MASTER(a,b,d,e,EBML_SemanticKaxTagMultiGlobal)
+#else
+#define DEFINE_TAG_MASTER(a,b,c,d,e)   DEFINE_xxx_MASTER(a,b,c,d,e,*GetKaxTagsGlobal_Context)
+#endif
+
+
+DEFINE_MKX_MASTER   (KaxTagMultiComment,           0x5B7B, 2, KaxTag, "MultiComment");
+DEFINE_MKX_STRING   (KaxTagMultiCommentName,       0x5F7D, 2, KaxTagMultiComment, "MultiCommentName");
+DEFINE_MKX_UNISTRING(KaxTagMultiCommentComments,   0x5F7C, 2, KaxTagMultiComment, "MultiCommentComments");
+DEFINE_MKX_STRING   (KaxTagMultiCommentLanguage, 0x22B59D, 3, KaxTagMultiComment, "MultiCommentLanguage");
+
+DEFINE_TAG_MASTER   (KaxTagMultiCommercial,        0x4DC7, 2, KaxTag, "MultiCommercial");
+DEFINE_TAG_MASTER   (KaxTagCommercial,             0x4EC7, 2, KaxTagMultiCommercial, "Commercial");
+DEFINE_MKX_UINTEGER (KaxTagMultiCommercialType,    0x5BD7, 2, KaxTagCommercial, "MultiCommercialType");
+DEFINE_MKX_UNISTRING(KaxTagMultiCommercialAddress, 0x5BBB, 2, KaxTagCommercial, "MultiCommercialAddress");
+DEFINE_MKX_STRING   (KaxTagMultiCommercialURL,     0x5BDA, 2, KaxTagCommercial, "MultiCommercialURL");
+DEFINE_MKX_STRING   (KaxTagMultiCommercialEmail,   0x5BC0, 2, KaxTagCommercial, "MultiCommercialEmail");
+DEFINE_TAG_MASTER   (KaxTagMultiPrice,             0x5BC3, 2, KaxTagCommercial, "MultiPrice");
+DEFINE_MKX_STRING   (KaxTagMultiPriceCurrency,     0x5B6C, 2, KaxTagMultiPrice, "MultiPriceCurrency");
+DEFINE_MKX_FLOAT    (KaxTagMultiPriceAmount,       0x5B6E, 2, KaxTagMultiPrice, "MultiPriceAmount");
+DEFINE_MKX_DATE     (KaxTagMultiPricePriceDate,    0x5B6F, 2, KaxTagMultiPrice, "MultiPricePriceDate");
+
+DEFINE_TAG_MASTER   (KaxTagMultiDate,              0x4DC8, 2, KaxTag, "MultiDate");
+DEFINE_TAG_MASTER   (KaxTagDate,                   0x4EC8, 2, KaxTagMultiDate, "Date");
+DEFINE_MKX_UINTEGER (KaxTagMultiDateType,          0x5BD8, 2, KaxTagDate, "MultiDateType");
+DEFINE_MKX_DATE     (KaxTagMultiDateDateBegin,     0x4460, 2, KaxTagDate, "MultiDateDateBegin");
+DEFINE_MKX_DATE     (KaxTagMultiDateDateEnd,       0x4462, 2, KaxTagDate, "MultiDateDateEnd");
+
+DEFINE_TAG_MASTER   (KaxTagMultiEntity,            0x4DC9, 2, KaxTag, "MultiEntity");
+DEFINE_TAG_MASTER   (KaxTagEntity,                 0x4EC9, 2, KaxTagMultiEntity, "Entity");
+DEFINE_MKX_UINTEGER (KaxTagMultiEntityType,        0x5BD9, 2, KaxTagEntity, "MultiEntityType");
+DEFINE_MKX_UNISTRING(KaxTagMultiEntityName,        0x5BED, 2, KaxTagEntity, "MultiEntityName");
+DEFINE_MKX_STRING   (KaxTagMultiEntityURL,         0x5BDB, 2, KaxTagEntity, "MultiEntityURL");
+DEFINE_MKX_STRING   (KaxTagMultiEntityEmail,       0x5BC1, 2, KaxTagEntity, "MultiEntityEmail");
+DEFINE_MKX_UNISTRING(KaxTagMultiEntityAddress,     0x5BDC, 2, KaxTagEntity, "MultiEntityAddress");
+
+DEFINE_TAG_MASTER   (KaxTagMultiIdentifier,        0x4DC6, 2, KaxTag, "MultiIdentifier");
+DEFINE_TAG_MASTER   (KaxTagIdentifier,             0x4EC6, 2, KaxTagMultiIdentifier, "Identifier");
+DEFINE_MKX_UINTEGER (KaxTagMultiIdentifierType,    0x5BAD, 2, KaxTagIdentifier, "MultiIdentifierType");
+DEFINE_MKX_BINARY   (KaxTagMultiIdentifierBinary,  0x6B67, 2, KaxTagIdentifier, "MultiIdentifierBinary");
+DEFINE_MKX_UNISTRING(KaxTagMultiIdentifierString,  0x6B68, 2, KaxTagIdentifier, "MultiIdentifierString");
+
+DEFINE_TAG_MASTER   (KaxTagMultiLegal,             0x4DC5, 2, KaxTag, "MultiLegal");
+DEFINE_TAG_MASTER   (KaxTagLegal,                  0x4EC5, 2, KaxTagMultiLegal, "Legal");
+DEFINE_MKX_UINTEGER (KaxTagMultiLegalType,         0x5BBD, 2, KaxTagLegal, "MultiLegalType");
+DEFINE_MKX_UNISTRING(KaxTagMultiLegalContent,      0x5BB2, 2, KaxTagLegal, "MultiLegalContent");
+DEFINE_MKX_STRING   (KaxTagMultiLegalURL,          0x5B34, 2, KaxTagLegal, "MultiLegalURL");
+DEFINE_MKX_UNISTRING(KaxTagMultiLegalAddress,      0x5B9B, 2, KaxTagLegal, "MultiLegalAddress");
+
+DEFINE_TAG_MASTER   (KaxTagMultiTitle,             0x4DC4, 2, KaxTag, "MultiTitle");
+DEFINE_TAG_MASTER   (KaxTagTitle,                  0x4EC4, 2, KaxTagMultiTitle, "Title");
+DEFINE_MKX_UINTEGER (KaxTagMultiTitleType,         0x5B7D, 2, KaxTagTitle, "MultiTitleType");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleName,         0x5BB9, 2, KaxTagTitle, "MultiTitleName");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleSubTitle,     0x5B5B, 2, KaxTagTitle, "MultiTitleSubTitle");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleEdition,      0x5BAE, 2, KaxTagTitle, "MultiTitleEdition");
+DEFINE_MKX_UNISTRING(KaxTagMultiTitleAddress,      0x5B33, 2, KaxTagTitle, "MultiTitleAddress");
+DEFINE_MKX_STRING   (KaxTagMultiTitleURL,          0x5BA9, 2, KaxTagTitle, "MultiTitleURL");
+DEFINE_MKX_STRING   (KaxTagMultiTitleEmail,        0x5BC9, 2, KaxTagTitle, "MultiTitleEmail");
+DEFINE_MKX_STRING   (KaxTagMultiTitleLanguage,   0x22B59E, 3, KaxTagTitle, "MultiTitleLanguage");
+
+DEFINE_TAG_MASTER   (KaxTagMultiAttachment,        0x4DC3, 2, KaxTag, "MultiAttachment");
+DEFINE_TAG_MASTER   (KaxTagAttachment,             0x4EC3, 2, KaxTagMultiAttachment, "Attachment");
+DEFINE_MKX_UINTEGER (KaxTagAttachmentID,           0x5BA0, 2, KaxTagAttachment, "AttachmentID");
+
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxTags.cpp b/src/KaxTags.cpp
index 4b9b712..709d854 100644
--- a/src/KaxTags.cpp
+++ b/src/KaxTags.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -36,25 +36,17 @@
 #include "matroska/KaxTags.h"
 #include "matroska/KaxTag.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 using namespace LIBEBML_NAMESPACE;
 
 // sub elements
 START_LIBMATROSKA_NAMESPACE
 
-EbmlSemantic KaxTags_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTag::ClassInfos),
-};
+DEFINE_START_SEMANTIC(KaxTags)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTag)
+DEFINE_END_SEMANTIC(KaxTags)
 
-const EbmlSemanticContext KaxTags_Context = EbmlSemanticContext(countof(KaxTags_ContextList), KaxTags_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxTags::ClassInfos);
-
-EbmlId KaxTags_TheId(0x1254C367, 4);
-
-const EbmlCallbacks KaxTags::ClassInfos(KaxTags::Create, KaxTags_TheId, "Tags", KaxTags_Context);
-
-KaxTags::KaxTags()
-	:EbmlMaster(KaxTags_Context)
-{}
+DEFINE_MKX_MASTER(KaxTags, 0x1254C367, 4, KaxSegment, "Tags");
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxTrackAudio.cpp b/src/KaxTrackAudio.cpp
index 7fc934d..59289d1 100644
--- a/src/KaxTrackAudio.cpp
+++ b/src/KaxTrackAudio.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -36,53 +36,27 @@
 
 // sub elements
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-#if MATROSKA_VERSION == 1
-const EbmlSemantic KaxTrackAudio_ContextList[4] =
-#else // MATROSKA_VERSION
-const EbmlSemantic KaxTrackAudio_ContextList[5] =
-#endif // MATROSKA_VERSION
-{
-	EbmlSemantic(true , true, KaxAudioSamplingFreq::ClassInfos),
-	EbmlSemantic(true , true, KaxAudioChannels::ClassInfos),
-	EbmlSemantic(false, true, KaxAudioBitDepth::ClassInfos),
-	EbmlSemantic(false, true, KaxAudioOutputSamplingFreq::ClassInfos),
+DEFINE_START_SEMANTIC(KaxTrackAudio)
+DEFINE_SEMANTIC_ITEM(true, true, KaxAudioSamplingFreq)
+DEFINE_SEMANTIC_ITEM(true, true, KaxAudioChannels)
+DEFINE_SEMANTIC_ITEM(false, true, KaxAudioBitDepth)
+DEFINE_SEMANTIC_ITEM(false, true, KaxAudioOutputSamplingFreq)
 #if MATROSKA_VERSION >= 2
-	EbmlSemantic(false, true, KaxAudioPosition::ClassInfos),
+DEFINE_SEMANTIC_ITEM(false, true, KaxAudioPosition)
 #endif // MATROSKA_VERSION
-};
+DEFINE_END_SEMANTIC(KaxTrackAudio)
 
-const EbmlSemanticContext KaxTrackAudio_Context = EbmlSemanticContext(countof(KaxTrackAudio_ContextList), KaxTrackAudio_ContextList, &KaxTrackEntry_Context, *GetKaxGlobal_Context, &KaxTrackAudio::ClassInfos);
-const EbmlSemanticContext KaxAudioSamplingFreq_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &KaxAudioSamplingFreq::ClassInfos);
-const EbmlSemanticContext KaxAudioOutputSamplingFreq_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &KaxAudioOutputSamplingFreq::ClassInfos);
-const EbmlSemanticContext KaxAudioChannels_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &KaxAudioChannels::ClassInfos);
-const EbmlSemanticContext KaxAudioBitDepth_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &KaxAudioBitDepth::ClassInfos);
+DEFINE_MKX_MASTER      (KaxTrackAudio,                0xE1, 1, KaxTrackEntry, "TrackAudio");
+DEFINE_MKX_FLOAT_DEF   (KaxAudioSamplingFreq,         0xB5, 1, KaxTrackAudio, "AudioSamplingFreq", 8000.0);
+DEFINE_MKX_FLOAT       (KaxAudioOutputSamplingFreq, 0x78B5, 2, KaxTrackAudio, "AudioOutputSamplingFreq");
+DEFINE_MKX_UINTEGER_DEF(KaxAudioChannels,             0x9F, 1, KaxTrackAudio, "AudioChannels", 1);
+DEFINE_MKX_UINTEGER    (KaxAudioBitDepth,           0x6264, 2, KaxTrackAudio, "AudioBitDepth");
 #if MATROSKA_VERSION >= 2
-const EbmlSemanticContext KaxAudioPosition_Context = EbmlSemanticContext(0, NULL, &KaxTrackAudio_Context, *GetKaxGlobal_Context, &KaxAudioPosition::ClassInfos);
-#endif // MATROSKA_VERSION
-
-EbmlId KaxTrackAudio_TheId       (0xE1, 1);
-EbmlId KaxAudioSamplingFreq_TheId(0xB5, 1);
-EbmlId KaxAudioOutputSamplingFreq_TheId(0x78B5, 2);
-EbmlId KaxAudioChannels_TheId    (0x9F, 1);
-EbmlId KaxAudioBitDepth_TheId    (0x6264, 2);
-#if MATROSKA_VERSION >= 2
-EbmlId KaxAudioPosition_TheId    (0x7D7B, 2);
-#endif // MATROSKA_VERSION
-
-const EbmlCallbacks KaxTrackAudio::ClassInfos(KaxTrackAudio::Create, KaxTrackAudio_TheId, "TrackAudio", KaxTrackAudio_Context);
-const EbmlCallbacks KaxAudioSamplingFreq::ClassInfos(KaxAudioSamplingFreq::Create, KaxAudioSamplingFreq_TheId, "AudioSamplingFreq", KaxAudioSamplingFreq_Context);
-const EbmlCallbacks KaxAudioOutputSamplingFreq::ClassInfos(KaxAudioOutputSamplingFreq::Create, KaxAudioOutputSamplingFreq_TheId, "AudioOutputSamplingFreq", KaxAudioOutputSamplingFreq_Context);
-const EbmlCallbacks KaxAudioChannels::ClassInfos(KaxAudioChannels::Create, KaxAudioChannels_TheId, "AudioChannels", KaxAudioChannels_Context);
-const EbmlCallbacks KaxAudioBitDepth::ClassInfos(KaxAudioBitDepth::Create, KaxAudioBitDepth_TheId, "AudioBitDepth", KaxAudioBitDepth_Context);
-#if MATROSKA_VERSION >= 2
-const EbmlCallbacks KaxAudioPosition::ClassInfos(KaxAudioPosition::Create, KaxAudioPosition_TheId, "AudioPosition", KaxAudioPosition_Context);
-#endif // MATROSKA_VERSION
-
-KaxTrackAudio::KaxTrackAudio()
-	:EbmlMaster(KaxTrackAudio_Context)
-{}
+DEFINE_MKX_BINARY      (KaxAudioPosition,           0x7D7B, 2, KaxTrackAudio, "AudioPosition");
+#endif
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxTrackEntryData.cpp b/src/KaxTrackEntryData.cpp
index a26cfd9..f9e7c4c 100644
--- a/src/KaxTrackEntryData.cpp
+++ b/src/KaxTrackEntryData.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -35,108 +35,45 @@
 */
 #include "matroska/KaxTrackEntryData.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-const EbmlSemantic KaxTrackTranslate_ContextList[3] =
-{
-	EbmlSemantic(false, false,KaxTrackTranslateEditionUID::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackTranslateCodec::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackTranslateTrackID::ClassInfos),
-};
+DEFINE_START_SEMANTIC(KaxTrackTranslate)
+DEFINE_SEMANTIC_ITEM(false, false, KaxTrackTranslateEditionUID)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTranslateCodec)
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackTranslateTrackID)
+DEFINE_END_SEMANTIC(KaxTrackTranslate)
 
-EbmlId KaxTrackNumber_TheId            (0xD7, 1);
-EbmlId KaxTrackUID_TheId               (0x73C5, 2);
-EbmlId KaxTrackType_TheId              (0x83, 1);
-EbmlId KaxTrackFlagDefault_TheId       (0x88, 1);
-EbmlId KaxTrackFlagForced_TheId        (0x55AA, 2);
-EbmlId KaxTrackFlagLacing_TheId        (0x9C, 1);
-EbmlId KaxTrackMinCache_TheId          (0x6DE7, 2);
-EbmlId KaxTrackMaxCache_TheId          (0x6DF8, 2);
-EbmlId KaxTrackDefaultDuration_TheId   (0x23E383, 3);
-EbmlId KaxTrackTimecodeScale_TheId     (0x23314F, 3);
-EbmlId KaxMaxBlockAdditionID_TheId     (0x55EE, 2);
-EbmlId KaxTrackName_TheId              (0x536E, 2);
-EbmlId KaxTrackLanguage_TheId          (0x22B59C, 3);
-EbmlId KaxCodecID_TheId                (0x86, 1);
-EbmlId KaxCodecPrivate_TheId           (0x63A2, 2);
-EbmlId KaxCodecName_TheId              (0x258688, 3);
-EbmlId KaxTrackAttachmentLink_TheId    (0x7446, 2);
-EbmlId KaxTrackOverlay_TheId           (0x6FAB, 2);
-EbmlId KaxTrackTranslate_TheId         (0x6624, 2);
-EbmlId KaxTrackTranslateEditionUID_TheId(0x66FC, 2);
-EbmlId KaxTrackTranslateCodec_TheId    (0x66BF, 2);
-EbmlId KaxTrackTranslateTrackID_TheId  (0x66A5, 2);
+DEFINE_MKX_UINTEGER    (KaxTrackNumber,                0xD7, 1, KaxTracks, "TrackNumber");
+DEFINE_MKX_UINTEGER    (KaxTrackUID,                 0x73C5, 2, KaxTracks, "TrackUID");
+DEFINE_MKX_UINTEGER    (KaxTrackType,                  0x83, 1, KaxTracks, "TrackType");
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagDefault,           0x88, 1, KaxTracks, "TrackFlagEnabled", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagForced,          0x55AA, 2, KaxTracks, "TrackFlagForced", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagLacing,            0x9C, 1, KaxTracks, "TrackFlagLacing", 1);
+DEFINE_MKX_UINTEGER_DEF(KaxTrackMinCache,            0x6DE7, 2, KaxTracks, "TrackMinCache", 0);
+DEFINE_MKX_UINTEGER    (KaxTrackMaxCache,            0x6DF8, 2, KaxTracks, "TrackMaxCache\0rotomodobopo");
+DEFINE_MKX_UINTEGER    (KaxTrackDefaultDuration,   0x23E383, 3, KaxTracks, "TrackDefaultDuration");
+DEFINE_MKX_FLOAT_DEF   (KaxTrackTimecodeScale,     0x23314F, 3, KaxTracks, "TrackTimecodeScale", 1.0);
+DEFINE_MKX_UINTEGER_DEF(KaxMaxBlockAdditionID,       0x55EE, 2, KaxTracks, "MaxBlockAdditionID", 0);
+//DEFINE_MKX_SINTEGER_DEF(KaxTrackOffset,            0x537F, 2, KaxTracks, "TrackOffset", 0);
+DEFINE_MKX_UNISTRING   (KaxTrackName,                0x536E, 2, KaxTracks, "TrackName");
+DEFINE_MKX_STRING_DEF  (KaxTrackLanguage,          0x22B59C, 3, KaxTracks, "TrackLanguage", "eng");
+DEFINE_MKX_STRING      (KaxCodecID,                    0x86, 1, KaxTracks, "CodecID");
+DEFINE_MKX_BINARY      (KaxCodecPrivate,             0x63A2, 2, KaxTracks, "CodecPrivate");
+DEFINE_MKX_UNISTRING   (KaxCodecName,              0x258688, 3, KaxTracks, "CodecName");
+DEFINE_MKX_BINARY      (KaxTrackAttachmentLink,      0x7446, 2, KaxTracks, "TrackAttachmentLink");
+DEFINE_MKX_UINTEGER    (KaxTrackOverlay,             0x6FAB, 2, KaxTracks, "TrackOverlay");
+DEFINE_MKX_MASTER      (KaxTrackTranslate,           0x6624, 2, KaxTracks, "TrackTranslate");
+DEFINE_MKX_UINTEGER    (KaxTrackTranslateEditionUID, 0x66FC, 2, KaxTrackTranslate, "TrackTranslateEditionUID");
+DEFINE_MKX_UINTEGER    (KaxTrackTranslateCodec,      0x66BF, 2, KaxTrackTranslate, "TrackTranslateCodec");
+DEFINE_MKX_BINARY      (KaxTrackTranslateTrackID,    0x66A5, 2, KaxTrackTranslate, "TrackTranslateTrackID");
 #if MATROSKA_VERSION >= 2
-EbmlId KaxTrackFlagEnabled_TheId       (0xB9, 1);
-EbmlId KaxCodecSettings_TheId          (0x3A9697, 3);
-EbmlId KaxCodecInfoURL_TheId           (0x3B4040, 3);
-EbmlId KaxCodecDownloadURL_TheId       (0x26B240, 3);
-EbmlId KaxCodecDecodeAll_TheId         (0xAA, 1);
-#endif // MATROSKA_VERSION
-
-const EbmlSemanticContext KaxTrackNumber_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackNumber::ClassInfos);
-const EbmlSemanticContext KaxTrackUID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackUID::ClassInfos);
-const EbmlSemanticContext KaxTrackType_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackType::ClassInfos);
-const EbmlSemanticContext KaxTrackFlagDefault_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackFlagDefault::ClassInfos);
-const EbmlSemanticContext KaxTrackFlagForced_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackFlagForced::ClassInfos);
-const EbmlSemanticContext KaxTrackFlagLacing_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackFlagLacing::ClassInfos);
-const EbmlSemanticContext KaxTrackMinCache_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackMinCache::ClassInfos);
-const EbmlSemanticContext KaxTrackMaxCache_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackMaxCache::ClassInfos);
-const EbmlSemanticContext KaxTrackDefaultDuration_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackDefaultDuration::ClassInfos);
-const EbmlSemanticContext KaxTrackTimecodeScale_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackTimecodeScale::ClassInfos);
-const EbmlSemanticContext KaxMaxBlockAdditionID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxMaxBlockAdditionID::ClassInfos);
-const EbmlSemanticContext KaxTrackName_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackName::ClassInfos);
-const EbmlSemanticContext KaxTrackLanguage_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackLanguage::ClassInfos);
-const EbmlSemanticContext KaxCodecID_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxCodecID::ClassInfos);
-const EbmlSemanticContext KaxCodecPrivate_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxCodecPrivate::ClassInfos);
-const EbmlSemanticContext KaxCodecName_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxCodecName::ClassInfos);
-const EbmlSemanticContext KaxTrackAttachmentLink_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackAttachmentLink::ClassInfos);
-const EbmlSemanticContext KaxTrackOverlay_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackOverlay::ClassInfos);
-const EbmlSemanticContext KaxTrackTranslate_Context = EbmlSemanticContext(countof(KaxTrackTranslate_ContextList), KaxTrackTranslate_ContextList, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackTranslate::ClassInfos);
-const EbmlSemanticContext KaxTrackTranslateEditionUID_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &KaxTrackTranslateEditionUID::ClassInfos);
-const EbmlSemanticContext KaxTrackTranslateCodec_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &KaxTrackTranslateCodec::ClassInfos);
-const EbmlSemanticContext KaxTrackTranslateTrackID_Context = EbmlSemanticContext(0, NULL, &KaxTrackTranslate_Context, *GetKaxGlobal_Context, &KaxTrackTranslateTrackID::ClassInfos);
-#if MATROSKA_VERSION >= 2
-const EbmlSemanticContext KaxTrackFlagEnabled_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackFlagEnabled::ClassInfos);
-const EbmlSemanticContext KaxCodecSettings_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxCodecSettings::ClassInfos);
-const EbmlSemanticContext KaxCodecInfoURL_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxCodecInfoURL::ClassInfos);
-const EbmlSemanticContext KaxCodecDownloadURL_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxCodecDownloadURL::ClassInfos);
-const EbmlSemanticContext KaxCodecDecodeAll_Context = EbmlSemanticContext(0, NULL, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxCodecDecodeAll::ClassInfos);
-#endif // MATROSKA_VERSION
-
-const EbmlCallbacks KaxTrackNumber::ClassInfos(KaxTrackNumber::Create, KaxTrackNumber_TheId, "TrackNumber", KaxTrackNumber_Context);
-const EbmlCallbacks KaxTrackUID::ClassInfos(KaxTrackUID::Create, KaxTrackUID_TheId, "TrackUID", KaxTrackUID_Context);
-const EbmlCallbacks KaxTrackType::ClassInfos(KaxTrackType::Create, KaxTrackType_TheId, "TrackType", KaxTrackType_Context);
-const EbmlCallbacks KaxTrackFlagDefault::ClassInfos(KaxTrackFlagDefault::Create, KaxTrackFlagDefault_TheId, "TrackFlagDefault", KaxTrackFlagDefault_Context);
-const EbmlCallbacks KaxTrackFlagForced::ClassInfos(KaxTrackFlagForced::Create, KaxTrackFlagForced_TheId, "TrackFlagForced", KaxTrackFlagForced_Context);
-const EbmlCallbacks KaxTrackFlagLacing::ClassInfos(KaxTrackFlagLacing::Create, KaxTrackFlagLacing_TheId, "TrackFlagLacing", KaxTrackFlagLacing_Context);
-const EbmlCallbacks KaxTrackMinCache::ClassInfos(KaxTrackMinCache::Create, KaxTrackMinCache_TheId, "TrackMinCache", KaxTrackMinCache_Context);
-const EbmlCallbacks KaxTrackMaxCache::ClassInfos(KaxTrackMaxCache::Create, KaxTrackMaxCache_TheId, "TrackMaxCache\0rotomodobopo", KaxTrackMaxCache_Context);
-const EbmlCallbacks KaxTrackDefaultDuration::ClassInfos(KaxTrackDefaultDuration::Create, KaxTrackDefaultDuration_TheId, "TrackDefaultDuration", KaxTrackDefaultDuration_Context);
-const EbmlCallbacks KaxTrackTimecodeScale::ClassInfos(KaxTrackTimecodeScale::Create, KaxTrackTimecodeScale_TheId, "TrackTimecodeScale", KaxTrackTimecodeScale_Context);
-const EbmlCallbacks KaxMaxBlockAdditionID::ClassInfos(KaxMaxBlockAdditionID::Create, KaxMaxBlockAdditionID_TheId, "MaxBlockAdditionID", KaxMaxBlockAdditionID_Context);
-const EbmlCallbacks KaxTrackName::ClassInfos(KaxTrackName::Create, KaxTrackName_TheId, "TrackName", KaxTrackName_Context);
-const EbmlCallbacks KaxTrackLanguage::ClassInfos(KaxTrackLanguage::Create, KaxTrackLanguage_TheId, "TrackLanguage", KaxTrackLanguage_Context);
-const EbmlCallbacks KaxCodecID::ClassInfos(KaxCodecID::Create, KaxCodecID_TheId, "CodecID", KaxCodecID_Context);
-const EbmlCallbacks KaxCodecPrivate::ClassInfos(KaxCodecPrivate::Create, KaxCodecPrivate_TheId, "CodecPrivate", KaxCodecPrivate_Context);
-const EbmlCallbacks KaxCodecName::ClassInfos(KaxCodecName::Create, KaxCodecName_TheId, "CodecName", KaxCodecName_Context);
-const EbmlCallbacks KaxTrackAttachmentLink::ClassInfos(KaxTrackAttachmentLink::Create, KaxTrackAttachmentLink_TheId, "TrackAttachmentLink", KaxTrackAttachmentLink_Context);
-const EbmlCallbacks KaxTrackOverlay::ClassInfos(KaxTrackOverlay::Create, KaxTrackOverlay_TheId, "TrackOverlay", KaxTrackOverlay_Context);
-const EbmlCallbacks KaxTrackTranslate::ClassInfos(KaxTrackTranslate::Create, KaxTrackTranslate_TheId, "TrackTranslate", KaxTrackTranslate_Context);
-const EbmlCallbacks KaxTrackTranslateEditionUID::ClassInfos(KaxTrackTranslateEditionUID::Create, KaxTrackTranslateEditionUID_TheId, "TrackTranslateEditionUID", KaxTrackTranslateEditionUID_Context);
-const EbmlCallbacks KaxTrackTranslateCodec::ClassInfos(KaxTrackTranslateCodec::Create, KaxTrackTranslateCodec_TheId, "TrackTranslateCodec", KaxTrackTranslateCodec_Context);
-const EbmlCallbacks KaxTrackTranslateTrackID::ClassInfos(KaxTrackTranslateTrackID::Create, KaxTrackTranslateTrackID_TheId, "TrackTranslateTrackID", KaxTrackTranslateTrackID_Context);
-#if MATROSKA_VERSION >= 2
-const EbmlCallbacks KaxTrackFlagEnabled::ClassInfos(KaxTrackFlagEnabled::Create, KaxTrackFlagEnabled_TheId, "TrackFlagEnabled", KaxTrackFlagEnabled_Context);
-const EbmlCallbacks KaxCodecSettings::ClassInfos(KaxCodecSettings::Create, KaxCodecSettings_TheId, "CodecSettings", KaxCodecSettings_Context);
-const EbmlCallbacks KaxCodecInfoURL::ClassInfos(KaxCodecInfoURL::Create, KaxCodecInfoURL_TheId, "CodecInfoURL", KaxCodecInfoURL_Context);
-const EbmlCallbacks KaxCodecDownloadURL::ClassInfos(KaxCodecDownloadURL::Create, KaxCodecDownloadURL_TheId, "CodecDownloadURL", KaxCodecDownloadURL_Context);
-const EbmlCallbacks KaxCodecDecodeAll::ClassInfos(KaxCodecDecodeAll::Create, KaxCodecDecodeAll_TheId, "CodecDecodeAll", KaxCodecDecodeAll_Context);
-#endif // MATROSKA_VERSION
-
-KaxTrackTranslate::KaxTrackTranslate()
-	:EbmlMaster(KaxTrackTranslate_Context)
-{}
+DEFINE_MKX_UINTEGER_DEF(KaxTrackFlagEnabled,           0xB9, 1, KaxTracks, "TrackFlagDefault", 1);
+DEFINE_MKX_UNISTRING   (KaxCodecSettings,          0x3A9697, 3, KaxTracks, "CodecSettings");
+DEFINE_MKX_STRING      (KaxCodecInfoURL,           0x3B4040, 3, KaxTracks, "CodecInfoURL");
+DEFINE_MKX_STRING      (KaxCodecDownloadURL,       0x26B240, 3, KaxTracks, "CodecDownloadURL");
+DEFINE_MKX_UINTEGER_DEF(KaxCodecDecodeAll,             0xAA, 1, KaxTracks, "CodecDecodeAll", 1);
+#endif
 
 END_LIBMATROSKA_NAMESPACE
diff --git a/src/KaxTrackVideo.cpp b/src/KaxTrackVideo.cpp
index 64726d8..ca66bc2 100644
--- a/src/KaxTrackVideo.cpp
+++ b/src/KaxTrackVideo.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -36,96 +36,50 @@
 
 // sub elements
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-#if MATROSKA_VERSION == 1
-const EbmlSemantic KaxTrackVideo_ContextList[10] =
-#else // MATROSKA_VERSION
-const EbmlSemantic KaxTrackVideo_ContextList[15] =
-#endif // MATROSKA_VERSION
-{
-	EbmlSemantic(true , true, KaxVideoPixelWidth::ClassInfos),
-	EbmlSemantic(true , true, KaxVideoPixelHeight::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoPixelCropBottom::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoPixelCropTop::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoPixelCropLeft::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoPixelCropRight::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoDisplayWidth::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoDisplayHeight::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoColourSpace::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoFrameRate::ClassInfos),
-#if MATROSKA_VERSION >= 2
-	EbmlSemantic(true , true, KaxVideoFlagInterlaced::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoStereoMode::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoDisplayUnit::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoAspectRatio::ClassInfos),
-	EbmlSemantic(false, true, KaxVideoGamma::ClassInfos),
-#endif // MATROSKA_VERSION
-};
-
-const EbmlSemanticContext KaxTrackVideo_Context = EbmlSemanticContext(countof(KaxTrackVideo_ContextList), KaxTrackVideo_ContextList, &KaxTrackEntry_Context, *GetKaxGlobal_Context, &KaxTrackVideo::ClassInfos);
-const EbmlSemanticContext KaxVideoPixelWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelWidth::ClassInfos);
-const EbmlSemanticContext KaxVideoPixelHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelHeight::ClassInfos);
-const EbmlSemanticContext KaxVideoPixelCropBottom_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropBottom::ClassInfos);
-const EbmlSemanticContext KaxVideoPixelCropTop_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropTop::ClassInfos);
-const EbmlSemanticContext KaxVideoPixelCropRight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropLeft::ClassInfos);
-const EbmlSemanticContext KaxVideoPixelCropLeft_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoPixelCropRight::ClassInfos);
-const EbmlSemanticContext KaxVideoDisplayWidth_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoDisplayWidth::ClassInfos);
-const EbmlSemanticContext KaxVideoDisplayHeight_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoDisplayHeight::ClassInfos);
-const EbmlSemanticContext KaxVideoColourSpace_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoColourSpace::ClassInfos);
-const EbmlSemanticContext KaxVideoFrameRate_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoFrameRate::ClassInfos);
+DEFINE_START_SEMANTIC(KaxTrackVideo)
+DEFINE_SEMANTIC_ITEM(true, true, KaxVideoPixelWidth)
+DEFINE_SEMANTIC_ITEM(true, true, KaxVideoPixelHeight)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoPixelCropBottom)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoPixelCropTop)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoPixelCropLeft)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoPixelCropRight)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoDisplayWidth)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoDisplayHeight)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoColourSpace)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoFrameRate)
 #if MATROSKA_VERSION >= 2
-const EbmlSemanticContext KaxVideoFlagInterlaced_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoFlagInterlaced::ClassInfos);
-const EbmlSemanticContext KaxVideoStereoMode_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoStereoMode::ClassInfos);
-const EbmlSemanticContext KaxVideoDisplayUnit_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoDisplayUnit::ClassInfos);
-const EbmlSemanticContext KaxVideoAspectRatio_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoAspectRatio::ClassInfos);
-const EbmlSemanticContext KaxVideoGamma_Context = EbmlSemanticContext(0, NULL, &KaxTrackVideo_Context, *GetKaxGlobal_Context, &KaxVideoGamma::ClassInfos);
+DEFINE_SEMANTIC_ITEM(true, true, KaxVideoFlagInterlaced)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoStereoMode)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoDisplayUnit)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoAspectRatio)
+DEFINE_SEMANTIC_ITEM(false, true, KaxVideoGamma)
 #endif // MATROSKA_VERSION
+DEFINE_END_SEMANTIC(KaxTrackVideo)
 
-EbmlId KaxTrackVideo_TheId          (0xE0, 1);
-EbmlId KaxVideoPixelWidth_TheId     (0xB0, 1);
-EbmlId KaxVideoPixelHeight_TheId    (0xBA, 1);
-EbmlId KaxVideoPixelCropBottom_TheId(0x54AA, 2);
-EbmlId KaxVideoPixelCropTop_TheId   (0x54BB, 2);
-EbmlId KaxVideoPixelCropLeft_TheId  (0x54CC, 2);
-EbmlId KaxVideoPixelCropRight_TheId (0x54DD, 2);
-EbmlId KaxVideoDisplayWidth_TheId   (0x54B0, 2);
-EbmlId KaxVideoDisplayHeight_TheId  (0x54BA, 2);
-EbmlId KaxVideoColourSpace_TheId    (0x2EB524, 3);
-EbmlId KaxVideoFrameRate_TheId      (0x2383E3, 3);
+DEFINE_MKX_MASTER      (KaxTrackVideo,             0xE0, 1, KaxTrackEntry, "TrackVideo");
+DEFINE_MKX_UINTEGER    (KaxVideoPixelWidth,        0xB0, 1, KaxTrackVideo, "VideoPixelWidth");
+DEFINE_MKX_UINTEGER    (KaxVideoPixelHeight,       0xBA, 1, KaxTrackVideo, "VideoPixelHeight");
+DEFINE_MKX_UINTEGER_DEF(KaxVideoPixelCropBottom, 0x54AA, 2, KaxTrackVideo, "VideoPixelCropBottom", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxVideoPixelCropTop,    0x54BB, 2, KaxTrackVideo, "VideoPixelCropTop", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxVideoPixelCropLeft,   0x54CC, 2, KaxTrackVideo, "VideoPixelCropLeft", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxVideoPixelCropRight,  0x54DD, 2, KaxTrackVideo, "VideoPixelCropRight", 0);
+DEFINE_MKX_UINTEGER    (KaxVideoDisplayWidth,    0x54B0, 2, KaxTrackVideo, "VideoDisplayWidth");
+DEFINE_MKX_UINTEGER    (KaxVideoDisplayHeight,   0x54BA, 2, KaxTrackVideo, "VideoDisplayHeight");
+DEFINE_MKX_BINARY      (KaxVideoColourSpace,   0x2EB524, 3, KaxTrackVideo, "VideoColourSpace");
+DEFINE_MKX_FLOAT       (KaxVideoFrameRate,     0x2383E3, 3, KaxTrackVideo, "VideoFrameRate");
 #if MATROSKA_VERSION >= 2
-EbmlId KaxVideoFlagInterlaced_TheId (0x9A, 1);
-EbmlId KaxVideoStereoMode_TheId     (0x53B9, 2);
-EbmlId KaxVideoDisplayUnit_TheId    (0x54B2, 2);
-EbmlId KaxVideoAspectRatio_TheId    (0x54B3, 1);
-EbmlId KaxVideoGamma_TheId          (0x2FB523, 3);
-#endif // MATROSKA_VERSION
-
-const EbmlCallbacks KaxTrackVideo::ClassInfos(KaxTrackVideo::Create, KaxTrackVideo_TheId, "TrackAudio", KaxTrackVideo_Context);
-const EbmlCallbacks KaxVideoPixelWidth::ClassInfos(KaxVideoPixelWidth::Create, KaxVideoPixelWidth_TheId, "VideoPixelWidth", KaxVideoPixelWidth_Context);
-const EbmlCallbacks KaxVideoPixelHeight::ClassInfos(KaxVideoPixelHeight::Create, KaxVideoPixelHeight_TheId, "VideoPixelHeight", KaxVideoPixelHeight_Context);
-const EbmlCallbacks KaxVideoPixelCropBottom::ClassInfos(KaxVideoPixelCropBottom::Create, KaxVideoPixelCropBottom_TheId, "VideoPixelCropBottom", KaxVideoPixelCropBottom_Context);
-const EbmlCallbacks KaxVideoPixelCropTop::ClassInfos(KaxVideoPixelCropTop::Create, KaxVideoPixelCropTop_TheId, "VideoPixelCropTop", KaxVideoPixelCropTop_Context);
-const EbmlCallbacks KaxVideoPixelCropLeft::ClassInfos(KaxVideoPixelCropLeft::Create, KaxVideoPixelCropLeft_TheId, "VideoPixelCropLeft", KaxVideoPixelCropLeft_Context);
-const EbmlCallbacks KaxVideoPixelCropRight::ClassInfos(KaxVideoPixelCropRight::Create, KaxVideoPixelCropRight_TheId, "VideoPixelCropRight", KaxVideoPixelCropRight_Context);
-const EbmlCallbacks KaxVideoDisplayWidth::ClassInfos(KaxVideoDisplayWidth::Create, KaxVideoDisplayWidth_TheId, "VideoDisplayWidth", KaxVideoDisplayWidth_Context);
-const EbmlCallbacks KaxVideoDisplayHeight::ClassInfos(KaxVideoDisplayHeight::Create, KaxVideoDisplayHeight_TheId, "VideoDisplayHeight", KaxVideoDisplayHeight_Context);
-const EbmlCallbacks KaxVideoColourSpace::ClassInfos(KaxVideoColourSpace::Create, KaxVideoColourSpace_TheId, "VideoColourSpace", KaxVideoColourSpace_Context);
-const EbmlCallbacks KaxVideoFrameRate::ClassInfos(KaxVideoFrameRate::Create, KaxVideoFrameRate_TheId, "VideoFrameRate", KaxVideoFrameRate_Context);
-#if MATROSKA_VERSION >= 2
-const EbmlCallbacks KaxVideoFlagInterlaced::ClassInfos(KaxVideoFlagInterlaced::Create, KaxVideoFlagInterlaced_TheId, "VideoFlagInterlaced", KaxVideoFlagInterlaced_Context);
-const EbmlCallbacks KaxVideoStereoMode::ClassInfos(KaxVideoStereoMode::Create, KaxVideoStereoMode_TheId, "VideoStereoMode", KaxVideoStereoMode_Context);
-const EbmlCallbacks KaxVideoDisplayUnit::ClassInfos(KaxVideoDisplayUnit::Create, KaxVideoDisplayUnit_TheId, "VideoDisplayUnit", KaxVideoDisplayUnit_Context);
-const EbmlCallbacks KaxVideoAspectRatio::ClassInfos(KaxVideoAspectRatio::Create, KaxVideoAspectRatio_TheId, "VideoAspectRatio", KaxVideoAspectRatio_Context);
-const EbmlCallbacks KaxVideoGamma::ClassInfos(KaxVideoGamma::Create, KaxVideoGamma_TheId, "VideoGamma", KaxVideoGamma_Context);
-#endif // MATROSKA_VERSION
-
-KaxTrackVideo::KaxTrackVideo()
-	:EbmlMaster(KaxTrackVideo_Context)
-{}
+DEFINE_MKX_UINTEGER_DEF(KaxVideoFlagInterlaced,    0x9A, 1, KaxTrackVideo, "VideoFlagInterlaced", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxVideoStereoMode,      0x53B8, 2, KaxTrackVideo, "VideoStereoMode", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxVideoDisplayUnit,     0x54B2, 2, KaxTrackVideo, "VideoDisplayUnit", 0);
+DEFINE_MKX_UINTEGER_DEF(KaxVideoAspectRatio,     0x54B3, 2, KaxTrackVideo, "VideoAspectRatio", 0);
+DEFINE_MKX_FLOAT       (KaxVideoGamma,         0x2FB523, 3, KaxTrackVideo, "VideoGamma");
+#endif
 
-uint32 KaxVideoFrameRate::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault)
+filepos_t KaxVideoFrameRate::RenderData(IOCallback & output, bool bForceRender, bool bSaveDefault)
 {
 	assert(false); // no you are not allowed to use this element !
 	return 0;
diff --git a/src/KaxTracks.cpp b/src/KaxTracks.cpp
index 4fc79fa..81eeacf 100644
--- a/src/KaxTracks.cpp
+++ b/src/KaxTracks.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2005 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
@@ -40,68 +40,53 @@
 #include "matroska/KaxTrackVideo.h"
 #include "matroska/KaxContentEncoding.h"
 #include "matroska/KaxContexts.h"
+#include "matroska/KaxDefines.h"
 
 START_LIBMATROSKA_NAMESPACE
 
-const EbmlSemantic KaxTracks_ContextList[1] =
-{
-	EbmlSemantic(true, false, KaxTrackEntry::ClassInfos),
-};
+DEFINE_START_SEMANTIC(KaxTracks)
+DEFINE_SEMANTIC_ITEM(true, false, KaxTrackEntry)
+DEFINE_END_SEMANTIC(KaxTracks)
 
-#if MATROSKA_VERSION == 1
-const EbmlSemantic KaxTrackEntry_ContextList[22] =
-#else // MATROSKA_VERSION
-const EbmlSemantic KaxTrackEntry_ContextList[27] =
-#endif // MATROSKA_VERSION
-{
-	EbmlSemantic(true , true, KaxTrackNumber::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackUID::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackType::ClassInfos),
+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
-	EbmlSemantic(true , true, KaxTrackFlagEnabled::ClassInfos),
+DEFINE_SEMANTIC_ITEM(true, true, KaxTrackFlagEnabled)
 #endif // MATROSKA_VERSION
-	EbmlSemantic(true , true, KaxTrackFlagDefault::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackFlagForced::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackFlagLacing::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackMinCache::ClassInfos),
-	EbmlSemantic(false, true, KaxTrackMaxCache::ClassInfos),
-	EbmlSemantic(false, true, KaxTrackDefaultDuration::ClassInfos),
-	EbmlSemantic(true , true, KaxTrackTimecodeScale::ClassInfos),
-	EbmlSemantic(true , true, KaxMaxBlockAdditionID::ClassInfos),
-	EbmlSemantic(false, true, KaxTrackName::ClassInfos),
-	EbmlSemantic(false, true, KaxTrackLanguage::ClassInfos),
-	EbmlSemantic(true , true, KaxCodecID::ClassInfos),
-	EbmlSemantic(false, true, KaxCodecPrivate::ClassInfos),
-	EbmlSemantic(false, true, KaxCodecName::ClassInfos),
-	EbmlSemantic(false, true, KaxTrackAttachmentLink::ClassInfos),
+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
-	EbmlSemantic(false, true, KaxCodecSettings::ClassInfos),
-	EbmlSemantic(false, false,KaxCodecInfoURL::ClassInfos),
-	EbmlSemantic(false, false,KaxCodecDownloadURL::ClassInfos),
-	EbmlSemantic(true , true, KaxCodecDecodeAll::ClassInfos),
+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
-	EbmlSemantic(false, false,KaxTrackOverlay::ClassInfos),
-	EbmlSemantic(false, false,KaxTrackTranslate::ClassInfos),
-	EbmlSemantic(false, true, KaxTrackAudio::ClassInfos),
-	EbmlSemantic(false, true, KaxTrackVideo::ClassInfos),
-	EbmlSemantic(false, true, KaxContentEncodings::ClassInfos),
-};
-
-const EbmlSemanticContext KaxTracks_Context = EbmlSemanticContext(countof(KaxTracks_ContextList), KaxTracks_ContextList, &KaxSegment_Context, *GetKaxGlobal_Context, &KaxTracks::ClassInfos);
-const EbmlSemanticContext KaxTrackEntry_Context = EbmlSemanticContext(countof(KaxTrackEntry_ContextList), KaxTrackEntry_ContextList, &KaxTracks_Context, *GetKaxGlobal_Context, &KaxTrackEntry::ClassInfos);
+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)
 
-EbmlId KaxTracks_TheId    (0x1654AE6B, 4);
-EbmlId KaxTrackEntry_TheId(0xAE, 1);
-
-const EbmlCallbacks KaxTracks::ClassInfos(KaxTracks::Create, KaxTracks_TheId, "Tracks", KaxTracks_Context);
-const EbmlCallbacks KaxTrackEntry::ClassInfos(KaxTrackEntry::Create, KaxTrackEntry_TheId, "TrackEntry", KaxTrackEntry_Context);
-
-KaxTracks::KaxTracks()
-	:EbmlMaster(KaxTracks_Context)
-{}
+DEFINE_MKX_MASTER     (KaxTracks, 0x1654AE6B, 4, KaxSegment, "Tracks");
+DEFINE_MKX_MASTER_CONS(KaxTrackEntry,   0xAE, 1, KaxTracks, "TrackEntry");
 
-KaxTrackEntry::KaxTrackEntry()
-	:EbmlMaster(KaxTrackEntry_Context)
+KaxTrackEntry::KaxTrackEntry(EBML_EXTRA_DEF)
+	:EbmlMaster(EBML_CLASS_SEMCONTEXT(KaxTrackEntry) EBML_DEF_SEP EBML_EXTRA_CALL)
 	,bGlobalTimecodeScaleIsSet(false)
 {}
 
diff --git a/src/KaxVersion.cpp b/src/KaxVersion.cpp
index 6ed03d2..8900112 100644
--- a/src/KaxVersion.cpp
+++ b/src/KaxVersion.cpp
@@ -3,7 +3,7 @@
 **
 ** <file/class description>
 **
-** Copyright (C) 2002-2004 Steve Lhomme.  All rights reserved.
+** Copyright (C) 2002-2010 Steve Lhomme.  All rights reserved.
 **
 ** This file is part of libmatroska.
 **
diff --git a/test/Makefile b/test/Makefile
index 5d70369..479436e 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,10 +1,10 @@
-## libmatroska Makefile
-## (c) 2002 Steve Lhomme
-## This software is licensed under the LGPL, see LGPL.txt
-
-all: endian
-	echo "Making endianess tests"
-	(cd endian; make)
-clean:
-	echo "Cleaning all tests"
-	(cd endian; make $@)
+## libmatroska Makefile
+## (c) 2002 Steve Lhomme
+## This software is licensed under the LGPL, see LGPL.txt
+
+all: endian
+	echo "Making endianess tests"
+	(cd endian; make)
+clean:
+	echo "Cleaning all tests"
+	(cd endian; make $@)
diff --git a/test/ebml/Makefile b/test/ebml/Makefile
index 67f18ea..5e6658e 100644
--- a/test/ebml/Makefile
+++ b/test/ebml/Makefile
@@ -1,62 +1,62 @@
-# libmatroska core Makefile (used in cygwin)
-# $Id: Makefile 640 2004-07-09 21:05:36Z mosu $
-
-# Options
-EXTENSION=.cpp
-CXXFLAGS=-g -DDEBUG -Wall -Wno-unknown-pragmas -DWIN32 -I../../src/
-LDFLAGS=
-
-SRC_DIR=../../src/
-
-# Programs
-CXX=g++ -c
-LD=g++
-DEP=$(CXX) -MM
-DEPEND = makedepend
-AR = ar rcvu
-RANLIB = ranlib
-
-# Librarires
-INCLUDE=
-LIBS=
-
-# Names
-PROGRAM=test00
-
-# source-files
-sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
-
-# header files; replace .cxx extension with .h
-headers:=$(patsubst %$(EXTENSION),%.hpp,$(sources))
-
-# files holding dependency information; replace .cxx extension with .dep
-dependencies:=$(patsubst %$(EXTENSION),%.dep,$(sources))
-
-# object files; replace .cxx extension with .o
-objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
-
-OBJ=$(objects) test00.o
-
-DEPENDFLAGS  = ${CXXFLAGS} ${INCLUDE}
-
-# Build rules
-%.o: %$(EXTENSION)
-	$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $<
-
-$(PROGRAM): $(OBJ)
-#	$(AR) $@ $(objects)
-#	$(RANLIB) $@
-	$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
-	${LD} -o $@ ${LDFLAGS} ${OBJ} ${LIBS} ${EXTRA_LIBS}
-
-clean:
-	rm -f $(OBJ)
-	rm -f $(dependencies)
-	rm -f $(PROGRAM)
-	rm -f CORE
-
-# what are the source dependencies
-depend: $(sources)
-	$(DEPEND) $(DEPENDFLAGS) $(sources)
-
-# DO NOT DELETE
+# libmatroska core Makefile (used in cygwin)
+# $Id: Makefile 640 2004-07-09 21:05:36Z mosu $
+
+# Options
+EXTENSION=.cpp
+CXXFLAGS=-g -DDEBUG -Wall -Wno-unknown-pragmas -DWIN32 -I../../src/
+LDFLAGS=
+
+SRC_DIR=../../src/
+
+# Programs
+CXX=g++ -c
+LD=g++
+DEP=$(CXX) -MM
+DEPEND = makedepend
+AR = ar rcvu
+RANLIB = ranlib
+
+# Librarires
+INCLUDE=
+LIBS=
+
+# Names
+PROGRAM=test00
+
+# source-files
+sources:=$(wildcard ${SRC_DIR}*$(EXTENSION))
+
+# header files; replace .cxx extension with .h
+headers:=$(patsubst %$(EXTENSION),%.hpp,$(sources))
+
+# files holding dependency information; replace .cxx extension with .dep
+dependencies:=$(patsubst %$(EXTENSION),%.dep,$(sources))
+
+# object files; replace .cxx extension with .o
+objects:=$(patsubst %$(EXTENSION),%.o,$(sources))
+
+OBJ=$(objects) test00.o
+
+DEPENDFLAGS  = ${CXXFLAGS} ${INCLUDE}
+
+# Build rules
+%.o: %$(EXTENSION)
+	$(CXX) $(CXXFLAGS) $(INCLUDE) -o $@ $<
+
+$(PROGRAM): $(OBJ)
+#	$(AR) $@ $(objects)
+#	$(RANLIB) $@
+	$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
+	${LD} -o $@ ${LDFLAGS} ${OBJ} ${LIBS} ${EXTRA_LIBS}
+
+clean:
+	rm -f $(OBJ)
+	rm -f $(dependencies)
+	rm -f $(PROGRAM)
+	rm -f CORE
+
+# what are the source dependencies
+depend: $(sources)
+	$(DEPEND) $(DEPENDFLAGS) $(sources)
+
+# DO NOT DELETE
diff --git a/test/ebml/ebml.proj b/test/ebml/ebml.proj
index c2d2b99..94fe5bc 100644
--- a/test/ebml/ebml.proj
+++ b/test/ebml/ebml.proj
@@ -1,11 +1,11 @@
-#include "*/*.proj"
-
-CON ebml-test00
-{
-  SOURCE test00.cpp
-}
-
-CON ebml-test0
-{
-  SOURCE test0.cpp
-}
+#include "*/*.proj"
+
+CON ebml-test00
+{
+  SOURCE test00.cpp
+}
+
+CON ebml-test0
+{
+  SOURCE test0.cpp
+}
diff --git a/test/mux/mux.proj b/test/mux/mux.proj
index 46e309b..e46753c 100644
--- a/test/mux/mux.proj
+++ b/test/mux/mux.proj
@@ -1,11 +1,11 @@
-#include "*/*.proj"
-
-CON mux-test6
-{
-  SOURCE test6.cpp
-}
-
-CON mux-test8
-{
-  SOURCE test8.cpp
-}
+#include "*/*.proj"
+
+CON mux-test6
+{
+  SOURCE test6.cpp
+}
+
+CON mux-test8
+{
+  SOURCE test8.cpp
+}
diff --git a/test/tags/tags.proj b/test/tags/tags.proj
index 94415b7..10612dd 100644
--- a/test/tags/tags.proj
+++ b/test/tags/tags.proj
@@ -1,6 +1,6 @@
-#include "*/*.proj"
-
-CON tags-test9
-{
-  SOURCE tags.cpp
-}
+#include "*/*.proj"
+
+CON tags-test9
+{
+  SOURCE tags.cpp
+}
diff --git a/test/test.proj b/test/test.proj
index 4763b77..8af3a9a 100644
--- a/test/test.proj
+++ b/test/test.proj
@@ -1 +1 @@
-#include "*/*.proj"
+#include "*/*.proj"
diff --git a/test/utf8/utf8.proj b/test/utf8/utf8.proj
index 18843a4..6245d7e 100644
--- a/test/utf8/utf8.proj
+++ b/test/utf8/utf8.proj
@@ -1,6 +1,6 @@
-#include "*/*.proj"
-
-CON utf8-test5
-{
-  SOURCE test5.cpp
-}
+#include "*/*.proj"
+
+CON utf8-test5
+{
+  SOURCE test5.cpp
+}

-- 
libmatroska packaging



More information about the pkg-multimedia-commits mailing list