Index: /code/branches/audio/CMakeLists.txt
===================================================================
--- /code/branches/audio/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/CMakeLists.txt	(revision 310)
@@ -0,0 +1,59 @@
+PROJECT(Orxonox)
+
+#set some global variables, which are use throughout the project
+
+#Create some verbose output
+SET(CMAKE_VERBOSE_MAKEFILE TRUE)
+
+# set eNet search path
+SET(Boost_INCLUDE_DIR "/usr/include/boost/")
+
+#force-set the compile on tardis machines, as default points to g++-3.3
+# only run this test on a lunix/unix machine
+IF (UNIX)
+  FIND_PROGRAM(UNAME_CMD "uname"
+	PATHS "/usr/bin /bin")
+  IF(NOT UNAME_CMD)
+	MESSAGE("Unable to find uname. Tardis-Check cannot be done.")
+  ENDIF(NOT UNAME_CMD)
+  EXECUTE_PROCESS(
+	COMMAND "${UNAME_CMD}" "-n"
+	RESULT_VARIABLE UNAME_RV
+	ERROR_VARIABLE UNAME_EV
+	OUTPUT_VARIABLE UNAME_OV)
+
+  IF (NOT "${UNAME_RV}" STREQUAL "0")
+	MESSAGE("ERROR: uname terminated unclean.")
+  ENDIF (NOT "${UNAME_RV}" STREQUAL "0")
+# check wheter we are on a tardis INCLUDEmachine
+  IF ("${UNAME_OV}" MATCHES "tardis")
+    SET (IS_TARDIS "tardis")
+  ENDIF ("${UNAME_OV}" MATCHES "tardis")
+  # if on tardis change compiler
+  IF (IS_TARDIS)
+  MESSAGE("System is a TARDIS: Setting Compiler to g++-3.4.3")
+  SET(CMAKE_CXX_COMPILER "g++-3.4.3")
+# reset eNet serach path
+  SET(Boost_INCLUDE_DIR "/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1")
+  ENDIF(IS_TARDIS)
+ENDIF (UNIX)
+
+
+#This sets where to look for "Find*.cmake" files
+SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+#Performs the search and sets the variables
+FIND_PACKAGE(OGRE)
+FIND_PACKAGE(OIS)
+FIND_PACKAGE(CEGUI)
+FIND_PACKAGE(CEGUI_OGRE)
+FIND_PACKAGE(ENet)
+FIND_PACKAGE(Boost)
+
+#Sets the search paths for the linking
+LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${Boost_LIBRARY_DIRS} core objects loader network weapon classHierarchy)
+#Sets the search path for include files
+INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS})
+
+#add main source dir
+ADD_SUBDIRECTORY(src)
+
Index: /code/branches/audio/INSTALL
===================================================================
--- /code/branches/audio/INSTALL	(revision 310)
+++ /code/branches/audio/INSTALL	(revision 310)
@@ -0,0 +1,13 @@
+Here our installing directions
+
+requirements:
+ogre-1.4.5
+ois-1.0
+cegui-0.5.0b
+enet-1.1
+boost-1.34.1
+cmake-2.4.7
+(all named version were tested. lower version requirement may be possible)
+
+
+Further information about installing and running this application can be found on http://www.orxonox.net/wiki/Running
Index: /code/branches/audio/LICENSE
===================================================================
--- /code/branches/audio/LICENSE	(revision 310)
+++ /code/branches/audio/LICENSE	(revision 310)
@@ -0,0 +1,344 @@
+
+        GNU GENERAL PUBLIC LICENSE
+           Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+          Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, 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 or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+        GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+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 give any other recipients of the Program a copy of this License
+along with the Program.
+
+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 Program or any portion
+of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+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 Program, 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 Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) 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; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, 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 executable.  However, as a
+special exception, the source code 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.
+
+If distribution of executable or 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 counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program 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.
+
+  5. 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 Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program 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 to
+this License.
+
+  7. 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 Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program 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 Program.
+
+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.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program 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.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the 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 Program
+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 Program does not specify a
+version number of this License, you may choose any version ever
+published by the Free Software Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, 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
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE PROGRAM "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
+PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  12. 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 PROGRAM 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
+PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 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 Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+  To do so, attach the following notices to the program.  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 program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: /code/branches/audio/Media/fonts/read_me.html
===================================================================
--- /code/branches/audio/Media/fonts/read_me.html	(revision 310)
+++ /code/branches/audio/Media/fonts/read_me.html	(revision 310)
@@ -0,0 +1,2 @@
+<html><head><title>Larabie Fonts "read me" file, license and FAQ</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta name="keywords" content="typodermic,typo dermic,fonts,Larabie,Larabie Fonts,fontd,fotn,fnots,fons,fots,fnts,font,truetype,typefaces,typeface,logo,ttf,opentype,larbie,laribie,larby,larabee,lairby,larrabie,larraby,laraby,typography,Type1,postscript,macintosh,windows,design,lettering,type"><font face="Georgia"><h3>LARABIE FONTS README.TXT</h3><p>All Larabie Fonts in this file are free to use for personal and/or commercial purposes. No payment is necessary to use these fonts for personal or commercial use. For Software Products who want to include Larabie Fonts see the License Agreement below. You can add this font to a website but do not combine fonts into a single archive or alter them in any way.</p><p>All Larabie Fonts are free for commercial use but a sample of your product would be gratefully appreciated so I can see how the font looks in use. Contact <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a> for mailing information.</p><p>Some Larabie Fonts have enhanced and expanded families available for sale at <a href="http://www.typodermic.com">www.typodermic.com</a>.</p><p>If you'd like to make a voluntary donation to Larabie Fonts for the use of the free fonts in any amount please go to <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a></p><p>I accept CDs, magazines, t-shirts, a sample of your merchandise or anything featuring Larabie Fonts. Please remember to list your item as a gift on the customs form or I will have to pay import duties and taxes on the item. Mailing information is provided at the link above.</p><p>Font installation help is available at <a href="http://www.larabiefonts.com/help.html">www.larabiefonts.com/help.html</a></p><h3>LARABIE FONTS FREQUENTLY ASKED QUESTIONS</h3><ul><li>Q: How do use these fonts in my favourite software?<li>A: In Windows, you take the fonts out of the ZIP archive and place them in your fonts folder which can be found in your Control Panel. The next time you run your software, the font will be available. For example: If you install a new font, the next time you run Microsoft Word, that font will be available in the menu under Format / Font. For anything more complicated, or Mac installation, visit <a href="http://www.larabiefonts.com/help.html">www.larabiefonts.com/help.html</a></ul><ul><li>Q: How can I use this font in <a href="http://www.aol.com/aim/">AOL Instant Messenger</a>, <a href="http://messenger.msn.com/">MSN Messenger</a>, <a href="http://www.microsoft.com/office/outlook/">Outlook</a>, <a href="http://www.microsoft.com/office/outlook/">Outlook Express</a>, <a href="http://www.eudora.com/">Euodora</a> or any other email software?<li>A: At the time of this writing (Feb 2004) you cant. After installing one of my fonts, you may be able to select it in the above applications but the person at the other end wont see that same thing unless they have the font installed. If you really want to use my fonts in these applications, make sure the people at the other end have the same fonts installed.</ul><ul><li>Q: How can I use these fonts on a web page?<li>A: If youre creating a web page using Flash, its easy. Consult your Flash manual. If youre using <a href="http://www.adobe.com/products/acrobat/">Acrobat</a>, make sure the font embedding settings are turned on. Consult your Acrobat manual. For anything else there are limitations: If you want to use one of my fonts as your main, text font youre pretty much out of luck unless you explore a font embedding tool such as <a href="http://www.microsoft.com/typography/web/embedding/weft/">WEFT</a> but I dont recommend it. To use my fonts as headings or titles, use image creation software such as <a href="http://www.gimp.org/">The Gimp</a>, <a href="http://www.adobe.com/products/photoshop/">Photoshop</a>, <a href="http://www.jasc.com/">Paint Shop Pro</a>, <a href="http://www.google.com/search?q=pixia">Pixia</a> etc. Save the images as GIF files and place them on your web page. Theres a lot more to it than can be explained here but there are countless books available on web page design.</ul><ul><li>Q: How can I make these fonts bigger?<li>A: All my fonts are infinitely scalable; the limitations are in your software. A common problem is scaling fonts in Microsoft Word. If you choose Format / Font you can type in any number you like under size.</ul><ul><li>Q: Are these fonts really free?<li>A: Yes they are. Some fonts such as <a href="http://www.typodermic.com/fonts/19.html">Neuropol</a> have expanded font families available for sale at <a href="http://www.typodermic.com">www.typodermic.com</a> but the version you downloaded at Larabie Fonts is free.</ul><ul><li>Q: Your licence agreement states that the fonts cant be altered. Does that mean I cant mess around with your fonts in Photoshop/Illustrator/Publisher etc?<li>A: Those license restrictions refer to altering the actual fonts themselves, not what you make with them. As long as you dont alter the font files in font creation software such as FontLab or Fontographer youre free to create anything you like with them.</ul><ul><li>Q: Can I use your fonts in a logo?<li>A: Yes. But check with a lawyer if youre not sure. Its okay with me if you use it but do so at your own risk.</ul><ul><li>Q: Can I send you a sample of the nifty thing I created with your fonts?<li>A: Of course. Check <a href="http://www.larabiefonts.com/donation.html">www.larabiefonts.com/donation.html</a> for my current email or mailing address.</ul><ul><li>Q: Can you make a custom font for me?<li>A: Possibly. Check <a href="http://typodermic.com/custom.html">typodermic.com/custom.html</a> for details. Keep in mind that making fonts is my full-time job so no freebies.</ul><ul><li>Q: I want to sell software that includes you font files.<li>A: Contact me first at <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</ul><ul><li>Q: I want to sell rubber stamp alphabets, alphabet punches or stencil alphabets using your font designs.<li>A: Contact me first at <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</ul><ul><li>Q: My software wont let me embed one of your fonts.<li>A: You may have an old version of one of my fonts. Uninstall it and install a current version on Larabie Fonts.</ul><ul><li>Q: Can you help me find a font?<li>A: I really dont have the time but if you send a donation, I can give it a try. If not. post your question on my font forum: <a href="http://www.larabiefonts.com/info.html">www.larabiefonts.com/info.html</a>.</ul><h3>LARABIE FONTS END-USER LICENSE AGREEMENT FOR SOFTWARE PRODUCTS</h3><h4>SOFTWARE PRODUCT LICENSE</h4><p>The SOFTWARE PRODUCT is protected by copyright laws and International copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold.</p><h5>1. GRANT OF LICENSE. This document grants you the following rights:</h5><p>- Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT.  You may copy and distribute unlimited copies of the SOFTWARE PRODUCT as you receive them, in any medium, provided that you publish on each copy an appropriate copyright notice. Keep intact all the notices that refer to this License and give any other recipients of the fonts a copy of this License along with the fonts.</p><h5>2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.</h5><p>- You may modify your copy or copies of the SOFTWARE PRODUCT or any portion of it, provided that you also meet all of these rules:</p><p>a) Do not alter in any way alphanumeric characters (A-Z, a-z, 1-9) contained in the font. An exception is converting between formats, here is allowed the nominal distortion that occurs during conversion from second order to third order quadratic curves (TrueType to Postscript) and vice versa.</p><p>b) Extra characters may be added; here it is allowed to use curves (shapes) from alphanumeric characters in fonts under same license.</p><p>c) It is allowed to modify and remove analpahbetics (punctuation, special characters, ligatures and symbols).</p><p>d) The original font name must be retained but can be augmented. (ie. a Font named Blue Highway can be renamed Blue Highway Cyrillic or Blue Highway ANSI, etc.)</p><p>e) Character mapping may be altered.</p><p>f) If the kerning information is altered or discarded it must be stated in the user notes or documentation.</p><p>g) All modifications must be released under this license.</p></p>LIMITED WARRANTY NO WARRANTIES. Larabie Fonts expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you.</p><p>NO LIABILITY FOR CONSEQUENTIAL DAMAGES. In no event shall Larabie Fonts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if Larabie Fonts has been advised of the possibility of such damages.</p><h5>3. MISCELLANEOUS</h5><p>Should you have any questions concerning this document, or if you desire to contact Larabie Fonts for any reason, please email <a href="http://www.larabiefonts.com/email.html">www.larabiefonts.com/email.html</a>.</p></font></BODY></HTML>
+
Index: /code/branches/audio/Media/fonts/sample.fontdef
===================================================================
--- /code/branches/audio/Media/fonts/sample.fontdef	(revision 310)
+++ /code/branches/audio/Media/fonts/sample.fontdef	(revision 310)
@@ -0,0 +1,11 @@
+StarWars
+{
+	// Now this one I agree with ;)
+	// A Star Wars font :)
+	type 		truetype
+	source 		solo5.ttf
+	size 		16
+	resolution 	96
+}
+
+
Index: /code/branches/audio/Media/gui/CompositorDemo.layout
===================================================================
--- /code/branches/audio/Media/gui/CompositorDemo.layout	(revision 310)
+++ /code/branches/audio/Media/gui/CompositorDemo.layout	(revision 310)
@@ -0,0 +1,182 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+
+	<Window Type="DefaultGUISheet" Name="debug_overlay">
+		<Property Name="AlwaysOnTop" Value="True" />
+		<Property Name="Disabled" Value="True" />
+		
+		<Window Type="TaharezLook/StaticText" Name="Panel 1">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0.83,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.17,0}}" />
+			<Property Name="TopLeftFrameImage" Value="set:OgreGuiImagery image:BoxTopLeft" />
+			<Property Name="TopRightFrameImage" Value="set:OgreGuiImagery image:BoxTopRight" />
+			<Property Name="BottomLeftFrameImage" Value="set:OgreGuiImagery image:BoxBottomLeft" />
+			<Property Name="BottomRightFrameImage" Value="set:OgreGuiImagery image:BoxBottomRight" />
+			<Property Name="LeftFrameImage" Value="set:OgreGuiImagery image:BoxLeft" />
+			<Property Name="TopFrameImage" Value="set:OgreGuiImagery image:BoxTop" />
+			<Property Name="RightFrameImage" Value="set:OgreGuiImagery image:BoxRight" />
+			<Property Name="BottomFrameImage" Value="set:OgreGuiImagery image:BoxBottom" />
+			<Property Name="BackgroundImage" Value="set:OgreGuiImagery image:BoxBack" />
+			<Property Name="Alpha" Value="0.9" />
+			<Property Name="InheritsAlpha" Value="False" />
+	
+			<Window Type="TaharezLook/StaticText" Name="OPCurrentFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.12,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.85,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+				<Property Name="HorzFormatting" Value="HorzCentred" />
+				<Property Name="Text" Value="Current FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticImage" Name="OPBar1">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.27,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.6,0},{0.025,0}}" />
+				<Property Name="Image" Value="set:OgreGuiImagery image:Bar" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPAverageFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.32,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Average FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPWorstFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.45,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Worst FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPBestFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.58,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Best FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPTriCount">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.71,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Triangle Count: " />
+			</Window>
+
+		</Window>
+
+		<Window Type="TaharezLook/StaticText" Name="OPDebugMsg">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="Font" Value="BlueHighway-10" />
+			<Property Name="UnifiedPosition" Value="{{0.25,0},{0.93,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.65,0},{0.07,0}}" />
+			<Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+			<Property Name="InheritsAlpha" Value="False" />
+			<Property Name="VertFormatting" Value="VertCentred" />
+			<Property Name="HorzFormatting" Value="WordWrapCentred" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="OgreLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9,0},{0.95,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.1,0},{0.05,0}}" />
+			<Property Name="Image" Value="set:OgreGuiImagery image:OgreLogo" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="CeguiLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9125,0},{0.9115,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.075,0},{0.0385,0}}" />
+			<Property Name="Image" Value="set:OgreGuiImagery image:CeguiLogo" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+	</Window>
+
+	<Window Type="DefaultGUISheet" Name="CompositorDemo">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}" />
+
+
+		<Window Type="TaharezLook/StaticText" Name="HelpTxt">
+			<Property Name="UnifiedPosition" Value="{{0.6,0},{0.8,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="Text" Value="Use the Combo boxes to select a shader and a model" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+		
+		<Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.16,0},{0.22,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.16,0},{0.75,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.16,0},{0.3,0}}" />
+			<Property Name="Text" Value="Compositors" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/Button" Name="ExitDemoBtn">
+				<Property Name="VerticalAlignment" Value="Bottom" />
+				<Property Name="HorizontalAlignment" Value="Centre" />
+				<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Exit Demo" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+		</Window>
+		<Window Type="TaharezLook/FrameWindow" Name="DebugRTTs">
+			<Property Name="RollUpState" Value="True" />
+			<Property Name="UnifiedPosition" Value="{{0.70,0},{0,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.3,0},{0.3,0}}" />
+			<Property Name="Text" Value="Debug RTTs" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/Listbox" Name="DebugRTTListbox">
+				<Property Name="UnifiedPosition" Value="{{0.02,0},{0.1,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.1,0},{0.25,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.1,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.1,0},{0.25,0}}" />
+			</Window>
+			<Window Type="TaharezLook/StaticImage" Name="DebugRTTImage">
+				<Property Name="UnifiedPosition" Value="{{0.36,0},{0.1,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+			</Window>
+		</Window>
+	</Window>
+
+
+</Window>
+
+</GUILayout>
Index: /code/branches/audio/Media/gui/CompositorDemoCegui.config
===================================================================
--- /code/branches/audio/Media/gui/CompositorDemoCegui.config	(revision 310)
+++ /code/branches/audio/Media/gui/CompositorDemoCegui.config	(revision 310)
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<CEGUIConfig
+	Scheme="TaharezLookSkin.scheme"
+	Layout="CompositorDemo.layout"
+	DefaultFont="BlueHighway-12"
+/>
Index: /code/branches/audio/Media/gui/CrowdDemo.layout
===================================================================
--- /code/branches/audio/Media/gui/CrowdDemo.layout	(revision 310)
+++ /code/branches/audio/Media/gui/CrowdDemo.layout	(revision 310)
@@ -0,0 +1,201 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="root" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="DefaultWindow" Name="debug_overlay" >
+            <Property Name="Disabled" Value="True" />
+            <Property Name="AlwaysOnTop" Value="True" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/StaticText" Name="Panel 1" >
+                <Property Name="Alpha" Value="0.9" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.83,0},{0.23,0},{1,0}}" />
+                <Window Type="TaharezLook/StaticText" Name="OPCurrentFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Current FPS: " />
+                    <Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="HorzFormatting" Value="HorzCentred" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.12,0},{0.925,0},{0.37,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticImage" Name="OPBar1" >
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.27,0},{0.8,0},{0.295,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPAverageFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Average FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.32,0},{1.075,0},{0.57,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPWorstFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Worst FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.45,0},{1.075,0},{0.7,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPBestFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Best FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.58,0},{1.075,0},{0.83,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPTriCount" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Triangle Count: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.71,0},{1.075,0},{0.96,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="OPDebugMsg" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.93,0},{0.9,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="OgreLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9,0},{0.95,0},{1,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="CeguiLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9125,0},{0.9115,0},{0.9875,0},{0.95,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+        </Window>
+        <Window Type="DefaultWindow" Name="InstancingDemo" >
+            <Property Name="Font" Value="BlueHighway-8" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin" >
+                <Property Name="Text" Value="Techniques" />
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="TitlebarFont" Value="BlueHighway-12" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TitlebarEnabled" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{-0.00292969,0},{0.00381679,1.25081e-037},{0.331094,0},{0.464121,1.25081e-037}}" />
+                <Property Name="CloseButtonEnabled" Value="False" />
+                <Window Type="TaharezLook/RadioButton" Name="tInstancing" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Instancing" />
+                    <Property Name="Selected" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.055847,0},{0.10764,0},{0.973986,0},{0.187074,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tIndependantEntities" >
+                    <Property Name="ID" Value="1" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+					<Property Name="Text" Value="Independent Entities" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.055847,0},{0.172136,0},{0.962291,0},{0.265333,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="Shadows" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Shadows on/off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.475788,0},{1.05,0},{0.579744,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Object Count:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0880073,0},{0.263737,0},{0.382815,0},{0.369793,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Number" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="160" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.388902,0},{0.277557,0},{0.631087,0},{0.364265,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Object Count" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.39,0},{0.95,0},{0.441213,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="CPU occupation:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.59802,0},{0.427339,0},{0.680451,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Value" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="0 ms" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.415811,0},{0.599679,0},{0.640395,0},{0.686178,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Time Burner" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.687236,0},{0.95,0},{0.74726,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="PostEffect" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Post Effect On/Off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0470764,0},{0.765568,0},{0.892124,0},{0.82884,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="ExitDemoBtn" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Exit Demo" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{-0.0526254,0},{-0.063219,0},{0.277375,0},{-4.06504e-005,0}}" />
+                    <Property Name="VerticalAlignment" Value="Bottom" />
+                    <Property Name="HorizontalAlignment" Value="Centre" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: /code/branches/audio/Media/gui/Falagard.xsd
===================================================================
--- /code/branches/audio/Media/gui/Falagard.xsd	(revision 310)
+++ /code/branches/audio/Media/gui/Falagard.xsd	(revision 310)
@@ -0,0 +1,391 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="Falagard" type="falagardSpecificationType" />
+	<xsd:complexType name="falagardSpecificationType">
+		<xsd:sequence>
+			<xsd:element name="WidgetLook" type="widgetLookType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+	</xsd:complexType>
+	<xsd:complexType name="widgetLookType">
+		<xsd:sequence>
+            <xsd:element name="PropertyDefinition" type="propertyDefinitionType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="PropertyLinkDefinition" type="propertyLinkDefinitionType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="NamedArea" type="namedAreaType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Child" type="widgetComponentType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="ImagerySection" type="imagerySectionType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="StateImagery" type="stateType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="propertyDefinitionType">
+        <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" />
+        <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" />
+    </xsd:complexType>
+    <xsd:complexType name="propertyLinkDefinitionType">
+        <xsd:attribute name="type" type="propertyTypeEnum" use="optional" default="Generic" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="widget" type="xsd:string" use="required" />
+        <xsd:attribute name="targetProperty" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="initialValue" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="layoutOnWrite" type="xsd:boolean" use="optional" default="false" />
+        <xsd:attribute name="redrawOnWrite" type="xsd:boolean" use="optional" default="false" />
+    </xsd:complexType>
+    <xsd:complexType name="namedAreaType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+        </xsd:sequence>
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="stateType">
+		<xsd:sequence>
+			<xsd:element name="Layer" type="layerType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+        <xsd:attribute name="clipped" type="xsd:boolean" use="optional" default="true" />
+	</xsd:complexType>
+	<xsd:complexType name="layerType">
+		<xsd:sequence>
+			<xsd:element name="Section" type="sectionSpecType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="priority" type="xsd:integer" use="optional" default="0" />
+	</xsd:complexType>
+    <xsd:complexType name="sectionSpecType">
+        <xsd:choice  minOccurs="0" maxOccurs="1">
+            <xsd:element name="Colour" type="colourType" />
+            <xsd:element name="Colours" type="colourRectType" />
+            <xsd:element name="ColourProperty" type="settingByPropertyType" />
+            <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+        </xsd:choice>
+        <xsd:attribute name="look" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="section" type="xsd:string" use="required" />
+        <xsd:attribute name="controlProperty" type="xsd:string" use="optional" default="" />
+    </xsd:complexType>
+	<xsd:complexType name="imagerySectionType">
+		<xsd:sequence>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:element name="FrameComponent" type="frameComponentType" minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="ImageryComponent" type="imageryComponentType" minOccurs="0" maxOccurs="unbounded" />
+            <xsd:element name="TextComponent" type="textComponentType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="frameComponentType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+            <xsd:element name="Image" type="frameImageType" minOccurs="0" maxOccurs="9" />
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+    <xsd:complexType name="textComponentType">
+        <xsd:sequence>
+            <xsd:element name="Area" type="componentAreaType" />
+            <xsd:element name="Text" type="textStringType" minOccurs="0" maxOccurs="1" />
+            <xsd:element name="TextProperty" type="textPropertyType" minOccurs="0" maxOccurs="1" />
+            <xsd:element name="FontProperty" type="fontPropertyType" minOccurs="0" maxOccurs="1" />
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertTextFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzTextFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+        </xsd:sequence>
+    </xsd:complexType>
+	<xsd:complexType name="imageryComponentType">
+		<xsd:sequence>
+			<xsd:element name="Area" type="componentAreaType" />
+            <xsd:choice>
+                <xsd:element name="Image" type="imageType" />
+                <xsd:element name="ImageProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="Colour" type="colourType" />
+                <xsd:element name="Colours" type="colourRectType" />
+                <xsd:element name="ColourProperty" type="settingByPropertyType" />
+                <xsd:element name="ColourRectProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="VertFormat" type="vertFormatType" />
+                <xsd:element name="VertFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+            <xsd:choice  minOccurs="0" maxOccurs="1">
+                <xsd:element name="HorzFormat" type="horzFormatType" />
+                <xsd:element name="HorzFormatProperty" type="settingByPropertyType" />
+            </xsd:choice>
+		</xsd:sequence>
+	</xsd:complexType>
+	<xsd:complexType name="widgetComponentType">
+		<xsd:sequence>
+			<xsd:element name="Area" type="componentAreaType" />
+			<xsd:element name="VertAlignment" type="vertAlignmentType" minOccurs="0" maxOccurs="1" />
+			<xsd:element name="HorzAlignment" type="horzAlignmentType" minOccurs="0" maxOccurs="1" />
+			<xsd:element name="Property" type="propertyType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="type" type="xsd:string" use="required" />
+		<xsd:attribute name="nameSuffix" type="xsd:string" use="required" />
+		<xsd:attribute name="renderer" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="look" type="xsd:string" use="optional" default="" />
+	</xsd:complexType>
+	<xsd:complexType name="horzFormatType">
+		<xsd:attribute name="type" type="horzFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertFormatType">
+		<xsd:attribute name="type" type="vertFormatEnum" use="required" />
+	</xsd:complexType>
+        <xsd:complexType name="horzTextFormatType">
+		<xsd:attribute name="type" type="horzTextFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertTextFormatType">
+		<xsd:attribute name="type" type="vertTextFormatEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="horzAlignmentType">
+		<xsd:attribute name="type" type="horzAlignmentEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="vertAlignmentType">
+		<xsd:attribute name="type" type="vertAlignmentEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="propertyType">
+		<xsd:attribute name="name" type="xsd:string" use="required" />
+		<xsd:attribute name="value" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="imageType">
+		<xsd:attribute name="imageset" type="xsd:string" use="required" />
+		<xsd:attribute name="image" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="frameImageType">
+        <xsd:attribute name="type" type="frameImageComponentEnum" use="required" />
+        <xsd:attribute name="imageset" type="xsd:string" use="required" />
+        <xsd:attribute name="image" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="componentAreaType">
+        <xsd:choice>
+            <xsd:sequence>
+                <xsd:element name="Dim" type="dimensionType" minOccurs="4" maxOccurs="4" />
+            </xsd:sequence>
+            <xsd:element name="AreaProperty" type="settingByPropertyType" />
+        </xsd:choice>
+	</xsd:complexType>
+	<xsd:complexType name="dimensionType">
+		<xsd:choice>
+			<xsd:element name="UnifiedDim" type="unifiedDimType" />
+			<xsd:element name="AbsoluteDim" type="absoluteDimType" />
+			<xsd:element name="ImageDim" type="imageDimType" />
+            <xsd:element name="WidgetDim" type="widgetDimType" />
+            <xsd:element name="FontDim" type="fontDimType" />
+            <xsd:element name="PropertyDim" type="propertyDimType" />
+		</xsd:choice>
+		<xsd:attribute name="type" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="fontDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+        <xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="font" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="string" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="type" type="fontMetricTypeEnum" use="required" />
+        <xsd:attribute name="padding" type="xsd:decimal" use="optional" default="0" />
+    </xsd:complexType>
+    <xsd:complexType name="propertyDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+        <xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="unifiedDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="scale" type="xsd:decimal" use="optional" default="0" />
+		<xsd:attribute name="offset" type="xsd:integer" use="optional" default="0" />
+		<xsd:attribute name="type" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="absoluteDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="value" type="xsd:decimal" use="optional" default="0" />
+	</xsd:complexType>
+	<xsd:complexType name="imageDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="imageset" type="xsd:string" use="required" />
+		<xsd:attribute name="image" type="xsd:string" use="required" />
+		<xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="widgetDimType">
+        <xsd:sequence>
+            <xsd:element name="DimOperator" type="dimensionOperatorType" minOccurs="0" maxOccurs="1" />
+        </xsd:sequence>
+		<xsd:attribute name="widget" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="dimension" type="dimensionTypeEnum" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="settingByPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+	<xsd:complexType name="colourRectType">
+		<xsd:attribute name="topLeft" type="colourValType" use="required" />
+		<xsd:attribute name="topRight" type="colourValType" use="required" />
+		<xsd:attribute name="bottomLeft" type="colourValType" use="required" />
+		<xsd:attribute name="bottomRight" type="colourValType" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="colourType">
+		<xsd:attribute name="colour" type="colourValType" use="required" />
+	</xsd:complexType>
+	<xsd:simpleType name="colourValType">
+		<xsd:restriction base="xsd:string">
+			<xsd:pattern value="[a-fA-F0-9]{8}" />
+		</xsd:restriction>
+	</xsd:simpleType>
+    <xsd:complexType name="textStringType">
+        <xsd:attribute name="string" type="xsd:string" use="optional" default="" />
+        <xsd:attribute name="font" type="xsd:string" use="optional" default="" />
+    </xsd:complexType>
+    <xsd:complexType name="textPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+    <xsd:complexType name="fontPropertyType">
+        <xsd:attribute name="name" type="xsd:string" use="required" />
+    </xsd:complexType>
+    <xsd:complexType name="dimensionOperatorType">
+        <xsd:choice>
+            <xsd:element name="UnifiedDim" type="unifiedDimType" />
+            <xsd:element name="AbsoluteDim" type="absoluteDimType" />
+            <xsd:element name="ImageDim" type="imageDimType" />
+            <xsd:element name="WidgetDim" type="widgetDimType" />
+            <xsd:element name="FontDim" type="fontDimType" />
+            <xsd:element name="PropertyDim" type="propertyDimType" />
+        </xsd:choice>
+        <xsd:attribute name="op" type="dimensionOperatorEnum" use="required" />
+    </xsd:complexType>
+	<xsd:simpleType name="dimensionTypeEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftEdge" />
+			<xsd:enumeration value="TopEdge" />
+			<xsd:enumeration value="RightEdge" />
+			<xsd:enumeration value="BottomEdge" />
+			<xsd:enumeration value="XPosition" />
+			<xsd:enumeration value="YPosition" />
+			<xsd:enumeration value="Width" />
+			<xsd:enumeration value="Height" />
+			<xsd:enumeration value="XOffset" />
+			<xsd:enumeration value="YOffset" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="vertFormatEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="TopAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="BottomAligned" />
+			<xsd:enumeration value="Stretched" />
+			<xsd:enumeration value="Tiled" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="horzFormatEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="RightAligned" />
+			<xsd:enumeration value="Stretched" />
+			<xsd:enumeration value="Tiled" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="vertAlignmentEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="TopAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="BottomAligned" />
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:simpleType name="horzAlignmentEnum">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="LeftAligned" />
+			<xsd:enumeration value="CentreAligned" />
+			<xsd:enumeration value="RightAligned" />
+		</xsd:restriction>
+	</xsd:simpleType>
+    <xsd:simpleType name="horzTextFormatEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="LeftAligned" />
+            <xsd:enumeration value="RightAligned" />
+            <xsd:enumeration value="CentreAligned" />
+            <xsd:enumeration value="Justified" />
+            <xsd:enumeration value="WordWrapLeftAligned" />
+            <xsd:enumeration value="WordWrapRightAligned" />
+            <xsd:enumeration value="WordWrapCentreAligned" />
+            <xsd:enumeration value="WordWrapJustified" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="vertTextFormatEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="TopAligned" />
+            <xsd:enumeration value="BottomAligned" />
+            <xsd:enumeration value="CentreAligned" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="propertyTypeEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Generic" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="fontMetricTypeEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="LineSpacing" />
+            <xsd:enumeration value="Baseline" />
+            <xsd:enumeration value="HorzExtent" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="dimensionOperatorEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Noop" />
+            <xsd:enumeration value="Add" />
+            <xsd:enumeration value="Subtract" />
+            <xsd:enumeration value="Multiply" />
+            <xsd:enumeration value="Divide" />
+        </xsd:restriction>
+    </xsd:simpleType>
+    <xsd:simpleType name="frameImageComponentEnum">
+        <xsd:restriction base="xsd:string">
+            <xsd:enumeration value="Background" />
+            <xsd:enumeration value="TopLeftCorner" />
+            <xsd:enumeration value="TopRightCorner" />
+            <xsd:enumeration value="BottomLeftCorner" />
+            <xsd:enumeration value="BottomRightCorner" />
+            <xsd:enumeration value="LeftEdge" />
+            <xsd:enumeration value="RightEdge" />
+            <xsd:enumeration value="TopEdge" />
+            <xsd:enumeration value="BottomEdge" />
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
Index: /code/branches/audio/Media/gui/Font.xsd
===================================================================
--- /code/branches/audio/Media/gui/Font.xsd	(revision 310)
+++ /code/branches/audio/Media/gui/Font.xsd	(revision 310)
@@ -0,0 +1,34 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="Font" type="FontType" />
+
+	<xsd:complexType name="FontType">
+		<xsd:sequence>
+			<xsd:element name="Mapping" type="MapType" maxOccurs="unbounded" minOccurs="0" />
+		</xsd:sequence>
+		<xsd:attributeGroup ref="FontAttrs" />
+	</xsd:complexType>
+	<xsd:complexType name="MapType">
+		<xsd:attribute name="Codepoint" type="xsd:nonNegativeInteger" use="required" />
+		<xsd:attribute name="Image" type="xsd:string" use="required" />
+		<xsd:attribute name="HorzAdvance" type="xsd:integer" use="optional" default="-1" />
+	</xsd:complexType>
+	<xsd:attributeGroup name="FontAttrs">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Type" use="required">
+			<xsd:simpleType>
+				<xsd:restriction base="xsd:string">
+					<xsd:enumeration value="FreeType" />
+					<xsd:enumeration value="Pixmap" />
+				</xsd:restriction>
+			</xsd:simpleType>
+		</xsd:attribute>
+		<xsd:attribute name="Size" type="xsd:nonNegativeInteger" use="optional" default="12" />
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+		<xsd:attribute name="AntiAlias" type="xsd:boolean" use="optional" default="true" />
+	</xsd:attributeGroup>
+</xsd:schema>
Index: /code/branches/audio/Media/gui/GUILayout.xsd
===================================================================
--- /code/branches/audio/Media/gui/GUILayout.xsd	(revision 310)
+++ /code/branches/audio/Media/gui/GUILayout.xsd	(revision 310)
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="GUILayout" type="GUILayoutType"/>
+	
+	<xsd:complexType name="GUILayoutType">
+		<xsd:sequence>
+			<xsd:element name="Window" type="WindowType" />
+		</xsd:sequence>
+		<xsd:attribute name="Parent" type="xsd:string" use="optional" default=""/>
+	</xsd:complexType>
+	
+	<xsd:complexType name="WindowType">
+		<xsd:sequence>
+			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element name="Window" type="WindowType" />
+				<xsd:element name="AutoWindow" type="AutoWindowType" />
+			</xsd:choice>
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Type" type="xsd:string" use="required"/>
+		<xsd:attribute name="Name" type="xsd:string" use="optional" default="" />
+	</xsd:complexType>
+
+	<xsd:complexType name="AutoWindowType">
+		<xsd:sequence>
+			<xsd:element name="LayoutImport" type="LayoutImportType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:element name="Event" type="EventType"  minOccurs="0" maxOccurs="unbounded" />
+			<xsd:choice minOccurs="0" maxOccurs="unbounded">
+				<xsd:element name="Window" type="WindowType" />
+				<xsd:element name="AutoWindow" type="AutoWindowType" />
+			</xsd:choice>
+			<xsd:element name="Property" type="PropertyType"  minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="NameSuffix" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+	<xsd:complexType name="PropertyType">
+		<xsd:simpleContent>
+			<xsd:extension base="xsd:string">
+				<xsd:attribute name="Name" type="xsd:string" use="required"/>
+				<xsd:attribute name="Value" type="xsd:string" use="optional"/>
+			</xsd:extension>
+		</xsd:simpleContent> 
+	</xsd:complexType>
+
+	<xsd:complexType name="LayoutImportType">
+		<xsd:attribute name="Filename" type="xsd:string" use="required"/>
+		<xsd:attribute name="Prefix" type="xsd:string" use="optional" default="" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+
+	<xsd:complexType name="EventType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="Function" type="xsd:string" use="required"/>
+	</xsd:complexType>
+
+</xsd:schema>
+
Index: /code/branches/audio/Media/gui/GUIScheme.xsd
===================================================================
--- /code/branches/audio/Media/gui/GUIScheme.xsd	(revision 310)
+++ /code/branches/audio/Media/gui/GUIScheme.xsd	(revision 310)
@@ -0,0 +1,54 @@
+<?xml version="1.0" ?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+	<xsd:element name="GUIScheme" type="SchemeType" />
+	<xsd:complexType name="SchemeType">
+        <xsd:choice minOccurs="0" maxOccurs="unbounded">
+			<xsd:element name="Imageset" type="NamedDataType" />
+            <xsd:element name="ImagesetFromImage" type="NamedDataType" />
+			<xsd:element name="Font" type="NamedDataType" />
+            <xsd:element name="LookNFeel" type="FileDataType" />
+			<xsd:element name="WindowSet" type="WindowSetType" />
+			<xsd:element name="WindowRendererSet" type="WindowRendererSetType" />
+			<xsd:element name="WindowAlias" type="WindowAliasType" />
+            <xsd:element name="FalagardMapping" type="FalagardMapType" />
+		</xsd:choice>
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowSetType">
+		<xsd:sequence>
+            <xsd:element name="WindowFactory" type="WindowFactoryType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowRendererSetType">
+		<xsd:sequence>
+            <xsd:element name="WindowRendererFactory" type="WindowRendererFactoryType" minOccurs="0" maxOccurs="unbounded" />
+		</xsd:sequence>
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="FileDataType">
+        <xsd:attribute name="Filename" type="xsd:string" use="required" />
+        <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+    </xsd:complexType>
+	<xsd:complexType name="NamedDataType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+		<xsd:attribute name="Filename" type="xsd:string" use="required" />
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowFactoryType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowRendererFactoryType">
+		<xsd:attribute name="Name" type="xsd:string" use="required" />
+	</xsd:complexType>
+	<xsd:complexType name="WindowAliasType">
+		<xsd:attribute name="Alias" type="xsd:string" use="required" />
+		<xsd:attribute name="Target" type="xsd:string" use="required" />
+	</xsd:complexType>
+    <xsd:complexType name="FalagardMapType">
+        <xsd:attribute name="WindowType" type="xsd:string" use="required" />
+        <xsd:attribute name="TargetType" type="xsd:string" use="required" />
+		<xsd:attribute name="Renderer" type="xsd:string" use="required" />
+        <xsd:attribute name="LookNFeel" type="xsd:string" use="required" />
+    </xsd:complexType>
+</xsd:schema>
Index: /code/branches/audio/Media/gui/Imageset.xsd
===================================================================
--- /code/branches/audio/Media/gui/Imageset.xsd	(revision 310)
+++ /code/branches/audio/Media/gui/Imageset.xsd	(revision 310)
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xsd:element name="Imageset" type="ImagesetType"/>
+	
+	<xsd:complexType name="ImagesetType">
+		<xsd:sequence>
+			<xsd:element name="Image" type="ImageType" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:attribute name="Imagefile" type="xsd:string" use="required"/>
+		<xsd:attribute name="ResourceGroup" type="xsd:string" use="optional"  default="" />
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" />
+		<xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" />
+		<xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" />
+	</xsd:complexType>
+	
+	<xsd:complexType name="ImageType">
+		<xsd:attribute name="Name" type="xsd:string" use="required"/>
+		<xsd:attribute name="XPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="YPos" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Width" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="Height" type="xsd:nonNegativeInteger" use="required"/>
+		<xsd:attribute name="XOffset" type="xsd:integer" use="optional" default="0"/>
+		<xsd:attribute name="YOffset" type="xsd:integer" use="optional" default="0"/>						
+	</xsd:complexType>
+
+</xsd:schema>
Index: /code/branches/audio/Media/gui/InstancingDemo.layout
===================================================================
--- /code/branches/audio/Media/gui/InstancingDemo.layout	(revision 310)
+++ /code/branches/audio/Media/gui/InstancingDemo.layout	(revision 310)
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="root" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="DefaultWindow" Name="debug_overlay" >
+            <Property Name="Disabled" Value="True" />
+            <Property Name="AlwaysOnTop" Value="True" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+            <Window Type="TaharezLook/StaticText" Name="Panel 1" >
+                <Property Name="Alpha" Value="0.9" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.83,0},{0.23,0},{1,0}}" />
+                <Window Type="TaharezLook/StaticText" Name="OPCurrentFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Current FPS: " />
+                    <Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="HorzFormatting" Value="HorzCentred" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.12,0},{0.925,0},{0.37,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticImage" Name="OPBar1" >
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.27,0},{0.8,0},{0.295,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPAverageFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Average FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.32,0},{1.075,0},{0.57,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPWorstFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Worst FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.45,0},{1.075,0},{0.7,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPBestFPS" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Best FPS: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.58,0},{1.075,0},{0.83,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="OPTriCount" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="Triangle Count: " />
+                    <Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.075,0},{0.71,0},{1.075,0},{0.96,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="OPDebugMsg" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapCentred" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.93,0},{0.9,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="OgreLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9,0},{0.95,0},{1,0},{1,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="CeguiLogo" >
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.9125,0},{0.9115,0},{0.9875,0},{0.95,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+        </Window>
+        <Window Type="DefaultWindow" Name="InstancingDemo" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{2,0}}" />
+            <Window Type="TaharezLook/FrameWindow" Name="CompositorSelectorWin" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Techniques" />
+                <Property Name="Alpha" Value="0.75" />
+                <Property Name="TitlebarFont" Value="BlueHighway-12" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="TitlebarEnabled" Value="True" />
+                <Property Name="UnifiedAreaRect" Value="{{0,0},{0.00508906,0},{0.237344,0},{0.487022,0}}" />
+                <Property Name="CloseButtonEnabled" Value="False" />
+                <Window Type="TaharezLook/RadioButton" Name="tInstancing" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Instancing" />
+                    <Property Name="Selected" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.0592397,0},{1.05,0},{0.140919,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tStaticGeometry" >
+                    <Property Name="ID" Value="1" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Static Geometry" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.118479,0},{1.05,0},{0.198839,0}}" />
+                </Window>
+                <Window Type="TaharezLook/RadioButton" Name="tIndependantEntities" >
+                    <Property Name="ID" Value="2" />
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Independant Entities" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.180359,0},{1.05,0},{0.260718,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="Shadows" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Shadows on/off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.458078,0},{1.05,0},{0.545613,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Object Count:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0458855,0},{0.242239,0},{0.480053,0},{0.324677,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Object Count Number" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="160" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.475313,0},{0.245588,0},{0.679954,0},{0.327894,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Objects" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Choose an object" />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0541145,0},{0.561555,0},{0.954114,0},{0.821555,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Object Count" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.06,0},{0.33,0},{0.96,0},{0.382246,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Text" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="CPU occupation:" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0664582,0},{0.650819,0},{0.571251,0},{0.750819,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Time Burner Value" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="0 ms" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.616458,0},{0.650819,0},{0.905365,0},{0.750819,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Time Burner" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.75,0},{0.962344,0},{0.804855,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="PostEffect" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Post Effect On/Off" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.813539,0},{0.918334,0},{0.895712,0}}" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="ExitDemoBtn" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Exit Demo" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{-0.0325521,0},{-0.0135575,0},{0.48346,0},{0.0739895,0}}" />
+                    <Property Name="VerticalAlignment" Value="Bottom" />
+                    <Property Name="HorizontalAlignment" Value="Centre" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: /code/branches/audio/Media/gui/OceanDemoCegui.config
===================================================================
--- /code/branches/audio/Media/gui/OceanDemoCegui.config	(revision 310)
+++ /code/branches/audio/Media/gui/OceanDemoCegui.config	(revision 310)
@@ -0,0 +1,6 @@
+<?xml version="1.0" ?>
+<CEGUIConfig
+	Scheme="TaharezLookSkin.scheme"
+	Layout="OceanDemoLayout.xml"
+	DefaultFont="BlueHighway-12"
+/>
Index: /code/branches/audio/Media/gui/OceanDemoLayout.xml
===================================================================
--- /code/branches/audio/Media/gui/OceanDemoLayout.xml	(revision 310)
+++ /code/branches/audio/Media/gui/OceanDemoLayout.xml	(revision 310)
@@ -0,0 +1,264 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+
+	<Window Type="DefaultGUISheet" Name="debug_overlay">
+		<Property Name="AlwaysOnTop" Value="True" />
+		<Property Name="Disabled" Value="True" />
+		
+		<Window Type="TaharezLook/StaticText" Name="Panel 1">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0.83,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.17,0}}" />
+			<Property Name="Alpha" Value="0.9" />
+			<Property Name="InheritsAlpha" Value="False" />
+	
+			<Window Type="TaharezLook/StaticText" Name="OPCurrentFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.12,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.85,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FF4FF06F tr:FF4FF06F bl:FF4FF06F br:FF4FF06F" />
+				<Property Name="HorzFormatting" Value="HorzCentred" />
+				<Property Name="Text" Value="Current FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticImage" Name="OPBar1">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.27,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.6,0},{0.025,0}}" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPAverageFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.32,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Average FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPWorstFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.45,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Worst FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPBestFPS">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.58,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Best FPS: " />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="OPTriCount">
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="Font" Value="BlueHighway-10" />
+				<Property Name="UnifiedPosition" Value="{{0.075,0},{0.71,0}}" />
+				<Property Name="UnifiedSize" Value="{{1.0,0},{0.25,0}}" />
+				<Property Name="TextColours" Value="tl:FFFFF5F0 tr:FFFFF5F0 bl:FFFFF510 br:FFFFF5F0" />
+				<Property Name="Text" Value="Triangle Count: " />
+			</Window>
+
+		</Window>
+
+		<Window Type="TaharezLook/StaticText" Name="OPDebugMsg">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="Font" Value="BlueHighway-10" />
+			<Property Name="UnifiedPosition" Value="{{0.25,0},{0.93,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.65,0},{0.07,0}}" />
+			<Property Name="TextColours" Value="tl:A0FFFFFF tr:A0FFFFFF bl:A0FFFFFF br:A0FFFFFF" />
+			<Property Name="InheritsAlpha" Value="False" />
+			<Property Name="VertFormatting" Value="VertCentred" />
+			<Property Name="HorzFormatting" Value="WordWrapCentred" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="OgreLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9,0},{0.95,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.1,0},{0.05,0}}" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+		<Window Type="TaharezLook/StaticImage" Name="CeguiLogo">
+			<Property Name="FrameEnabled" Value="False" />
+			<Property Name="BackgroundEnabled" Value="False" />
+			<Property Name="UnifiedPosition" Value="{{0.9125,0},{0.9115,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.075,0},{0.0385,0}}" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+
+	</Window>
+
+	<Window Type="DefaultGUISheet" Name="OceanDemo">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}" />
+
+
+		<Window Type="TaharezLook/StaticText" Name="HelpTxt">
+			<Property Name="UnifiedPosition" Value="{{0.6,0},{0.8,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.3,0}}" />
+			<Property Name="Text" Value="Use the Combo boxes to select a shader and a model" />
+			<Property Name="InheritsAlpha" Value="False" />
+		</Window>
+		
+		<Window Type="TaharezLook/FrameWindow" Name="OceanDemo/MainWin">
+			<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.23,0},{0.23,0}}" />
+			<Property Name="Text" Value="Selector" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+
+			<Window Type="TaharezLook/StaticText" Name="ShaderTxt">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.10,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="HorzFormatting" Value="LeftAligned" />
+				<Property Name="Text" Value="Active Material" />
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Combobox" Name="ShaderCombos">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.27,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="ReadOnly" Value="True" />
+				<Property Name="ClippedByParent" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="ModelTxt">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.40,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.3,0},{0.06,0}}" />
+				<Property Name="HorzFormatting" Value="LeftAligned" />
+				<Property Name="Text" Value="Active Model" />
+				<Property Name="FrameEnabled" Value="False" />
+				<Property Name="BackgroundEnabled" Value="False" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Combobox" Name="ModelCombos">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.57,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.2,0},{0.25,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="ReadOnly" Value="True" />
+				<Property Name="ClippedByParent" Value="False" />
+			</Window>
+
+			<Window Type="TaharezLook/Button" Name="ExitDemoBtn">
+				<Property Name="UnifiedPosition" Value="{{0.25,0},{0.79,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.04,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.04,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.04,0}}" />
+				<Property Name="Text" Value="Exit Demo" />
+				<Property Name="InheritsAlpha" Value="False" />
+			</Window>
+
+
+		</Window>
+
+
+		<Window Type="TaharezLook/FrameWindow" Name="ShaderControlsWin">
+			<Property Name="UnifiedPosition" Value="{{0.50,0},{0,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.5,0},{0.22,0}}" />
+			<Property Name="Text" Value="Shader Controls" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+			
+			<Window Type="TaharezLook/VerticalScrollbar" Name="VerticalScroll">
+				<Property Name="UnifiedPosition" Value="{{0.94,0},{0.2,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.04,0},{0.75,0}}" />
+				<Property Name="DocumentSize" Value="1" />
+				<Property Name="PageSize" Value="1" />
+				<Property Name="StepSize" Value="0.01" />
+				<Property Name="OverlapSize" Value="0.5" />
+			</Window>
+			
+		</Window>
+
+		<Window Type="TaharezLook/FrameWindow" Name="MovementControlsWin">
+			<Property Name="UnifiedPosition" Value="{{0.0,0},{0.2,0}}" />
+			<Property Name="UnifiedMaxSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="UnifiedSize" Value="{{0.15,0},{0.22,0}}" />
+			<Property Name="Text" Value="Movement" />
+			<Property Name="Alpha" Value="0.75" />
+			<Property Name="CloseButtonEnabled" Value="False" />
+			
+			<Window Type="TaharezLook/RadioButton" Name="CameraRBtn">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.2,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Camera" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Selected" Value="true" />
+				<Property Name="ID" Value="0" />
+			
+			</Window>
+
+			<Window Type="TaharezLook/RadioButton" Name="ModelRBtn">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.4,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.33,0},{0.03,0}}" />
+				<Property Name="Text" Value="Model" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Selected" Value="False" />
+				<Property Name="ID" Value="1" />
+			
+			</Window>
+			
+			<Window Type="TaharezLook/Checkbox" Name="ModelSpinCB">
+				<Property Name="UnifiedPosition" Value="{{0.2,0},{0.53,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Text" Value="Spin" />
+				<Property Name="Selected" Value="True" />
+			</Window>
+
+			<Window Type="TaharezLook/Checkbox" Name="LightSpinCB">
+				<Property Name="UnifiedPosition" Value="{{0.1,0},{0.7,0}}" />
+				<Property Name="UnifiedMaxSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedMinSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.12,0},{0.03,0}}" />
+				<Property Name="InheritsAlpha" Value="False" />
+				<Property Name="Text" Value="Spin Light" />
+				<Property Name="Selected" Value="False" />
+			</Window>
+		</Window>
+	</Window>
+
+</Window>
+
+</GUILayout>
Index: /code/branches/audio/Media/gui/TaharezLook.imageset
===================================================================
--- /code/branches/audio/Media/gui/TaharezLook.imageset	(revision 310)
+++ /code/branches/audio/Media/gui/TaharezLook.imageset	(revision 310)
@@ -0,0 +1,242 @@
+<?xml version="1.0" ?>
+<Imageset Name="TaharezLook" Imagefile="TaharezLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
+	<Image Name="ClientBrush" XPos="2" YPos="2" Width="64" Height="64" />
+	<Image Name="WindowLeftEdge" XPos="6" YPos="95" Width="1" Height="22" XOffset="4" />
+	<Image Name="WindowRightEdge" XPos="34" YPos="95" Width="1" Height="22" XOffset="-5" />
+	<Image Name="WindowTopEdge" XPos="9" YPos="68" Width="23" Height="1" />
+	<Image Name="WindowBottomEdge" XPos="9" YPos="143" Width="23" Height="1" />
+	<Image Name="WindowTopLeft" XPos="2" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowTopRight" XPos="34" YPos="68" Width="5" Height="24" />
+	<Image Name="WindowBottomLeft" XPos="2" YPos="120" Width="5" Height="24" />
+	<Image Name="WindowBottomRight" XPos="34" YPos="120" Width="5" Height="24" />
+	<Image Name="ButtonLeftNormal" XPos="68" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonMiddleNormal" XPos="82" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonRightNormal" XPos="96" YPos="20" Width="12" Height="16" />
+	<Image Name="ButtonLeftPushed" XPos="68" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonMiddlePushed" XPos="82" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonRightPushed" XPos="96" YPos="38" Width="12" Height="16" />
+	<Image Name="ButtonLeftHighlight" XPos="68" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonMiddleHighlight" XPos="82" YPos="56" Width="12" Height="16" />
+	<Image Name="ButtonRightHighlight" XPos="96" YPos="56" Width="12" Height="16" />
+	<Image Name="CheckboxNormal" XPos="110" YPos="2" Width="12" Height="12" />
+	<Image Name="CheckboxHover" XPos="110" YPos="30" Width="12" Height="12" />
+	<Image Name="CheckboxMark" XPos="110" YPos="16" Width="12" Height="12" />
+	<Image Name="RadioButtonNormal" XPos="124" YPos="2" Width="12" Height="12" />
+	<Image Name="RadioButtonHover" XPos="124" YPos="30" Width="12" Height="12" />
+	<Image Name="RadioButtonMark" XPos="124" YPos="16" Width="12" Height="12" />
+	<Image Name="TitlebarLeft" XPos="68" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarMiddle" XPos="78" YPos="2" Width="8" Height="16" />
+	<Image Name="TitlebarRight" XPos="88" YPos="2" Width="8" Height="16" />
+	<Image Name="NewTitlebarLeft" XPos="61" YPos="127" Width="13" Height="16" />
+	<Image Name="NewTitlebarMiddle" XPos="77" YPos="127" Width="12" Height="16" />
+	<Image Name="NewTitlebarRight" XPos="92" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaMiddle" XPos="107" YPos="127" Width="12" Height="16" />
+	<Image Name="SysAreaRight" XPos="122" YPos="127" Width="13" Height="16" />
+	<Image Name="StaticLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="StaticTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="StaticBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="StaticBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ProgressBarLeft" XPos="71" YPos="74" Width="7" Height="12" />
+	<Image Name="ProgressBarMiddle" XPos="80" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarRight" XPos="88" YPos="74" Width="6" Height="12" />
+	<Image Name="ProgressBarDimSegment" XPos="96" YPos="74" Width="8" Height="12" />
+	<Image Name="ProgressBarLitSegment" XPos="106" YPos="74" Width="8" Height="12" />
+	<Image Name="EditBoxLeft" XPos="41" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxMiddle" XPos="47" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxRight" XPos="53" YPos="108" Width="4" Height="18" />
+	<Image Name="EditBoxCarat" XPos="60" YPos="108" Width="4" Height="18" />
+	<Image Name="SpinnerUpNormal" XPos="68" YPos="110" Width="10" Height="6" />
+	<Image Name="SpinnerDownNormal" XPos="68" YPos="118" Width="10" Height="6" />
+	<Image Name="SpinnerUpHover" XPos="82" YPos="110" Width="10" Height="6" />
+	<Image Name="SpinnerDownHover" XPos="82" YPos="118" Width="10" Height="6" />
+	<Image Name="TextSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="VertScrollTop" XPos="182" YPos="2" Width="20" Height="8" />
+	<Image Name="VertScrollMiddle" XPos="182" YPos="12" Width="20" Height="8" />
+	<Image Name="VertScrollBottom" XPos="182" YPos="22" Width="20" Height="8" />
+	<Image Name="VertScrollBarSegment" XPos="206" YPos="2" Width="4" Height="10" />
+	<Image Name="VertScrollThumbNormal" XPos="214" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollThumbHover" XPos="224" YPos="2" Width="8" Height="24" />
+	<Image Name="VertScrollUpNormal" XPos="196" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollDownNormal" XPos="182" YPos="32" Width="12" Height="12" />
+	<Image Name="VertScrollUpHover" XPos="196" YPos="46" Width="12" Height="12" />
+	<Image Name="VertScrollDownHover" XPos="182" YPos="46" Width="12" Height="12" />
+	<Image Name="MiniVertScrollBarSegment" XPos="207" YPos="60" Width="4" Height="10" />
+	<Image Name="MiniVertScrollThumbNormal" XPos="214" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollThumbTopNormal" XPos="214" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleNormal" XPos="214" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomNormal" XPos="214" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbTopHover" XPos="223" YPos="59" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbMiddleHover" XPos="223" YPos="65" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbBottomHover" XPos="223" YPos="76" Width="7" Height="5" />
+	<Image Name="MiniVertScrollThumbHover" XPos="223" YPos="59" Width="7" Height="22" />
+	<Image Name="MiniVertScrollUpNormal" XPos="194" YPos="60" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownNormal" XPos="182" YPos="59" Width="10" Height="9" />
+	<Image Name="MiniVertScrollUpHover" XPos="194" YPos="70" Width="10" Height="9" />
+	<Image Name="MiniVertScrollDownHover" XPos="182" YPos="69" Width="10" Height="9" />
+	<Image Name="VertSliderBody" XPos="234" YPos="2" Width="9" Height="48" />
+	<Image Name="VertSliderThumbNormal" XPos="217" YPos="28" Width="15" Height="6" />
+	<Image Name="VertSliderThumbHover" XPos="217" YPos="36" Width="15" Height="6" />
+	<Image Name="MiniHorzScrollBarSegment" XPos="244" YPos="80" Width="10" Height="4" />
+	<Image Name="MiniHorzScrollThumbNormal" XPos="233" YPos="87" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftNormal" XPos="233" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleNormal" XPos="239" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightNormal" XPos="250" YPos="87" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbHover" XPos="233" YPos="96" Width="22" Height="7" />
+	<Image Name="MiniHorzScrollThumbLeftHover" XPos="233" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbMiddleHover" XPos="239" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollThumbRightHover" XPos="250" YPos="96" Width="5" Height="7" />
+	<Image Name="MiniHorzScrollLeftNormal" XPos="246" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightNormal" XPos="245" YPos="67" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollLeftHover" XPos="236" YPos="55" Width="9" Height="10" />
+	<Image Name="MiniHorzScrollRightHover" XPos="235" YPos="67" Width="9" Height="10" />
+	<Image Name="ListboxLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="ListboxTop" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="ListboxBottom" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="ListboxTopLeft" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxTopRight" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="ListboxBottomLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBottomRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="ListboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="ListboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxEditLeft" XPos="138" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxEditMiddle" XPos="148" YPos="2" Width="8" Height="16" />
+	<Image Name="ComboboxListButtonNormal" XPos="158" YPos="2" Width="16" Height="16" />
+	<Image Name="ComboboxListButtonHover" XPos="158" YPos="20" Width="16" Height="16" />
+	<Image Name="ComboboxListLeft" XPos="138" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListRight" XPos="158" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListTop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxListBottom" XPos="148" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListTopLeft" XPos="138" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListTopRight" XPos="158" YPos="38" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomLeft" XPos="138" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBottomRight" XPos="158" YPos="58" Width="8" Height="8" />
+	<Image Name="ComboboxListBackdrop" XPos="148" YPos="48" Width="8" Height="8" />
+	<Image Name="ComboboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" />
+	<Image Name="ComboboxDividerLeft" XPos="138" YPos="68" Width="14" Height="1" />
+	<Image Name="ComboboxDividerMiddle" XPos="154" YPos="68" Width="8" Height="1" />
+	<Image Name="ComboboxDividerRight" XPos="164" YPos="68" Width="14" Height="1" />
+	<Image Name="HeaderBarBackdropNormal" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarBackdropHover" XPos="230" YPos="163" Width="10" Height="12" />
+	<Image Name="HeaderBarSplitterNormal" XPos="225" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSplitterHover" XPos="200" YPos="92" Width="3" Height="16" />
+	<Image Name="HeaderBarSortUp" XPos="233" YPos="178" Width="8" Height="8" />
+	<Image Name="HeaderBarSortDown" XPos="244" YPos="178" Width="8" Height="8" />
+	<Image Name="MultiListLeft" XPos="170" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListRight" XPos="191" YPos="92" Width="7" Height="6" />
+	<Image Name="MultiListTop" XPos="181" YPos="81" Width="6" Height="7" />
+	<Image Name="MultiListBottom" XPos="181" YPos="102" Width="6" Height="7" />
+	<Image Name="MultiListTopLeft" XPos="170" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListTopRight" XPos="191" YPos="81" Width="7" Height="7" />
+	<Image Name="MultiListBottomLeft" XPos="170" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBottomRight" XPos="191" YPos="102" Width="7" Height="7" />
+	<Image Name="MultiListBackdrop" XPos="181" YPos="92" Width="6" Height="6" />
+	<Image Name="MultiListSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="AltProgressLeft" XPos="71" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressMiddle" XPos="81" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressRight" XPos="91" YPos="88" Width="8" Height="12" />
+	<Image Name="AltProgressQuarter" XPos="102" YPos="89" Width="3" Height="4" />
+	<Image Name="AltProgressHalf" XPos="109" YPos="89" Width="4" Height="5" />
+	<Image Name="AltProgressLight1" XPos="100" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight2" XPos="106" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight3" XPos="112" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight4" XPos="118" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight5" XPos="124" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight6" XPos="130" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight7" XPos="136" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight8" XPos="142" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight9" XPos="148" YPos="97" Width="4" Height="8" />
+	<Image Name="AltProgressLight10" XPos="154" YPos="97" Width="4" Height="8" />
+	<Image Name="CloseButtonNormal" XPos="41" YPos="128" Width="16" Height="16" />
+	<Image Name="CloseButtonHover" XPos="41" YPos="146" Width="16" Height="16" />
+	<Image Name="CloseButtonPressed" XPos="41" YPos="164" Width="16" Height="16" />
+	<Image Name="NewCloseButtonNormal" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonHover" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="NewCloseButtonPressed" XPos="90" YPos="146" Width="10" Height="10" />
+	<Image Name="MultiLineEditboxLeft" XPos="41" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxRight" XPos="63" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTop" XPos="52" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottom" XPos="52" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopLeft" XPos="41" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxTopRight" XPos="63" YPos="78" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomLeft" XPos="41" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBottomRight" XPos="63" YPos="100" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="MultiLineEditboxSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" />
+	<Image Name="MouseTarget" XPos="182" YPos="127" Width="17" Height="17" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseArrow" XPos="138" YPos="127" Width="31" Height="25" XOffset="0" YOffset="0" />
+	<Image Name="MouseMoveCursor" XPos="201" YPos="127" Width="18" Height="18" XOffset="-8" YOffset="-8" />
+	<Image Name="MouseNoSoCursor" XPos="221" YPos="127" Width="8" Height="18" XOffset="-3" YOffset="-8" />
+	<Image Name="MouseEsWeCursor" XPos="182" YPos="150" Width="18" Height="8" XOffset="-8" YOffset="-3" />
+	<Image Name="MouseNeSwCursor" XPos="201" YPos="147" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseNwSeCursor" XPos="230" YPos="126" Width="14" Height="14" XOffset="-7" YOffset="-7" />
+	<Image Name="MouseTextBar" XPos="173" YPos="127" Width="7" Height="18" XOffset="-2" YOffset="-9" />
+	<Image Name="TabHorizontalFiller" XPos="197" YPos="201" Width="7" Height="1" />
+	<Image Name="TabContentPaneUpperLeft" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabContentPaneUpper" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabContentPaneUpperRight" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabContentPaneLeft" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabContentPaneRight" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabContentPaneLower" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabContentPaneLowerLeft" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabContentPaneLowerRight" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabContentPaneMiddle" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonScrollLeftNormal" XPos="97" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollRightNormal" XPos="112" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollLeftHover" XPos="127" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonScrollRightHover" XPos="142" YPos="108" Width="16" Height="17" />
+	<Image Name="TabButtonLeftNormal" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightNormal" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperNormal" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerNormal" XPos="52" YPos="99" Width="6" Height="7" />
+	<Image Name="TabButtonUpperLeftNormal" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperLeft2Normal" XPos="186" YPos="164" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightNormal" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftNormal" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightNormal" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRight2Normal" XPos="187" YPos="195" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleNormal" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonLeftSelected" XPos="41" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonRightSelected" XPos="62" YPos="89" Width="7" Height="6" />
+	<Image Name="TabButtonUpperSelected" XPos="52" YPos="78" Width="6" Height="7" />
+	<Image Name="TabButtonLowerSelected" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TabButtonUpperLeftSelected" XPos="41" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonUpperRightSelected" XPos="62" YPos="78" Width="7" Height="7" />
+	<Image Name="TabButtonLowerLeftSelected" XPos="41" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonLowerRightSelected" XPos="62" YPos="99" Width="7" Height="7" />
+	<Image Name="TabButtonMiddleSelected" XPos="52" YPos="89" Width="6" Height="6" />
+	<Image Name="TooltipTopLeft" XPos="61" YPos="160" Width="4" Height="4" />
+	<Image Name="TooltipTopRight" XPos="85" YPos="160" Width="5" Height="4" />
+	<Image Name="TooltipBottomLeft" XPos="61" YPos="184" Width="4" Height="5" />
+	<Image Name="TooltipBottomRight" XPos="85" YPos="184" Width="5" Height="5" />
+	<Image Name="TooltipLeftEdge" XPos="61" YPos="171" Width="4" Height="6" />
+	<Image Name="TooltipRightEdge" XPos="85" YPos="171" Width="5" Height="6" />
+	<Image Name="TooltipTopEdge" XPos="72" YPos="160" Width="6" Height="4" />
+	<Image Name="TooltipBottomEdge" XPos="72" YPos="184" Width="6" Height="5" />
+	<Image Name="TooltipMiddle" XPos="72" YPos="171" Width="6" Height="6" />
+	<Image Name="MenuTopLeft" XPos="166" YPos="204" Width="2" Height="2" />
+	<Image Name="MenuTopRight" XPos="175" YPos="204" Width="3" Height="2" />
+	<Image Name="MenuBottomLeft" XPos="166" YPos="213" Width="2" Height="3" />
+	<Image Name="MenuBottomRight" XPos="175" YPos="213" Width="3" Height="3" />
+	<Image Name="MenuLeft" XPos="166" YPos="209" Width="2" Height="1" />
+	<Image Name="MenuRight" XPos="175" YPos="209" Width="3" Height="1" />
+	<Image Name="MenuTop" XPos="171" YPos="204" Width="1" Height="2" />
+	<Image Name="MenuBottom" XPos="171" YPos="213" Width="1" Height="3" />
+	<Image Name="MenuMiddle" XPos="171" YPos="209" Width="1" Height="1" />
+	<Image Name="PopupMenuFrameTopLeft" XPos="186" YPos="204" Width="2" Height="2" />
+	<Image Name="PopupMenuFrameTopRight" XPos="195" YPos="204" Width="4" Height="2" />
+	<Image Name="PopupMenuFrameBottomLeft" XPos="186" YPos="213" Width="2" Height="4" />
+	<Image Name="PopupMenuFrameBottomRight" XPos="195" YPos="213" Width="4" Height="4" />
+	<Image Name="PopupMenuFrameLeft" XPos="186" YPos="209" Width="2" Height="1" />
+	<Image Name="PopupMenuFrameRight" XPos="195" YPos="209" Width="4" Height="1" />
+	<Image Name="PopupMenuFrameTop" XPos="191" YPos="204" Width="1" Height="2" />
+	<Image Name="PopupMenuFrameBottom" XPos="191" YPos="213" Width="1" Height="4" />
+	<Image Name="PopupMenuMiddle" XPos="191" YPos="209" Width="1" Height="1" />
+	<Image Name="PopupMenuArrowRight" XPos="179" YPos="204" Width="5" Height="5" />
+	<Image Name="PopupMenuArrowLeft" XPos="179" YPos="210" Width="5" Height="5" />
+</Imageset>
Index: /code/branches/audio/Media/gui/TaharezLook.looknfeel
===================================================================
--- /code/branches/audio/Media/gui/TaharezLook.looknfeel	(revision 310)
+++ /code/branches/audio/Media/gui/TaharezLook.looknfeel	(revision 310)
@@ -0,0 +1,4315 @@
+<?xml version="1.0" ?>
+<Falagard>
+    <!--
+    ***************************************************
+        TaharezLook/Button
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Button">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" />
+        <PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" />
+        <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormatProperty name="VertLabelFormatting" />
+                <HorzFormatProperty name="HorzLabelFormatting" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightNormal" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddleNormal" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="NormalImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftHighlight" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightHighlight" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddleHighlight" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="HoverImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="pushed">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftPushed" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightPushed" />
+                <Image type="Background" imageset="TaharezLook" image="ButtonMiddlePushed" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="PushedImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="pushed" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PushedOff">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/RadioButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/RadioButton">
+		<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="RadioButtonNormal" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="3" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonNormal" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonHover" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="select_mark">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="RadioButtonMark" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedNormal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedHover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedDisabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="select_mark">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Checkbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Checkbox">
+		<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="CheckboxNormal" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="3" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxNormal" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxHover" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="select_mark">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="CheckboxMark" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedNormal">
+            <Layer>
+                <Section section="normal" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedHover">
+            <Layer>
+                <Section section="hover" />
+                <Section section="select_mark" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SelectedDisabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="select_mark">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Editbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Editbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="container_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="EditBoxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="EditBoxRight" />
+                <Image type="Background" imageset="TaharezLook" image="EditBoxMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="selection">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="container_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="ActiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="InactiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Titlebar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Titlebar">
+        <PropertyDefinition name="CaptionColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarLeft" />
+                <VertFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarRight" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="SysAreaMiddle" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="SysAreaRight" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width">
+                                            <DimOperator op="Add">
+                                                <ImageDim imageset="TaharezLook" image="NewTitlebarRight" dimension="Width" />
+                                            </DimOperator>
+                                        </ImageDim>
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="NewTitlebarMiddle" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="caption">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" offset="-75" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ColourProperty name="CaptionColour" />
+                <VertFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Active">
+            <Layer>
+                <Section section="main" />
+                <Section section="caption" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Inactive">
+            <Layer>
+                <Section section="main" />
+                <Section section="caption" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="caption">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/FrameWindow
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/FrameWindow">
+        <PropertyLinkDefinition name="CaptionColour" widget="__auto_titlebar__" targetProperty="CaptionColour" initialValue="FFFFFFFF" />
+        <PropertyLinkDefinition name="TitlebarFont" widget="__auto_titlebar__" targetProperty="Font" />
+        <Property name="NSSizingCursorImage" value="set:TaharezLook image:MouseNoSoCursor" />
+        <Property name="EWSizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" />
+        <Property name="NWSESizingCursorImage" value="set:TaharezLook image:MouseNwSeCursor" />
+        <Property name="NESWSizingCursorImage" value="set:TaharezLook image:MouseNeSwCursor" />
+        <NamedArea name="ClientWithTitleWithFrame">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientWithTitleNoFrame">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="BottomEdge" ><WidgetDim dimension="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientNoTitleWithFrame">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="WindowTopEdge" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ClientNoTitleNoFrame">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child type="TaharezLook/Titlebar" nameSuffix="__auto_titlebar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><FontDim type="LineSpacing" padding="8" /></Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="False" />
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_closebutton__">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <UnifiedDim scale="1" type="LeftEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <AbsoluteDim value="0.5">
+                        <DimOperator op="Multiply">
+                            <WidgetDim widget="__auto_titlebar__" dimension="Height">
+                                <DimOperator op="Subtract">
+                                    <ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" />
+                                </DimOperator>
+                            </WidgetDim>
+                        </DimOperator>
+                    </AbsoluteDim>
+                </Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:NewCloseButtonNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:NewCloseButtonHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:NewCloseButtonPressed" />
+        </Child>
+        <ImagerySection name="withtitle_frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="WindowBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="WindowBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="WindowBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="notitle_frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="WindowTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="WindowTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="WindowBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="WindowBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="WindowLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="WindowRightEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="WindowBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="withtitle_noframe_client_area">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="Height" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="notitle_noframe_client_area">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ClientBrush" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="ActiveWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledWithTitleWithFrame">
+            <Layer>
+                <Section section="withtitle_frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledWithTitleNoFrame">
+            <Layer>
+                <Section section="withtitle_noframe_client_area">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNoTitleWithFrame">
+            <Layer>
+                <Section section="notitle_frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNoTitleNoFrame">
+            <Layer>
+                <Section section="notitle_noframe_client_area">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ProgressBar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ProgressBar">
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ProgressBarLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ProgressBarRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ProgressBarLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ProgressBarRight" />
+                <Image type="Background" imageset="TaharezLook" image="ProgressBarMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="ProgressBarLitSegment" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/AlternateProgressBar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/AltProgressBar">
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="AltProgressLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="AltProgressRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-4" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="AltProgressLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="AltProgressRight" />
+                <Image type="Background" imageset="TaharezLook" image="AltProgressMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight1" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.1" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight2" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.2" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight3" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.3" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight4" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.4" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight5" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.5" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight6" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.6" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight7" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.7" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight8" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.8" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight9" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.9" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="AltProgressLight10" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VUMeter (progress bar)
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VUMeter">
+        <Property name="VerticalProgress" value="True" />
+        <NamedArea name="ProgressArea">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" ><UnifiedDim scale="0" type="TopEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="progress_lights" >
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0.5" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FF00FF00" topRight="FF00FF00" bottomLeft="FF00FF00" bottomRight="FF00FF00" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0.2" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.3" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FFFFFF00" topRight="FFFFFF00" bottomLeft="FFFFFF00" bottomRight="FFFFFF00" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" ><UnifiedDim scale="0" type="TopEdge" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="0.2" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <Colours topLeft="FFFF0000" topRight="FFFF0000" bottomLeft="FFFF0000" bottomRight="FFFF0000" />
+                <VertFormat type="Tiled" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+        </StateImagery>
+        <StateImagery name="Disabled">
+        </StateImagery>
+        <StateImagery name="EnabledProgress">
+            <Layer>
+                <Section section="progress_lights" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledProgress">
+            <Layer>
+                <Section section="progress_lights">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/SliderThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/SliderThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderThumbNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderThumbHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Slider
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Slider">
+        <Property name="VerticalSlider" value="True" />
+        <Property name="MouseButtonDownAutoRepeat" value="True" />
+        <Property name="WantsMultiClickEvents" value="False" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/SliderThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="VertSliderThumbNormal" dimension="Height" /></Dim>
+            </Area>
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" offset="-6" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertSliderBody" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/HorizontalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/HorizontalScrollbarThumb">
+        <Property name="HorzFree" value="True" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="MiniHorzScrollThumbLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MiniHorzScrollThumbRightNormal" />
+                <Image type="Background" imageset="TaharezLook" image="MiniHorzScrollThumbMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="MiniHorzScrollThumbLeftHover" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MiniHorzScrollThumbRightHover" />
+                <Image type="Background" imageset="TaharezLook" image="MiniHorzScrollThumbMiddleHover" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/HorizontalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/HorizontalScrollbar">
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1.0" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:MiniHorzScrollRightNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniHorzScrollRightHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniHorzScrollRightNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:MiniHorzScrollLeftNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniHorzScrollLeftHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniHorzScrollLeftNormal" />
+        </Child>
+        <Child  type="TaharezLook/HorizontalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+            <Property name="UnifiedMinSize" value="{{0,25},{0,0}}" />
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MiniHorzScrollLeftNormal" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1.0" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MiniHorzScrollRightNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="MiniHorzScrollBarSegment" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VerticalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VerticalScrollbarThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="MiniVertScrollThumbTopNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MiniVertScrollThumbBottomNormal" />
+                <Image type="Background" imageset="TaharezLook" image="MiniVertScrollThumbMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="MiniVertScrollThumbTopHover" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MiniVertScrollThumbBottomHover" />
+                <Image type="Background" imageset="TaharezLook" image="MiniVertScrollThumbMiddleHover" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/VerticalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/VerticalScrollbar">
+        <Property name="VerticalScrollbar" value="True" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1.0" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:MiniVertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniVertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniVertScrollDownNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:MiniVertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:MiniVertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:MiniVertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.1" type="Height" /></Dim>
+            </Area>
+            <Property name="UnifiedMinSize" value="{{0,0},{0,25}}" />
+        </Child>
+        <ImagerySection name="main">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MiniVertScrollUpNormal" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1.0" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MiniVertScrollDownNormal" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="MiniVertScrollBarSegment" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="CentreAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Listbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Listbox">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ListboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ListboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ListboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="ListboxTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="ListboxTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="ListboxBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="ListboxBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="ListboxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ListboxRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="ListboxTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="ListboxBottom" />
+                <Image type="Background" imageset="TaharezLook" image="ListboxBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ComboDropList
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ComboDropList">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="ComboboxListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="ComboboxListTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="ComboboxListTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="ComboboxListTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="ComboboxListBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="ComboboxListBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="ComboboxListLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="ComboboxListRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="ComboboxListTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="ComboboxListBottom" />
+                <Image type="Background" imageset="TaharezLook" image="ComboboxListBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ComboEditbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ComboEditbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="container_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="ComboboxEditLeft" />
+                <Image type="Background" imageset="TaharezLook" image="ComboboxEditMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="selection">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="TextSelectionBrush" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="container_normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="container_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ActiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="ActiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="InactiveSelection">
+            <Layer>
+                <Section section="selection">
+                    <ColourProperty name="InactiveSelectionColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Combobox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Combobox">
+        <PropertyLinkDefinition name="NormalEditTextColour" widget="__auto_editbox__" targetProperty="NormalTextColour" initialValue="FFFFFFFF" />
+        <PropertyLinkDefinition name="SelectedEditTextColour" widget="__auto_editbox__" targetProperty="SelectedTextColour" initialValue="FF000000" />
+        <PropertyLinkDefinition name="ActiveEditSelectionColour" widget="__auto_editbox__" targetProperty="ActiveSelectionColour" initialValue="FF6060FF" />
+        <PropertyLinkDefinition name="InactiveEditSelectionColour" widget="__auto_editbox__" targetProperty="InactiveSelectionColour" initialValue="FF808080" />
+        <Child  type="TaharezLook/ComboEditbox" nameSuffix="__auto_editbox__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <FontDim type="LineSpacing">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="1.5" />
+                                </DimOperator>
+                            </FontDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" >
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="1.5" />
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ComboDropList" nameSuffix="__auto_droplist__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_editbox__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_button__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><WidgetDim widget="__auto_editbox__" dimension="Height" /></Dim>
+                <Dim type="Height" ><WidgetDim widget="__auto_editbox__" dimension="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:ComboboxListButtonNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:ComboboxListButtonHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:ComboboxListButtonNormal" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Spinner
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Spinner">
+        <Child  type="TaharezLook/Editbox" nameSuffix="__auto_editbox__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><UnifiedDim scale="0.5" type="TopEdge" /></Dim>
+                <Dim type="Width" ><ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="0.5" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollDownNormal" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticShared
+        (Shared imagery components for static widgets)
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticShared">
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="StaticTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="StaticTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="StaticBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="StaticBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="StaticLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="StaticRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="StaticTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="StaticBottom" />
+                <ColourRectProperty name="FrameColours" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="background">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="StaticBackdrop" />
+                <!--<ColourRectProperty name="BackgroundColours" />-->
+                <Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFFFFFFF" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="background_noframe">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge"><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge"><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="StaticBackdrop" />
+                <!--<ColourRectProperty name="BackgroundColours" />-->
+                <Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFFFFFFF" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticImage
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticImage">
+		<PropertyDefinition name="ImageColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="VertFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <Property name="BackgroundEnabled" value="True" />
+        <Property name="FrameEnabled" value="True" />
+        <ImagerySection name="image_withframe">
+            <ImageryComponent>
+                <Area>
+					<Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+					<Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+					<Dim type="RightEdge" >
+						<UnifiedDim scale="1" type="RightEdge">
+							<DimOperator op="Subtract">
+								<ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+							</DimOperator>
+						</UnifiedDim>
+					</Dim>
+					<Dim type="BottomEdge" >
+						<UnifiedDim scale="1" type="BottomEdge">
+							<DimOperator op="Subtract">
+								<ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+							</DimOperator>
+						</UnifiedDim>
+					</Dim>
+				</Area>
+                <ImageProperty name="Image" />
+                <ColourRectProperty name="ImageColours" />
+                <VertFormatProperty name="VertFormatting" />
+                <HorzFormatProperty name="HorzFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="image_noframe">
+            <ImageryComponent>
+                <Area>
+					<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+					<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+					<Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+					<Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+				</Area>
+                <ImageProperty name="Image" />
+                <ColourRectProperty name="ImageColours" />
+                <VertFormatProperty name="VertFormatting" />
+                <HorzFormatProperty name="HorzFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+        <StateImagery name="EnabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameImage">
+            <Layer>
+                <Section section="image_withframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameImage">
+            <Layer>
+                <Section section="image_noframe" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/StaticText
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/StaticText">
+		<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+		<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <Property name="FrameEnabled" value="True" />
+        <Property name="BackgroundEnabled" value="True" />
+        <NamedArea name="WithFrameTextRenderArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="WithFrameTextRenderAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="NoFrameTextRenderAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+        <StateImagery name="EnabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledFrame">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="frame" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="WithFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameEnabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="NoFrameDisabledBackground">
+            <Layer>
+                <Section look="TaharezLook/StaticShared" section="background_noframe" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ListHeaderSegment
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ListHeaderSegment">
+        <Property name="SizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" />
+        <Property name="MovingCursorImage" value="set:TaharezLook image:MouseMoveCursor" />
+        <ImagerySection name="segment_normal">
+            <Colours topLeft="FFDDDDDD" topRight="FFDDDDDD" bottomLeft="FFDDDDDD" bottomRight="FFDDDDDD" />
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="HeaderBarSplitterNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarBackdropNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="segment_hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="HeaderBarSplitterNormal" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarBackdropHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="splitter_normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSplitterNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="splitter_hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSplitterHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="ascend_icon">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Width" /></Dim>
+                    <Dim type="Height" ><ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSortUp" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="descend_icon">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="3" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="HeaderBarSortDown" dimension="Width" /></Dim>
+                    <Dim type="Height" ><ImageDim imageset="TaharezLook" image="HeaderBarSortDown" dimension="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="HeaderBarSortDown" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" >
+                        <ImageDim imageset="TaharezLook" image="HeaderBarSortUp" dimension="Width">
+                            <DimOperator op="Add">
+                                <AbsoluteDim value="5" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="segment_normal" />
+                <Section section="splitter_normal" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="segment_hover" />
+                <Section section="splitter_normal" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="SplitterHover">
+            <Layer>
+                <Section section="segment_normal" />
+                <Section section="splitter_hover" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DragGhost" clipped="false" >
+            <Layer priority="1" >
+                <Section section="segment_normal">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+                <Section section="splitter_normal">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+                <Section section="label">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="AscendingSortIcon">
+            <Layer>
+                <Section section="ascend_icon" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DescendingSortIcon">
+            <Layer>
+                <Section section="descend_icon" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="GhostAscendingSortIcon" clipped="false">
+            <Layer priority="1" >
+                <Section section="ascend_icon">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="GhostDescendingSortIcon" clipped="false">
+            <Layer priority="1" >
+                <Section section="descend_icon">
+                    <Colours topLeft="90FFFFFF" topRight="90FFFFFF" bottomLeft="90FFFFFF" bottomRight="90FFFFFF" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="segment_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="splitter_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ListHeader
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ListHeader">
+        <Property name="SegmentWidgetType" value="TaharezLook/ListHeaderSegment" />
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MultiColumnList
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MultiColumnList">
+        <NamedArea name="ItemRenderingArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiListBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ItemRenderingAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiListLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ListHeader" nameSuffix="__auto_listheader__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="2" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1" offset="-2" type="RightEdge" /></Dim>
+                <Dim type="Height" >
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="1.5" />
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><WidgetDim widget="__auto_listheader__" dimension="BottomEdge" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1" offset="-12" type="BottomEdge" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MultiListTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MultiListTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MultiListBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MultiListBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MultiListLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MultiListRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MultiListTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MultiListBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MultiListBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MultiLineEditbox
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MultiLineEditbox">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" />
+        <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" />
+        <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" />
+        <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" />
+        <Property name="SelectionBrushImage" value="set:TaharezLook image:MultiLineEditboxSelectionBrush" />
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="MultiLineEditboxBottom" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="TextAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxLeft" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MultiLineEditboxTop" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MultiLineEditboxTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MultiLineEditboxTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MultiLineEditboxBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MultiLineEditboxBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MultiLineEditboxLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MultiLineEditboxRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MultiLineEditboxTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MultiLineEditboxBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MultiLineEditboxBackdrop" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="Carat">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="EditBoxCarat" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="ReadOnly">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/Tooltip
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Tooltip">
+        <NamedArea name="TextArea">
+            <Area>
+                <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="TooltipLeftEdge" dimension="Width" /></Dim>
+                <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="TooltipTopEdge" dimension="Height" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="TooltipRightEdge" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="TooltipBottomEdge" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TooltipTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TooltipTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TooltipBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TooltipBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TooltipLeftEdge" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TooltipRightEdge" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TooltipTopEdge" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TooltipBottomEdge" />
+                <Image type="Background" imageset="TaharezLook" image="TooltipMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="TooltipLeftEdge" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="TooltipTopEdge" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TooltipRightEdge" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TooltipBottomEdge" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Colours topLeft="FF000000" topRight="FF000000" bottomLeft="FF000000" bottomRight="FF000000" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main" />
+                <Section section="label" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/ScrollablePane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ScrollablePane">
+        <NamedArea name="ViewableArea">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaHScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="ViewableAreaHVScroll">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_vscrollbar__" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_hscrollbar__" dimension="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/HorizontalScrollbar" nameSuffix="__auto_hscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="1" offset="-12" type="Width" /></Dim>
+                <Dim type="Height" ><AbsoluteDim value="12" /></Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+        </Child>
+        <Child  type="TaharezLook/VerticalScrollbar" nameSuffix="__auto_vscrollbar__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><AbsoluteDim value="12" /></Dim>
+                <Dim type="Height" ><UnifiedDim scale="1" offset="-12" type="Height" /></Dim>
+            </Area>
+            <HorzAlignment type="RightAligned" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabButton">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFC0C0C0" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverTextColour" initialValue="FFE0E0E0" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="SelectedTextColour" initialValue="FFE0E0E0" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="CentreAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="top_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftNormal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRight2Normal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeft2Normal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="top_hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftNormal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRight2Normal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_hover">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeft2Normal" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightNormal" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftNormal" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightNormal" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="top_selected">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabButtonUpperLeftSelected" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabButtonUpperSelected" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabButtonUpperRightSelected" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftSelected" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleSelected" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightSelected" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="bot_selected">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabButtonLeftSelected" />
+                <Image type="Background" imageset="TaharezLook" image="TabButtonMiddleSelected" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabButtonRightSelected" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabButtonLowerLeftNormal" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabButtonLowerNormal" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabButtonLowerRightNormal" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="TopNormal">
+            <Layer>
+                <Section section="top_normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomNormal">
+            <Layer>
+                <Section section="bot_normal" />
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopHover">
+            <Layer>
+                <Section section="top_hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomHover">
+            <Layer>
+                <Section section="bot_hover" />
+                <Section section="label">
+                    <ColourProperty name="HoverTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopSelected">
+            <Layer>
+                <Section section="top_selected" />
+                <Section section="label">
+                    <ColourProperty name="SelectedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomSelected">
+            <Layer>
+                <Section section="bot_selected" />
+                <Section section="label">
+                    <ColourProperty name="SelectedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopPushed">
+            <Layer>
+                <Section section="top_normal" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomPushed">
+            <Layer>
+                <Section section="bot_normal" />
+                <Section section="label">
+                    <ColourProperty name="PushedTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="TopDisabled">
+            <Layer>
+                <Section section="top_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="BottomDisabled">
+            <Layer>
+                <Section section="bot_normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabContentPane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabContentPane">
+        <PropertyDefinition name="EnableTop" initialValue="0" redrawOnWrite="true" layoutOnwrite="true" />
+        <PropertyDefinition name="EnableBottom" initialValue="0" redrawOnWrite="true" layoutOnwrite="true" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabContentPaneUpperLeft" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="TabContentPaneUpperLeft" />
+                <Image type="TopEdge" imageset="TaharezLook" image="TabContentPaneUpper" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="TabContentPaneUpperRight" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabContentPaneUpperLeft" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabContentPaneLowerLeft" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image type="LeftEdge" imageset="TaharezLook" image="TabContentPaneLeft" />
+                <Image type="Background" imageset="TaharezLook" image="TabContentPaneMiddle" />
+                <Image type="RightEdge" imageset="TaharezLook" image="TabContentPaneRight" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabContentPaneLowerLeft" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="TabContentPaneLowerLeft" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabContentPaneLower" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="TabContentPaneLowerRight" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabButtonPane
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabButtonPane">
+        <PropertyDefinition name="EnableTop" initialValue="1" redrawOnWrite="true" layoutOnwrite="true" />
+        <PropertyDefinition name="EnableBottom" initialValue="1" redrawOnWrite="true" layoutOnwrite="true" />
+        <ImagerySection name="normal">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="TabHorizontalFiller" />
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                            <DimOperator op="Multiply">
+                                <PropertyDim name="EnableTop" />
+                            </DimOperator>
+                        </ImageDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+            </FrameComponent>
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" >
+                        <UnifiedDim scale="1" type="Height">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="TabHorizontalFiller" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <PropertyDim name="EnableBottom" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="BottomEdge" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="BottomEdge" imageset="TaharezLook" image="TabHorizontalFiller" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/TabControl
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/TabControl">
+        <Property name="TabButtonType" value="TaharezLook/TabButton" />
+        <Property name="TabTextPadding" value="{0,6}" />
+        <Child type="TaharezLook/TabContentPane" nameSuffix="__auto_TabPane__">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge"><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="TopEdge">
+                    <PropertyDim widget="__auto_TabPane__" name="EnableBottom">
+                        <DimOperator op="Multiply">
+                            <PropertyDim name="TabHeight" type="Height" />
+                        </DimOperator>
+                    </PropertyDim>
+                </Dim>
+                <Dim type="Height">
+                    <UnifiedDim scale="1" type="Height">
+                        <DimOperator op="Subtract">
+                            <PropertyDim name="TabHeight" type="Height" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </Child>
+        <Child  type="TaharezLook/TabButtonPane" nameSuffix="__auto_TabPane__Buttons">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="RightEdge"><UnifiedDim scale="1" type="Width" /></Dim>
+                <Dim type="TopEdge">
+                    <PropertyDim widget="__auto_TabPane__Buttons" name="EnableTop">
+                        <DimOperator op="Multiply">
+                            <UnifiedDim scale="1" type="Height">
+                                <DimOperator op="Subtract">
+                                    <PropertyDim name="TabHeight" type="Height" />
+                                </DimOperator>
+                            </UnifiedDim>
+                        </DimOperator>
+                    </PropertyDim>
+                </Dim>
+                <Dim type="Height"><PropertyDim name="TabHeight" type="Height" /></Dim>
+            </Area>
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_TabPane__ScrollLeft">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="TopEdge" />
+                </Dim>
+                <Dim type="Width">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="TabButtonScrollLeftNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="TabButtonScrollLeftNormal" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="BottomEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="BottomEdge" />
+                </Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:TabButtonScrollLeftNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:TabButtonScrollLeftHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:TabButtonScrollLeftHover" />
+        </Child>
+        <Child type="TaharezLook/SystemButton" nameSuffix="__auto_TabPane__ScrollRight">
+            <Area>
+                <Dim type="Width">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="TabButtonScrollRightNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="TabButtonScrollRightNormal" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="LeftEdge">
+                    <UnifiedDim scale="1" type="Width">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_TabPane__ScrollRight" dimension="Width" />
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="TopEdge">
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="TopEdge" />
+                </Dim>
+                <Dim type="Height"><AbsoluteDim value="0" />
+                    <WidgetDim widget="__auto_TabPane__Buttons" dimension="Height" />
+                </Dim>
+            </Area>
+            <Property name="AlwaysOnTop" value="True" />
+            <Property name="NormalImage" value="set:TaharezLook image:TabButtonScrollRightNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:TabButtonScrollRightHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:TabButtonScrollRightHover" />
+        </Child>
+        <StateImagery name="Enabled" />
+        <StateImagery name="Disabled" />
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/MenuItem
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/MenuItem">
+        <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="OpenedColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
+        <Property name="WantsMultiClickEvents" value="False" />
+        <NamedArea name="ContentSize">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width">
+                    <FontDim type="HorzExtent">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+                <Dim type="Height">
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <NamedArea name="HasPopupContentSize">
+            <Area>
+                <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width">
+                    <FontDim type="HorzExtent">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width">
+                                        <DimOperator op="Add">
+                                            <ImageDim imageset="TaharezLook" image="PopupMenuArrowLeft" dimension="Width">
+                                                <DimOperator op="Multiply">
+                                                    <AbsoluteDim value="3" />
+                                                </DimOperator>
+                                            </ImageDim>
+                                        </DimOperator>
+                                    </ImageDim>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+                <Dim type="Height">
+                    <FontDim type="LineSpacing">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </FontDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="label">
+            <TextComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="MenuLeft" dimension="Width" /></Dim>
+                    <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="MenuTop" dimension="Height" /></Dim>
+                    <Dim type="RightEdge" >
+                        <UnifiedDim scale="1" type="RightEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MenuRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="MenuBottom" dimension="Height" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="LeftAligned" />
+            </TextComponent>
+        </ImagerySection>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="MenuTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="MenuTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="MenuBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="MenuBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="MenuLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="MenuRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="MenuTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="MenuBottom" />
+                <Image type="Background" imageset="TaharezLook" image="MenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <ImagerySection name="popup_arrow_right">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" >
+                        <UnifiedDim scale="1" type="Width">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="PopupMenuArrowRight" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="PopupMenuArrowRight" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="popup_arrow_left">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" >
+                        <UnifiedDim scale="1" type="Width">
+                            <DimOperator op="Subtract">
+                                <ImageDim imageset="TaharezLook" image="PopupMenuArrowLeft" dimension="Width" />
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="PopupMenuArrowLeft" />
+                <VertFormat type="CentreAligned" />
+                <HorzFormat type="RightAligned" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="EnabledNormal">
+            <Layer>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledHover">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="HoverColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledPushed">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="PushedColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="EnabledPopupOpen">
+            <Layer>
+                <Section section="frame">
+                    <ColourProperty name="OpenedColour" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="NormalTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledNormal">
+            <Layer>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledHover">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledPushed">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="DisabledPopupOpen">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+                <Section section="label">
+                    <ColourProperty name="DisabledTextColour" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PopupClosedIcon">
+            <Layer>
+                <Section section="popup_arrow_right" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PopupOpenIcon">
+            <Layer>
+                <Section section="popup_arrow_left" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/PopupMenu
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/PopupMenu">
+        <PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="BorderWidth" initialValue="0" layoutOnWrite="true" />
+        <NamedArea name="ItemRenderArea">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameLeft" dimension="Width">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameTop" dimension="Height">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameBottom" dimension="Height">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="PopupMenuFrameTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="PopupMenuFrameTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="PopupMenuFrameBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="PopupMenuFrameBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="PopupMenuFrameLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="PopupMenuFrameRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="PopupMenuFrameTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="PopupMenuFrameBottom" />
+                <Image type="Background" imageset="TaharezLook" image="PopupMenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame">
+                    <ColourRectProperty name="BackgroundColours" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    
+    <!--
+    ***************************************************
+        TaharezLook/Menubar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/Menubar">
+        <PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
+        <PropertyDefinition name="BorderWidth" initialValue="5" layoutOnWrite="true" />
+        <NamedArea name="ItemRenderArea">
+            <Area>
+                <Dim type="LeftEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameLeft" dimension="Width">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="TopEdge" >
+                    <ImageDim imageset="TaharezLook" image="PopupMenuFrameTop" dimension="Height">
+                        <DimOperator op="Add">
+                            <PropertyDim name="BorderWidth" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="RightEdge" >
+                    <UnifiedDim scale="1" type="RightEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameRight" dimension="Width">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <ImageDim imageset="TaharezLook" image="PopupMenuFrameBottom" dimension="Height">
+                                <DimOperator op="Add">
+                                    <PropertyDim name="BorderWidth" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <ImagerySection name="frame">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopLeftCorner" imageset="TaharezLook" image="PopupMenuFrameTopLeft" />
+                <Image type="TopRightCorner" imageset="TaharezLook" image="PopupMenuFrameTopRight" />
+                <Image type="BottomLeftCorner" imageset="TaharezLook" image="PopupMenuFrameBottomLeft" />
+                <Image type="BottomRightCorner" imageset="TaharezLook" image="PopupMenuFrameBottomRight" />
+                <Image type="LeftEdge" imageset="TaharezLook" image="PopupMenuFrameLeft" />
+                <Image type="RightEdge" imageset="TaharezLook" image="PopupMenuFrameRight" />
+                <Image type="TopEdge" imageset="TaharezLook" image="PopupMenuFrameTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="PopupMenuFrameBottom" />
+                <Image type="Background" imageset="TaharezLook" image="PopupMenuMiddle" />
+            </FrameComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="frame">
+                    <ColourRectProperty name="BackgroundColours" />
+                </Section>
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="frame">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/LargeVerticalScrollbarThumb
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/LargeVerticalScrollbarThumb">
+        <Property name="VertFree" value="True" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollThumbNormal" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollThumbHover" />
+                <VertFormat type="Stretched" />
+                <HorzFormat type="Stretched" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="normal">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+    
+    <!--
+    ***************************************************
+        TaharezLook/LargeVerticalScrollbar
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/LargeVerticalScrollbar">
+        <Property name="VerticalScrollbar" value="True" />
+        <NamedArea name="ThumbTrackArea">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.325" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" >
+                    <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                        <DimOperator op="Add">
+                            <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="0.5" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </WidgetDim>
+                </Dim>
+                <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                <Dim type="BottomEdge" >
+                    <UnifiedDim scale="1.0" type="BottomEdge">
+                        <DimOperator op="Subtract">
+                            <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                                <DimOperator op="Add">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                        <DimOperator op="Multiply">
+                                            <AbsoluteDim value="0.5" />
+                                        </DimOperator>
+                                    </ImageDim>
+                                </DimOperator>
+                            </WidgetDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </NamedArea>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_incbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.25" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge" >
+                    <AbsoluteDim value="-1">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                <DimOperator op="Multiply">
+                                    <AbsoluteDim value="0.5" />
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </AbsoluteDim>
+                </Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.6" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.6" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Height"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+            <VertAlignment type="BottomAligned" />
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollDownNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollDownHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollDownNormal" />
+        </Child>
+        <Child  type="TaharezLook/ImageButton" nameSuffix="__auto_decbtn__">
+            <Area>
+                <Dim type="LeftEdge" ><UnifiedDim scale="0.25" type="LeftEdge" /></Dim>
+                <Dim type="TopEdge">
+                    <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                        <DimOperator op="Multiply">
+                            <AbsoluteDim value="0.5" />
+                        </DimOperator>
+                    </ImageDim>
+                </Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.6" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.6" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Width">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollUpNormal" dimension="Height"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+            <Property name="NormalImage" value="set:TaharezLook image:VertScrollUpNormal" />
+            <Property name="HoverImage" value="set:TaharezLook image:VertScrollUpHover" />
+            <Property name="PushedImage" value="set:TaharezLook image:VertScrollUpNormal" />
+        </Child>
+        <Child  type="TaharezLook/LargeVerticalScrollbarThumb" nameSuffix="__auto_thumb__">
+            <Area>
+                <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                <Dim type="Width" ><UnifiedDim scale="0.4" type="Width" /></Dim>
+                <Dim type="Height" >
+                    <UnifiedDim scale="0.4" type="Width">
+                        <DimOperator op="Multiply">
+                            <ImageDim imageset="TaharezLook" image="VertScrollThumbNormal" dimension="Height">
+                                <DimOperator op="Divide">
+                                    <ImageDim imageset="TaharezLook" image="VertScrollThumbNormal" dimension="Width"/>
+                                </DimOperator>
+                            </ImageDim>
+                        </DimOperator>
+                    </UnifiedDim>
+                </Dim>
+            </Area>
+        </Child>
+        <ImagerySection name="main">
+            <FrameComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <Image type="TopEdge" imageset="TaharezLook" image="VertScrollTop" />
+                <Image type="BottomEdge" imageset="TaharezLook" image="VertScrollBottom" />
+                <Image type="Background" imageset="TaharezLook" image="VertScrollMiddle" />
+            </FrameComponent>
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><UnifiedDim scale="0.45" type="LeftEdge" /></Dim>
+                    <Dim type="TopEdge" >
+                        <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                            <DimOperator op="Add">
+                                <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                    <DimOperator op="Multiply">
+                                        <AbsoluteDim value="0.5" />
+                                    </DimOperator>
+                                </ImageDim>
+                            </DimOperator>
+                        </WidgetDim>
+                    </Dim>
+                    <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim>
+                    <Dim type="BottomEdge" >
+                        <UnifiedDim scale="1.0" type="BottomEdge">
+                            <DimOperator op="Subtract">
+                                <WidgetDim widget="__auto_decbtn__" dimension="Height">
+                                    <DimOperator op="Add">
+                                        <ImageDim imageset="TaharezLook" image="VertScrollTop" dimension="Height">
+                                            <DimOperator op="Multiply">
+                                                <AbsoluteDim value="0.5" />
+                                            </DimOperator>
+                                        </ImageDim>
+                                    </DimOperator>
+                                </WidgetDim>
+                            </DimOperator>
+                        </UnifiedDim>
+                    </Dim>
+                </Area>
+                <Image imageset="TaharezLook" image="VertScrollBarSegment" />
+                <VertFormat type="Tiled" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Enabled">
+            <Layer>
+                <Section section="main" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="main">
+                    <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
+                </Section>
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+
+    <!--
+    ***************************************************
+        TaharezLook/ImageButton
+    ***************************************************
+    -->
+    <WidgetLook name="TaharezLook/ImageButton">
+        <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
+        <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
+        <ImagerySection name="normal">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="NormalImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="hover">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="HoverImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="pushed">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="PushedImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <ImagerySection name="disabled">
+            <ImageryComponent>
+                <Area>
+                    <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
+                    <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
+                    <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
+                </Area>
+                <ImageProperty name="DisabledImage" />
+                <VertFormatProperty name="VertImageFormatting" />
+                <HorzFormatProperty name="HorzImageFormatting" />
+            </ImageryComponent>
+        </ImagerySection>
+        <StateImagery name="Normal">
+            <Layer>
+                <Section section="normal" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Hover">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Pushed">
+            <Layer>
+                <Section section="pushed" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="PushedOff">
+            <Layer>
+                <Section section="hover" />
+            </Layer>
+        </StateImagery>
+        <StateImagery name="Disabled">
+            <Layer>
+                <Section section="disabled" />
+            </Layer>
+        </StateImagery>
+    </WidgetLook>
+
+</Falagard>
+
Index: /code/branches/audio/Media/gui/TaharezLookSkin.scheme
===================================================================
--- /code/branches/audio/Media/gui/TaharezLookSkin.scheme	(revision 310)
+++ /code/branches/audio/Media/gui/TaharezLookSkin.scheme	(revision 310)
@@ -0,0 +1,48 @@
+<?xml version="1.0" ?>
+<GUIScheme Name="TaharezLook">
+	<Imageset Name="TaharezLook" Filename="TaharezLook.imageset" />
+    <Font Name="BlueHighway-12" Filename="bluehighway-12.font" />
+    <Font Name="BlueHighway-10" Filename="bluehighway-10.font" />
+    <Font Name="BlueHighway-8" Filename="bluehighway-8.font" />
+	<LookNFeel Filename="TaharezLook.looknfeel" />
+	<WindowRendererSet Filename="CEGUIFalagardWRBase" />
+	<FalagardMapping WindowType="TaharezLook/Button"      TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="TaharezLook/Button" />
+	<FalagardMapping WindowType="TaharezLook/Checkbox"    TargetType="CEGUI/Checkbox"    Renderer="Falagard/ToggleButton" LookNFeel="TaharezLook/Checkbox" />
+	<FalagardMapping WindowType="TaharezLook/ImageButton" TargetType="CEGUI/PushButton"  Renderer="Falagard/Button"       LookNFeel="TaharezLook/ImageButton" />
+	<FalagardMapping WindowType="TaharezLook/RadioButton" TargetType="CEGUI/RadioButton" Renderer="Falagard/ToggleButton" LookNFeel="TaharezLook/RadioButton" />
+	<FalagardMapping WindowType="TaharezLook/FrameWindow"  TargetType="CEGUI/FrameWindow" Renderer="Falagard/FrameWindow"  LookNFeel="TaharezLook/FrameWindow" />
+	<FalagardMapping WindowType="TaharezLook/Titlebar"     TargetType="CEGUI/Titlebar"    Renderer="Falagard/Titlebar"     LookNFeel="TaharezLook/Titlebar" />
+	<FalagardMapping WindowType="TaharezLook/SystemButton" TargetType="CEGUI/PushButton"  Renderer="Falagard/SystemButton" LookNFeel="TaharezLook/Button" />
+	<FalagardMapping WindowType="TaharezLook/Editbox"          TargetType="CEGUI/Editbox"          Renderer="Falagard/Editbox"          LookNFeel="TaharezLook/Editbox" />
+	<FalagardMapping WindowType="TaharezLook/MultiLineEditbox" TargetType="CEGUI/MultiLineEditbox" Renderer="Falagard/MultiLineEditbox" LookNFeel="TaharezLook/MultiLineEditbox" />
+	<FalagardMapping WindowType="TaharezLook/Menubar"   TargetType="CEGUI/Menubar"   Renderer="Falagard/Menubar"   LookNFeel="TaharezLook/Menubar" />
+	<FalagardMapping WindowType="TaharezLook/PopupMenu" TargetType="CEGUI/PopupMenu" Renderer="Falagard/PopupMenu" LookNFeel="TaharezLook/PopupMenu" />
+	<FalagardMapping WindowType="TaharezLook/MenuItem"  TargetType="CEGUI/MenuItem"  Renderer="Falagard/MenuItem"  LookNFeel="TaharezLook/MenuItem" />
+	<FalagardMapping WindowType="TaharezLook/AlternateProgressBar" TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/AltProgressBar" />
+	<FalagardMapping WindowType="TaharezLook/ProgressBar"          TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/ProgressBar" />
+	<FalagardMapping WindowType="TaharezLook/VUMeter"              TargetType="CEGUI/ProgressBar" Renderer="Falagard/ProgressBar" LookNFeel="TaharezLook/VUMeter" />
+	<FalagardMapping WindowType="TaharezLook/VerticalScrollbar"   TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/VerticalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/HorizontalScrollbar" TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/HorizontalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/VerticalScrollbarThumb"   TargetType="CEGUI/Thumb" Renderer="Falagard/Button" LookNFeel="TaharezLook/VerticalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/HorizontalScrollbarThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button" LookNFeel="TaharezLook/HorizontalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/LargeVerticalScrollbar"      TargetType="CEGUI/Scrollbar" Renderer="Falagard/Scrollbar" LookNFeel="TaharezLook/LargeVerticalScrollbar" />
+	<FalagardMapping WindowType="TaharezLook/LargeVerticalScrollbarThumb" TargetType="CEGUI/Thumb"     Renderer="Falagard/Button"    LookNFeel="TaharezLook/LargeVerticalScrollbarThumb" />
+	<FalagardMapping WindowType="TaharezLook/TabButton"  TargetType="CEGUI/TabButton"  Renderer="Falagard/TabButton"  LookNFeel="TaharezLook/TabButton" />
+	<FalagardMapping WindowType="TaharezLook/TabControl" TargetType="CEGUI/TabControl" Renderer="Falagard/TabControl" LookNFeel="TaharezLook/TabControl" />
+	<FalagardMapping WindowType="TaharezLook/TabContentPane"    TargetType="DefaultWindow"    Renderer="Falagard/Default"    LookNFeel="TaharezLook/TabContentPane" />
+	<FalagardMapping WindowType="TaharezLook/TabButtonPane"    TargetType="DefaultWindow"    Renderer="Falagard/Default"    LookNFeel="TaharezLook/TabButtonPane" />
+	<FalagardMapping WindowType="TaharezLook/ComboDropList" TargetType="CEGUI/ComboDropList" Renderer="Falagard/Listbox" LookNFeel="TaharezLook/ComboDropList" />
+	<FalagardMapping WindowType="TaharezLook/ComboEditbox"  TargetType="CEGUI/Editbox"	 Renderer="Falagard/Editbox" LookNFeel="TaharezLook/ComboEditbox" />
+	<FalagardMapping WindowType="TaharezLook/Combobox"	TargetType="CEGUI/Combobox"	 Renderer="Falagard/Default" LookNFeel="TaharezLook/Combobox" />
+	<FalagardMapping WindowType="TaharezLook/Listbox"           TargetType="CEGUI/Listbox"           Renderer="Falagard/Listbox"           LookNFeel="TaharezLook/Listbox" />
+	<FalagardMapping WindowType="TaharezLook/ListHeader"        TargetType="CEGUI/ListHeader"        Renderer="Falagard/ListHeader"        LookNFeel="TaharezLook/ListHeader" />
+	<FalagardMapping WindowType="TaharezLook/ListHeaderSegment" TargetType="CEGUI/ListHeaderSegment" Renderer="Falagard/ListHeaderSegment" LookNFeel="TaharezLook/ListHeaderSegment" />
+	<FalagardMapping WindowType="TaharezLook/MultiColumnList"   TargetType="CEGUI/MultiColumnList"   Renderer="Falagard/MultiColumnList"   LookNFeel="TaharezLook/MultiColumnList" />
+	<FalagardMapping WindowType="TaharezLook/Slider"      TargetType="CEGUI/Slider"      Renderer="Falagard/Slider"  LookNFeel="TaharezLook/Slider" />
+	<FalagardMapping WindowType="TaharezLook/SliderThumb" TargetType="CEGUI/Thumb" Renderer="Falagard/Button"  LookNFeel="TaharezLook/SliderThumb" />
+	<FalagardMapping WindowType="TaharezLook/ScrollablePane" TargetType="CEGUI/ScrollablePane" Renderer="Falagard/ScrollablePane" LookNFeel="TaharezLook/ScrollablePane" />
+	<FalagardMapping WindowType="TaharezLook/Spinner" TargetType="CEGUI/Spinner" Renderer="Falagard/Default" LookNFeel="TaharezLook/Spinner" />
+	<FalagardMapping WindowType="TaharezLook/Tooltip" TargetType="CEGUI/Tooltip" Renderer="Falagard/Tooltip" LookNFeel="TaharezLook/Tooltip" />
+	<FalagardMapping WindowType="TaharezLook/StaticImage" TargetType="DefaultWindow" Renderer="Falagard/StaticImage" LookNFeel="TaharezLook/StaticImage" />
+	<FalagardMapping WindowType="TaharezLook/StaticText"  TargetType="DefaultWindow" Renderer="Falagard/StaticText"  LookNFeel="TaharezLook/StaticText" />
+</GUIScheme>
Index: /code/branches/audio/Media/gui/TaharezLookWidgetAliases.scheme
===================================================================
--- /code/branches/audio/Media/gui/TaharezLookWidgetAliases.scheme	(revision 310)
+++ /code/branches/audio/Media/gui/TaharezLookWidgetAliases.scheme	(revision 310)
@@ -0,0 +1,34 @@
+<?xml version="1.0" ?>
+<GUIScheme Name="TaharezLookWidgetAliases">
+	<WindowAlias Alias="Taharez AltProgressBar" Target="TaharezLook/AlternateProgressBar" />
+	<WindowAlias Alias="Taharez Button" Target="TaharezLook/Button" />
+	<WindowAlias Alias="Taharez Checkbox" Target="TaharezLook/Checkbox" />
+	<WindowAlias Alias="Taharez Close Button" Target="TaharezLook/CloseButton" />
+	<WindowAlias Alias="Taharez Combobox" Target="TaharezLook/Combobox" />
+	<WindowAlias Alias="Taharez ComboDropList" Target="TaharezLook/ComboDropList" />
+	<WindowAlias Alias="Taharez ComboEditbox" Target="TaharezLook/ComboEditbox" />
+	<WindowAlias Alias="Taharez Editbox" Target="TaharezLook/Editbox" />
+	<WindowAlias Alias="Taharez Frame Window" Target="TaharezLook/FrameWindow" />
+	<WindowAlias Alias="Taharez Listbox" Target="TaharezLook/Listbox" />
+	<WindowAlias Alias="Taharez ListHeader" Target="TaharezLook/ListHeader" />
+	<WindowAlias Alias="Taharez ListHeaderSegment" Target="TaharezLook/ListHeaderSegment" />
+	<WindowAlias Alias="Taharez MiniHorzScrollbar" Target="TaharezLook/HorizontalScrollbar" />
+	<WindowAlias Alias="Taharez MiniHorzScrollbarThumb" Target="TaharezLook/HorizontalScrollbarThumb" />
+	<WindowAlias Alias="Taharez MiniVertScrollbar" Target="TaharezLook/VerticalScrollbar" />
+	<WindowAlias Alias="Taharez MiniVertScrollbarThumb" Target="TaharezLook/VerticalScrollbarThumb" />
+	<WindowAlias Alias="Taharez MultiColumnList" Target="TaharezLook/MultiColumnList" />
+	<WindowAlias Alias="Taharez MultiLineEditbox" Target="TaharezLook/MultiLineEditbox" />
+	<WindowAlias Alias="Taharez ProgressBar" Target="TaharezLook/ProgressBar" />
+	<WindowAlias Alias="Taharez RadioButton" Target="TaharezLook/RadioButton" />
+	<WindowAlias Alias="Taharez Slider" Target="TaharezLook/Slider" />
+	<WindowAlias Alias="Taharez Slider Thumb" Target="TaharezLook/SliderThumb" />
+	<WindowAlias Alias="Taharez StaticImage" Target="TaharezLook/StaticImage" />
+	<WindowAlias Alias="Taharez StaticText" Target="TaharezLook/StaticText" />
+	<WindowAlias Alias="Taharez Tab Button" Target="TaharezLook/TabButton" />
+	<WindowAlias Alias="Taharez Tab Pane" Target="TaharezLook/TabPane" />
+	<WindowAlias Alias="Taharez Tab Control" Target="TaharezLook/TabControl" />
+	<WindowAlias Alias="Taharez Titlebar" Target="TaharezLook/Titlebar" />
+	<WindowAlias Alias="Taharez VertScrollbar" Target="TaharezLook/LargeVerticalScrollbar" />
+	<WindowAlias Alias="Taharez VertScrollbarThumb" Target="TaharezLook/LargeVerticalScrollbarThumb" />
+</GUIScheme>
+
Index: /code/branches/audio/Media/gui/bluehighway-10.font
===================================================================
--- /code/branches/audio/Media/gui/bluehighway-10.font	(revision 310)
+++ /code/branches/audio/Media/gui/bluehighway-10.font	(revision 310)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-10" Filename="bluehigh.ttf" Type="FreeType" Size="10" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="false" AntiAlias="true" />
Index: /code/branches/audio/Media/gui/bluehighway-12.font
===================================================================
--- /code/branches/audio/Media/gui/bluehighway-12.font	(revision 310)
+++ /code/branches/audio/Media/gui/bluehighway-12.font	(revision 310)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-12" Filename="bluehigh.ttf" Type="FreeType" Size="12" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"/>
Index: /code/branches/audio/Media/gui/bluehighway-8.font
===================================================================
--- /code/branches/audio/Media/gui/bluehighway-8.font	(revision 310)
+++ /code/branches/audio/Media/gui/bluehighway-8.font	(revision 310)
@@ -0,0 +1,2 @@
+<?xml version="1.0" ?>
+<Font Name="BlueHighway-8" Filename="bluehigh.ttf" Type="FreeType" Size="8" NativeHorzRes="1024" NativeVertRes="768" AutoScaled="true" AntiAlias="true" />
Index: /code/branches/audio/Media/gui/cegui8.layout
===================================================================
--- /code/branches/audio/Media/gui/cegui8.layout	(revision 310)
+++ /code/branches/audio/Media/gui/cegui8.layout	(revision 310)
@@ -0,0 +1,130 @@
+<?xml version="1.0" ?>
+<!-- Layout file from CEGUI Demo8 -->
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="demo_root">
+
+	<Window Type="DefaultGUISheet" Name="Demo8">
+
+		<Property Name="UnifiedMaxSize" Value="{{1,0},{2,0}}" />
+		<Property Name="UnifiedSize" Value="{{1,0},{2,0}}"  />
+
+		<Window Type="TaharezLook/VerticalScrollbar" Name="Demo8/ViewScroll">
+			<Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}"  />
+			<Property Name="UnifiedSize" Value="{{0.03,0},{0.75,0}}"  />
+			<Property Name="DocumentSize" Value="2" />
+			<Property Name="PageSize" Value="1" />
+			<Property Name="StepSize" Value="0.01" />
+			<Property Name="OverlapSize" Value="0.5" />
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window1">
+			<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{1,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
+			<Property Name="UnifiedSize" Value="{{0.4,0},{0.35,0}}"  />
+			<Property Name="Text" Value="Demo 8 - Listbox Demo" />
+
+			<Window Type="TaharezLook/Listbox" Name="Demo8/Window1/Listbox">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.33,0}}"  />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.45,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.5,0}}"  />
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Red">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.05,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Green">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.12,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="256" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Demo8/Window1/Controls/Blue">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.19,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.06,0}}"  />
+					<Property Name="DocumentSize" Value="255" />
+					<Property Name="PageSize" Value="16" />
+					<Property Name="StepSize" Value="1" />
+					<Property Name="OverlapSize" Value="1" />
+				</Window>
+
+				<Window Type="TaharezLook/StaticImage" Name="Demo8/Window1/Controls/ColourSample">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.26,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.1,0}}"  />
+					<Property Name="Image" Value="set:TaharezLook image:ListboxSelectionBrush" />
+					<Property Name="ImageColours" Value="tl:0 tr:0 bl:0 br:0" />
+				</Window>
+
+				<Window Type="TaharezLook/Editbox" Name="Demo8/Window1/Controls/Editbox">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.38,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.6,0},{0.15,0}}"  />
+				</Window>
+
+                <Window Type="TaharezLook/Button" Name="Demo8/Window1/Controls/Add">
+					<Property Name="UnifiedPosition" Value="{{0.68,0},{0.38,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.3,0},{0.15,0}}"  />
+					<Property Name="Text" Value="Add" />
+				</Window>
+
+                <Window Type="TaharezLook/StaticText" Name="Demo8/Window1/Controls/ins1">
+					<Property Name="UnifiedPosition" Value="{{0.05,0},{0.55,0}}"  />
+					<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}"  />
+					<Property Name="HorzFormatting" Value="WordWrapCentred" />
+					<Property Name="Text" Value="Use this panel to add items.  The scrollbars change the selection colour." />
+				</Window>
+
+			</Window>
+			
+		</Window>
+
+        <Window Type="TaharezLook/FrameWindow" Name="Demo8/Window2">
+			<Property Name="UnifiedPosition" Value="{{0.55,0},{0.1,0}}"  />
+			<Property Name="UnifiedMaxSize" Value="{{0.5,0},{1,0}}" />
+			<Property Name="UnifiedMinSize" Value="{{0,128},{0,128}}" />
+			<Property Name="UnifiedSize" Value="{{0.4,0},{0.3,0}}"  />
+			<Property Name="Text" Value="Demo 8 - Information Window" />
+
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Info">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.1,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.3,0}}"  />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+				<Property Name="Text" Value="The panel below gives some information about the item under the mouse." />
+			</Window>
+	
+            <Window Type="TaharezLook/StaticText" Name="Demo8/Window2/Tips">
+				<Property Name="UnifiedPosition" Value="{{0.05,0},{0.5,0}}"  />
+				<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+				<Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}"  />
+				<Property Name="HorzFormatting" Value="WordWrapCentred" />
+			</Window>
+
+		</Window>
+
+
+	</Window>
+
+</Window>
+
+</GUILayout>
Index: /code/branches/audio/Media/gui/facial.layout
===================================================================
--- /code/branches/audio/Media/gui/facial.layout	(revision 310)
+++ /code/branches/audio/Media/gui/facial.layout	(revision 310)
@@ -0,0 +1,379 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+    <Window Type="DefaultGUISheet" Name="FacialDemo">
+		<Property Name="UnifiedSize" Value="{{0.25,0},{1,0}}" />
+
+		<Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
+
+			<Property Name="UnifiedSize" Value="{{0,200},{0,400}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0,0.52}}" />
+            <Property Name="TitlebarEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+			<Property Name="Text" Value="Editor Window" />
+			<Window Type="TaharezLook/RadioButton" Name="Facial/Radio/Play">
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,15},{0,5}}" />
+				<Property Name="UnifiedSize" Value="{{0,90},{0,40}}" />
+                <Property Name="Text" Value="Animation" />
+            </Window>
+			<Window Type="TaharezLook/RadioButton" Name="Facial/Radio/Manual">
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,110},{0,5}}" />
+				<Property Name="UnifiedSize" Value="{{0,90},{0,40}}" />
+                <Property Name="Text" Value="Manual" />
+			</Window>				
+			<Window Type="TaharezLook/StaticText" Name="Facial/Expressions">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,35}}" />
+				<Property Name="UnifiedSize" Value="{{0,190},{0,40}}" />
+                <Property Name="Text" Value="Expressions" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Happy_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,55}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Happy" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Happy_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,75}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Sad_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,70}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Sad" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Sad_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,90}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/Angry_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,5},{0,85}}" />
+				<Property Name="UnifiedSize" Value="{{0,60},{0,40}}" />
+                <Property Name="Text" Value="Angry" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/Angry_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,105}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+			</Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Facial/MouthShapes">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,5},{0,110}}" />
+				<Property Name="UnifiedSize" Value="{{0,150},{0,40}}" />
+                <Property Name="Text" Value="Mouth Shapes" />
+            </Window>
+
+			<Window Type="TaharezLook/StaticText" Name="Facial/A_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,135}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="A" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/A_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,150}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/E_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,150}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="E" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/E_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,165}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/I_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,165}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="I" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/I_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,180}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/O_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,180}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="O" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/O_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,195}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/U_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,195}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="U" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/U_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,210}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/C_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,210}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="C" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/C_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,225}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+			</Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/W_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+				<Property Name="UnifiedPosition" Value="{{0,25},{0,225}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="W" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/W_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,240}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/M_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,240}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="M" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/M_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,255}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/L_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,255}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="L" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/L_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,270}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/F_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,270}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="F" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/F_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,285}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/T_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,285}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="T" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/T_Scroll">
+
+				<Property Name="UnifiedPosition" Value="{{0,60},{0,300}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/P_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,300}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="P" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/P_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,315}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/R_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,315}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="R" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/R_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,330}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/S_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,330}}" />
+				<Property Name="UnifiedSize" Value="{{0,30},{0,40}}" />
+                <Property Name="Text" Value="S" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/S_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,345}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			<Window Type="TaharezLook/StaticText" Name="Facial/TH_Label">
+				<Property Name="FrameEnabled" Value="False"/>
+				<Property Name="BackgroundEnabled" Value="False"/>
+				<Property Name="Font" Value="BlueHighway-12"/>
+
+                <Property Name="UnifiedPosition" Value="{{0,25},{0,345}}" />
+				<Property Name="UnifiedSize" Value="{{0,35},{0,40}}" />
+                <Property Name="Text" Value="TH" />
+            </Window>
+			<Window Type="TaharezLook/HorizontalScrollbar" Name="Facial/TH_Scroll">
+
+                <Property Name="UnifiedPosition" Value="{{0,60},{0,360}}" />
+				<Property Name="UnifiedSize" Value="{{0,120},{0,10}}" />
+				<Property Name="DocumentSize" Value="1.1" />
+				<Property Name="PageSize" Value="0.1" />
+				<Property Name="StepSize" Value="0.05" />
+				<Property Name="OverlapSize" Value="0.05" />
+            </Window>
+			
+			<!-- A, U, O, E, I, C, W, M, L, F, T, P, R, S, TH -->
+
+        </Window>
+	</Window>
+</Window>
+
+</GUILayout>
Index: /code/branches/audio/Media/gui/ogregui.layout
===================================================================
--- /code/branches/audio/Media/gui/ogregui.layout	(revision 310)
+++ /code/branches/audio/Media/gui/ogregui.layout	(revision 310)
@@ -0,0 +1,79 @@
+<?xml version="1.0" ?>
+<GUILayout>
+<Window Type="DefaultGUISheet" Name="root">
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo">
+		<Property Name="UnifiedSize" Value="{{0.25,0},{1,0}}" />
+
+        <Window Type="TaharezLook/TabControl" Name="OgreGuiDemo/TabCtrl">
+            <Property Name="UnifiedPosition" Value="{{0.0,0},{0.0,0}}" />
+            <Property Name="UnifiedSize" Value="{{1,0},{0.5,0}}" />
+
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page1">
+                <Property Name="Text" Value="File" />
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/NewButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="New" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/LoadButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.2,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="Load Test Layout" />
+                </Window>
+                <Window Type="TaharezLook/Button" Name="OgreGuiDemo/TabCtrl/Page1/QuitButton">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.3,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.07,0}}" />
+                    <Property Name="Text" Value="Quit" />
+                </Window>
+            </Window>
+            <Window Type="DefaultGUISheet" Name="OgreGuiDemo/TabCtrl/Page2">
+                <Property Name="Text" Value="Objects" />
+                <Window Type="TaharezLook/Combobox" Name="OgreGuiDemo/TabCtrl/Page2/ObjectTypeList">
+                    <Property Name="UnifiedPosition" Value="{{0.1,0},{0.1,0}}" />
+                    <Property Name="UnifiedSize" Value="{{0.8,0},{0.5,0}}" />
+                    <Property Name="Text" Value="Select Type" />
+                    <Property Name="ClippedByParent" Value="false" />
+                    <Property Name="ReadOnly" Value="true" />
+                </Window>
+            </Window>
+        </Window>
+        <!--<Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo/WindowPropertiesWindow">
+            <Property Name="UnifiedSize" Value="{{1,0},{0.3,0}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0.52,0}}" />
+            <Property Name="TitlebarEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Visible" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+            <Window Type="TaharezLook/StaticText" Name="OgreGuiDemo/WindowProperties/NameText">
+                <Property Name="UnifiedPosition" Value="{{0.05,0},{0.2,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.9,0},{0.4,0}}" />
+                <Property Name="Text" Value="Name:" />
+            </Window>
+
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/OKButton">
+                <Property Name="UnifiedPosition" Value="{{0.15,0},{0.8,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.3,0},{0.1,0}}" />
+                <Property Name="Text" Value="OK" />
+            </Window>
+            <Window Type="TaharezLook/Button" Name="OgreGuiDemo/WindowPropertiesWindow/CancelButton">
+                <Property Name="UnifiedPosition" Value="{{0.55,0},{0.8,0}}" />
+                <Property Name="UnifiedSize" Value="{{0.3,0},{0.1,0}}" />
+                <Property Name="Text" Value="Cancel" />
+            </Window>
+        </Window>-->
+	</Window>
+    <Window Type="DefaultGUISheet" Name="OgreGuiDemo2">
+		<Property Name="UnifiedSize" Value="{{0.75,0},{1,0}}" />
+		<Property Name="UnifiedPosition" Value="{{0.25,0},{0,0}}" />
+        <Window Type="TaharezLook/FrameWindow" Name="OgreGuiDemo2/MainWindow">
+            <Property Name="UnifiedSize" Value="{{1,0},{1,0}}" />
+            <Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
+            <Property Name="DragMovingEnabled" Value="false" />
+            <Property Name="RollUpEnabled" Value="false" />
+            <Property Name="CloseButtonEnabled" Value="false" />
+            <Property Name="Text" Value="Editor Window" />
+        </Window>
+    </Window>
+</Window>
+
+</GUILayout>
Index: /code/branches/audio/Media/gui/shadows.layout
===================================================================
--- /code/branches/audio/Media/gui/shadows.layout	(revision 310)
+++ /code/branches/audio/Media/gui/shadows.layout	(revision 310)
@@ -0,0 +1,247 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<GUILayout >
+    <Window Type="DefaultWindow" Name="Shadows" >
+        <Property Name="InheritsAlpha" Value="False" />
+        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+        <Window Type="TaharezLook/FrameWindow" Name="Shadows/Main" >
+            <Property Name="Font" Value="BlueHighway-12" />
+            <Property Name="Alpha" Value="0.5" />
+            <Property Name="FrameEnabled" Value="False" />
+            <Property Name="TitlebarFont" Value="BlueHighway-12" />
+            <Property Name="SizingEnabled" Value="False" />
+            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+            <Property Name="TitlebarEnabled" Value="False" />
+            <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.797107,0},{0.148408,0}}" />
+            <Property Name="DragMovingEnabled" Value="False" />
+            <Property Name="CloseButtonEnabled" Value="False" />
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Stencil" >
+                <Property Name="ID" Value="1" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Stencil shadows" />
+                <Property Name="GroupID" Value="1" />
+                <Property Name="Tooltip" Value="Stencil Shadows: Geometric shadow volumes are generated from mesh silhouettes and extruded, shadowed areas calculated in the stencil buffer. Good on lower end hardware but cannot handle alpha or vertex programs that deform shape, and is too expensive at high poly counts. Sharp edged shadows." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00465426,0},{0.167892,0},{0.192628,0},{0.344774,0}}" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Texture" >
+                <Property Name="ID" Value="2" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Texture shadows" />
+                <Property Name="GroupID" Value="1" />
+                <Property Name="Tooltip" Value="Texture Shadows: Shadow casters are rendered to a texture and this is later projected onto shadow receivers. More flexible,  handles alpha and deforming vertex programs, and texture shadow can be used in shaders for more advanced effects. Uses more GPU memory and fixed size can cause aliasing (but see projection options)" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00531136,0},{0.362541,0},{0.194019,0},{0.529099,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Label2" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Lighting:" />
+                <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.19234,0},{-0.0189824,0},{0.303863,0},{0.18662,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Label1" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Technique:" />
+                <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.00658522,0},{-0.00904641,0},{0.160622,0},{0.186908,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Additive" >
+                <Property Name="ID" Value="3" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Additive" />
+                <Property Name="GroupID" Value="2" />
+                <Property Name="Tooltip" Value="Additive Lighting: Light is built up incrementally in the scene, and areas of shadow are masked out per light during the process. Much more realistic lighting model, taking into account multiple coloured lights and ambient contribution well, but more expensive since it can take more passes to render." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.196723,0},{0.174711,0},{0.327724,0},{0.348675,0}}" />
+            </Window>
+            <Window Type="TaharezLook/RadioButton" Name="Shadows/Modulative" >
+                <Property Name="ID" Value="4" />
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="Text" Value="Modulative" />
+                <Property Name="GroupID" Value="2" />
+                <Property Name="Tooltip" Value="Modulative shadows: Shadowed areas are uniformly darkened by a shadow colour after rendering the scene normally. A simple but inaccurate model, it works best when there is one dominant light source (e.g. outdoor daylight). Multiple lights exhibit overdarkening artefacts." />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.195901,0},{0.36936,0},{0.334983,0},{0.532604,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticText" Name="Shadows/Desc" >
+                <Property Name="Font" Value="BlueHighway-10" />
+                <Property Name="Text" >
+</Property>
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="InheritsAlpha" Value="False" />
+                <Property Name="HorzFormatting" Value="WordWrapLeftAligned" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="VertFormatting" Value="TopAligned" />
+                <Property Name="UnifiedAreaRect" Value="{{-0.00124776,0},{0.534509,0},{0.998327,0},{1.00537,0}}" />
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/ProjectionGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.318294,0},{0.0269328,0},{0.547929,0},{0.488323,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/Label21" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Projection:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0242767,0},{-0.00538364,0},{0.514109,0},{0.300338,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Shadows/Projection" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Tooltip" Value="Projection: This is the basis for the shadow projection. A uniform projection is the simplest but can also cause aliasing close to the camera due to the finite resolution of the shadow texture. You can plug new ShadowCameraSetup classes to change the projection basis and distribute the shadow texture differently to compensate for this." />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.0215161,0},{0.406132,0},{1.00682,0},{4,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/MaterialGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.554514,0},{0.0286934,0},{0.927227,0},{0.490084,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/Label211" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Text" Value="Material Setup:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.021516,0},{-0.158454,0},{0.862772,0},{0.387132,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/Combobox" Name="Shadows/Material" >
+                    <Property Name="Font" Value="BlueHighway-12" />
+                    <Property Name="Tooltip" Value="Material setup: You can customise materials texture shadows with material; you can modify the standard shadow passes, which are separate from the normal render, or you can use &apos;custom sequence&apos; shadows which allow you to incorporate shadow textures directly in your own materials, thus gaining complete control. Both can use shaders for effects like PCF / depth shadowmapping." />
+                    <Property Name="ReadOnly" Value="True" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.021516,0},{0.406132,0},{0.731289,0},{4,0}}" />
+                    <Property Name="MaxEditTextLength" Value="1073741823" />
+                </Window>
+            </Window>
+            <Window Type="TaharezLook/StaticImage" Name="Shadows/DepthShadowTweakGroup" >
+                <Property Name="Font" Value="BlueHighway-12" />
+                <Property Name="FrameEnabled" Value="False" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.825038,0},{0.0186838,0},{0.999281,0},{0.548657,0}}" />
+                <Property Name="BackgroundEnabled" Value="False" />
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/FixedBiasLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="FixedBias:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.0,0},{0.373716,0},{0.2,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/FixedBias" >
+                    <Property Name="PageSize" Value="0.001" />
+                    <Property Name="StepSize" Value="0.0005" />
+                    <Property Name="OverlapSize" Value="0.0005" />
+                    <Property Name="DocumentSize" Value="0.021" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.0,0},{1,0},{0.15,0}}" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/FixedBiasText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.125,0},{0.943746,0},{0.3,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeBiasLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+                    <Property Name="Text" Value="SlopeBias:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.35,0},{0.373716,0},{0.55,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/SlopeBias" >
+                    <Property Name="PageSize" Value="0.1" />
+                    <Property Name="StepSize" Value="0.05" />
+                    <Property Name="OverlapSize" Value="0.05" />
+                    <Property Name="DocumentSize" Value="2.1" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.35,0},{1,0},{0.5,0}}" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeBiasText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.475,0},{0.943746,0},{0.675,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeClampLabel" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="Clamp:" />
+                    <Property Name="TextColours" Value="tl:FFFFFF00 tr:FFFFFF00 bl:FFFFFF00 br:FFFFFF00" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.0316741,0},{0.675,0},{0.472153,0},{0.85,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="Shadows/DepthShadowTweakGroup/SlopeClamp" >
+                    <Property Name="PageSize" Value="0.01" />
+                    <Property Name="StepSize" Value="0.005" />
+                    <Property Name="OverlapSize" Value="0.005" />
+                    <Property Name="DocumentSize" Value="0.11" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="ClippedByParent" Value="False" />
+					<Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.7,0},{1,0},{0.85,0}}" />
+                </Window>
+				<Window Type="TaharezLook/StaticText" Name="Shadows/DepthShadowTweakGroup/SlopeClampText" >
+                    <Property Name="Font" Value="BlueHighway-10" />
+					<Property Name="Text" Value="" />
+                    <Property Name="FrameEnabled" Value="False" />
+                    <Property Name="InheritsAlpha" Value="False" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+					<Property Name="UnifiedAreaRect" Value="{{0.70,0},{0.825,0},{0.943746,0},{0.99,0}}" />
+                    <Property Name="BackgroundEnabled" Value="False" />
+                </Window>
+            </Window>
+        </Window>
+    </Window>
+</GUILayout>
Index: /code/branches/audio/Media/materials/scripts/Example.material
===================================================================
--- /code/branches/audio/Media/materials/scripts/Example.material	(revision 310)
+++ /code/branches/audio/Media/materials/scripts/Example.material	(revision 310)
@@ -0,0 +1,1044 @@
+
+material Examples/EnvMappedRustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/OgreLogo
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.8 0.8 0.8
+
+			texture_unit
+			{
+				texture ogrelogo.png
+			}
+		}
+	}
+}
+material Examples/DarkMaterial
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.1 0.1 0.1
+
+			texture_unit
+			{
+				texture BeachStones.jpg
+			}
+		}
+	}
+}
+material Examples/SpaceSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stevecube.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubemap_fr.jpg cubemap_bk.jpg cubemap_lf.jpg cubemap_rt.jpg cubemap_up.jpg cubemap_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap1
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubemap.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+material Examples/SceneSkyBox2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cubescene_fr.jpg cubescene_bk.jpg cubescene_lf.jpg cubescene_rt.jpg cubescene_up.jpg cubescene_dn.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Examples/SceneCubeMap2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture cubescene.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+material Examples/CloudyNoonSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture cloudy_noon.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/StormySkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture stormy.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+
+fragment_program Examples/MorningSkyBoxHDRfp cg
+{
+	source hdr.cg
+	entry_point morningskybox_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+			depth_write off
+
+			vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named ambient float4 1 1 1 1
+			}
+			fragment_program_ref Examples/MorningSkyBoxHDRfp
+			{
+			}
+
+			texture_unit
+			{
+				cubic_texture morning.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+fragment_program Examples/MorningCubeMapHDRfp cg
+{
+	source hdr.cg
+	entry_point morningcubemap_fp
+	profiles ps_2_0 arbfp1
+
+}
+material Examples/MorningCubeMap
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+	// HDR technique (fake)
+	technique
+	{
+		scheme HDR
+
+		pass
+		{
+			lighting off
+
+			fragment_program_ref Examples/MorningCubeMapHDRfp
+			{
+			}
+			texture_unit
+			{
+				cubic_texture morning.jpg combinedUVW
+				tex_address_mode clamp
+				env_map cubic_reflection
+			}
+		}
+	}
+}
+
+
+material Examples/EveningSkyBox
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				cubic_texture evening.jpg separateUV
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material Examples/CloudySky
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+
+			texture_unit
+			{
+				texture clouds.jpg
+				scroll_anim 0.15 0
+			}
+		}
+	}
+}
+material Examples/RustySteel
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture RustySteel.jpg
+			}
+		}
+	}
+}
+material Examples/Chrome
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Chrome.jpg
+				env_map spherical
+			}
+		}
+	}
+}
+material Examples/SpaceSkyPlane
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_write off
+			fog_override true none
+
+			texture_unit
+			{
+				texture spacesky.jpg
+			}
+		}
+	}
+}
+material Examples/TextureEffect1
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+				rotate_anim 0.2
+				wave_xform scale_x sine 1 0.1 0 5
+				wave_xform scale_y sine 0.5 0.2 0.5 3
+			}
+		}
+	}
+}
+material Examples/TextureEffect2
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.5 0
+			}
+		}
+	}
+}
+material Examples/TextureEffect3
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim -0.25 0.1
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				scroll_anim -0.1 0.25
+			}
+		}
+	}
+}
+material Examples/TextureEffect4
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.3 0.3 0.3
+			scene_blend colour_blend
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture Water02.jpg
+				scroll_anim 0.01 0.01
+			}
+		}
+	}
+}
+material Examples/BumpyMetal
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.75 0.75 0.75
+			cull_hardware none
+			cull_software none
+
+			texture_unit
+			{
+				texture BumpyMetal.jpg
+			}
+		}
+	}
+}
+material Examples/TransparentTest
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture Water01.jpg
+				scroll_anim 0.25 0
+			}
+
+			texture_unit
+			{
+				texture Water01.jpg
+				wave_xform scroll_y sine 0 0.1 0 0.5
+			}
+		}
+	}
+}
+material Examples/Flare
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+material Examples/Flare2
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture flaretrail.png
+			}
+		}
+	}
+}
+material Examples/FlarePointSprite
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			point_sprites on
+			point_size 2
+			point_size_attenuation on
+
+			texture_unit
+			{
+				texture flare.png
+			}
+		}
+	}
+}
+
+material Examples/Droplet
+{
+	technique
+	{
+		pass
+		{
+			scene_blend colour_blend
+			depth_write off
+
+			texture_unit
+			{
+				texture basic_droplet.png
+			}
+		}
+	}
+}
+material Examples/Hilite/Yellow
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture dkyellow.png
+			}
+		}
+	}
+}
+material Examples/Rocky
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.2 0.2 0.2
+
+			texture_unit
+			{
+				texture egyptrockyfull.jpg
+			}
+		}
+	}
+}
+material Examples/10PointBlock
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture 10points.png
+			}
+		}
+	}
+}
+material Material__25
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture texmap2.jpg
+			}
+		}
+	}
+}
+material 2 - Default
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+		}
+	}
+}
+material Material #8
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture BODY.jpg
+			}
+		}
+	}
+}
+material Material #3
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture HEAD4.jpg
+			}
+		}
+	}
+}
+material Material #9
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture LEGS.jpg
+			}
+		}
+	}
+}
+
+material Examples/Fish
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture steelhead.png
+			}
+		}
+	}
+}
+material Examples/Ninja
+{
+	technique
+	{
+		pass
+		{
+		
+			texture_unit
+			{
+				texture nskingr.jpg
+			}
+		}
+	}
+}
+
+material Examples/Robot
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningOneWeight
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto lightPos[0] light_position 0
+				param_named_auto lightPos[1] light_position 1
+				param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+				param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+				param_named_auto ambient ambient_light_colour
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningOneWeightShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture r2skin.jpg
+			}
+		}
+	}
+}
+
+material Examples/GrassFloor
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture grass_1024.jpg
+			}
+		}
+	}
+}
+
+vertex_program Examples/GrassWaverVp cg
+{
+	source Grass.cg
+	entry_point grass_vp
+	profiles vs_1_1 arbvp1
+}
+
+material Examples/GrassBlades
+{
+	// Vertex program waving grass
+    technique
+    {
+        pass
+        {
+			vertex_program_ref Examples/GrassWaverVp
+			{
+				param_named_auto worldViewProj worldviewproj_matrix
+				param_named_auto ambient ambient_light_colour
+				param_named_auto objSpaceLight light_position_object_space 0
+				param_named_auto lightColour light_diffuse_colour 0
+				param_named_auto offset custom 999
+			}
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+
+	// Non-vertex program technique (no waving)
+	technique
+    {
+        pass
+        {
+			alpha_rejection greater 150 
+			scene_blend alpha_blend
+		    cull_hardware none
+            cull_software none
+            texture_unit
+            {
+                texture gras_02.png 
+            }
+        }
+    }
+}
+
+material Examples/Rockwall
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture rockwall.tga
+			}
+		}
+	}
+}
+
+material Examples/Aureola
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_write off
+			cull_hardware none
+
+			texture_unit
+			{
+				texture aureola.png PF_BYTE_LA
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+// Test hardware morph animation
+material Examples/HardwareMorphAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwareMorphAnimation
+			{
+				// all default
+			}
+
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+		
+		}
+	}
+}
+
+// Test hardware pose animation
+material Examples/HardwarePoseAnimation
+{
+	technique
+	{
+		pass
+		{
+			
+			vertex_program_ref Ogre/HardwarePoseAnimation
+			{
+				// all default
+			}
+			texture_unit
+			{
+				tex_coord_set 0
+				colour_op_ex source1 src_current src_current
+			}
+			// need to define these texture units otherwise GL won't use the uv sets			
+			texture_unit
+			{
+				tex_coord_set 1
+				// also need to set blending to ignore texture which is GL warning texture
+				colour_op_ex source1 src_current src_current
+			}
+			texture_unit
+			{
+				tex_coord_set 2
+				colour_op_ex source1 src_current src_current
+			}
+
+		
+		}
+	}
+}
+
+material RustyBarrel
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+			emissive 0.0 0.0 0.0 1.0
+			texture_unit
+			{
+				texture RustyBarrel.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material WoodPallet
+{
+	receive_shadows on
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.5 1.0
+			diffuse 1.0 1.0 1.0 1.0
+			specular 0.0 0.0 0.0 1.0 12.5
+
+			texture_unit
+			{
+				texture WoodPallet.png
+				filtering trilinear
+			}
+		}
+	}
+}
+
+material Examples/LightRibbonTrail
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend add
+			depth_write off
+
+			texture_unit
+			{
+				texture ribbonband.png 1d
+				tex_address_mode clamp
+				filtering none
+			}
+		}
+	}
+}
+
+material Examples/TudorHouse
+{
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture fw12b.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+
+material jaiqua
+{
+	// Hardware skinning techniique
+	technique
+	{
+		pass
+		{
+			vertex_program_ref Ogre/HardwareSkinningTwoWeights
+			{
+			
+			}
+			// alternate shadow caster program
+			shadow_caster_vertex_program_ref Ogre/HardwareSkinningTwoWeightsShadowCaster
+			{
+				param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+				param_named_auto viewProjectionMatrix viewproj_matrix
+				param_named_auto ambient ambient_light_colour
+			
+			}
+
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+
+	// Software blending technique
+	technique
+	{
+		pass
+		{
+			texture_unit
+			{
+				texture blue_jaiqua.jpg
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
+
+
+material Examples/Plane/IntegratedShadows
+{
+	technique
+	{
+		pass
+		{
+			// Single-pass shadowing
+			texture_unit
+			{
+				texture MtlPlat2.jpg
+			}
+			texture_unit
+			{
+				// standard modulation blend
+				content_type shadow
+				tex_address_mode clamp
+			}
+		}
+	}
+	
+}
Index: /code/branches/audio/Media/materials/scripts/Examples.compositor
===================================================================
--- /code/branches/audio/Media/materials/scripts/Examples.compositor	(revision 310)
+++ /code/branches/audio/Media/materials/scripts/Examples.compositor	(revision 310)
@@ -0,0 +1,592 @@
+// Manuel's bloom
+// Needs a scene-sized rtt, but does only one render of the scene
+compositor Bloom
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 128 128 PF_A8R8G8B8
+        texture rt1 128 128 PF_A8R8G8B8
+
+        target rt1
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt0
+        {
+            // Start with clear texture
+            input none
+            // Vertical blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur0
+                input 0 rt1
+            }
+        }
+
+        target rt1
+        {
+            // Start with clear texture
+            input none
+            // Horizontal blur pass
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Blur1
+                input 0 rt0
+            }
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input previous
+            // Draw a fullscreen quad
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BloomBlend
+                input 0 rt1
+            }
+        }
+    }
+}
+
+compositor Glass
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                material Ogre/Compositor/GlassPass
+                input 0 rt0
+            }
+        }
+    }
+}
+
+compositor "Old TV"
+{
+    technique
+    {
+        texture rt0 target_width target_height PF_R8G8B8
+
+        // render scene to a texture
+        target rt0 { input previous }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+
+            pass render_quad
+            {
+                // convert the previous render target to a black and white image, add some noise, distort it,
+                // then render to scene aligned quad
+                material Ogre/Compositor/OldTV
+                input 0 rt0
+            }
+        }
+    }
+}
+
+
+// Black and white effect
+compositor B&W
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/BlackAndWhite
+                input 0 rt0
+            }
+        }
+    }
+}
+
+//compositor DOF // based on Blur but final pass does depth of field
+//{
+//    technique
+//    {
+//        // Temporary textures
+//        texture rt0 target_width target_height PF_A8R8G8B8
+//        texture rt1 target_width target_height PF_A8R8G8B8
+//
+//        target rt1
+//        {
+//            // Render output from previous compositor (or original scene)
+//            input previous
+//        }
+//
+//        target rt0
+//        {
+//            // Start with clear texture
+//            input none
+//            // Vertical blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur0
+//                input 0 rt1
+//            }
+//        }
+//
+//        target rt1
+//        {
+//            // Start with clear texture
+//            input none
+//            // Horizontal blur pass
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blur1
+//                input 0 rt0
+//            }
+//        }
+//
+//        target_output
+//        {
+//            // Start with clear output
+//            input none
+//            // Draw a fullscreen quad
+//            pass render_quad
+//            {
+//                // Renders a fullscreen quad with a material
+//                material Ogre/Compositor/DOF_Blend
+//                input 0 rt0
+//                input 1 rt1
+//            }
+//        }
+//    }
+//}
+
+// Embossed (fake bump) effect
+compositor Embossed
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Embossed
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// SharpenEdges
+compositor Sharpen Edges
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/SharpenEdges
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Invert
+compositor Invert
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Invert
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Posterize
+compositor Posterize
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Posterize
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Laplace
+compositor Laplace
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Laplace
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Tiling
+compositor Tiling
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/Tiling
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// Old Movie
+compositor Old Movie
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target_output
+        {
+            // Start with clear output
+            input none
+            // Draw a fullscreen quad with the black and white image
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+                material Ogre/Compositor/OldMovie
+                input 0 rt0
+            }
+        }
+    }
+}
+
+// HDR
+compositor HDR
+{
+	// floating point only for now
+	technique
+	{
+        // Temporary textures
+		// Fullsize HDR render target, used as tone mapping source
+        texture rt_full target_width target_height PF_FLOAT16_RGB
+		// Targets used for luminance evaluation (3x3 downsample, point filtering)
+		texture rt_lum0 1 1 PF_FLOAT16_RGB
+		texture rt_lum1 4 4 PF_FLOAT16_RGB
+		texture rt_lum2 16 16 PF_FLOAT16_RGB
+		texture rt_lum3 64 64 PF_FLOAT16_RGB
+		texture rt_lum4 128 128 PF_FLOAT16_RGB
+		// Bright-pass filtered target (tone mapped)
+		texture rt_brightpass 128 128 PF_R8G8B8
+		// Bloom filter targets
+		texture rt_bloom0 128 128 PF_R8G8B8
+		texture rt_bloom1 128 128 PF_R8G8B8
+
+
+		target rt_full
+		{
+			// No input, render differently
+			input none
+
+			// Use float target HDR material scheme (unclamped shaders)
+			material_scheme HDR
+
+			pass clear
+			{
+			}
+
+			pass render_scene
+			{
+			}
+
+		}
+
+		// Downsample the original HDR scene to extract luminence value
+		target rt_lum4
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 2x2 filter and convert to greyscale
+                material Ogre/Compositor/HDR/Downsample2x2Luminence
+                input 0 rt_full
+                identifier 994
+            }
+		}
+		target rt_lum3
+		{
+            input none
+            pass render_quad
+            {
+				// Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum4
+                identifier 993
+            }
+		}
+		target rt_lum2
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum3
+                identifier 992
+            }
+		}
+		target rt_lum1
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum2
+                identifier 991
+            }
+		}
+		target rt_lum0
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter
+                material Ogre/Compositor/HDR/Downsample3x3
+                input 0 rt_lum1
+                identifier 990
+            }
+		}
+
+
+		target rt_brightpass
+		{
+            input none
+            pass render_quad
+            {
+                // Downsample using a 3x3 filter, hi-pass and tone map
+                material Ogre/Compositor/HDR/Downsample3x3Brightpass
+                input 0 rt_full
+		        input 1 rt_lum0
+				identifier 800
+            }
+		}
+
+		target rt_bloom1
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_brightpass
+				identifier 701
+			}
+		}
+		target rt_bloom0
+		{
+			input none
+			pass render_quad
+			{
+				// Blur horizontally
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt_bloom1
+				identifier 700
+			}
+		}
+
+
+		// Final output combines tone mapping of the original scene, with an
+		// exposure setting passed in as a GPU parameter, and an additive bloom
+		// effect
+		target_output
+		{
+			input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/ToneMapping
+				input 0 rt_full
+				input 1 rt_bloom0
+				input 2 rt_lum0
+			}
+		}
+
+
+	}
+
+}
+
+
+// Gaussian blur effect
+compositor Gaussian Blur
+{
+    technique
+    {
+        // Temporary textures
+        texture rt0 target_width target_height PF_A8R8G8B8
+        texture rt1 target_width target_height PF_A8R8G8B8
+
+        target rt0
+        {
+            // Render output from previous compositor (or original scene)
+            input previous
+        }
+
+        target rt1
+        {
+            // Blur horizontally
+            input none
+			pass render_quad
+			{
+				material Ogre/Compositor/HDR/GaussianBloom
+				input 0 rt0
+				identifier 700
+			}
+        }
+
+		target_output
+        {
+            // Start with clear output
+            input none
+            // Blur vertically
+            pass render_quad
+            {
+                // Renders a fullscreen quad with a material
+				material Ogre/Compositor/HDR/GaussianBloom
+                input 0 rt1
+				identifier 701
+            }
+        }
+    }
+}
+
Index: /code/branches/audio/Media/materials/scripts/Examples.program
===================================================================
--- /code/branches/audio/Media/materials/scripts/Examples.program	(revision 310)
+++ /code/branches/audio/Media/materials/scripts/Examples.program	(revision 310)
@@ -0,0 +1,158 @@
+//---------------------------------------------------
+// This file includes a number of basic GPU programs
+// for use in many materials. 
+//---------------------------------------------------
+
+
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTexture cg
+{
+	source Example_Basic.cg
+	entry_point ambientOneTexture_vp
+	profiles vs_1_1 arbvp1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+	
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureHLSL hlsl
+{
+	source Example_Basic.hlsl
+	entry_point ambientOneTexture_vp
+	target vs_1_1
+
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto ambient ambient_light_colour
+	}
+}
+// A really basic ambient pass program, support for one texture coodinate set
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureGLSL glsl
+{
+	source AmbientOneTexture.glsl
+
+	default_params
+	{
+		param_named_auto ambient ambient_light_colour
+	}
+}
+
+vertex_program Ogre/BasicVertexPrograms/AmbientOneTextureUnified unified
+{
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureGLSL
+	delegate Ogre/BasicVertexPrograms/AmbientOneTextureHLSL
+}
+
+
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningOneWeightShadowCaster cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningOneWeightCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+// Basic hardware skinning using one indexed weight per vertex
+vertex_program Ogre/HardwareSkinningOneWeight cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningOneWeight_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true   
+}
+// Same as below, but for use when rendering texture shadows
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterCg cg
+{
+	source Example_Basic.cg
+	entry_point hardwareSkinningTwoWeightsCaster_vp
+	profiles vs_1_1 arbvp1
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL glsl
+{
+	source skinningTwoWeightsShadowCasterVp.glsl
+	includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsShadowCaster unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsShadowCasterCg
+}
+
+// Basic hardware skinning using two indexed weights per vertex
+vertex_program Ogre/HardwareSkinningTwoWeightsCg cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningTwoWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeightsGLSL glsl
+{
+   source skinningTwoWeightsVp.glsl
+   includes_skeletal_animation true
+}
+
+vertex_program Ogre/HardwareSkinningTwoWeights unified
+{
+	delegate Ogre/HardwareSkinningTwoWeightsGLSL
+	delegate Ogre/HardwareSkinningTwoWeightsCg
+	
+   default_params
+   {
+   		param_named_auto worldMatrix3x4Array world_matrix_array_3x4
+		param_named_auto viewProjectionMatrix viewproj_matrix
+		param_named_auto lightPos[0] light_position 0
+		param_named_auto lightPos[1] light_position 1
+		param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
+		param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
+   }
+}
+
+// Basic hardware skinning using four indexed weights per vertex
+vertex_program Ogre/HardwareSkinningFourWeights cg
+{
+   source Example_Basic.cg
+   entry_point hardwareSkinningFourWeights_vp
+   profiles vs_1_1 arbvp1
+   includes_skeletal_animation true
+
+}
+// Basic hardware morph animation 
+vertex_program Ogre/HardwareMorphAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwareMorphAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_morph_animation true
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+// Basic hardware pose animation supporting 2 active poses
+vertex_program Ogre/HardwarePoseAnimation cg
+{
+	source Example_Basic.cg
+	entry_point hardwarePoseAnimation
+	profiles vs_1_1 arbvp1
+
+	includes_pose_animation 2
+	default_params
+	{
+		param_named_auto worldViewProj worldviewproj_matrix
+		param_named_auto anim_t animation_parametric
+	}
+}
+
+
Index: /code/branches/audio/Media/materials/scripts/Ogre.material
===================================================================
--- /code/branches/audio/Media/materials/scripts/Ogre.material	(revision 310)
+++ /code/branches/audio/Media/materials/scripts/Ogre.material	(revision 310)
@@ -0,0 +1,542 @@
+
+material Ogre/Earring
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0
+			diffuse 1 1 0
+
+			texture_unit
+			{
+				texture spheremap.png
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+				env_map spherical
+			}
+		}
+	}
+}
+material Ogre/Skin
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.7 0.7 0.7
+			cull_hardware none
+
+			texture_unit
+			{
+				texture GreenSkin.jpg
+				tex_address_mode mirror
+			}
+		}
+	}
+}
+material Ogre/Tusks
+{
+	technique
+	{
+		pass
+		{
+			ambient 0.5 0.5 0.4
+			diffuse 1 1 0.8
+
+			texture_unit
+			{
+				texture dirt01.jpg
+				colour_op_ex add src_texture src_current
+				colour_op_multipass_fallback one one
+			}
+		}
+	}
+}
+material Ogre/Eyes
+{
+	technique
+	{
+		pass
+		{
+
+			texture_unit
+			{
+				texture WeirdEye.png
+			}
+		}
+	}
+}
+material Cursor/default
+{
+	technique
+	{
+		pass
+		{
+			scene_blend alpha_blend
+
+			texture_unit
+			{
+				texture cursor.png
+				tex_address_mode clamp
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Down
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborder.png
+			}
+		}
+	}
+}
+material Core/StatsBlockBorder/Up
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ogreborderUp.png
+			}
+		}
+	}
+}
+
+
+
+material Orxonox/SuperEgg
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture superegg.png
+			}
+		}
+	}
+}
+
+material Orxonox/Shot
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture shot.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/Red
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+			scene_blend 0.5 0.5
+			ambient 0 0 0 0.5
+
+			texture_unit
+			{
+				texture OrxonoxRED.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/Black
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			depth_check off
+			scene_blend 0.5 0.5
+			ambient 0 0 0 0.5
+
+			texture_unit
+			{
+				texture OrxonoxBlack.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/BackGround
+{
+	technique
+	{
+		pass
+		{
+
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+			texture_unit
+			{
+				texture backGround.png
+			}
+		}
+	}
+}
+
+material Orxonox/EnergyBackground
+{
+	technique
+	{
+		pass
+		{
+
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+			texture_unit
+			{
+				texture EnergyBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/Clock
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture clock.png
+			}
+		}
+	}
+}
+
+material Orxonox/Gun
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture gun.png
+			}
+		}
+	}
+}
+
+material Orxonox/Man
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture man.png
+			}
+		}
+	}
+}
+
+material Orxonox/MapBackGround
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture MapBackGround.png
+			}
+		}
+	}
+}
+
+material Orxonox/MyShip
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture MyShip.png
+			}
+		}
+	}
+}
+
+material Orxonox/RacketBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture RacketBackground.png
+			}
+		}
+	}
+}
+
+
+material Orxonox/TargetBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture TargetBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/PrimarBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture PrimarBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/PrimarSample
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture PrimarSample.png
+			}
+		}
+	}
+}
+
+material Orxonox/PrimarChoice
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture PrimarChoice.png
+			}
+		}
+	}
+}
+
+material Orxonox/RedPoint
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture RedPoint.png
+			}
+		}
+	}
+}
+
+material Orxonox/EnergyDistrBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture EnergyDistrBackground.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildLeftTop
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildLeftTop.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildRightTop
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildRightTop.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildLeftBottom
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildLeftBottom.png
+			}
+		}
+	}
+}
+
+material Orxonox/ShildRightBottom
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture ShildRightBottom.png
+			}
+		}
+	}
+}
+
+material Orxonox/TimeBackground
+{
+	technique
+	{
+		pass
+		{
+			lighting off
+			scene_blend alpha_blend
+			depth_check off
+
+			texture_unit
+			{
+				texture TimeBackground.png
+			}
+		}
+	}
+}
+
Index: /code/branches/audio/Media/overlay/OrxonoxHUD.overlay
===================================================================
--- /code/branches/audio/Media/overlay/OrxonoxHUD.overlay	(revision 310)
+++ /code/branches/audio/Media/overlay/OrxonoxHUD.overlay	(revision 310)
@@ -0,0 +1,142 @@
+Orxonox/HUD
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Orxonox/Panel)
+	{
+		metrics_mode pixels
+		vert_align top
+		left 5 
+		top 5
+		width 250
+		height 90
+		material Orxonox/Red
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		    
+
+
+		container BorderPanel(Orxonox/HUD1/SuperEggPanel)
+		{	
+    		    	border_size 1 1 1 1
+        		border_material Core/StatsBlockBorder
+        		border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    		border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    		border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    		border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    		border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    		border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        		border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    		border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 10
+			left 10
+			width 70
+			height 70
+			material Orxonox/SuperEgg
+		}
+
+		element TextArea(Orxonox/HUD1/HP)
+		{
+			metrics_mode pixels
+			left 100
+			top 15
+			width 50
+			height 25
+			font_name BlueHighway
+			char_height 25
+			caption HP:
+			colour_top 0.5 0.7 0.5
+			colour_bottom 0.3 0.5 0.3
+		}
+
+
+
+		container BorderPanel(Orxonox/HUD1/HPBar)
+		{	
+    		    	border_size 1 1 1 1
+        		border_material Core/StatsBlockBorder
+        		border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    		border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    		border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    		border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    		border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    		border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        		border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    		border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 25
+			left 140
+			width 100
+			height 15
+			material Orxonox/Red
+		}
+
+		element TextArea(Orxonox/HUD1/HPText)
+		{
+			metrics_mode pixels
+			horz_align left
+			left 140
+			top 10
+			width 100
+			height 15
+			font_name BlueHighway
+			char_height 15
+			caption 1000/1000
+			colour 1 1 1 
+		}
+
+		container Panel(Orxonox/HUD1/Shot1)
+		{	
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 55
+			left 110
+			width 30
+			height 25
+			material Orxonox/Shot
+		}
+
+		container Panel(Orxonox/HUD1/Shot2)
+		{	
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 55
+			left 160
+			width 30
+			height 25
+			material Orxonox/Shot
+		}
+		
+		container Panel(Orxonox/HUD1/Shot3)
+		{	
+			metrics_mode pixels
+			horz_align left
+			vert_align top
+			top 55
+			left 210
+			width 30
+			height 25
+			material Orxonox/Shot
+		}
+
+
+		
+
+	}
+}
Index: /code/branches/audio/Media/overlay/OrxonoxHUD1.1.overlay
===================================================================
--- /code/branches/audio/Media/overlay/OrxonoxHUD1.1.overlay	(revision 310)
+++ /code/branches/audio/Media/overlay/OrxonoxHUD1.1.overlay	(revision 310)
@@ -0,0 +1,153 @@
+Orxonox/HUD1.1
+{
+	zorder 500
+	// Stats block
+	container BorderPanel(Orxonox/HUD1.1/Time)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align center
+		left -140
+		top 10
+		width 280
+		height 60
+		material Orxonox/BackGround
+        	border_size 1 1 1 1
+        	border_material Orxonox/Black
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+	
+		element Panel(Orxonox/HUD1.1/TimeImg)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 60
+			height 60
+			material Orxonox/Clock
+		}
+
+		element Panel(Orxonox/HUD1.1/TimeLine)
+		{
+			metrics_mode pixels
+			left 60
+			top 0
+			width 2
+			height 60
+			material Orxonox/Black
+		}		
+		
+
+	}
+
+	container BorderPanel(Orxonox/HUD1.1/Ammo)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align left
+		left 10
+		top -70
+		width 180
+		height 60
+		material Orxonox/BackGround
+        	border_size 1 1 1 1
+        	border_material Orxonox/Black
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+	
+		element Panel(Orxonox/HUD1.1/AmmoImg)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 60
+			height 60
+			material Orxonox/Gun
+		}
+
+		element Panel(Orxonox/HUD1.1/AmmoLine)
+		{
+			metrics_mode pixels
+			left 60
+			top 0
+			width 2
+			height 60
+			material Orxonox/Black
+		}		
+		
+
+	}
+
+	container BorderPanel(Orxonox/HUD1.1/Life)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align center
+		left -90
+		top -70
+		width 180
+		height 60
+		material Orxonox/BackGround
+        	border_size 1 1 1 1
+        	border_material Orxonox/Black
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+	
+		element Panel(Orxonox/HUD1.1/LifeImg)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 60
+			height 60
+			material Orxonox/Man
+		}
+
+		element Panel(Orxonox/HUD1.1/LifeLine)
+		{
+			metrics_mode pixels
+			left 60
+			top 0
+			width 2
+			height 60
+			material Orxonox/Black
+		}	
+		
+
+	}
+
+
+
+	container BorderPanel(Orxonox/HUD1.1/MapBackGround)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -210
+		top -210
+		width 200
+		height 200
+		material Orxonox/MapBackGround
+		
+		
+
+	}
+}
Index: /code/branches/audio/Media/overlay/OrxonoxHUD1.2.overlay
===================================================================
--- /code/branches/audio/Media/overlay/OrxonoxHUD1.2.overlay	(revision 310)
+++ /code/branches/audio/Media/overlay/OrxonoxHUD1.2.overlay	(revision 310)
@@ -0,0 +1,456 @@
+Orxonox/HUD1.2
+{
+	zorder 500
+	// Stats block
+
+
+	
+
+
+
+	container Panel(Orxonox/HUD1.2/MapBackGround)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align center
+		left -75
+		top -160
+		width 150
+		height 150
+		material Orxonox/MapBackGround
+	}
+
+	container Panel(Orxonox/HUD1.2/MyShip)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align center
+		left 100
+		top -140
+		width 100
+		height 100
+		material Orxonox/MyShip
+		
+		container Panel(Orxonox/HUD1.2/ShildLeftTop)
+		{
+			metrics_mode pixels
+			left -5
+			top 0
+			width 30
+			height 30
+			material Orxonox/ShildLeftTop
+		}
+
+		container Panel(Orxonox/HUD1.2/ShildRightTop)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 0
+			width 30
+			height 30
+			material Orxonox/ShildRightTop
+		}
+
+		container Panel(Orxonox/HUD1.2/ShildLeftBottom)
+		{
+			metrics_mode pixels
+			vert_align bottom
+			left -5
+			top -30
+			width 30
+			height 30
+			material Orxonox/ShildLeftBottom
+		}
+
+		container Panel(Orxonox/HUD1.2/ShildRightBottom)
+		{
+			metrics_mode pixels
+			vert_align bottom
+			horz_align right
+			left -30
+			top -30
+			width 30
+			height 30
+			material Orxonox/ShildRightBottom
+		}
+		
+	}
+
+
+	container Panel(Orxonox/HUD1.2/PrimarBackground)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -180
+		top -180
+		width 150
+		height 50
+		material Orxonox/PrimarBackground
+
+		container Panel(Orxonox/HUD1.2/PrimarSample1)
+		{
+			metrics_mode pixels
+			left 0
+			top 0
+			width 50
+			height 50
+			material Orxonox/PrimarSample
+		}
+
+		container Panel(Orxonox/HUD1.2/PrimarSample2)
+		{
+			metrics_mode pixels
+			left 50
+			top 0
+			width 50
+			height 50
+			material Orxonox/PrimarSample
+		}
+
+		container Panel(Orxonox/HUD1.2/PrimarSample3)
+		{
+			metrics_mode pixels
+			left 100
+			top 0
+			width 50
+			height 50
+			material Orxonox/PrimarSample
+		}
+
+		container Panel(Orxonox/HUD1.2/PrimarChoice)
+		{
+			metrics_mode pixels
+			left 2
+			top 2
+			width 48
+			height 46
+			material Orxonox/PrimarChoice
+		}
+
+
+
+
+	}
+	
+	container Panel(Orxonox/HUD1.2/RacketBackground)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -180
+		top -130
+		width 150
+		height 100
+		material Orxonox/RacketBackground
+
+		element TextArea(Orxonox/HUD1.2/Rocket1)
+		{
+			metrics_mode pixels
+			left 10
+			top 7
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket1
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/Rocket2)
+		{
+			metrics_mode pixels
+			left 10
+			top 29
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket2
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/Rocket3)
+		{
+			metrics_mode pixels
+			left 10
+			top 51
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket3
+			colour_top 0 1 0 
+		}
+	
+		element TextArea(Orxonox/HUD1.2/Rocket4)
+		{
+			metrics_mode pixels
+			left 10
+			top 74
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Rocket4
+			colour_top 0 1 0 
+		}
+
+
+		element TextArea(Orxonox/HUD1.2/RocketNum1)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 7
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 20
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/RocketNum2)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 29
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 99
+			colour_top 0 1 0 
+		}	
+
+		element TextArea(Orxonox/HUD1.2/RocketNum3)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 51
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 01
+			colour_top 0 1 0 
+		}
+	
+		element TextArea(Orxonox/HUD1.2/RocketNum4)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -30
+			top 74
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 55
+			colour_top 0 1 0 
+		}	
+	
+		
+	
+
+
+	}
+
+
+	container Panel(Orxonox/HUD1.2/Energy)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align center
+		left -100
+		top 20
+		width 200
+		height 20
+
+		container Panel(Orxonox/HUD1.2/EnergyBackground)
+		{
+			metrics_mode pixels
+			width 200
+			height 20
+			material Orxonox/EnergyBackground
+		}
+		
+		element TextArea(Orxonox/HUD1.2/EnergyText)
+		{
+			metrics_mode pixels
+			horz_align center
+			left -20
+			top 2
+			width 200
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Energy
+			colour_top 1 1 0 
+		}
+	}
+
+	container Panel(Orxonox/HUD1.2/TargetWindow)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align left
+		left 40
+		top -130
+		width 150
+		height 100
+		material Orxonox/TargetBackground
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/Name)
+		{
+			metrics_mode pixels
+			left 20
+			top 5
+			width 200
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption Moesonator
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/Distance)
+		{
+			metrics_mode pixels
+			left 9
+			top 35
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Distance
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/Status)
+		{
+			metrics_mode pixels
+			left 7
+			top 55
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Status
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/HitRating)
+		{
+			metrics_mode pixels
+			left 7
+			top 75
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption Hit Rating
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/DistanceText)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -50
+			top 35
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption 50km
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/StatusText)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -50
+			top 55
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption huhu
+			colour_top 0 1 0 
+		}
+
+		element TextArea(Orxonox/HUD1.2/TargetWindow/HitRatingText)
+		{
+			metrics_mode pixels
+			horz_align right
+			left -50
+			top 75
+			width 150
+			height 20
+			font_name BlueHighway
+			char_height 20
+			caption 50%
+			colour_top 0 1 0 
+		}
+
+
+
+	}
+
+
+
+
+	container Panel(Orxonox/HUD1.2/EnergyDistrWindow)
+	{
+		metrics_mode pixels
+		vert_align bottom
+		horz_align right
+		left -150
+		top -300
+		width 100
+		height 86
+		material Orxonox/EnergyDistrBackground
+
+		container Panel(Orxonox/HUD1.2/EnergyDistrPoint)
+		{
+			metrics_mode pixels
+			left 40
+			top 36
+			width 7
+			height 7
+			material Orxonox/RedPoint
+		}
+	}
+
+	container Panel(Orxonox/HUD1.2/Time)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align left
+		left 30
+		top 10
+		width 60
+		height 30
+
+		
+		element TextArea(Orxonox/HUD1.2/Time/Text)
+		{
+			metrics_mode pixels
+			horz_align left
+			left 10
+			top 5
+			width 100
+			height 20
+			font_name BlueHighway
+			char_height 25
+			caption 99:99
+			colour_top 0 1 0 
+		}
+
+}
Index: /code/branches/audio/Media/particle/Example-Water.particle
===================================================================
--- /code/branches/audio/Media/particle/Example-Water.particle	(revision 310)
+++ /code/branches/audio/Media/particle/Example-Water.particle	(revision 310)
@@ -0,0 +1,35 @@
+Examples/Water/Rain
+{
+    material        Examples/Droplet
+    particle_width  100
+    particle_height 300
+    cull_each       true
+    quota           100
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   20
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	1000
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           3000
+        height          3000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -1000 0
+        force_application add
+    }
+
+}
+
Index: /code/branches/audio/Media/particle/Example.particle
===================================================================
--- /code/branches/audio/Media/particle/Example.particle	(revision 310)
+++ /code/branches/audio/Media/particle/Example.particle	(revision 310)
@@ -0,0 +1,395 @@
+// Example particle systems
+
+// Exudes greeny particles which float upwards
+Examples/GreenyNimbus
+{
+    material        Examples/FlarePointSprite
+	point_rendering	true
+	// point rendering means size is controlled by material
+	// provide fallback sizes for hardware that doesn't support point sprite
+    particle_width  30
+    particle_height 30
+    cull_each       false
+	cull_each       false
+    quota           10000
+    billboard_type  point
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   30
+        time_to_live    5
+        direction       0 1 0
+        velocity    	0
+        colour_range_start  1 1 0
+        colour_range_end    0.3 1 0.3
+        width           60
+        height          60
+        depth           60
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+
+
+}
+
+// A sparkly purple fountain
+Examples/PurpleFountain
+{
+    material        Examples/Flare2
+    particle_width  20
+    particle_height 40
+    cull_each       false
+    quota           10000
+    billboard_type  oriented_self
+    
+    // Area emitter
+    emitter Point
+    {
+        angle           15
+        emission_rate   75
+        time_to_live    3
+        direction       0 1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  0 0 0
+        colour_range_end    1 1 1
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -100 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader
+    {
+        red -0.25
+        green -0.25
+        blue -0.25
+    }
+}
+
+
+// A downpour
+Examples/Rain
+{
+    material        Examples/Droplet
+    particle_width  20
+    particle_height 100
+    cull_each       true
+    quota           10000
+    // Make common direction straight down (faster than self oriented)
+    billboard_type  oriented_common
+    common_direction 0 -1 0
+    
+    // Area emitter
+    emitter Box
+    {
+        angle           0
+        emission_rate   100
+        time_to_live    5
+        direction       0 -1 0
+        velocity    	50
+        colour_range_start  0.3 1 0.3
+        colour_range_end    0.7 1 0.7
+        width           1000
+        height          1000
+        depth           0
+    }
+
+    // Gravity
+    affector LinearForce
+    {
+        force_vector      0 -200 0
+        force_application add
+    }
+
+}
+
+// A jet engine (of sorts)
+Examples/JetEngine1
+{
+	material 		Examples/Flare
+	particle_width 	25
+	particle_height	25
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 5
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    250
+        velocity_max    300
+        colour_range_start  1 1 0.5
+        colour_range_end    1 0.8 0.3
+		
+	}
+	affector ColourFader
+	{
+		red -0.25
+		green -1
+		blue -1
+	}
+	
+}
+Examples/JetEngine2
+{
+	material 		Examples/Flare
+	particle_width 	15
+	particle_height	15
+	cull_each		false
+	quota			200
+	billboard_type	point
+
+	emitter Point
+	{
+		angle 3
+		emission_rate 100
+        time_to_live    1
+        direction       0 -1 0
+        velocity_min    350
+        velocity_max    400
+        colour_range_start  0.5 1 1
+        colour_range_end    0.3 0.8 1
+		
+	}
+	affector ColourFader
+	{
+		red -1
+		green -1
+		blue -0.5
+	}
+	
+}
+
+// Exudes aureola particles which around the model float upwards
+Examples/Aureola
+{
+    material        Examples/Aureola
+    particle_width  200
+    particle_height 200
+    cull_each       false
+    quota           100
+    billboard_type  perpendicular_common
+    common_direction 0 1 0
+    common_up_vector 0 0 1
+
+    // Area emitter
+    emitter Box
+    {
+        angle           30
+        emission_rate   4
+        time_to_live    5
+        position        0 -100 0
+        direction       0 1 0
+        velocity_min  	0
+        velocity_max  	30
+        colour_range_start  0.3 0.3 0.3 0.0
+        colour_range_end    0.8 0.8 0.8 0.0
+        width           10
+        height          10
+        depth           30
+    }
+
+    // Make em float upwards
+    affector LinearForce
+    {
+        force_vector      0 70 0
+        force_application add
+    }
+
+    // Fader
+    affector ColourFader2
+    {
+        red1 +0.4
+        green1 +0.4
+        blue1 +0.4
+        alpha1 +0.7
+
+        red2 -0.25
+        green2 -0.25
+        blue2 -0.25
+        alpha2 -0.3333
+
+        state_change 3.5
+    }
+
+    // Rotater
+    affector Rotator
+    {
+        rotation_range_start 0
+        rotation_range_end 360
+        rotation_speed_range_start 0
+        rotation_speed_range_end 180
+    }
+}
+
+
+Examples/Swarm
+{
+	quota	3000
+	material	Examples/Flare2
+	particle_width	12
+	particle_height	24
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	oriented_self
+
+	emitter Box
+	{
+		angle	180
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 1 0
+		emission_rate	30
+		position	0 0 0
+		velocity	50
+		velocity_min	50
+		velocity_max	1
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	80
+		height	80
+		depth	80
+	}
+
+	affector ColourFader
+	{
+		red	-0.05
+		green	0
+		blue	0
+		alpha	0
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 -50 0
+		plane_normal	0 1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 50 0
+		plane_normal	0 -1 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	50 0 0
+		plane_normal	-1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	-50 0 0
+		plane_normal	1 0 0
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 50
+		plane_normal	0 0 -1
+		bounce	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 -50
+		plane_normal	0 0 1
+		bounce	1
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	60
+	}
+}
+
+
+Examples/Snow
+{
+	quota	2000
+	material	Examples/Flare
+	particle_width	4
+	particle_height	4
+	cull_each	true
+	renderer	billboard
+	sorted	true
+	local_space	false
+	billboard_type	point
+
+	emitter Box
+	{
+		angle	0
+		colour	1 1 1 1
+		colour_range_start	1 1 1 1
+		colour_range_end	1 1 1 1
+		direction	0 -1 0
+		emission_rate	100
+		position	0 200 0
+		velocity	20
+		velocity_min	20
+		velocity_max	20
+		time_to_live	20
+		time_to_live_min	20
+		time_to_live_max	20
+		duration	0
+		duration_min	0
+		duration_max	0
+		repeat_delay	0
+		repeat_delay_min	0
+		repeat_delay_max	0
+		width	200
+		height	200
+		depth	1
+	}
+
+	affector DeflectorPlane
+	{
+		plane_point	0 0 0
+		plane_normal	0 1 0
+		bounce	0
+	}
+
+	affector DirectionRandomiser
+	{
+		randomness	10
+	}
+}
+
+
Index: /code/branches/audio/Media/particle/emitted_emitter.particle
===================================================================
--- /code/branches/audio/Media/particle/emitted_emitter.particle	(revision 310)
+++ /code/branches/audio/Media/particle/emitted_emitter.particle	(revision 310)
@@ -0,0 +1,112 @@
+// Example emitted emitters
+
+Examples/Fireworks
+
+{
+
+    material Examples/Flare
+
+    point_rendering            false
+
+    particle_width             10
+
+    particle_height            10
+
+    cull_each                  false
+
+    quota                      1000
+
+    emit_emitter_quota         10
+
+    billboard_type             point
+
+    
+
+    // Emitter that emits multiple Point emitters with name 'explosion'
+
+    emitter Box
+
+    {
+
+        name                    mainEmitter
+
+        emit_emitter            explosion
+
+        angle                   30
+
+        emission_rate           1000
+
+        time_to_live            3
+
+        direction               0 1 0
+
+        velocity                200
+
+    }
+
+
+
+    // This Point emitter is emitted by the Box emitter and emits billboard particles itself
+
+    emitter Point
+
+    {
+
+        name                    explosion
+
+        angle                   360
+
+        emission_rate           1000
+
+        time_to_live            2
+
+        direction               0 1 0
+
+        velocity                80
+
+        duration                0.1
+
+        repeat_delay_min        2
+
+        repeat_delay_max        3
+
+    }
+
+
+
+    // Make em float downwards
+
+    affector LinearForce
+
+    {
+
+        force_vector            0 -100 0
+
+        force_application       add
+
+    }
+
+
+
+    // Give em some nice colours
+
+    affector ColourInterpolator
+
+    {
+
+        time0                   0
+
+        colour0                 1 1 0
+
+        time1                   0.5
+
+        colour1                 1 0 0
+
+        time2                   0.9
+
+        colour2                 0 0 1
+
+    }
+
+}
+
Index: /code/branches/audio/Media/particle/smoke.particle
===================================================================
--- /code/branches/audio/Media/particle/smoke.particle	(revision 310)
+++ /code/branches/audio/Media/particle/smoke.particle	(revision 310)
@@ -0,0 +1,43 @@
+// Example particle systems
+
+// smoke
+Examples/Smoke
+{
+    	material        	Examples/Smoke
+    	particle_width  	55
+    	particle_height 	55
+    	cull_each       	true
+    	quota           	500
+    	billboard_type  	point
+		sorted				true
+    
+    	// Area emitter
+    	emitter Point
+    	{
+		angle               		11
+        	emission_rate       		15
+        	time_to_live        		4
+        	direction           		0 1 0
+        	velocity_min        		150
+        	velocity_max        		240    	
+	}
+
+	affector ColourImage
+	{
+		image		smokecolors.png
+	}
+
+   	affector Rotator
+   	{
+        	rotation_range_start  		0
+        	rotation_range_end   	 	360
+        	rotation_speed_range_start  	-60
+        	rotation_speed_range_end    	200
+   	}
+
+   	affector Scaler
+   	{
+       	rate 	100
+   	}
+
+}
Index: /code/branches/audio/README
===================================================================
--- /code/branches/audio/README	(revision 310)
+++ /code/branches/audio/README	(revision 310)
@@ -0,0 +1,20 @@
+Hi there,
+
+We are proud to present you Orxonox - the most ferious 3D space shooter ever to exist.
+
+This game is free, if you have paid for this, get your money back! The source code of this game is licensed under the GPL (GNU General Public License). 
+The game content is licensed under the Creative Commons Attribution-Sharealike 2.5 license. For more information read LICENSE in the same folder you found this file.
+
+For directions to install this game, please check out the file INSTALL or http://www.orxonox.net/wiki/Running
+
+This application uses the Ogre Graphics Engine (http://www.ogre3d.org), if you haven't already downloaded a precompiled version of Ogre with this package. Visit our webpage to get your Orxonox compatible version of the Ogre libraries.
+
+This is an open source game. If you want to contribute check out http://www.orxonox.net/wiki/development to find more information how you could help us making the game better. We are always looking for programmers and content designers, who like to contribute.
+
+We hope you have fun playing the game. Check out http://www.orxonox.net for news and newer versions of the game.
+
+Please contact us in our forum ( http://forum.orxonox.net ) or check out our contact page ( http://www.orxonox.net/wiki/about#Contact ). We hope to hear from you and are looking forward to your feedback.
+
+
+Cheers,
+The Orxonox Development Team
Index: /code/branches/audio/bin/CMakeCache.txt
===================================================================
--- /code/branches/audio/bin/CMakeCache.txt	(revision 310)
+++ /code/branches/audio/bin/CMakeCache.txt	(revision 310)
@@ -0,0 +1,375 @@
+# This is the CMakeCache file.
+# For build in directory: d:/orxonox/project_make/bin
+# It was generated by CMake: D:/orxonox/cmake-2.4.7-win32-x86/bin/cmake.exe
+# You can edit this file to change values found and used by cmake.
+# If you do not want to change any of the values, simply exit the editor.
+# If you do want to change a value, simply edit, save, and exit the editor.
+# The syntax for the file is as follows:
+# KEY:TYPE=VALUE
+# KEY is the name of a variable in the cache.
+# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
+# VALUE is the current value for the KEY.
+
+########################
+# EXTERNAL cache entries
+########################
+
+//Library is used for debug links only
+CEGUIBase_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+CEGUIBase_d_LINK_TYPE:STATIC=debug
+
+//Missing description
+CEGUI_INCLUDE_DIR:PATH=../ogre/Dependencies/include/CEGUI
+
+//Missing description
+CEGUI_LIBRARIES:STRING=debug;CEGUIBase_d;optimized;CEGUIBase
+
+//Missing description
+CEGUI_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release/lib
+
+//Missing description
+CEGUI_OGRE_INCLUDE_DIR:PATH=../ogre/Samples/Common/CEGUIRenderer/include
+
+//Missing description
+CEGUI_OGRE_LIBRARIES:STRING=debug;OgreGUIRenderer_d;optimized;OgreGUIRenderer
+
+//Missing description
+CEGUI_OGRE_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release/lib
+
+//Path to a program.
+CMAKE_AR:FILEPATH=CMAKE_AR-NOTFOUND
+
+//For backwards compatibility, what version of CMake commands and
+// syntax should this version of CMake allow.
+CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4
+
+//Semicolon separated list of supported configuration types, only
+// supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything
+// else will be ignored.
+CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
+
+//C++ compiler
+CMAKE_CXX_COMPILER:FILEPATH=cl
+
+//Flags used by the compiler during all build types.
+CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR
+
+//Flags used by the compiler during debug builds.
+CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
+
+//Flags used by the compiler during release minsize builds.
+CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
+
+//Flags used by the compiler during release builds (/MD /Ob1 /Oi
+// /Ot /Oy /Gs will produce slightly less optimized but smaller
+// files).
+CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
+
+//Flags used by the compiler during Release with Debug Info builds.
+//
+CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
+
+//Size of stack for programs.
+CMAKE_CXX_STACK_SIZE:STRING=10000000
+
+//Libraries linked by defalut with all C++ applications.
+CMAKE_CXX_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib '
+
+//Default compiler warning level for C++.
+CMAKE_CXX_WARNING_LEVEL:STRING=3
+
+//C compiler
+CMAKE_C_COMPILER:FILEPATH=cl
+
+//Flags for C compiler.
+CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000
+
+//Flags used by the compiler during debug builds.
+CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi  /Ob0 /Od /RTC1
+
+//Flags used by the compiler during release minsize builds.
+CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG
+
+//Flags used by the compiler during release builds (/MD /Ob1 /Oi
+// /Ot /Oy /Gs will produce slightly less optimized but smaller
+// files).
+CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG
+
+//Flags used by the compiler during Release with Debug Info builds.
+//
+CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG
+
+//Libraries linked by defalut with all C applications.
+CMAKE_C_STANDARD_LIBRARIES:STRING='kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib '
+
+//Flags used by the linker.
+CMAKE_EXE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//Install path prefix, prepended onto install directories.
+CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/Orxonox
+
+//make program
+CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MICROS~2/Common7/IDE/devenv.com
+
+//Flags used by the linker during the creation of modules.
+CMAKE_MODULE_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//RC compiler
+CMAKE_RC_COMPILER:FILEPATH=rc
+
+//Flags for Fortran compiler.
+CMAKE_RC_FLAGS:STRING=' '
+
+//Flags used by the linker during the creation of dll's.
+CMAKE_SHARED_LINKER_FLAGS:STRING= /MANIFEST /STACK:10000000 /machine:I386
+
+//Flags used by the linker during debug builds.
+CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES
+
+//Flags used by the linker during release minsize builds.
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during release builds.
+CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
+
+//Flags used by the linker during Release with Debug Info builds.
+//
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES
+
+//If set, runtime paths are not added when using shared libraries.
+//
+CMAKE_SKIP_RPATH:BOOL=OFF
+
+//If true, cmake will use relative paths in makefiles and projects.
+//
+CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
+
+//If this value is on, makefiles will be generated without the
+// .SILENT directive, and all commands will be echoed to the console
+// during the make.  This is useful for debugging only. With Visual
+// Studio IDE projects all commands are done without /nologo.
+CMAKE_VERBOSE_MAKEFILE:BOOL=OFF
+
+//Single output directory for building all executables.
+EXECUTABLE_OUTPUT_PATH:PATH=
+
+//Single output directory for building all libraries.
+LIBRARY_OUTPUT_PATH:PATH=
+
+//Missing description
+OGRE_INCLUDE_DIR:PATH=../ogre/OgreMain/include
+
+//Missing description
+OGRE_LIBRARIES:STRING=debug;OgreMain_d;optimized;OgreMain
+
+//Missing description
+OGRE_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release
+
+//Missing description
+OIS_INCLUDE_DIR:PATH=../ogre/Dependencies/include
+
+//Missing description
+OIS_LIBRARIES:STRING=debug;OIS_d;optimized;OIS
+
+//Missing description
+OIS_LIB_DIR:PATH=D:/orxonox/project_make/../ogre/Samples/Common/bin/Release
+
+//Library is used for debug links only
+OIS_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OIS_d_LINK_TYPE:STATIC=debug
+
+//Library is used for debug links only
+OgreGUIRenderer_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OgreGUIRenderer_d_LINK_TYPE:STATIC=debug
+
+//Library is used for debug links only
+OgreMain_LINK_TYPE:STATIC=optimized
+
+//Library is used for debug links only
+OgreMain_d_LINK_TYPE:STATIC=debug
+
+//Value Computed by CMake
+Orxonox_BINARY_DIR:STATIC=D:/orxonox/project_make/bin/src
+
+//Value Computed by CMake
+Orxonox_SOURCE_DIR:STATIC=D:/orxonox/project_make/src
+
+
+########################
+# INTERNAL cache entries
+########################
+
+//Stored GUID
+../bin/main_GUID_CMAKE:INTERNAL=8F17E8DD-EF89-4C22-A0F2-167AD950D6E4
+//Stored GUID
+ALL_BUILD_GUID_CMAKE:INTERNAL=3F43A6B8-0CD9-4299-BC3F-0F8DBEC01146
+//Advanced flag for variable: CMAKE_AR
+CMAKE_AR-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_BUILD_TOOL
+CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
+//What is the target build tool cmake is generating for.
+CMAKE_BUILD_TOOL:INTERNAL=C:/PROGRA~1/MICROS~2/Common7/IDE/devenv.com
+//This is the directory where this CMakeCahe.txt was created
+CMAKE_CACHEFILE_DIR:INTERNAL=d:/orxonox/project_make/bin
+//Major version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
+//Minor version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_MINOR_VERSION:INTERNAL=4
+//Major version of cmake used to create the current loaded cache
+//
+CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 7
+//Path to CMake executable.
+CMAKE_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/cmake.exe
+//Advanced flag for variable: CMAKE_CONFIGURATION_TYPES
+CMAKE_CONFIGURATION_TYPES-ADVANCED:INTERNAL=1
+//Path to ctest program executable.
+CMAKE_CTEST_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/ctest.exe
+//Advanced flag for variable: CMAKE_CXX_COMPILER
+CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_CXX_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS
+CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG
+CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL
+CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE
+CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
+CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_STACK_SIZE
+CMAKE_CXX_STACK_SIZE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_STANDARD_LIBRARIES
+CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_CXX_WARNING_LEVEL
+CMAKE_CXX_WARNING_LEVEL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_COMPILER
+CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_C_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS
+CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_DEBUG
+CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL
+CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_RELEASE
+CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
+CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_C_STANDARD_LIBRARIES
+CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
+//Path to cache edit program executable.
+CMAKE_EDIT_COMMAND:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/bin/CMakeSetup.exe
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS
+CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
+CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
+CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Name of generator.
+CMAKE_GENERATOR:INTERNAL=Visual Studio 8 2005
+//Start directory with the top level CMakeLists.txt file for this
+// project
+CMAKE_HOME_DIRECTORY:INTERNAL=D:/orxonox/project_make
+//Advanced flag for variable: CMAKE_MAKE_PROGRAM
+CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS
+CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
+CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
+//
+CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//number of local generators
+CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=2
+//noop for ranlib
+CMAKE_RANLIB:INTERNAL=:
+//Advanced flag for variable: CMAKE_RC_COMPILER
+CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1
+CMAKE_RC_COMPILER_WORKS:INTERNAL=1
+//Advanced flag for variable: CMAKE_RC_FLAGS
+CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1
+//Path to CMake installation.
+CMAKE_ROOT:INTERNAL=D:/orxonox/cmake-2.4.7-win32-x86/share/cmake-2.4
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS
+CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
+CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
+//
+CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
+//
+CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
+//
+CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
+//Result of TRY_RUN
+CMAKE_SIZEOF_VOID_P:INTERNAL=4
+//Advanced flag for variable: CMAKE_SKIP_RPATH
+CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS
+CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
+//Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE
+CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
+//Stored GUID
+EDIT_CACHE_GUID_CMAKE:INTERNAL=1DE5DAE6-289E-4E4A-B940-28E28BF11CD4
+//Result of TRY_COMPILE
+HAVE_CMAKE_SIZEOF_VOID_P:INTERNAL=TRUE
+//Stored GUID
+INSTALL_GUID_CMAKE:INTERNAL=0674E882-E93A-413B-868D-A7B23DF04DE3
+//Stored GUID
+PACKAGE_GUID_CMAKE:INTERNAL=62F1CD05-C002-4EE4-B5A6-4F63E00AFF45
+//Stored GUID
+REBUILD_CACHE_GUID_CMAKE:INTERNAL=77BD3F50-1E2D-4E04-8744-69AFB6D92B55
+//Stored GUID
+RUN_TESTS_GUID_CMAKE:INTERNAL=32FE96A7-4B32-4AD9-9D2C-D036887B28B7
+//Stored GUID
+ZERO_CHECK_GUID_CMAKE:INTERNAL=573F13E6-3D74-491E-909A-3C24E9303E85
+
Index: /code/branches/audio/bin/levels/sp_level_moonstation.oxw
===================================================================
--- /code/branches/audio/bin/levels/sp_level_moonstation.oxw	(revision 310)
+++ /code/branches/audio/bin/levels/sp_level_moonstation.oxw	(revision 310)
@@ -0,0 +1,596 @@
+<WorldDataFile>
+	<name>Moon Station</name>
+	<description>The central moonstation, where the player will 'land'.</description>
+	<image>textures/menu/moonstation_512x512.jpg</image>
+
+	<LoadScreen>
+		<BackgroundImage>textures/load_screens/ambush.png</BackgroundImage>
+		<ElementCount>16</ElementCount>
+		<BackgroundPS>0,0,1.0,1</BackgroundPS>
+		<BarPS>.65,.87,.3,.05</BarPS>
+		<BarImage>textures/load_screens/ambush-loadbar.png</BarImage>
+	</LoadScreen>
+	
+	<clip-region>1, 100000</clip-region>
+	
+	<WorldEntities>
+
+
+
+	<ModelEntity>
+		<name>surface</name>
+		<abs-coor>-250, 100, -100</abs-coor>
+		<abs-dir>1.57, 0, 1, 0</abs-dir>
+		<model>models/decoration/moonsurface_1730.obj, 3000</model>
+	</ModelEntity>
+		
+	<Planet>
+		<name>Earth</name>
+		<texture>textures/planets/earth_no_clouds.jpg</texture>
+		<size>250</size>
+		<abs-coor>-1685.414917, 1228.985352, 1216.223511</abs-coor>
+		<abs-dir>3.1412, 0,0,1</abs-dir>
+	</Planet>
+
+	<BspEntity>
+		<Name>levels/maps/moonstation/moonstation.bsp</Name>
+	</BspEntity>
+	
+	<SkyBox>
+		<name>Sky</name>
+		<Materialset>textures/sky/simple_space</Materialset>
+		<Size>7520</Size>
+	</SkyBox>
+	
+	<FPSPlayer>
+		<name>Player</name>
+		<damageable>true</damageable>
+		<model>models/creatures/doom_male/male.md2, 9</model>
+		<loadShield>10,10,0,0</loadShield>
+		<abs-coor>630,21,-20</abs-coor>
+		<list>group01</list>
+		<!-- <abs-coor>208.740707, -781.369263, -268.533173</abs-coor> underground -->
+	</FPSPlayer>
+	
+<!-- Bridge ------------------------------------------------------------------------ -->
+
+	<AdmTurret>
+		<model>models/guns/turret/turret_body.obj,10</model>
+		<list>group00</list>
+		<type>ceil</type>
+		<damageable>true</damageable>
+		<target>Player</target>
+		<abs-coor>356, 588, -160</abs-coor>
+		<Cannons>
+			<model>models/guns/turret/turret_riffle.obj,10</model>
+			<rel-coor>0, 47, 0</rel-coor>
+		</Cannons>
+
+		<Sensor>
+			<model>models/guns/turret/turret_radar.obj,10</model>
+			<rel-coor>0, 32.5, 0</rel-coor>
+		</Sensor>
+		<Weapon>
+			<Range>400</Range>
+			<SetDamage>10</SetDamage>
+			<FireRate>1</FireRate>
+			<AlwaysHits>false</AlwaysHits>
+			<addPoint>-30,1,11</addPoint>
+			<addPoint>-30,1,-11</addPoint>
+		</Weapon>
+	</AdmTurret>
+
+	<Planet>
+		<name>Earth</name>
+		<texture>textures/planets/earth_no_clouds.jpg</texture>
+		<size>50</size>
+		<abs-coor>458.725555, 505.465271, -164.975540</abs-coor>
+		<abs-dir>3.1412, 0,0,1</abs-dir>
+		<planet-rotation-speed>-0.3</planet-rotation-speed>
+		<planet-rotation-axis>0,1,0</planet-rotation-axis>
+	</Planet>
+	
+	<Planet>
+		<name>Moon</name>
+		<texture>textures/planets/pluto.png</texture>
+		<size>10</size>
+		<abs-coor>543.408203, 505.465271, -158.724747</abs-coor>
+		<abs-dir>3.1412, 0,0,0</abs-dir>
+	</Planet>
+	
+	<Building>
+		<name>zhara</name>
+		<model>models/space_stations/ZHARA_Space_Station.obj, 1</model>
+		<mountpoints>models/space_stations/ZHARA_Space_Station.oif</mountpoints>
+		<abs-coor>500.981537, 507.057343, -179.489685</abs-coor>
+		<abs-dir>3.1412, 0,1,0</abs-dir>
+	</Building>
+
+<!-- Air cleaning/lager room ------------------------------------------------ -->
+	
+	<AdmTurret>
+		<model>models/guns/turret/turret_body.obj,10</model>
+		<list>group00</list>
+		<target>Player</target>
+		<abs-coor>-119, 123, 25</abs-coor>
+		<damageable>true</damageable>
+		<Cannons>
+			<model>models/guns/turret/turret_riffle.obj,10</model>
+			<rel-coor>0, 47, 0</rel-coor>
+		</Cannons>
+
+		<Sensor>
+			<model>models/guns/turret/turret_radar.obj,10</model>
+			<rel-coor>0, 32.5, 0</rel-coor>
+		</Sensor>
+		<Weapon>
+			<Range>40000</Range>
+			<SetDamage>10</SetDamage>
+			<FireRate>1</FireRate>
+			<AlwaysHits>false</AlwaysHits>
+			<addPoint>-30,1,11</addPoint>
+			<addPoint>-30,1,-11</addPoint>
+		</Weapon>
+	</AdmTurret>
+	
+	<Mover>
+		<name>door_aircleaning</name>
+		<bReopen>1</bReopen>
+		<bReclose>1</bReclose>
+		<model>models/doors/door_small_b.obj, 6.7</model><!-- modelpath, size -->
+		<abs-dir>3.141, 0, 1, 0</abs-dir><!-- Pi,,Y-Axis-Rotation, -->
+		<abs-coor>120, 160, 320</abs-coor>
+		<triggers>
+			<ApproachTrigger>
+				<radius>50</radius>
+			</ApproachTrigger>
+		</triggers>
+		<stations>
+			<MoverStation>
+				<moving-time>0.6</moving-time>
+				<rel-target-coor>0, 0, -45</rel-target-coor>
+				<opening-sound>sounds/doors/door_opening2.wav</opening-sound>
+				<closing-sound>sounds/doors/door_opening2.wav</closing-sound>
+			</MoverStation>
+		</stations>
+	</Mover>
+		
+	<Mover>
+		<name>door_lager</name>
+		<bReopen>1</bReopen>
+		<bReclose>1</bReclose>
+		<model>models/doors/door_blue_big.obj, 19</model><!-- modelpath, size -->
+		<abs-dir>1.57, 0, 1, 0</abs-dir><!-- Pi,,Y-Axis-Rotation, -->
+		<abs-coor>-65, 128, -161.1</abs-coor>
+		<triggers>
+			<ApproachTrigger>
+				<radius>130</radius>
+			</ApproachTrigger>
+		</triggers>
+		<stations>
+			<MoverStation>
+				<moving-time>1.2</moving-time>
+				<rel-target-coor>0, 92.5, 0</rel-target-coor>
+				<opening-sound>sounds/doors/door_opening2.wav</opening-sound>
+				<closing-sound>sounds/doors/door_opening2.wav</closing-sound>
+				<closed-sound>sounds/doors/door_closed2.wav</closed-sound>
+			</MoverStation>
+		</stations>
+	</Mover>		
+		
+	<Rotor>
+		<name>rotor_aircleaning</name>
+		<model>models/decoration/rotor1_hack.obj, 5</model>
+		<abs-coor>52,167,241</abs-coor>
+		<abs-dir>0, 0, 0, 0</abs-dir>
+		<rotation>8,0,0</rotation>
+	</Rotor>
+	<Rotor>
+		<name>rotor_aircleaning</name>
+		<model>models/decoration/rotor1_hack.obj, 5</model>
+		<abs-coor>28,167,241</abs-coor>
+		<abs-dir>0, 0, 0, 0</abs-dir>
+		<rotation>8,0,0</rotation>
+	</Rotor>
+	<Rotor>
+		<name>rotor_aircleaning</name>
+		<model>models/decoration/rotor1_hack.obj, 5</model>
+		<abs-coor>4,167,241</abs-coor>
+		<abs-dir>0, 0, 0, 0</abs-dir>
+		<rotation>8,0,0</rotation>
+	</Rotor>
+	<Rotor>
+		<name>rotor_aircleaning</name>
+		<model>models/decoration/rotor1_hack.obj, 5</model>
+		<abs-coor>-20,167,241</abs-coor>
+		<abs-dir>0, 0, 0, 0</abs-dir>
+		<rotation>8,0,0</rotation>
+	</Rotor>
+		
+<!-- Main hall ------------------------------------------------------------ -->
+	<AdmTurret>
+		<model>models/guns/turret/turret_body.obj,10</model>
+		<list>group00</list>
+		<type>ceil</type>
+		<damageable>true</damageable>
+		<target>Player</target>
+		<abs-coor>191, 115, 70</abs-coor>
+		<Cannons>
+			<model>models/guns/turret/turret_riffle.obj,10</model>
+			<rel-coor>0, 47, 0</rel-coor>
+		</Cannons>
+
+		<Sensor>
+			<model>models/guns/turret/turret_radar.obj,10</model>
+			<rel-coor>0, 32.5, 0</rel-coor>
+		</Sensor>
+		<Weapon>
+			<Range>400</Range>
+			<SetDamage>10</SetDamage>
+			<FireRate>1</FireRate>
+			<AlwaysHits>false</AlwaysHits>
+			<addPoint>-30,1,11</addPoint>
+			<addPoint>-30,1,-11</addPoint>
+		</Weapon>
+	</AdmTurret>
+	
+	<SpriteParticles>
+		<name>str3</name>
+		<type>sprite</type>
+		<texture>steam01.png</texture>
+		<max-count>50</max-count>
+		<life-span>4, 6</life-span>
+		<radius>0.0, 15.0, 20.0</radius>
+		<radius>0.2, 20.0, 25.0</radius>
+		<radius>1.0, 25.0, 30.0</radius>
+		<mass>1.0, 0.3, .2</mass>
+		<color>0,1, 1, 1,.5</color>
+		<color>.5, .6, .6, .6, .2</color>
+		<color>1, .0, .0, .0, .0</color>
+		<precache>5</precache>
+		<emitters>
+			<PlaneEmitter>
+				<name>SteamEmitter</name>
+				<rel-coor>-4.005549, 251.321747, -11.710030</rel-coor>
+				<rel-dir>0.927172, -0.003523, -0.374517, 0.008722</rel-dir>
+				<spread>0.0, 1</spread>
+				<emission-velocity>20, 30</emission-velocity>
+				<size>8, 15</size>
+				<rate>7</rate>
+			</PlaneEmitter>
+		</emitters>
+	</SpriteParticles>
+		
+	<SpriteParticles>
+		<name>Big one hall</name>
+		<type>sprite</type>
+		<texture>steam01.png</texture>
+		<max-count>50</max-count>
+		<life-span>10, 2</life-span>
+		<radius>0.0, 100, 100</radius>
+		<radius>0.2, 100, 100</radius>
+		<radius>1.0, 100, 100</radius>
+		<mass>1.0, 0.5, .3</mass>
+		<color>0,1, 1, 1,.5</color>
+		<color>.5, .6, .6, .6, .2</color>
+		<color>1, .0, .0, .0, .0</color>
+		<precache>5</precache>
+		<emitters>
+			<PlaneEmitter>
+				<name>SteamEmitter</name>
+				<rel-coor>93.780792, -35.366524, 18.198116</rel-coor>
+				<rel-dir>3.1412, 0, 0, 1</rel-dir>
+				<spread>0, 1.0</spread>
+				<emission-velocity>-50,50</emission-velocity>
+				<size>100, 110</size>
+				<rate>2</rate>
+			</PlaneEmitter>
+		</emitters>
+	</SpriteParticles>
+	
+<!-- Destroyed room ------------------------------------------------------- -->
+	<ModelEntity>
+		<name>destroyed fighter</name>
+		<abs-coor>540, 30, -100</abs-coor><!--Orx: koo Y,Z,X -->
+		<abs-dir>2.3, 0.9, -2.5, -0.5</abs-dir>
+		<model>models/spaceships/human_spaceship_fighter.obj, 8.5</model>
+	</ModelEntity>
+		
+	<SpriteParticles>
+		<name>str1</name>
+		<type>sprite</type>
+		<texture>steam01.png</texture>
+		<max-count>50</max-count>
+		<life-span>4, 6</life-span>
+		<radius>0.0, 15.0, 20.0</radius>
+		<radius>0.2, 20.0, 25.0</radius>
+		<radius>1.0, 25.0, 30.0</radius>
+		<mass>1.0, 0.3, .2</mass>
+		<color>0,1, 1, 1,.5</color>
+		<color>.5, .6, .6, .6, .2</color>
+		<color>1, .0, .0, .0, .0</color>
+		<precache>5</precache>
+		<emitters>
+			<PlaneEmitter>
+				<name>SteamEmitter</name>
+				<rel-coor>727, 93, -111</rel-coor>
+				<rel-dir>3.1412, 0, 0, 1</rel-dir>
+				<spread>0.0, 1</spread>
+				<emission-velocity>10, 30</emission-velocity>
+				<size>8, 15</size>
+				<rate>7</rate>
+			</PlaneEmitter>
+		</emitters>
+	</SpriteParticles>
+		
+	<SpriteParticles>
+		<name>str2</name>
+		<type>sprite</type>
+		<texture>steam01.png</texture>
+		<max-count>50</max-count>
+		<life-span>4, 6</life-span>
+		<radius>0.0, 15.0, 20.0</radius>
+		<radius>0.2, 20.0, 25.0</radius>
+		<radius>1.0, 25.0, 30.0</radius>
+		<mass>1.0, 0.3, .2</mass>
+		<color>0,1, 1, 1,.5</color>
+		<color>.5, .6, .6, .6, .2</color>
+		<color>1, .0, .0, .0, .0</color>
+		<precache>5</precache>
+		<emitters>
+			<PlaneEmitter>
+				<name>SteamEmitter</name>
+				<rel-coor>772, 160, -87.5</rel-coor>
+				<rel-dir>3.1412, 0, 0, 1</rel-dir>
+				<spread>0.0, 1</spread>
+				<emission-velocity>10, 30</emission-velocity>
+				<size>8, 15</size>
+				<rate>7</rate>
+			</PlaneEmitter>
+		</emitters>
+	</SpriteParticles>
+		
+	<SpriteParticles>
+		<name>Big one</name>
+		<type>sprite</type>
+		<texture>steam01.png</texture>
+		<max-count>50</max-count>
+		<life-span>10, 2</life-span>
+		<radius>0.0, 100, 100</radius>
+		<radius>0.2, 100, 100</radius>
+		<radius>1.0, 100, 100</radius>
+		<mass>1.0, 0.5, .3</mass>
+		<color>0,1, 1, 1,.5</color>
+		<color>.5, .6, .6, .6, .2</color>
+		<color>1, .0, .0, .0, .0</color>
+		<precache>5</precache>
+		<emitters>
+			<PlaneEmitter>
+				<name>SteamEmitter</name>
+				<rel-coor>616, -50, -196</rel-coor>
+				<rel-dir>3.1412, 0, 0, 1</rel-dir>
+				<spread>0, 1.0</spread>
+				<emission-velocity>-50,50</emission-velocity>
+				<size>120, 150</size>
+				<rate>6</rate>
+			</PlaneEmitter>
+		</emitters>
+	</SpriteParticles>
+
+<!-- sleeping room ------------------------------------------------------ -->
+	
+	<Mover>
+		<name>door_sleepingroom_l</name>
+		<bReopen>1</bReopen>
+		<bReclose>1</bReclose>
+		<model>models/doors/door_small_b.obj, 6.2</model><!-- modelpath, size -->
+		<abs-dir>1.57, 0, 1, 0</abs-dir><!-- Pi,,Y-Axis-Rotation, -->
+		<abs-coor>405.5, 160, 175</abs-coor>
+		<triggers>
+			<ApproachTrigger>
+				<radius>50</radius>
+			</ApproachTrigger>
+		</triggers>
+		<stations>
+			<MoverStation>
+				<moving-time>0.6</moving-time>
+				<rel-target-coor>31, 0, 0</rel-target-coor>
+				<opening-sound>sounds/doors/door_opening2.wav</opening-sound>
+				<closing-sound>sounds/doors/door_opening2.wav</closing-sound>
+				<!--<closed-sound>sounds/doors/door_closed2.wav</closed-sound>-->
+			</MoverStation>
+		</stations>
+	</Mover>
+	<Mover>
+		<name>door_sleepingroom_r</name>
+		<bReopen>1</bReopen>
+		<bReclose>1</bReclose>
+		<model>models/doors/door_small_b.obj, 6.2</model><!-- modelpath, size -->
+		<abs-dir>1.57, 0, -1, 0</abs-dir><!-- Pi,,Y-Axis-Rotation, -->
+		<abs-coor>362, 160, 175</abs-coor>
+		<triggers>
+			<ApproachTrigger>
+				<radius>50</radius>
+			</ApproachTrigger>
+		</triggers>
+		<stations>
+			<MoverStation>
+				<moving-time>0.6</moving-time>
+				<rel-target-coor>-31, 0, 0</rel-target-coor>
+			</MoverStation>
+		</stations>
+	</Mover>
+	
+	<SpriteParticles>
+		<name>Steam in sleeping room</name>
+		<type>sprite</type>
+		<texture>steam01.png</texture>
+		<max-count>50</max-count>
+		<life-span>2, 5</life-span>
+		<radius>0.0, 15.0, 20.0</radius>
+		<radius>0.2, 20.0, 25.0</radius>
+		<radius>1.0, 25.0, 30.0</radius>
+		<mass>1.0, 0.3, .2</mass>
+		<color>0,1, 1, 1,.5</color>
+		<color>.5, .6, .6, .6, .2</color>
+		<color>1, .0, .0, .0, .0</color>
+		<precache>5</precache>
+		<emitters>
+			<PlaneEmitter>
+				<name>SteamEmitter</name>
+				<rel-coor>382, 210, 255</rel-coor>
+				<rel-dir>3.1412, 0, 0, 1</rel-dir>
+				<spread>0.0, 1</spread>
+				<emission-velocity>10, 30</emission-velocity>
+				<size>8, 15</size>
+				<rate>7</rate>
+			</PlaneEmitter>
+		</emitters>
+	</SpriteParticles>
+
+	<SpriteParticles>
+		<name>Stream Air Cleaning</name>
+		<type>sprite</type>
+		<texture>steam01.png</texture>
+		<max-count>50</max-count>
+		<life-span>10, 0</life-span>
+		<radius>0.0, 15.0, 2</radius>
+		<radius>0.2, 20.0, 5</radius>
+		<radius>1.0, 25.0, 7</radius>
+		<mass>1.0, 0.3, .2</mass>
+		<color>0,0, 1, 0,.5</color>
+		<color>.5, 0, .6, 0, .2</color>
+		<color>1, .0, .0, .0, .0</color>
+		<precache>0</precache>
+		<emitters>
+			<PlaneEmitter>
+				<name>SteamEmitter</name>
+				<rel-coor>85, 168, 243</rel-coor>
+				<rel-dir>1.57, 0, 0, 1</rel-dir>
+				<spread>0.0, 0</spread>
+				<emission-velocity>20, 2</emission-velocity>
+				<size>10, 14</size>
+				<rate>7</rate>
+			</PlaneEmitter>
+		</emitters>
+		</SpriteParticles>
+
+<!-- Underground      ######################################################################## -->
+	<Mover>
+		<name>door_elevator</name>
+		<bReopen>1</bReopen>
+		<bReclose>1</bReclose>
+		<model>models/doors/door_small_b.obj, 10</model><!-- modelpath, size -->
+		<abs-dir>1.57, 0, 1, 0</abs-dir><!-- Pi,,Y-Axis-Rotation, -->
+		<abs-coor>210, -810, -454</abs-coor>
+		<triggers>
+			<ApproachTrigger>
+				<radius>50</radius>
+			</ApproachTrigger>
+		</triggers>
+		<stations>
+			<MoverStation>
+				<moving-time>0.6</moving-time>
+				<rel-target-coor>60, 0, 0</rel-target-coor>
+				<opening-sound>sounds/doors/door_opening2.wav</opening-sound>
+				<closing-sound>sounds/doors/door_opening2.wav</closing-sound>
+				<!--<closed-sound>sounds/doors/door_closed2.wav</closed-sound>-->
+			</MoverStation>
+		</stations>
+	</Mover>
+		
+<!-- Cutscenes/Quests ######################################################################## -->
+
+	<NPC>
+		<name>IntroSpaceship</name>
+		<model>models/spaceships/human_spaceship_fighter.obj,9</model>
+		<mountpoints>models/spaceships/human_spaceship_fighter.oif</mountpoints>
+		<Track>
+			<mode>1</mode>
+			<speed>600</speed>
+			<addPoint>4000, 866, -284</addPoint>
+			<addPoint>1840, 866, -284</addPoint>
+			<addPoint>1302, 524, -217</addPoint>
+			<addPoint>760, 127, -137</addPoint>
+			<addPoint>-25, -360, -99</addPoint>
+			<addPoint>-100, -400, -110</addPoint><!-- hide position -->
+			<addPoint>-120, -410, -113</addPoint>
+		</Track>
+	</NPC>
+	
+	<NPC> <!-- triggerable door hack -->
+		<name>triggeredDoor</name>
+		<model>models/doors/door_blue_big.obj, 19</model><!-- modelpath, size -->
+		<abs-coor>222, 0, -472</abs-coor>
+		<abs-dir>0, 0, 1, 0</abs-dir>
+	</NPC> 
+	
+	<Building> <!-- Camera target hack -->
+		<name>MoonstationCenterHack</name>
+		<model>models/spaceships/human_spaceship_fighter.obj,0.1</model>
+		<abs-coor>300, 36, -170</abs-coor>
+		<abs-dir>3.1412, 0,1,0</abs-dir>
+	</Building>
+	 
+	<QuestGUI>
+		<name>energyQuest</name>
+		<quest-name>Hangar Door</quest-name>
+		<quest-description>QUEST: Open the door to the hangar.</quest-description>
+		<quest-picture>/textures/orxonox_logo.png</quest-picture>
+		<quest-difficulty>STORY: I have to leave this station. </quest-difficulty>
+		<quest-persons>Maybe I can find a ship in the hangar behind this door.</quest-persons>
+		<reward-picture>/textures/amiv_braeu.png</reward-picture>
+		<reward-description>HINT: Maybe it would be favourably to take a	look at the bridge on top of the station.</reward-description>
+	</QuestGUI>
+	
+	<BspEntity>
+		<Name>levels/maps/moonstation/moonstation_flares.bsp</Name>
+		<Transparency>1, 1</Transparency>
+	</BspEntity>
+
+</WorldEntities> <!-- End WoldEntities ##################################################### -->
+
+<ScriptManager> 
+	<Scripts>
+		<Script file="moonstation/intro.lua" />
+		<Script file="moonstation/quest.lua" />
+		<Script file="moonstation/switchLevel.lua" />
+	</Scripts>
+</ScriptManager>
+
+<CameraMan name="cameraManager">
+	<Cameras>
+		<Camera name="CameraIntro">
+			<Track>
+				<mode>1</mode>
+				<speed>80</speed>
+				<addPoint>-1295.883301, 621.807922, -969.386780</addPoint>
+				<addPoint>-1253.895386, 727.938721, -268.726807</addPoint><!-- cam2 station -->
+				<addPoint>-1092.265991, 743.441040, -15.836866</addPoint>
+				<addPoint>-438.112305, 661.747009, 566.756775</addPoint>
+				<addPoint>180.627167, 755.514709, 871.833801</addPoint><!-- cam2 ship 199.251480, 611.205872, 670.132324 -->
+				<addPoint>871.084534, 629.498901, 619.159058</addPoint>
+				<!-- <addPoint>1409.606201, 668.009155, 122.551933</addPoint>
+				<addPoint>1331.963867, 562.559082, -213.602997</addPoint> -->
+				<addPoint>1160.229858, 248.129639, -396.398438</addPoint>
+				<addPoint>1210.095825, 308.348694, -414.233826</addPoint>
+				<addPoint>881.456055, 184.982635, -176.643326</addPoint>
+				<addPoint>719.431091, 79.719810, -149.023880</addPoint><!-- intro end -->
+			</Track>
+		</Camera>
+		<Camera name="CameraDoor" abs-coor="346, 128, -110">
+		</Camera>
+	</Cameras>
+</CameraMan>
+
+<LightManager>
+		<Lights>
+			<Light diffuse-color="0.5,0.5,0.6" abs-coor="205,565,-162" />
+			<Light diffuse-color="0.5,0.5,0.6" abs-coor="-990.843811, 896.596130, -1569.420288" />
+			<Light diffuse-color="0.8,0.8,0.8" abs-coor="203.364914, -807.093872, -228.443466" />
+		</Lights>
+		<ambient color="1, 1, 1" />
+</LightManager>
+
+</WorldDataFile>
+
Index: /code/branches/audio/bin/media.cfg
===================================================================
--- /code/branches/audio/bin/media.cfg	(revision 310)
+++ /code/branches/audio/bin/media.cfg	(revision 310)
@@ -0,0 +1,16 @@
+Mesh=ogrehead.mesh
+Mesh=geosphere4500.mesh
+Mesh=razor.mesh
+Mesh=knot.mesh
+Mesh=RZR-002.mesh
+Mesh=geosphere8000.mesh
+Mesh=sphere.mesh
+
+CubeMap=cubescene.jpg
+CubeMap=early_morning.jpg
+CubeMap=cubemap.jpg
+CubeMap=morning.jpg
+CubeMap=cloudy_noon.jpg
+CubeMap=evening.jpg
+CubeMap=stormy.jpg
+CubeMap=stevecube.jpg
Index: /code/branches/audio/bin/ogre.cfg-init
===================================================================
--- /code/branches/audio/bin/ogre.cfg-init	(revision 310)
+++ /code/branches/audio/bin/ogre.cfg-init	(revision 310)
@@ -0,0 +1,7 @@
+Render System=OpenGL Rendering Subsystem
+
+[OpenGL Rendering Subsystem]
+FSAA=4
+Full Screen=No
+RTT Preferred Mode=PBuffer
+Video Mode=1280 x 1024
Index: /code/branches/audio/bin/plugins.cfg-init
===================================================================
--- /code/branches/audio/bin/plugins.cfg-init	(revision 310)
+++ /code/branches/audio/bin/plugins.cfg-init	(revision 310)
@@ -0,0 +1,14 @@
+# Defines plugins to load
+
+# Define plugin folder
+PluginFolder=/usr/lib/OGRE
+
+# Define plugins
+#Plugin=RenderSystem_Direct3D9
+Plugin=RenderSystem_GL
+Plugin=Plugin_ParticleFX
+Plugin=Plugin_BSPSceneManager
+Plugin=Plugin_OctreeSceneManager
+#Plugin=Plugin_CgProgramManager
+
+
Index: /code/branches/audio/bin/quake3settings.cfg
===================================================================
--- /code/branches/audio/bin/quake3settings.cfg	(revision 310)
+++ /code/branches/audio/bin/quake3settings.cfg	(revision 310)
@@ -0,0 +1,3 @@
+Pak0Location: f:\quake3levels\chiropteraDM.pk3
+Map: maps/chiropteradm.bsp
+
Index: /code/branches/audio/bin/resources.cfg
===================================================================
--- /code/branches/audio/bin/resources.cfg	(revision 310)
+++ /code/branches/audio/bin/resources.cfg	(revision 310)
@@ -0,0 +1,22 @@
+# Resource locations to be added to the 'boostrap' path
+# This also contains the minimum you need to use the Ogre example framework
+[Bootstrap]
+Zip=../Media/packs/OgreCore.zip
+
+# Resource locations to be added to the default path
+[General]
+FileSystem=../Media
+FileSystem=../Media/fonts
+#FileSystem=../Media/materials/programs
+FileSystem=../Media/materials/scripts
+FileSystem=../Media/materials/textures
+FileSystem=../Media/models
+FileSystem=../Media/overlay
+#FileSystem=../Media/particle
+FileSystem=../Media/gui
+Zip=../Media/packs/cubemap.zip
+#Zip=../Media/packs/cubemapsJS.zip
+#Zip=../Media/packs/dragon.zip
+#Zip=../Media/packs/fresneldemo.zip
+#Zip=../Media/packs/ogretestmap.zip
+Zip=../Media/packs/skybox.zip
Index: /code/branches/audio/bin/run-script
===================================================================
--- /code/branches/audio/bin/run-script	(revision 310)
+++ /code/branches/audio/bin/run-script	(revision 310)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+if [[ !  -f main ]] ; then
+	echo "main does not exist"
+	echo "did you compile it?"
+
+	exit 1
+fi
+
+if [[ ! -f orge.cfg ]] ; then
+	cp ogre.cfg-init ogre.cfg
+fi
+
+# check if plugins.cfg exists, and of not create it
+# and modify 
+if [[ ! -f plugins.cfg ]] ; then 
+	if uname -n | grep "tardis" > /dev/null ; then
+		sed -e 's:PluginFolder=/usr/lib/OGRE:PluginFolder=/usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/OGRE/:' \
+		-e 's:#Plugin=Plugin_CgProgramManager:Plugin=Plugin_CgProgramManager:' plugins.cfg-init > plugins.cfg
+	else
+                cp plugins.cfg-init plugins.cfg
+	fi
+fi
+exec ./main
Index: /code/branches/audio/bin/run-script.bat
===================================================================
--- /code/branches/audio/bin/run-script.bat	(revision 310)
+++ /code/branches/audio/bin/run-script.bat	(revision 310)
@@ -0,0 +1,4 @@
+cd ..\..\ogre\Samples\Common\bin\Release
+..\..\..\..\..\trunk\bin\main.exe
+cd ..\..\..\..\..\trunk\bin
+pause
Index: /code/branches/audio/cmake/FindBoost.cmake
===================================================================
--- /code/branches/audio/cmake/FindBoost.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindBoost.cmake	(revision 310)
@@ -0,0 +1,269 @@
+# - Find the Boost includes and libraries.
+# The following variables are set if Boost is found.  If Boost is not
+# found, Boost_FOUND is set to false.
+#  Boost_FOUND                  - True when the Boost include directory is found.
+#  Boost_INCLUDE_DIRS           - the path to where the boost include files are.
+#  Boost_LIBRARY_DIRS           - The path to where the boost library files are.
+#  Boost_LIB_DIAGNOSTIC_DEFINITIONS - Only set if using Windows.
+#  Boost_<library>_FOUND        - True if the Boost <library> is found.
+#  Boost_<library>_INCLUDE_DIRS - The include path for Boost <library>.
+#  Boost_<library>_LIBRARIES    - The libraries to link to to use Boost <library>.
+#  Boost_LIBRARIES              - The libraries to link to to use all Boost libraries.
+#
+# The following variables can be set to configure how Boost is found:
+#  Boost_LIB_PREFIX             - Look for Boost libraries prefixed with this, e.g. "lib"
+#  Boost_LIB_SUFFIX             - Look for Boost libraries ending with this, e.g. "vc80-mt"
+#  Boost_LIB_SUFFIX_DEBUG       - As for Boost_LIB_SUFFIX but for debug builds, e.g. "vs80-mt-gd"
+
+# ----------------------------------------------------------------------------
+# If you have installed Boost in a non-standard location or you have
+# just staged the boost files using bjam then you have three
+# options. In the following comments, it is assumed that <Your Path>
+# points to the root directory of the include directory of Boost. e.g
+# If you have put boost in C:\development\Boost then <Your Path> is
+# "C:/development/Boost" and in this directory there will be two
+# directories called "include" and "lib".
+# 1) After CMake runs, set Boost_INCLUDE_DIR to <Your Path>/include/boost<-version>
+# 2) Use CMAKE_INCLUDE_PATH to set a path to <Your Path>/include. This will allow FIND_PATH()
+#    to locate Boost_INCLUDE_DIR by utilizing the PATH_SUFFIXES option. e.g.
+#    SET(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "<Your Path>/include")
+# 3) Set an environment variable called ${BOOST_ROOT} that points to the root of where you have
+#    installed Boost, e.g. <Your Path>. It is assumed that there is at least a subdirectory called
+#    include in this path.
+#
+# Note:
+#  1) If you are just using the boost headers, then you do not need to use
+#     Boost_LIBRARY_DIRS in your CMakeLists.txt file.
+#  2) If Boost has not been installed, then when setting Boost_LIBRARY_DIRS
+#     the script will look for /lib first and, if this fails, then for /stage/lib.
+#
+# Usage:
+# In your CMakeLists.txt file do something like this:
+# ...
+# # Boost
+# FIND_PACKAGE(Boost)
+# ...
+# INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+# LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
+#
+# In Windows, we make the assumption that, if the Boost files are installed, the default directory
+# will be C:\boost.
+
+#
+# TODO:
+#
+# 1) Automatically find the Boost library files and eliminate the need
+#    to use Link Directories.
+#
+
+IF(WIN32)
+# In windows, automatic linking is performed, so you do not have to specify the libraries.
+# If you are linking to a dynamic runtime, then you can choose to link to either a static or a
+# dynamic Boost library, the default is to do a static link.  You can alter this for a specific
+# library "whatever" by defining BOOST_WHATEVER_DYN_LINK to force Boost library "whatever" to
+# be linked dynamically.  Alternatively you can force all Boost libraries to dynamic link by
+# defining BOOST_ALL_DYN_LINK.
+
+# This feature can be disabled for Boost library "whatever" by defining BOOST_WHATEVER_NO_LIB,
+# or for all of Boost by defining BOOST_ALL_NO_LIB.
+
+# If you want to observe which libraries are being linked against then defining
+# BOOST_LIB_DIAGNOSTIC will cause the auto-linking code to emit a #pragma message each time
+# a library is selected for linking.
+  SET(Boost_LIB_DIAGNOSTIC_DEFINITIONS "-DBOOST_LIB_DIAGNOSTIC")
+ENDIF(WIN32)
+
+
+SET(BOOST_INCLUDE_PATH_DESCRIPTION "directory containing the boost include files. E.g /usr/local/include/boost-1_33_1 or c:\\boost\\include\\boost-1_33_1")
+
+SET(BOOST_DIR_MESSAGE "Set the Boost_INCLUDE_DIR cmake cache entry to the ${BOOST_INCLUDE_PATH_DESCRIPTION}")
+
+SET(BOOST_DIR_SEARCH $ENV{BOOST_ROOT})
+IF(BOOST_DIR_SEARCH)
+  FILE(TO_CMAKE_PATH ${BOOST_DIR_SEARCH} BOOST_DIR_SEARCH)
+  SET(BOOST_DIR_SEARCH ${BOOST_DIR_SEARCH}/include)
+ENDIF(BOOST_DIR_SEARCH)
+
+IF(WIN32)
+  SET(BOOST_DIR_SEARCH
+    ${BOOST_DIR_SEARCH}
+    C:/boost/include
+    D:/boost/include
+  )
+ENDIF(WIN32)
+
+# Add in some path suffixes. These will have to be updated whenever a new Boost version comes out.
+SET(SUFFIX_FOR_PATH
+ boost-1_34_1
+ boost-1_34_0
+ boost-1_34
+ boost-1_33_1
+ boost-1_33_0
+)
+
+#
+# Look for an installation.
+#
+FIND_PATH(Boost_INCLUDE_DIR NAMES boost/config.hpp PATH_SUFFIXES ${SUFFIX_FOR_PATH} PATHS
+
+# Look in other places.
+  ${BOOST_DIR_SEARCH}
+
+# Help the user find it if we cannot.
+  DOC "The ${BOOST_INCLUDE_PATH_DESCRIPTION}"
+)
+
+# Assume we didn't find it.
+SET(Boost_FOUND 0)
+
+# Now try to get the include and library path.
+IF(Boost_INCLUDE_DIR)
+
+# Look for the boost library path.
+# Note that the user may not have installed any libraries
+# so it is quite possible the Boost_LIBRARY_PATH may not exist.
+  SET(Boost_LIBRARY_DIR ${Boost_INCLUDE_DIR})
+
+  IF("${Boost_LIBRARY_DIR}" MATCHES "boost-[0-9]+")
+    GET_FILENAME_COMPONENT(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR} PATH)
+  ENDIF ("${Boost_LIBRARY_DIR}" MATCHES "boost-[0-9]+")
+
+  IF("${Boost_LIBRARY_DIR}" MATCHES "/include$")
+# Strip off the trailing "/include" in the path.
+    GET_FILENAME_COMPONENT(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR} PATH)
+  ENDIF("${Boost_LIBRARY_DIR}" MATCHES "/include$")
+
+  IF(EXISTS "${Boost_LIBRARY_DIR}/lib")
+    SET (Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR}/lib)
+  ELSE(EXISTS "${Boost_LIBRARY_DIR}/lib")
+    IF(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
+      SET(Boost_LIBRARY_DIR ${Boost_LIBRARY_DIR}/stage/lib)
+    ELSE(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
+      SET(Boost_LIBRARY_DIR "")
+    ENDIF(EXISTS "${Boost_LIBRARY_DIR}/stage/lib")
+  ENDIF(EXISTS "${Boost_LIBRARY_DIR}/lib")
+
+  IF(EXISTS "${Boost_INCLUDE_DIR}")
+    SET(Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
+# We have found boost. It is possible that the user has not
+# compiled any libraries so we set Boost_FOUND to be true here.
+    SET(Boost_FOUND 1)
+    MARK_AS_ADVANCED(Boost_INCLUDE_DIR)
+  ENDIF(EXISTS "${Boost_INCLUDE_DIR}")
+
+  IF(Boost_LIBRARY_DIR AND EXISTS "${Boost_LIBRARY_DIR}")
+    SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIR})
+  ENDIF(Boost_LIBRARY_DIR AND EXISTS "${Boost_LIBRARY_DIR}")
+ENDIF(Boost_INCLUDE_DIR)
+
+#
+# Find boost libraries
+#
+
+# List of library suffixes to search, e.g. libboost_date_time-gcc
+SET(BOOST_SUFFIX_SEARCH
+  gcc
+  il
+)
+
+# List of all boost libraries
+SET(BOOST_ALL_LIBRARIES
+  date_time
+  filesystem
+  graph
+  iostreams
+  program_options
+  python
+  regex
+  serialization
+  signals
+  unit_test_framework
+  thread
+  wave
+)
+
+# Macro to find boost library called name
+MACRO(BOOST_FIND_LIBRARY name)
+
+# User can specify a particular build variant via the variables:
+#   Boost_LIB_PREFIX, Boost_LIB_SUFFIX, Boost_LIB_SUFFIX_DEBUG
+# otherwise we'll search the BOOST_SUFFIX_SEARCH list
+  SET(BOOST_LIB_NAMES ${Boost_LIB_PREFIX}boost_${name}-${Boost_LIB_SUFFIX})
+  IF(NOT Boost_LIB_SUFFIX)
+    FOREACH(suffix ${BOOST_SUFFIX_SEARCH})
+      SET(BOOST_LIB_NAMES ${BOOST_LIB_NAMES} ${Boost_LIB_PREFIX}boost_${name}-${suffix})
+    ENDFOREACH(suffix)
+  ENDIF(NOT Boost_LIB_SUFFIX)
+
+# Find the library in the Boost_LIBRARY_DIRS
+  FIND_LIBRARY(Boost_${name}_LIBRARY
+    NAMES ${BOOST_LIB_NAMES}
+    PATHS ${Boost_LIBRARY_DIRS})
+
+# For MSVC builds find debug library
+  IF(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
+    FIND_LIBRARY(Boost_${name}_LIBRARY_DEBUG ${Boost_LIB_PREFIX}boost_${name}-${Boost_LIB_SUFFIX_DEBUG})
+
+    IF(MSVC_IDE)
+      IF(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
+        SET(Boost_${name}_LIBRARIES debug ${Boost_${name}_LIBRARY_DEBUG} optimized ${Boost_${name}_LIBRARY})
+      ELSE(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
+        MESSAGE(FATAL_ERROR "Could not find the debug and release version of Boost ${name} library.")
+      ENDIF(Boost_${name}_LIBRARY AND Boost_${name}_LIBRARY_DEBUG)
+    ELSE(MSVC_IDE)
+      STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
+      IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+        SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY_DEBUG})
+      ELSE(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+        SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY})
+      ENDIF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+    ENDIF(MSVC_IDE)
+  ELSE(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
+    SET(Boost_${name}_LIBRARIES ${Boost_${name}_LIBRARY})
+  ENDIF(WIN32 AND MSVC AND Boost_${name}_LIBRARY)
+
+# If we've got it setup appropriate variables or issue error message
+  IF(Boost_${name}_LIBRARY)
+    SET(Boost_${name}_FOUND 1)
+    SET(Boost_${name}_INCLUDE_DIRS ${Boost_INCLUDE_DIR})
+    MARK_AS_ADVANCED(Boost_${name}_LIBRARY Boost_${name}_LIBRARY_DEBUG)
+  ELSE(Boost_${name}_LIBRARY)
+    IF(NOT Boost_FIND_QUIETLY)
+      MESSAGE(STATUS "Boost ${name} library was not found.")
+    ELSE(NOT Boost_FIND_QUIETLY)
+      IF(Boost_FIND_REQUIRED_${name})
+        MESSAGE(FATAL_ERROR "Could NOT find required Boost ${name} library.")
+      ENDIF(Boost_FIND_REQUIRED_${name})
+    ENDIF(NOT Boost_FIND_QUIETLY)
+  ENDIF(Boost_${name}_LIBRARY)
+ENDMACRO(BOOST_FIND_LIBRARY)
+
+IF(Boost_LIBRARY_DIRS)
+
+# If the user specified required components e.g. via
+# FIND_PACKAGE(Boost REQUIRED date_time regex)
+# find (just) those libraries. Otherwise find all libraries.
+  IF(Boost_FIND_COMPONENTS)
+    SET(Boost_FIND_LIBRARIES ${Boost_FIND_COMPONENTS})
+  ELSE(Boost_FIND_COMPONENTS)
+    SET(Boost_FIND_LIBRARIES ${BOOST_ALL_LIBRARIES})
+  ENDIF(Boost_FIND_COMPONENTS)
+
+  SET(Boost_LIBRARIES)
+  FOREACH(library ${Boost_FIND_LIBRARIES})
+    BOOST_FIND_LIBRARY(${library})
+    IF(Boost_${library}_FOUND)
+      SET(Boost_LIBRARIES ${Boost_LIBRARIES} ${Boost_${library}_LIBRARIES})
+    ENDIF(Boost_${library}_FOUND)
+  ENDFOREACH(library)
+ENDIF(Boost_LIBRARY_DIRS)
+
+IF(NOT Boost_FOUND)
+  IF(NOT Boost_FIND_QUIETLY)
+    MESSAGE(STATUS "Boost was not found. ${BOOST_DIR_MESSAGE}")
+  ELSE(NOT Boost_FIND_QUIETLY)
+    IF(Boost_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "Boost was not found. ${BOOST_DIR_MESSAGE}")
+    ENDIF(Boost_FIND_REQUIRED)
+  ENDIF(NOT Boost_FIND_QUIETLY)
+ENDIF(NOT Boost_FOUND)
Index: /code/branches/audio/cmake/FindCEGUI.cmake
===================================================================
--- /code/branches/audio/cmake/FindCEGUI.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindCEGUI.cmake	(revision 310)
@@ -0,0 +1,56 @@
+# Find CEGUI includes and library
+#
+# This module defines
+#  CEGUI_INCLUDE_DIR
+#  CEGUI_LIBRARIES, the libraries to link against to use CEGUI.
+#  CEGUI_LIB_DIR, the location of the libraries
+#  CEGUI_FOUND, If false, do not try to use CEGUI
+#
+# Created by Matt Williams to find OGRE libraries
+# Copyright © 2007, Matt Williams
+#
+# Modified by Nicolas Schlumberger to find CEGUI libraries
+# and make it run on the Tardis-Infrastucture of the ETH Zurich
+# Copyright 2007, Nicolas Schlumberger
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+IF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR)
+    SET(CEGUI_FIND_QUIETLY TRUE) # Already in cache, be silent
+ENDIF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR)
+
+IF (WIN32) #Windows
+    MESSAGE(STATUS "Looking for CEGUI")
+    SET(CEGUI_INCLUDE_DIR ../ogre/Dependencies/include/CEGUI)
+    SET(CEGUI_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ogre/Samples/Common/bin/Release/lib)
+    SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
+ELSE (WIN32) #Unix
+    FIND_PACKAGE(PkgConfig)
+    PKG_SEARCH_MODULE(CEGUI CEGUI /usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1/lib/pkgconfig/CEGUI.pc) # tardis specific hack
+    SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})
+    SET(CEGUI_LIB_DIR ${CEGUI_LIBDIR})
+    SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
+ENDIF (WIN32)
+
+#Do some preparation
+SEPARATE_ARGUMENTS(CEGUI_INCLUDE_DIR)
+SEPARATE_ARGUMENTS(CEGUI_LIBRARIES)
+
+SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIR} CACHE PATH "")
+SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
+SET(CEGUI_LIB_DIR ${CEGUI_LIB_DIR} CACHE PATH "")
+
+IF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES)
+    SET(CEGUI_FOUND TRUE)
+ENDIF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES)
+
+IF (CEGUI_FOUND)
+    IF (NOT CEGUI_FIND_QUIETLY)
+        MESSAGE(STATUS "  libraries : ${CEGUI_LIBRARIES} from ${CEGUI_LIB_DIR}")
+        MESSAGE(STATUS "  includes  : ${CEGUI_INCLUDE_DIR}")
+    ENDIF (NOT CEGUI_FIND_QUIETLY)
+ELSE (CEGUI_FOUND)
+    IF (CEGUI_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could not find CEGUI")
+    ENDIF (CEGUI_FIND_REQUIRED)
+ENDIF (CEGUI_FOUND)
Index: /code/branches/audio/cmake/FindCEGUI_OGRE.cmake
===================================================================
--- /code/branches/audio/cmake/FindCEGUI_OGRE.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindCEGUI_OGRE.cmake	(revision 310)
@@ -0,0 +1,56 @@
+# Find CEGUI_OGRE includes and library
+#
+# This module defines
+#  CEGUI_OGRE_INCLUDE_DIR
+#  CEGUI_OGRE_LIBRARIES, the libraries to link against to use CEGUI_OGRE.
+#  CEGUI_OGRE_LIB_DIR, the location of the libraries
+#  CEGUI_OGRE_FOUND, If false, do not try to use CEGUI_OGRE
+#
+# Created by Matt Williams to find OGRE libraries
+# Copyright © 2007, Matt Williams
+#
+# Modified by Nicolas Schlumberger to find CEGUI-OGRE libraries
+# and make it run on the Tardis-Infrastucture of the ETH Zurich
+# Copyright 2007, Nicolas Schlumberger
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+IF (CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_INCLUDE_DIR)
+    SET(CEGUI_OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
+ENDIF (CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_INCLUDE_DIR)
+
+IF (WIN32) #Windows
+    MESSAGE(STATUS "Looking for CEGUI_OGRE")
+    SET(CEGUI_OGRE_INCLUDE_DIR ../ogre/Samples/Common/CEGUIRenderer/include)
+    SET(CEGUI_OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ogre/Samples/Common/bin/Release/lib)
+    SET(CEGUI_OGRE_LIBRARIES debug OgreGUIRenderer_d optimized OgreGUIRenderer)
+ELSE (WIN32) #Unix
+    FIND_PACKAGE(PkgConfig)
+    PKG_SEARCH_MODULE(CEGUI_OGRE CEGUI-OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/CEGUI-OGRE.pc) # tardis specific hack
+    SET(CEGUI_OGRE_INCLUDE_DIR ${CEGUI_OGRE_INCLUDE_DIRS})
+    SET(CEGUI_OGRE_LIB_DIR ${CEGUI_OGRE_LIBDIR})
+    SET(CEGUI_OGRE_LIBRARIES ${CEGUI_OGRE_LIBRARIES} CACHE STRING "")
+ENDIF (WIN32)
+
+#Do some preparation
+SEPARATE_ARGUMENTS(CEGUI_OGRE_INCLUDE_DIR)
+SEPARATE_ARGUMENTS(CEGUI_OGRE_LIBRARIES)
+
+SET(CEGUI_OGRE_INCLUDE_DIR ${CEGUI_OGRE_INCLUDE_DIR} CACHE PATH "")
+SET(CEGUI_OGRE_LIBRARIES ${CEGUI_OGRE_LIBRARIES} CACHE STRING "")
+SET(CEGUI_OGRE_LIB_DIR ${CEGUI_OGRE_LIB_DIR} CACHE PATH "")
+
+IF (CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIBRARIES)
+    SET(CEGUI_OGRE_FOUND TRUE)
+ENDIF (CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIBRARIES)
+
+IF (CEGUI_OGRE_FOUND)
+    IF (NOT CEGUI_OGRE_FIND_QUIETLY)
+        MESSAGE(STATUS "  libraries : ${CEGUI_OGRE_LIBRARIES} from ${CEGUI_OGRE_LIB_DIR}")
+        MESSAGE(STATUS "  includes  : ${CEGUI_OGRE_INCLUDE_DIR}")
+    ENDIF (NOT CEGUI_OGRE_FIND_QUIETLY)
+ELSE (CEGUI_OGRE_FOUND)
+    IF (CEGUI_OGRE_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could not find CEGUI_OGRE")
+    ENDIF (CEGUI_OGRE_FIND_REQUIRED)
+ENDIF (CEGUI_OGRE_FOUND)
Index: /code/branches/audio/cmake/FindENet.cmake
===================================================================
--- /code/branches/audio/cmake/FindENet.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindENet.cmake	(revision 310)
@@ -0,0 +1,46 @@
+# - Try to find enet
+# Once done this will define
+#
+#  ENET_FOUND - system has enet
+#  ENET_INCLUDE_DIR - the enet include directory
+#  ENET_LIBRARIES - the libraries needed to use enet
+#  ENET_DEFINITIONS - Compiler switches required for using enet
+#
+#  Borrowed from The Mana World
+#  http://themanaworld.org/
+#
+
+IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+   SET(ENet_FIND_QUIETLY TRUE)
+ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+
+FIND_PATH(ENet_INCLUDE_DIR enet/enet.h
+    /usr/include
+    /usr/local/include
+    /usr/pack/enet-2007-sd/include
+    )
+
+FIND_LIBRARY(ENet_LIBRARY
+    NAMES enet
+    PATHS /usr/lib /usr/local/lib /usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/
+    )
+
+IF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+    SET(ENET_FOUND TRUE)
+    SET(ENET_INCLUDE_DIR ${ENet_INCLUDE_DIR})
+    SET(ENET_LIBRARIES ${ENet_LIBRARY})
+ELSE (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+    SET(ENET_FOUND FALSE)
+ENDIF (ENet_INCLUDE_DIR AND ENet_LIBRARY)
+
+IF (ENET_FOUND)
+    IF (NOT ENet_FIND_QUIETLY)
+        MESSAGE(STATUS "Found enet: ${ENet_LIBRARY}")
+    ENDIF (NOT ENet_FIND_QUIETLY)
+ELSE (ENET_FOUND)
+    IF (ENet_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could NOT find enet")
+    ENDIF (ENet_FIND_REQUIRED)
+ENDIF (ENET_FOUND)
+
+MARK_AS_ADVANCED(ENet_INCLUDE_DIR ENet_LIBRARY)
Index: /code/branches/audio/cmake/FindODE.cmake
===================================================================
--- /code/branches/audio/cmake/FindODE.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindODE.cmake	(revision 310)
@@ -0,0 +1,46 @@
+# find ODE (Open Dynamics Engine) includes and library
+#
+# ODE_INCLUDE_DIR - where the directory containing the ODE headers can be
+#                   found
+# ODE_LIBRARY     - full path to the ODE library
+# ODE_FOUND       - TRUE if ODE was found
+
+IF (NOT ODE_FOUND)
+
+  FIND_PATH(ODE_INCLUDE_DIR ode/ode.h
+    /usr/include
+    /usr/local/include
+    $ENV{OGRE_HOME}/include # OGRE SDK on WIN32
+    $ENV{INCLUDE}
+  )
+  FIND_LIBRARY(ODE_LIBRARY
+    NAMES ode
+    PATHS
+    /usr/lib
+    /usr/local/lib
+    $ENV{OGRE_HOME}/lib # OGRE SDK on WIN32
+  )
+
+  IF(ODE_INCLUDE_DIR)
+    MESSAGE(STATUS "Found ODE include dir: ${ODE_INCLUDE_DIR}")
+  ELSE(ODE_INCLUDE_DIR)
+    MESSAGE(STATUS "Could NOT find ODE headers.")
+  ENDIF(ODE_INCLUDE_DIR)
+
+  IF(ODE_LIBRARY)
+    MESSAGE(STATUS "Found ODE library: ${ODE_LIBRARY}")
+  ELSE(ODE_LIBRARY)
+    MESSAGE(STATUS "Could NOT find ODE library.")
+  ENDIF(ODE_LIBRARY)
+
+  IF(ODE_INCLUDE_DIR AND ODE_LIBRARY)
+     SET(ODE_FOUND TRUE CACHE STRING "Whether ODE was found or not")
+   ELSE(ODE_INCLUDE_DIR AND ODE_LIBRARY)
+     SET(ODE_FOUND FALSE)
+     IF(ODE_FIND_REQUIRED)
+       MESSAGE(FATAL_ERROR "Could not find ODE. Please install ODE (http://www.ode.org)")
+     ENDIF(ODE_FIND_REQUIRED)
+   ENDIF(ODE_INCLUDE_DIR AND ODE_LIBRARY)
+ENDIF (NOT ODE_FOUND)
+
+# vim: et sw=4 ts=4
Index: /code/branches/audio/cmake/FindOGRE.cmake
===================================================================
--- /code/branches/audio/cmake/FindOGRE.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindOGRE.cmake	(revision 310)
@@ -0,0 +1,52 @@
+# Find OGRE includes and library
+#
+# This module defines
+#  OGRE_INCLUDE_DIR
+#  OGRE_LIBRARIES, the libraries to link against to use OGRE.
+#  OGRE_LIB_DIR, the location of the libraries
+#  OGRE_FOUND, If false, do not try to use OGRE
+#
+# Copyright © 2007, Matt Williams
+# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture of the ETH Zurich
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
+    SET(OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
+ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
+
+IF (WIN32) #Windows
+    MESSAGE(STATUS "Looking for OGRE")
+    SET(OGRE_INCLUDE_DIR ../ogre/OgreMain/include)
+    SET(OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ogre/Samples/Common/bin/Release)
+    SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
+ELSE (WIN32) #Unix
+    FIND_PACKAGE(PkgConfig)
+    PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack
+    SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
+    SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
+    SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
+ENDIF (WIN32)
+
+#Do some preparation
+SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
+SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
+
+SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
+SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
+SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
+
+IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
+    SET(OGRE_FOUND TRUE)
+ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
+
+IF (OGRE_FOUND)
+    IF (NOT OGRE_FIND_QUIETLY)
+        MESSAGE(STATUS "  libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}")
+        MESSAGE(STATUS "  includes  : ${OGRE_INCLUDE_DIR}")
+    ENDIF (NOT OGRE_FIND_QUIETLY)
+ELSE (OGRE_FOUND)
+    IF (OGRE_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could not find OGRE")
+    ENDIF (OGRE_FIND_REQUIRED)
+ENDIF (OGRE_FOUND)
Index: /code/branches/audio/cmake/FindOIS.cmake
===================================================================
--- /code/branches/audio/cmake/FindOIS.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindOIS.cmake	(revision 310)
@@ -0,0 +1,56 @@
+# Find OIS includes and library
+#
+# This module defines
+#  OIS_INCLUDE_DIR
+#  OIS_LIBRARIES, the libraries to link against to use OIS.
+#  OIS_LIB_DIR, the location of the libraries
+#  OIS_FOUND, If false, do not try to use OIS
+#
+# Created by Matt Williams to find OGRE libraries
+# Copyright © 2007, Matt Williams
+#
+# Modified by Nicolas Schlumberger to find OIS libraries
+# and make it run on the Tardis-Infrastucture of the ETH Zurich
+# Copyright 2007, Nicolas Schlumberger
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
+    SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent
+ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
+
+IF (WIN32) #Windows
+    MESSAGE(STATUS "Looking for OIS")
+    SET(OIS_INCLUDE_DIR ../ogre/Dependencies/include)
+    SET(OIS_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ogre/Samples/Common/bin/Release)
+    SET(OIS_LIBRARIES debug OIS_d optimized OIS)
+ELSE (WIN32) #Unix
+    FIND_PACKAGE(PkgConfig)
+    PKG_SEARCH_MODULE(OIS OIS /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc) # tardis specific hack
+    SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS})
+    SET(OIS_LIB_DIR ${OIS_LIBDIR})
+    SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
+ENDIF (WIN32)
+
+#Do some preparation
+SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR)
+SEPARATE_ARGUMENTS(OIS_LIBRARIES)
+
+SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "")
+SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
+SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "")
+
+IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
+    SET(OIS_FOUND TRUE)
+ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
+
+IF (OIS_FOUND)
+    IF (NOT OIS_FIND_QUIETLY)
+        MESSAGE(STATUS "  libraries : ${OIS_LIBRARIES} from ${OIS_LIB_DIR}")
+        MESSAGE(STATUS "  includes  : ${OIS_INCLUDE_DIR}")
+    ENDIF (NOT OIS_FIND_QUIETLY)
+ELSE (OIS_FOUND)
+    IF (OIS_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could not find OIS")
+    ENDIF (OIS_FIND_REQUIRED)
+ENDIF (OIS_FOUND)
Index: /code/branches/audio/cmake/FindPkgConfig.cmake
===================================================================
--- /code/branches/audio/cmake/FindPkgConfig.cmake	(revision 310)
+++ /code/branches/audio/cmake/FindPkgConfig.cmake	(revision 310)
@@ -0,0 +1,360 @@
+# - a pkg-config module for CMake
+#
+# Usage:
+#   pkg_check_modules(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
+#     checks for all the given modules
+#
+#   pkg_search_module(<PREFIX> [REQUIRED] <MODULE> [<MODULE>]*)
+#     checks for given modules and uses the first working one
+#
+# When the 'REQUIRED' argument was set, macros will fail with an error
+# when module(s) could not be found
+#
+# It sets the following variables:
+#   PKG_CONFIG_FOUND         ... true iff pkg-config works on the system
+#   PKG_CONFIG_EXECUTABLE    ... pathname of the pkg-config program
+#   <PREFIX>_FOUND           ... set to 1 iff module(s) exist
+#
+# For the following variables two sets of values exist; first one is the
+# common one and has the given PREFIX. The second set contains flags
+# which are given out when pkgconfig was called with the '--static'
+# option.
+#   <XPREFIX>_LIBRARIES      ... only the libraries (w/o the '-l')
+#   <XPREFIX>_LIBRARY_DIRS   ... the paths of the libraries (w/o the '-L')
+#   <XPREFIX>_LDFLAGS        ... all required linker flags
+#   <XPREFIX>_LDFLAGS_OTHERS ... all other linker flags
+#   <XPREFIX>_INCLUDE_DIRS   ... the '-I' preprocessor flags (w/o the '-I')
+#   <XPREFIX>_CFLAGS         ... all required cflags
+#   <XPREFIX>_CFLAGS_OTHERS  ... the other compiler flags
+#
+#   <XPREFIX> = <PREFIX>        for common case
+#   <XPREFIX> = <PREFIX>_STATIC for static linking
+#
+# There are some special variables whose prefix depends on the count
+# of given modules. When there is only one module, <PREFIX> stays
+# unchanged. When there are multiple modules, the prefix will be
+# changed to <PREFIX>_<MODNAME>:
+#   <XPREFIX>_VERSION    ... version of the module
+#   <XPREFIX>_PREFIX     ... prefix-directory of the module
+#   <XPREFIX>_INCLUDEDIR ... include-dir of the module
+#   <XPREFIX>_LIBDIR     ... lib-dir of the module
+#
+#   <XPREFIX> = <PREFIX>  when |MODULES| == 1, else
+#   <XPREFIX> = <PREFIX>_<MODNAME>
+#
+# A <MODULE> parameter can have the following formats:
+#   {MODNAME}            ... matches any version
+#   {MODNAME}>={VERSION} ... at least version <VERSION> is required
+#   {MODNAME}={VERSION}  ... exactly version <VERSION> is required
+#   {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
+#
+# Examples
+#   pkg_check_modules (GLIB2   glib-2.0)
+#
+#   pkg_check_modules (GLIB2   glib-2.0>=2.10)
+#     requires at least version 2.10 of glib2 and defines e.g.
+#       GLIB2_VERSION=2.10.3
+#
+#   pkg_check_modules (FOO     glib-2.0>=2.10 gtk+-2.0)
+#     requires both glib2 and gtk2, and defines e.g.
+#       FOO_glib-2.0_VERSION=2.10.3
+#       FOO_gtk+-2.0_VERSION=2.8.20
+#
+#   pkg_check_modules (XRENDER REQUIRED xrender)
+#     defines e.g.:
+#       XRENDER_LIBRARIES=Xrender;X11
+#       XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
+#
+#   pkg_search_module (BAR     libxml-2.0 libxml2 libxml>=2)
+
+
+# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+#
+# Redistribution and use, with or without modification, are permitted
+# provided that the following conditions are met:
+# 
+#    1. Redistributions must retain the above copyright notice, this
+#       list of conditions and the following disclaimer.
+#    2. The name of the author may not be used to endorse or promote
+#       products derived from this software without specific prior
+#       written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+### Common stuff ####
+set(PKG_CONFIG_VERSION 1)
+set(PKG_CONFIG_FOUND   0)
+
+find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
+mark_as_advanced(PKG_CONFIG_EXECUTABLE)
+
+if(PKG_CONFIG_EXECUTABLE)
+  set(PKG_CONFIG_FOUND 1)
+endif(PKG_CONFIG_EXECUTABLE)
+
+
+# Unsets the given variables
+macro(_pkgconfig_unset var)
+  set(${var} "" CACHE INTERNAL "")
+endmacro(_pkgconfig_unset)
+
+macro(_pkgconfig_set var value)
+  set(${var} ${value} CACHE INTERNAL "")
+endmacro(_pkgconfig_set)
+
+# Invokes pkgconfig, cleans up the result and sets variables
+macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
+  set(_pkgconfig_invoke_result)
+
+  execute_process(
+    COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist}
+    OUTPUT_VARIABLE _pkgconfig_invoke_result
+    RESULT_VARIABLE _pkgconfig_failed)
+
+  if (_pkgconfig_failed)
+    set(_pkgconfig_${_varname} "")
+    _pkgconfig_unset(${_prefix}_${_varname})
+  else(_pkgconfig_failed)
+    string(REGEX REPLACE "[\r\n]"                  " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+    string(REGEX REPLACE " +$"                     ""  _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+
+    if (NOT ${_regexp} STREQUAL "")
+      string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+    endif(NOT ${_regexp} STREQUAL "")
+
+    separate_arguments(_pkgconfig_invoke_result)
+
+    #message(STATUS "  ${_varname} ... ${_pkgconfig_invoke_result}")
+    set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result})
+    _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}")
+  endif(_pkgconfig_failed)
+endmacro(_pkgconfig_invoke)
+
+# Invokes pkgconfig two times; once without '--static' and once with
+# '--static'
+macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
+  _pkgconfig_invoke("${_pkglist}" ${_prefix}        ${_varname} "${cleanup_regexp}" ${ARGN})
+  _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static  ${ARGN})
+endmacro(_pkgconfig_invoke_dyn)
+
+# Splits given arguments into options and a package list
+macro(_pkgconfig_parse_options _result _is_req)
+  set(${_is_req} 0)
+  
+  foreach(_pkg ${ARGN})
+    if (_pkg STREQUAL "REQUIRED")
+      set(${_is_req} 1)
+    endif (_pkg STREQUAL "REQUIRED")
+  endforeach(_pkg ${ARGN})
+
+  set(${_result} ${ARGN})
+  list(REMOVE_ITEM ${_result} "REQUIRED")
+endmacro(_pkgconfig_parse_options)
+
+###
+macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
+  _pkgconfig_unset(${_prefix}_FOUND)
+  _pkgconfig_unset(${_prefix}_VERSION)
+  _pkgconfig_unset(${_prefix}_PREFIX)
+  _pkgconfig_unset(${_prefix}_INCLUDEDIR)
+  _pkgconfig_unset(${_prefix}_LIBDIR)
+  _pkgconfig_unset(${_prefix}_LIBS)
+  _pkgconfig_unset(${_prefix}_LIBS_L)
+  _pkgconfig_unset(${_prefix}_LIBS_PATHS)
+  _pkgconfig_unset(${_prefix}_LIBS_OTHER)
+  _pkgconfig_unset(${_prefix}_CFLAGS)
+  _pkgconfig_unset(${_prefix}_CFLAGS_I)
+  _pkgconfig_unset(${_prefix}_CFLAGS_OTHER)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBDIR)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS_L)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS_PATHS)
+  _pkgconfig_unset(${_prefix}_STATIC_LIBS_OTHER)
+  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS)
+  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_I)
+  _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_OTHER)
+
+  # create a better addressable variable of the modules and calculate its size
+  set(_pkg_check_modules_list ${ARGN})
+  list(LENGTH _pkg_check_modules_list _pkg_check_modules_cnt)
+
+  if(PKG_CONFIG_EXECUTABLE)
+    # give out status message telling checked module
+    if (NOT ${_is_silent})
+      if (_pkg_check_modules_cnt EQUAL 1)
+        message(STATUS "checking for module '${_pkg_check_modules_list}'")
+      else(_pkg_check_modules_cnt EQUAL 1)
+        message(STATUS "checking for modules '${_pkg_check_modules_list}'")
+      endif(_pkg_check_modules_cnt EQUAL 1)
+    endif(NOT ${_is_silent})
+    
+    set(_pkg_check_modules_packages)
+    set(_pkg_check_modules_failed)
+
+    # iterate through module list and check whether they exist and match the required version
+    foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
+      set(_pkg_check_modules_exist_query)
+
+      # check whether version is given
+      if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
+        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op   "${_pkg_check_modules_pkg}")
+        string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver  "${_pkg_check_modules_pkg}")
+      else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+        set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
+        set(_pkg_check_modules_pkg_op)
+        set(_pkg_check_modules_pkg_ver)
+      endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+
+      # handle the operands
+      if (_pkg_check_modules_pkg_op STREQUAL ">=")
+        list(APPEND _pkg_check_modules_exist_query --atleast-version)
+      endif(_pkg_check_modules_pkg_op STREQUAL ">=")
+
+      if (_pkg_check_modules_pkg_op STREQUAL "=")
+        list(APPEND _pkg_check_modules_exist_query --exact-version)
+      endif(_pkg_check_modules_pkg_op STREQUAL "=")
+      
+      if (_pkg_check_modules_pkg_op STREQUAL "<=")
+        list(APPEND _pkg_check_modules_exist_query --max-version)
+      endif(_pkg_check_modules_pkg_op STREQUAL "<=")
+
+      # create the final query which is of the format:
+      # * --atleast-version <version> <pkg-name>
+      # * --exact-version <version> <pkg-name>      
+      # * --max-version <version> <pkg-name>
+      # * --exists <pkg-name>
+      if (_pkg_check_modules_pkg_op)
+        list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
+      else(_pkg_check_modules_pkg_op)
+        list(APPEND _pkg_check_modules_exist_query --exists)
+      endif(_pkg_check_modules_pkg_op)
+
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR)
+      _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR)
+
+      list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}")
+      list(APPEND _pkg_check_modules_packages    "${_pkg_check_modules_pkg_name}")
+
+      # execute the query
+      execute_process(
+        COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query}
+        RESULT_VARIABLE _pkgconfig_retval)
+
+      # evaluate result and tell failures
+      if (_pkgconfig_retval)
+        if(NOT ${_is_silent})
+          message(STATUS "  package '${_pkg_check_modules_pkg}' not found")
+        endif(NOT ${_is_silent})
+
+        set(_pkg_check_modules_failed 1)
+      endif(_pkgconfig_retval)
+    endforeach(_pkg_check_modules_pkg)
+
+    if(_pkg_check_modules_failed)
+      # fail when requested
+      if (${_is_required})
+        message(SEND_ERROR "A required package was not found")
+      endif (${_is_required})
+    else(_pkg_check_modules_failed)
+      # when we are here, we checked whether requested modules
+      # exist. Now, go through them and set variables
+      
+      _pkgconfig_set(${_prefix}_FOUND 1)
+      list(LENGTH _pkg_check_modules_packages pkg_count)
+
+      # iterate through all modules again and set individual variables
+      foreach (_pkg_check_modules_pkg ${_pkg_check_modules_packages})
+        # handle case when there is only one package required
+        if (pkg_count EQUAL 1)
+          set(_pkg_check_prefix "${_prefix}")
+        else(pkg_count EQUAL 1)
+          set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
+        endif(pkg_count EQUAL 1)
+        
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION    ""   --modversion )
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX     ""   --variable=prefix )
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR ""   --variable=includedir )
+        _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR     ""   --variable=libdir )
+
+        message(STATUS "  found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
+      endforeach(_pkg_check_modules_pkg)
+
+      # set variables which are combined for multiple modules
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES           "(^| )-l" --libs-only-l )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS        "(^| )-L" --libs-only-L )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS             ""        --libs )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER       ""        --libs-only-other )
+
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS        "(^| )-I" --cflags-only-I )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS              ""        --cflags )
+      _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER        ""        --cflags-only-other )
+    endif(_pkg_check_modules_failed)
+  else(PKG_CONFIG_EXECUTABLE)
+    if (${_is_required})
+      message(SEND_ERROR "pkg-config tool not found")
+    endif (${_is_required})
+  endif(PKG_CONFIG_EXECUTABLE)
+endmacro(_pkg_check_modules_internal)
+
+###
+### User visible macros start here
+###
+
+###
+macro(pkg_check_modules _prefix _module0)
+  # check cached value
+  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
+    _pkgconfig_parse_options   (_pkg_modules _pkg_is_required "${_module0}" ${ARGN})
+    _pkg_check_modules_internal("${_pkg_is_required}" 0 "${_prefix}" ${_pkg_modules})
+
+    _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
+endmacro(pkg_check_modules)
+
+###
+macro(pkg_search_module _prefix _module0)
+  # check cached value
+  if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})
+    set(_pkg_modules_found 0)
+    _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required "${_module0}" ${ARGN})
+
+    message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
+
+    # iterate through all modules and stop at the first working one.
+    foreach(_pkg_alt ${_pkg_modules_alt})
+      if(NOT _pkg_modules_found)
+        _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}")
+      endif(NOT _pkg_modules_found)
+
+      if (${_prefix}_FOUND)
+        set(_pkg_modules_found 1)
+      endif(${_prefix}_FOUND)
+    endforeach(_pkg_alt)
+
+    if (NOT ${_prefix}_FOUND)
+      if(${_pkg_is_required})
+        message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
+      endif(${_pkg_is_required})
+    endif(NOT ${_prefix}_FOUND)
+    
+    _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+  endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION})  
+endmacro(pkg_search_module)
+
+### Local Variables:
+### mode: cmake
+### End:
Index: /code/branches/audio/src/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/CMakeLists.txt	(revision 310)
@@ -0,0 +1,8 @@
+PROJECT(Orxonox)
+
+ADD_SUBDIRECTORY(orxonox)
+ADD_SUBDIRECTORY(loader)
+ADD_SUBDIRECTORY(network)
+ADD_SUBDIRECTORY(class_hierarchy)
+ADD_SUBDIRECTORY(openal)
+
Index: /code/branches/audio/src/class_hierarchy/BaseObject.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/BaseObject.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/BaseObject.cc	(revision 310)
@@ -0,0 +1,14 @@
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    BaseObject::BaseObject()
+    {
+        registerRootObject(BaseObject);
+    }
+
+    BaseObject::~BaseObject()
+    {
+        unregisterObject();
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/BaseObject.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/BaseObject.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/BaseObject.h	(revision 310)
@@ -0,0 +1,70 @@
+#ifndef _BaseObject_H__
+#define _BaseObject_H__
+
+#include "IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class BaseObject : virtual public OrxonoxClass
+    {
+        public:
+            BaseObject();
+            virtual ~BaseObject();
+
+            inline bool isA(Identifier* identifier)
+                { return this->getIdentifier()->isA(identifier); }
+            inline bool isDirectlyA(Identifier* identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier); }
+            inline bool isChildOf(Identifier* identifier)
+                { return this->getIdentifier()->isChildOf(identifier); }
+            inline bool isDirectChildOf(Identifier* identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier); }
+            inline bool isParentOf(Identifier* identifier)
+                { return this->getIdentifier()->isParentOf(identifier); }
+            inline bool isDirectParentOf(Identifier* identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier); }
+
+            inline bool isA(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isA(identifier->getIdentifier()); }
+            inline bool isDirectlyA(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); }
+            inline bool isChildOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isChildOf(identifier->getIdentifier()); }
+            inline bool isDirectChildOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier->getIdentifier()); }
+            inline bool isParentOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isParentOf(identifier->getIdentifier()); }
+            inline bool isDirectParentOf(BaseIdentifier<class B>* identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier->getIdentifier()); }
+
+            inline bool isA(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isA(identifier.getIdentifier()); }
+            inline bool isDirectlyA(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); }
+            inline bool isChildOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isChildOf(identifier.getIdentifier()); }
+            inline bool isDirectChildOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectChildOf(identifier.getIdentifier()); }
+            inline bool isParentOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isParentOf(identifier.getIdentifier()); }
+            inline bool isDirectParentOf(BaseIdentifier<class B> identifier)
+                { return this->getIdentifier()->isDirectParentOf(identifier.getIdentifier()); }
+/*
+            inline bool isA(OrxonoxClass* object)
+                { return this->getIdentifier()->isA(object->getIdentifier()); }
+            inline bool isDirectlyA(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectlyA(object->getIdentifier); }
+            inline bool isChildOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isChildOf(object->getIdentifier); }
+            inline bool isDirectChildOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectChildOf(object->getIdentifier); }
+            inline bool isParentOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isParentOf(object->getIdentifier); }
+            inline bool isDirectParentOf(OrxonoxClass* object)
+                { return this->getIdentifier()->isDirectParentOf(object->getIdentifier); }
+*/
+
+    };
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/class_hierarchy/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/CMakeLists.txt	(revision 310)
@@ -0,0 +1,17 @@
+PROJECT(Orxonox)
+
+# create a few variables to simplify life
+SET( CLASS_HIERARCHY_SRC
+	BaseObject.cc
+	ClassHierarchy.cc
+	Identifier.cc
+	IdentifierList.cc
+	ObjectList.cc
+	orxonox.cc
+	OrxonoxClass.cc
+	test1.cc
+	test2.cc
+	test3.cc
+   )
+
+ADD_LIBRARY(classHierarchy ${CLASS_HIERARCHY_SRC} )
Index: /code/branches/audio/src/class_hierarchy/ClassHierarchy.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/ClassHierarchy.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/ClassHierarchy.cc	(revision 310)
@@ -0,0 +1,28 @@
+#include "ClassHierarchy.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###     ClassHierarchy      ###
+    // ###############################
+    ClassHierarchy* ClassHierarchy::pointer_ = NULL;
+
+    ClassHierarchy* ClassHierarchy::getSingleton()
+    {
+        if (!pointer_)
+            pointer_ = new ClassHierarchy();
+
+        return pointer_;
+    }
+
+    ClassHierarchy::ClassHierarchy()
+    {
+        this->hierarchyCreatingCounter_ = 0;
+    }
+
+    ClassHierarchy::~ClassHierarchy()
+    {
+      this->pointer_ = NULL;
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/ClassHierarchy.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/ClassHierarchy.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/ClassHierarchy.h	(revision 310)
@@ -0,0 +1,97 @@
+#ifndef _ClassHierarchy_H__
+#define _ClassHierarchy_H__
+
+#include <string>
+#include <iostream>
+
+// DONE AND TESTED:
+// - build class hierarchy
+// - isA, isChildOf, ...
+// - insert into class-lists
+// - ClassIdentifier
+// - BaseIdentifier
+
+// IN WORK:
+// - Factory
+
+// TO DO:
+// - iterate through lists
+// - searchtree for classname-strings
+
+
+namespace orxonox
+{
+    // ##### ClassHierarchy #####
+    template <class T>
+    class ClassIdentifier;
+
+    class ClassHierarchy
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        public:
+            static ClassHierarchy* getSingleton();
+            bool isCreatingHierarchy() { return (this->hierarchyCreatingCounter_ > 0); }
+
+        private:
+            ClassHierarchy();
+            ~ClassHierarchy();
+            void startCreatingHierarchy() { this->hierarchyCreatingCounter_++; std::cout << "*** Increased Hierarchy-Creating-Counter to " << this->hierarchyCreatingCounter_ << "\n"; }
+            void stopCreatingHierarchy() { this->hierarchyCreatingCounter_--; std::cout << "*** Decreased Hierarchy-Creating-Counter to " << this->hierarchyCreatingCounter_ << "\n"; }
+
+            static ClassHierarchy* pointer_;
+            int hierarchyCreatingCounter_;
+    };
+
+
+    // ##### Macros #####
+    #define registerRootObject(ClassName) \
+        std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && !this->getParents()) \
+            this->setParents(new IdentifierList()); \
+        if (this->getIdentifier()) \
+            this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, false)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerAbstractRootObject(ClassName) \
+        std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && !this->getParents()) \
+            this->setParents(new IdentifierList()); \
+        if (this->getIdentifier()) \
+            this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, true)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerObject(ClassName) \
+        std::cout << "*** Register Object: " << #ClassName << "\n"; \
+        this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, false)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define registerAbstractObject(ClassName) \
+        std::cout << "*** Register Object: " << #ClassName << "\n"; \
+        this->getIdentifier()->removeObject(this); \
+        this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, true)); \
+        if (ClassHierarchy::getSingleton()->isCreatingHierarchy() && this->getParents()) \
+            this->getParents()->add(this->getIdentifier()); \
+        this->getIdentifier()->addObject(this)
+
+    #define unregisterObject() \
+        this->getIdentifier()->removeObject(this)
+
+    #define Class(ClassName) \
+        ClassIdentifier<ClassName>::getIdentifier()
+
+    #define Factory(ClassName) \
+        ClassIdentifier<ClassName>::create()
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/Identifier.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/Identifier.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/Identifier.cc	(revision 310)
@@ -0,0 +1,117 @@
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
+    Identifier::Identifier()
+    {
+        this->bCreatedOneObject_ = false;
+        this->directParents_ = new IdentifierList();
+        this->allParents_ = new IdentifierList();
+        this->directChildren_ = new IdentifierList();
+        this->allChildren_ = new IdentifierList();
+        this->objects_ = new ObjectList();
+    }
+
+    Identifier::~Identifier()
+    {
+        delete this->directParents_;
+        delete this->allParents_;
+        delete this->directChildren_;
+        delete this->allChildren_;
+        delete this->objects_;
+        delete &this->name_;
+    }
+
+    void Identifier::initialize(IdentifierList* parents)
+    {
+        std::cout << "*** Initialize " << this->name_ << "-Singleton.\n";
+        if (parents)
+        {
+            this->bCreatedOneObject_ = true;
+
+            IdentifierListElement* temp1;
+            IdentifierListElement* temp2;
+            IdentifierListElement* temp3;
+
+            temp1 = parents->first_;
+            while (temp1)
+            {
+                temp2 = temp1->identifier_->directParents_->first_;
+                while (temp2)
+                {
+                    temp3 = parents->first_;
+                    while(temp3)
+                    {
+                        if (temp3->identifier_ == temp2->identifier_)
+                            temp3->bDirect_ = false;
+
+                        temp3 = temp3->next_;
+                    }
+
+                    temp2 = temp2->next_;
+                }
+                temp1 = temp1->next_;
+            }
+
+            temp1 = parents->first_;
+            while (temp1)
+            {
+                if (temp1->bDirect_)
+                {
+                    this->directParents_->add(temp1->identifier_);
+                    temp1->identifier_->directChildren_->add(this);
+                }
+
+                this->allParents_->add(temp1->identifier_);
+                temp1->identifier_->allChildren_->add(this);
+
+                temp1 = temp1->next_;
+            }
+        }
+    }
+
+    void Identifier::addObject(OrxonoxClass* object)
+    {
+        std::cout << "*** Added " << this->name_ << " to list.\n";
+        this->objects_->add(object);
+    }
+
+    void Identifier::removeObject(OrxonoxClass* object)
+    {
+        std::cout << "*** Removed " << this->name_ << " from list.\n";
+        this->objects_->remove(object);
+    }
+
+    bool Identifier::isA(Identifier* identifier)
+    {
+        return (identifier == this || this->allParents_->isInList(identifier));
+    }
+
+    bool Identifier::isDirectlyA(Identifier* identifier)
+    {
+        return (identifier == this);
+    }
+
+    bool Identifier::isChildOf(Identifier* identifier)
+    {
+        return this->allParents_->isInList(identifier);
+    }
+
+    bool Identifier::isDirectChildOf(Identifier* identifier)
+    {
+        return this->directParents_->isInList(identifier);
+    }
+
+    bool Identifier::isParentOf(Identifier* identifier)
+    {
+        return this->allChildren_->isInList(identifier);
+    }
+
+    bool Identifier::isDirectParentOf(Identifier* identifier)
+    {
+        return this->directChildren_->isInList(identifier);
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/Identifier.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/Identifier.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/Identifier.h	(revision 310)
@@ -0,0 +1,173 @@
+#ifndef _Identifier_H__
+#define _Identifier_H__
+
+#include "ClassHierarchy.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    // ##### Identifier #####
+    class Identifier
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        template <class T>
+        friend class BaseIdentifier;
+
+        public:
+            void addObject(OrxonoxClass* object);
+            void removeObject(OrxonoxClass* object);
+
+            bool isA(Identifier* identifier);
+            bool isDirectlyA(Identifier* identifier);
+            bool isChildOf(Identifier* identifier);
+            bool isDirectChildOf(Identifier* identifier);
+            bool isParentOf(Identifier* identifier);
+            bool isDirectParentOf(Identifier* identifier);
+
+            std::string getName() { return this->name_; }
+            IdentifierList* getDirectParents() { return this->directParents_; }
+            IdentifierList* getAllParents() { return this->allParents_; }
+            IdentifierList* getDirectChildren() { return this->directChildren_; }
+            IdentifierList* getAllChildren() { return this->allChildren_; }
+
+        private:
+            Identifier();
+            Identifier(const Identifier& identifier) {}
+            virtual ~Identifier();
+            void initialize(IdentifierList* parents);
+
+            IdentifierList* directParents_;
+            IdentifierList* allParents_;
+            IdentifierList* directChildren_;
+            IdentifierList* allChildren_;
+
+            ObjectList* objects_;
+            std::string name_;
+
+            bool bIsAbstractClass_;
+            bool bCreatedOneObject_;
+    };
+
+
+    // ##### ClassIdentifier #####
+    template <class T>
+    class ClassIdentifier : public Identifier
+    {
+        public:
+            static ClassIdentifier<T>* registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass);
+            static ClassIdentifier<T>* getIdentifier();
+
+        private:
+            ClassIdentifier();
+            ClassIdentifier(const ClassIdentifier<T>& identifier) {}
+            ~ClassIdentifier();
+
+            static ClassIdentifier<T>* pointer_;
+
+    };
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::pointer_ = NULL;
+
+    template <class T>
+    ClassIdentifier<T>::ClassIdentifier()
+    {
+    }
+
+    template <class T>
+    ClassIdentifier<T>::~ClassIdentifier()
+    {
+        this->pointer_ = NULL;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass)
+    {
+        std::cout << "*** Register Class in " << name << "-Singleton.\n";
+        if (!pointer_)
+        {
+            std::cout << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n";
+            if (parents || bRootClass)
+            {
+                pointer_ = new ClassIdentifier();
+                pointer_->name_ = name;
+                pointer_->bIsAbstractClass_ = bIsAbstractClass;
+                pointer_->initialize(parents);
+            }
+            else
+            {
+                pointer_ = getIdentifier();
+            }
+        }
+
+        return pointer_;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
+    {
+//        std::cout << "*** Get Identifier.\n";
+        if (!pointer_)
+        {
+            std::cout << "*** Get Identifier -> Create Class\n";
+            ClassHierarchy::getSingleton()->startCreatingHierarchy();
+            T* temp = new T();
+            ClassHierarchy::getSingleton()->stopCreatingHierarchy();
+            delete temp;
+        }
+
+        return pointer_;
+    }
+
+
+    // ##### BaseIdentifier #####
+    template <class B>
+    class BaseIdentifier// : public Identifier
+    {
+        public:
+            BaseIdentifier();
+
+            //template <class T>
+            BaseIdentifier<B>& operator= (/*Class*/Identifier/*<T>*/* identifier)
+            {
+                if (!identifier->isA(ClassIdentifier<B>::getIdentifier()))
+                {
+                    std::cout << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<B>::getIdentifier()->getName() << "!\n";
+                    std::cout << "Error: BaseIdentifier<" << ClassIdentifier<B>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";
+                    std::cout << "Aborting...\n";
+                    abort();
+                }
+                this->identifier_ = identifier;
+                return *this;
+            }
+            inline Identifier* getIdentifier()
+                { return this->identifier_; }
+            inline bool isA(Identifier* identifier)
+                { return this->identifier_->isA(identifier); }
+            inline bool isDirectlyA(Identifier* identifier)
+                { return this->identifier_->isDirectlyA(identifier); }
+            inline bool isChildOf(Identifier* identifier)
+                { return this->identifier_->isChildOf(identifier); }
+            inline bool isDirectChildOf(Identifier* identifier)
+                { return this->identifier_->isDirectChildOf(identifier); }
+            inline bool isParentOf(Identifier* identifier)
+                { return this->identifier_->isParentOf(identifier); }
+            inline bool isDirectParentOf(Identifier* identifier)
+                { return this->identifier_->isDirectParentOf(identifier); }
+
+        private:
+            Identifier* identifier_;
+    };
+
+    template <class B>
+    BaseIdentifier<B>::BaseIdentifier()
+    {
+        this->identifier_ = ClassIdentifier<B>::getIdentifier();
+    }
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/IdentifierIncludes.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/IdentifierIncludes.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/IdentifierIncludes.h	(revision 310)
@@ -0,0 +1,5 @@
+#include "ClassHierarchy.h"
+#include "Identifier.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "OrxonoxClass.h"
Index: /code/branches/audio/src/class_hierarchy/IdentifierList.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/IdentifierList.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/IdentifierList.cc	(revision 310)
@@ -0,0 +1,106 @@
+#include "IdentifierList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###     IdentifierList      ###
+    // ###############################
+    IdentifierList::IdentifierList()
+    {
+        this->first_ = 0;
+    }
+
+    IdentifierList::~IdentifierList()
+    {
+        IdentifierListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    void IdentifierList::add(Identifier* identifier)
+    {
+        IdentifierListElement* temp = this->first_;
+        this->first_ = new IdentifierListElement(identifier);
+        this->first_->next_ = temp;
+    }
+
+    void IdentifierList::remove(Identifier* identifier)
+    {
+        if (!identifier)
+            return;
+
+        if (this->first_->identifier_ == identifier)
+        {
+            IdentifierListElement* temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+
+            return;
+        }
+
+        IdentifierListElement* temp = this->first_;
+        while (temp->next_)
+        {
+            if (temp->next_->identifier_ == identifier)
+            {
+                IdentifierListElement* temp2 = temp->next_->next_;
+                delete temp->next_;
+                temp->next_ = temp2;
+
+                return;
+            }
+
+            temp = temp->next_;
+        }
+    }
+
+    bool IdentifierList::isInList(Identifier* identifier)
+    {
+        IdentifierListElement* temp = this->first_;
+        while (temp)
+        {
+            if (temp->identifier_ == identifier)
+                return true;
+
+            temp = temp->next_;
+        }
+
+        return false;
+    }
+
+    std::string IdentifierList::toString()
+    {
+        IdentifierListElement* temp = this->first_;
+        std::string output = "";
+
+        while (temp)
+        {
+            output += temp->identifier_->getName();
+            output += " ";
+
+            temp = temp->next_;
+        }
+
+        return output;
+    }
+
+
+    // ###############################
+    // ###  IdentifierListElement  ###
+    // ###############################
+    IdentifierListElement::IdentifierListElement(Identifier* identifier)
+    {
+        this->identifier_ = identifier;
+        this->next_ = 0;
+        this->bDirect_ = true;
+    }
+
+    IdentifierListElement::~IdentifierListElement()
+    {
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/IdentifierList.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/IdentifierList.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/IdentifierList.h	(revision 310)
@@ -0,0 +1,35 @@
+#ifndef _IdentifierList_H__
+#define _IdentifierList_H__
+
+#include <string>
+
+namespace orxonox
+{
+    class Identifier;
+
+    class IdentifierListElement
+    {
+        public:
+            IdentifierListElement(Identifier* identifier);
+            ~IdentifierListElement();
+
+            Identifier* identifier_;
+            IdentifierListElement* next_;
+            bool bDirect_;
+    };
+
+    class IdentifierList
+    {
+        public:
+            IdentifierList();
+            ~IdentifierList();
+            void add(Identifier* identifier);
+            void remove(Identifier* identifier);
+            bool isInList(Identifier* identifier);
+            std::string toString();
+
+            IdentifierListElement* first_;
+    };
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/ObjectList.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/ObjectList.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/ObjectList.cc	(revision 310)
@@ -0,0 +1,74 @@
+#include "ObjectList.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       ObjectList        ###
+    // ###############################
+    ObjectList::ObjectList()
+    {
+        this->first_ = 0;
+    }
+
+    ObjectList::~ObjectList()
+    {
+        ObjectListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    void ObjectList::add(OrxonoxClass* object)
+    {
+        ObjectListElement* temp = this->first_;
+        this->first_ = new ObjectListElement(object);
+        this->first_->next_ = temp;
+    }
+
+    void ObjectList::remove(OrxonoxClass* object)
+    {
+        if (!object)
+            return;
+
+        if (this->first_->object_ == object)
+        {
+            ObjectListElement* temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+
+            return;
+        }
+
+        ObjectListElement* temp = this->first_;
+        while (temp->next_)
+        {
+            if (temp->next_->object_ == object)
+            {
+                ObjectListElement* temp2 = temp->next_->next_;
+                delete temp->next_;
+                temp->next_ = temp2;
+
+                return;
+            }
+
+            temp = temp->next_;
+        }
+    }
+
+
+    // ###############################
+    // ###    ObjectListElement    ###
+    // ###############################
+    ObjectListElement::ObjectListElement(OrxonoxClass* object)
+    {
+        this->object_ = object;
+        this->next_ = 0;
+    }
+
+    ObjectListElement::~ObjectListElement()
+    {
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/ObjectList.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/ObjectList.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/ObjectList.h	(revision 310)
@@ -0,0 +1,30 @@
+#ifndef _ObjectList_H__
+#define _ObjectList_H__
+
+namespace orxonox
+{
+    class OrxonoxClass;
+
+    class ObjectListElement
+    {
+        public:
+            ObjectListElement(OrxonoxClass* object);
+            ~ObjectListElement();
+
+            OrxonoxClass* object_;
+            ObjectListElement* next_;
+    };
+
+    class ObjectList
+    {
+        public:
+            ObjectList();
+            ~ObjectList();
+            void add(OrxonoxClass* object);
+            void remove(OrxonoxClass* object);
+
+            ObjectListElement* first_;
+    };
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/OrxonoxClass.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/OrxonoxClass.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/OrxonoxClass.cc	(revision 310)
@@ -0,0 +1,17 @@
+#include "ClassHierarchy.h"
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    OrxonoxClass::OrxonoxClass()
+    {
+        this->identifier_ = 0;
+        this->parents_ = 0;
+    }
+
+    OrxonoxClass::~OrxonoxClass()
+    {
+        if (this->parents_)
+            delete this->parents_;
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/OrxonoxClass.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/OrxonoxClass.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/OrxonoxClass.h	(revision 310)
@@ -0,0 +1,25 @@
+#ifndef _OrxonoxClass_H__
+#define _OrxonoxClass_H__
+
+#include "IdentifierList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    class OrxonoxClass
+    {
+        public:
+            OrxonoxClass();
+            ~OrxonoxClass();
+            Identifier* getIdentifier() { return this->identifier_; }
+            void setIdentifier(Identifier* identifier) { this->identifier_ = identifier; }
+            IdentifierList* getParents() { return this->parents_; }
+            void setParents(IdentifierList* parents) { this->parents_ = parents; }
+
+        private:
+            Identifier* identifier_;
+            IdentifierList* parents_;
+    };
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/Test.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/Test.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/Test.h	(revision 310)
@@ -0,0 +1,129 @@
+#ifndef _Test_H__
+#define _Test_H__
+
+#include "IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class Interface1 : virtual public OrxonoxClass
+    {
+        public:
+            Interface1() { registerRootObject(Interface1); }
+    };
+
+    class Interface2 : virtual public OrxonoxClass
+    {
+        public:
+            Interface2() { registerRootObject(Interface2); }
+    };
+
+    class A1 : public BaseObject
+    {
+        public:
+            A1() { registerObject(A1); }
+    };
+
+    class A2 : public BaseObject
+    {
+        public:
+            A2() { registerObject(A2); }
+    };
+
+    class A3: public BaseObject, public Interface1
+    {
+        public:
+            A3() { registerObject(A3); }
+    };
+
+    class A1B1 : public A1
+    {
+        public:
+            A1B1() { registerObject(A1B1); }
+    };
+
+    class A1B2 : public A1
+    {
+        public:
+            A1B2() { registerObject(A1B2); }
+    };
+
+    class A2B1 : public A2
+    {
+        public:
+            A2B1() { registerObject(A2B1); }
+    };
+
+    class A2B2 : public A2, Interface1
+    {
+        public:
+            A2B2() { registerObject(A2B2); }
+    };
+
+    class A3B1 : public A3
+    {
+        public:
+            A3B1() { registerObject(A3B1); }
+    };
+
+    class A3B2 : public A3, Interface2
+    {
+        public:
+            A3B2() { registerObject(A3B2); }
+    };
+
+    class A1B1C1 : public A1B1
+    {
+        public:
+            A1B1C1() { registerObject(A1B1C1); }
+    };
+
+    class A1B1C2 : public A1B1
+    {
+        public:
+            A1B1C2() { registerObject(A1B1C2); }
+    };
+
+    class A1B2C1 : public A1B2
+    {
+        public:
+            A1B2C1() { registerObject(A1B2C1); }
+    };
+
+    class A2B1C1 : public A2B1, Interface2
+    {
+        public:
+            A2B1C1() { registerObject(A2B1C1); }
+    };
+
+    class A2B2C1 : public A2B2
+    {
+        public:
+            A2B2C1() { registerObject(A2B2C1); }
+    };
+
+    class A3B1C1 : public A3B1
+    {
+        public:
+            A3B1C1() { registerObject(A3B1C1); }
+    };
+
+    class A3B1C2 : public A3B1, Interface2
+    {
+        public:
+            A3B1C2() { registerObject(A3B1C2); }
+    };
+
+    class A3B2C1 : public A3B2
+    {
+        public:
+            A3B2C1() { registerObject(A3B2C1); }
+    };
+
+    class A3B2C2 : public A3B2
+    {
+        public:
+            A3B2C2() { registerObject(A3B2C2); }
+    };
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/orxonox.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/orxonox.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/orxonox.cc	(revision 310)
@@ -0,0 +1,294 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include <Ogre.h>
+#include <OIS/OIS.h>
+#include <CEGUI/CEGUI.h>
+#include <OgreCEGUIRenderer.h>
+
+#include "BaseObject.h"
+#include "Test.h"
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <CoreFoundation/CoreFoundation.h>
+
+// This function will locate the path to our application on OS X,
+// unlike windows you can not rely on the curent working directory
+// for locating your configuration files and resources.
+std::string macBundlePath()
+{
+  char path[1024];
+  CFBundleRef mainBundle = CFBundleGetMainBundle();
+  assert(mainBundle);
+
+  CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+  assert(mainBundleURL);
+
+  CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+  assert(cfStringRef);
+
+  CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+  CFRelease(mainBundleURL);
+  CFRelease(cfStringRef);
+
+  return std::string(path);
+}
+#endif
+
+namespace orxonox
+{
+  class OrxExitListener : public Ogre::FrameListener
+  {
+    public:
+      OrxExitListener(OIS::Keyboard *keyboard)
+    : mKeyboard(keyboard)
+      {
+      }
+
+      bool frameStarted(const Ogre::FrameEvent& evt)
+      {
+        mKeyboard->capture();
+        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
+      }
+
+    private:
+      OIS::Keyboard *mKeyboard;
+  };
+
+  class OrxApplication
+  {
+    public:
+      void go()
+      {
+
+        #define testandcout(code) \
+          std::cout << #code << " " << code << "\n"
+
+
+        std::cout << "Test 8\n";
+
+        std::cout << "1\n";
+        Test1* test8_01 = new Test1;
+        Test3* test8_03 = new Test3;
+        test8_03->usefullClassesIsATest(test8_01);
+
+        std::cout << "2\n";
+        Test2* test8_02 = new Test2;
+        test8_03->usefullClassesIsATest(test8_02);
+
+        std::cout << "3\n";
+        test8_01->setUsefullClass1(Class(Test1));
+        test8_01->setUsefullClass1(test8_02->getIdentifier());
+        test8_01->setUsefullClass2(Class(Test2));
+        test8_01->setUsefullClassOfTypeTest3(Class(Test3));
+        test8_01->setUsefullClassOfTypeTest3(test8_03->getIdentifier());
+
+
+        testandcout(test8_01->isA(Class(Test1)));
+        testandcout(test8_01->isA(Class(Test2)));
+        testandcout(test8_01->isA(Class(Test3)));
+
+        Test2* test8_04 = new Test2;
+        testandcout(test8_02->isA(Class(Test1)));
+        testandcout(test8_02->isA(Class(Test2)));
+        testandcout(test8_02->isA(Class(Test3)));
+
+        Test3* test8_05 = new Test3;
+        testandcout(test8_03->isA(Class(Test1)));
+        testandcout(test8_03->isA(Class(Test2)));
+        testandcout(test8_03->isA(Class(Test3)));
+
+        delete test8_01;
+        delete test8_02;
+        delete test8_03;
+
+
+      }
+
+      ~OrxApplication()
+      {
+        mInputManager->destroyInputObject(mKeyboard);
+        OIS::InputManager::destroyInputSystem(mInputManager);
+
+        delete mRenderer;
+        delete mSystem;
+
+        delete mListener;
+        delete mRoot;
+      }
+
+    private:
+      Ogre::Root *mRoot;
+      OIS::Keyboard *mKeyboard;
+      OIS::Mouse *mMouse;
+      OIS::InputManager *mInputManager;
+      CEGUI::OgreCEGUIRenderer *mRenderer;
+      CEGUI::System *mSystem;
+      OrxExitListener *mListener;
+
+      void createRoot()
+      {
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        mRoot = new Ogre::Root(macBundlePath() + "/Contents/Resources/plugins.cfg");
+#else
+        mRoot = new Ogre::Root();
+#endif
+      }
+
+      void defineResources()
+      {
+        Ogre::String secName, typeName, archName;
+        Ogre::ConfigFile cf;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
+#else
+        cf.load("resources.cfg");
+#endif
+
+        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
+        while (seci.hasMoreElements())
+        {
+          secName = seci.peekNextKey();
+          Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+          Ogre::ConfigFile::SettingsMultiMap::iterator i;
+          for (i = settings->begin(); i != settings->end(); ++i)
+          {
+            typeName = i->first;
+            archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
+#else
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
+#endif
+          }
+        }
+      }
+
+      void setupRenderSystem()
+      {
+        if (!mRoot->restoreConfig() && !mRoot->showConfigDialog())
+          throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
+      }
+
+      void createRenderWindow()
+      {
+        mRoot->initialise(true, "Ogre Render Window");
+      }
+
+      void initializeResourceGroups()
+      {
+        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
+        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+      }
+
+      void setupScene()
+      {
+        Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
+        Ogre::Camera *cam = mgr->createCamera("Camera");
+        Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam);
+      }
+
+      void setupInputSystem()
+      {
+        size_t windowHnd = 0;
+        std::ostringstream windowHndStr;
+        OIS::ParamList pl;
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        win->getCustomAttribute("WINDOW", &windowHnd);
+        windowHndStr << windowHnd;
+        pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+        mInputManager = OIS::InputManager::createInputSystem(pl);
+
+        try
+        {
+          mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false));
+          mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false));
+        }
+        catch (const OIS::Exception &e)
+        {
+          throw new Ogre::Exception(42, e.eText, "OrxApplication::setupInputSystem");
+        }
+      }
+
+      void setupCEGUI()
+      {
+        Ogre::SceneManager *mgr = mRoot->getSceneManager("Default SceneManager");
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        // CEGUI setup
+        mRenderer = new CEGUI::OgreCEGUIRenderer(win, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mgr);
+        mSystem = new CEGUI::System(mRenderer);
+
+        // Other CEGUI setup here.
+      }
+
+      void createFrameListener()
+      {
+        mListener = new OrxExitListener(mKeyboard);
+        mRoot->addFrameListener(mListener);
+      }
+
+      void startRenderLoop()
+      {
+        mRoot->startRendering();
+      }
+  };
+}
+
+using namespace Ogre;
+
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+             INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
+#else
+             int main(int argc, char **argv)
+#endif
+{
+  try
+  {
+    orxonox::OrxApplication orxonox;
+    orxonox.go();
+  }
+  catch(Exception& e)
+  {
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+    MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+    fprintf(stderr, "An exception has occurred: %s\n",
+            e.getFullDescription().c_str());
+#endif
+  }
+
+  return 0;
+}
Index: /code/branches/audio/src/class_hierarchy/test1.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/test1.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/test1.cc	(revision 310)
@@ -0,0 +1,61 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test1::Test1()
+    {
+        registerObject(Test1);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test1::~Test1()
+    {
+    }
+
+    bool Test1::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test1::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test1::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test1::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test1::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test1::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/test1.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/test1.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/test1.h	(revision 310)
@@ -0,0 +1,30 @@
+#ifndef _Test1_H__
+#define _Test1_H__
+
+#include "BaseObject.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    class Test1 : public BaseObject
+    {
+        public:
+            Test1();
+            virtual ~Test1();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            BaseIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/test2.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/test2.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/test2.cc	(revision 310)
@@ -0,0 +1,61 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test2::Test2()
+    {
+        registerObject(Test2);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test2::~Test2()
+    {
+    }
+
+    bool Test2::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test2::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test2::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test2::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test2::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test2::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/test2.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/test2.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/test2.h	(revision 310)
@@ -0,0 +1,31 @@
+#ifndef _Test2_H__
+#define _Test2_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test3;
+
+    class Test2 : public BaseObject
+    {
+        public:
+            Test2();
+            virtual ~Test2();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            BaseIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: /code/branches/audio/src/class_hierarchy/test3.cc
===================================================================
--- /code/branches/audio/src/class_hierarchy/test3.cc	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/test3.cc	(revision 310)
@@ -0,0 +1,53 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    Test3::Test3()
+    {
+        registerObject(Test3);
+    }
+
+    Test3::~Test3()
+    {
+    }
+        #define testandcout(code) \
+          std::cout << #code << " " << code << "\n"
+
+    bool Test3::usefullClassesIsATest(Test1* test1)
+    {
+        std::cout << "\n";
+        std::cout << "Test1:\n";
+        testandcout(test1->usefullClass1isA(Class(Test1)));
+        testandcout(test1->usefullClass1isA(Class(Test2)));
+        testandcout(test1->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass2isA(Class(Test1)));
+        testandcout(test1->usefullClass2isA(Class(Test2)));
+        testandcout(test1->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass3isA(Class(Test1)));
+        testandcout(test1->usefullClass3isA(Class(Test2)));
+        testandcout(test1->usefullClass3isA(Class(Test3)));
+        return true;
+    }
+
+    bool Test3::usefullClassesIsATest(Test2* test2)
+    {
+        std::cout << "\n";
+        std::cout << "Test2:\n";
+        testandcout(test2->usefullClass1isA(Class(Test1)));
+        testandcout(test2->usefullClass1isA(Class(Test2)));
+        testandcout(test2->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass2isA(Class(Test1)));
+        testandcout(test2->usefullClass2isA(Class(Test2)));
+        testandcout(test2->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass3isA(Class(Test1)));
+        testandcout(test2->usefullClass3isA(Class(Test2)));
+        testandcout(test2->usefullClass3isA(Class(Test3)));
+        return true;
+    }
+}
Index: /code/branches/audio/src/class_hierarchy/test3.h
===================================================================
--- /code/branches/audio/src/class_hierarchy/test3.h	(revision 310)
+++ /code/branches/audio/src/class_hierarchy/test3.h	(revision 310)
@@ -0,0 +1,22 @@
+#ifndef _Test3_H__
+#define _Test3_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test1;
+    class Test2;
+
+    class Test3 : public BaseObject
+    {
+        public:
+            Test3();
+            virtual ~Test3();
+
+            bool usefullClassesIsATest(Test1* test1);
+            bool usefullClassesIsATest(Test2* test2);
+    };
+}
+
+#endif
Index: /code/branches/audio/src/inertial_node.cc
===================================================================
--- /code/branches/audio/src/inertial_node.cc	(revision 310)
+++ /code/branches/audio/src/inertial_node.cc	(revision 310)
@@ -0,0 +1,126 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneNode.h"
+#include "OgreVector3.h"
+
+#include "inertial_node.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+
+  InertialNode::InertialNode(SceneNode *node, Vector3 speed)
+        : node_(node), speed_(speed), childListSize_(4), childListIndex_(0),
+        parentNode_(NULL)
+  {
+    childList_ = new InertialNode*[childListSize_];
+  }
+
+
+  InertialNode::InertialNode(orxonox::InertialNode *parentNode, Vector3 speed)
+        : parentNode_(parentNode), childListSize_(4), childListIndex_(0), speed_(speed)
+  {
+    childList_ = new InertialNode*[childListSize_];
+    node_ = parentNode_->getSceneNode()->createChildSceneNode();
+  }
+
+
+  InertialNode::~InertialNode()
+  {
+    if (childList_)
+    {
+      for (int i = 0; i < childListIndex_; i++)
+        if (childList_[i])
+          delete childList_[i];
+      delete childList_;
+    }
+  }
+
+
+  InertialNode* InertialNode::createChildNode()
+  {
+    InertialNode *temp = new InertialNode(this);
+    addChild(temp);
+    return temp;
+  }
+
+
+  InertialNode* InertialNode::getParentNode()
+  {
+    return parentNode_;
+  }
+
+
+  SceneNode* InertialNode::getSceneNode()
+  {
+    return node_;
+  }
+
+
+  Vector3 InertialNode::getSpeed()
+  {
+    return speed_;
+  }
+
+
+  Vector3 InertialNode::getWorldSpeed()
+  {
+    // go through the tree of Inertial nodes
+    Vector3 speed = speed_;
+    InertialNode *temp = parentNode_;
+    while (temp != NULL)
+    {
+      speed = temp->getSceneNode()->getOrientation() * speed + temp->getSpeed();
+      temp = temp->getParentNode();
+    }
+    return speed;
+  }
+
+
+  void InertialNode::addSpeed(Vector3 speed)
+  {
+    speed_ += speed;
+  }
+
+
+  void InertialNode::addChild(orxonox::InertialNode *node)
+  {
+    if (childListIndex_ == childListSize_)
+    {
+      // redimension the array
+      InertialNode **tempArray = new InertialNode*[2*childListSize_];
+      for (int i = 0; i < childListSize_; i++)
+        tempArray[i] = childList_[i];
+      childListSize_ *= 2;
+      delete childList_;
+      childList_ = tempArray;
+    }
+    childList_[childListIndex_++] = node;
+  }
+
+}
Index: /code/branches/audio/src/inertial_node.h
===================================================================
--- /code/branches/audio/src/inertial_node.h	(revision 310)
+++ /code/branches/audio/src/inertial_node.h	(revision 310)
@@ -0,0 +1,77 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef INERTIAL_NODE_H
+#define INERTIAL_NODE_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class InertialNode
+  {
+  public:
+    InertialNode(Ogre::SceneNode*, Ogre::Vector3);
+	  ~InertialNode();
+
+    InertialNode* createChildNode();
+
+    InertialNode* getParentNode();
+
+    Ogre::SceneNode* getSceneNode();
+
+    Ogre::Vector3 getSpeed();
+
+    Ogre::Vector3 getWorldSpeed();
+
+    void addSpeed(Ogre::Vector3);
+
+  protected:
+    InertialNode(InertialNode*, Ogre::Vector3 speed = Ogre::Vector3::ZERO);
+    void addChild(InertialNode*);
+
+  public:
+
+  protected:
+    InertialNode **childList_;
+    int childListSize_;
+    int childListIndex_;
+
+    Ogre::SceneNode *node_;
+	  Ogre::Vector3 speed_;
+
+    InertialNode* parentNode_;
+
+  };
+
+}
+
+#endif /* INERTIAL_NODE_H */
Index: /code/branches/audio/src/loader/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/loader/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/loader/CMakeLists.txt	(revision 310)
@@ -0,0 +1,9 @@
+PROJECT(Orxonox)
+
+# TODO find a cleaner way to include xmlParser
+SET(SRC_FILES LevelLoader.cc ../xml/xmlParser.cc)
+SET(INC_FILES LevelLoader.h ../xml/xmlParser.h)
+
+INCLUDE_DIRECTORIES(..)
+
+ADD_LIBRARY(loader ${SRC_FILES} ${INC_FILES})
Index: /code/branches/audio/src/loader/LevelLoader.cc
===================================================================
--- /code/branches/audio/src/loader/LevelLoader.cc	(revision 310)
+++ /code/branches/audio/src/loader/LevelLoader.cc	(revision 310)
@@ -0,0 +1,133 @@
+#include <string.h>
+#include <iostream>
+
+#include "LevelLoader.h"
+#include "../xml/xmlParser.h"
+
+using namespace std;
+
+namespace loader
+{
+
+LevelLoader::LevelLoader(string file, string dir)
+{
+	// Load XML level file
+	dir.append("/");
+	dir.append(file);	
+  	rootNode = XMLNode::openFileHelper(dir.c_str(),"WorldDataFile");
+  	// TODO: Error handling
+
+	// Assing general level infos to class variables
+  	this->name_ = rootNode.getChildNode("name").getText();
+  	this->description_ = rootNode.getChildNode("description").getText();
+  	this->image_ = rootNode.getChildNode("image").getText();
+  
+  	this->loadingScreen();
+  
+  // Assign sub-nodes
+  if (rootNode.nChildNode("LightManager")==1)
+  {
+  	// Init Luightmanager...
+  }
+  
+  /*
+  
+	worldNode = rootNode.getChildNode("WorldEntities");
+	scriptNode = rootNode.getChildNode("ScriptManager");
+	cameraNode = rootNode.getChildNode("CameraMan");
+	lightNode = rootNode.getChildNode("LightManager");
+*/
+
+}
+
+LevelLoader::~LevelLoader()
+{
+
+
+}
+
+
+string LevelLoader::name()
+{
+	return this->name_;
+}
+
+string LevelLoader::description()
+{
+	return this->description_;
+}
+
+string LevelLoader::image()
+{
+	return this->image_;
+}
+
+void LevelLoader::loadingScreen()
+{
+	cout << "\n\n\nThis is Orxonox\nthe hottest 3D action shooter ever to exist\n\n\n";
+	cout << "Level: " << name() << "\nDescription:" << description() << "\nImage:"<<image()<<"\n\n\n";
+}
+
+/*
+
+
+void LevelLoader::loadWorld(WorldManager* wm)
+{
+	if (!worldNode.getChildNode("lights").isEmpty())
+	{
+		
+		
+	}
+}
+
+
+void LevelLoader::loadLights(LightManager* lm)
+{
+	if (!lightNode.getChildNode("lights").isEmpty())
+	{
+		int nLights = lightNode.getChildNode("lights").nChildNode("light");
+		for (int i=0; i<nLights;i++)
+		{
+			XMLNode t = lightNode.getChildNode("lights").getChildNode("light",i);
+			const char* diffuse = t.getAttribute("diffuse-color");
+			const char* coor = t.getAttribute("abs-coor");
+			lm->addLight(diffuse,coor);	
+		}
+	}
+	lm->setAmbient(lightNode.getChildNode("ambient").getAttribute("color"));	
+}
+
+void LevelLoader::loadCameras(CameraManager* cm)
+{
+	if (!cameraNode.getChildNode("cameras").isEmpty())
+	{
+		int nCameras = cameraNode.getChildNode("cameras").nChildNode("camera");
+		for (int i=0; i<nCameras;i++)
+		{
+			XMLNode t = cameraNode.getChildNode("cameras").getChildNode("camera",i);
+			
+			
+			cm->addCamera();
+		}
+	}
+}
+
+
+void LevelLoader::loadScripts(ScriptManager* sm)
+{
+	if (!scriptNode.getChildNode("scripts").isEmpty())
+	{
+		int nScripts = scriptNode.getChildNode("scripts").nChildNode("script");
+		for (int i=0; i<nScripts;i++)
+		{
+			XMLNode t = scriptNode.getChildNode("scripts").getChildNode("script",i);
+			sm->addScript(t.getAttribute("file"));
+		}
+	
+	}
+}
+*/
+
+
+}
+
Index: /code/branches/audio/src/loader/LevelLoader.h
===================================================================
--- /code/branches/audio/src/loader/LevelLoader.h	(revision 310)
+++ /code/branches/audio/src/loader/LevelLoader.h	(revision 310)
@@ -0,0 +1,54 @@
+/**
+* Orxonox - www.orxonox.net
+* Level Loader class
+* 
+* @author Nicolas Perrenoud <nicolape@ee.ethz.ch>
+*/
+
+#include <string>
+#include <iostream>
+
+#include "../xml/xmlParser.h"
+
+#ifndef __MODULE_LEVELLOADER__
+#define __MODULE_LEVELLOADER__
+
+using namespace std;
+
+namespace loader
+{
+	class LevelLoader
+	{
+	private:
+		
+		// XML Nodes 
+		XMLNode rootNode;  
+		XMLNode worldNode;
+		XMLNode scriptNode;
+		XMLNode cameraNode;
+		XMLNode lightNode;
+		
+		// Level information
+		string name_;
+		string description_;
+		string image_;
+			
+	public:
+
+		// Constructors
+		LevelLoader(string file, string dir="levels");
+		~LevelLoader();
+		
+		void loadingScreen();
+		
+		// Getters
+		string name();
+		string description();
+		string image();		
+		
+		// Managers 
+		
+			
+	};	
+}
+#endif
Index: /code/branches/audio/src/loader/Light.cc
===================================================================
--- /code/branches/audio/src/loader/Light.cc	(revision 310)
+++ /code/branches/audio/src/loader/Light.cc	(revision 310)
@@ -0,0 +1,23 @@
+
+#include "../xml/xmlParser.h"
+#include "Light.h"
+
+namespace light
+{								
+	Light::Light()
+	{		
+		
+	}
+	
+	Light::Light(XMLNode xml)
+	{
+		this->loadParams(xml);	
+	}
+	
+	void Light::loadParams(XMLNode xml)
+	{
+		// Here comes the tricky part... convert strings to int
+		const char* diffuse = xml.getAttribute("diffuse-color");
+		const char* coor = xml.getAttribute("abs-coor");
+	}
+}
Index: /code/branches/audio/src/loader/Light.h
===================================================================
--- /code/branches/audio/src/loader/Light.h	(revision 310)
+++ /code/branches/audio/src/loader/Light.h	(revision 310)
@@ -0,0 +1,28 @@
+
+#include "../xml/xmlParser.h"
+
+#ifndef __MODULE_LIGHT__
+#define __MODULE_LIGHT__
+
+namespace light
+{
+	class Light()
+	{
+	public:      
+		Light();
+		Light(XMLNode xml);
+		~Light();
+		void loadParams(XMLNode xml);
+	
+	private:
+		float diffuseColor_r_;
+		float diffuseColor_g_;
+		float diffuseColor_b_;
+
+		int coord_x_;
+		int coord_y_;
+		int coord_z_;
+	};
+}
+
+#endif
Index: /code/branches/audio/src/loader/LightManager.cc
===================================================================
--- /code/branches/audio/src/loader/LightManager.cc	(revision 310)
+++ /code/branches/audio/src/loader/LightManager.cc	(revision 310)
@@ -0,0 +1,28 @@
+
+#include "../xml/xmlParser.h"
+#include "LightManager.h"
+
+namespace light
+{
+	LightManager::LightManager()
+	{
+		vector<Light> this->elements_ = new vector<Light>;
+	}
+	
+	void LightManager::loadParams(XMLNode xml)
+	{
+		if (!xml.isEmpty())
+		{
+			int nLights = xml.nChildNode("light");
+			for (int i=0; i<nLights;i++)
+			{
+				Light l = new Light(xml.getChildNode("light",i));
+				this->elements_.append(l);
+			}
+		}		
+		
+	}	
+		
+	
+}
+
Index: /code/branches/audio/src/loader/LightManager.h
===================================================================
--- /code/branches/audio/src/loader/LightManager.h	(revision 310)
+++ /code/branches/audio/src/loader/LightManager.h	(revision 310)
@@ -0,0 +1,26 @@
+#include <vector>
+
+#include "../xml/xmlParser.h"
+#include "Light.h"
+
+#ifndef __MODULE_LIGHTMANAGER__
+#define __MODULE_LIGHTMANAGER__
+
+namespace light
+{
+	class LightManager()
+	{      
+	public:
+		LightManager();
+		~LightManager();
+		void loadParams(XMLNode xml);		
+				
+	private:
+		float ambient_r_;
+		float ambient_g_;
+		float ambient_b_;
+		vector<Light> elements_;
+	};
+}
+
+#endif
Index: /code/branches/audio/src/network/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/network/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/network/CMakeLists.txt	(revision 310)
@@ -0,0 +1,6 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES Client.cc ConnectionManager.cc PacketBuffer.cc PacketGenerator.cc Synchronisable.cc dummyclient2.cc ClientConnection.cc GameStateManager.cc PacketDecoder.cc Server.cc dummyclient.cc dummyserver.cc)
+SET(INC_FILES Client.h ClientConnection.h ConnectionManager.h GameStateManager.h PacketBuffer.h PacketManager.h Server.h Synchronisable.h)
+
+ADD_LIBRARY(network ${SRC_FILES} ${INC_FILES})
Index: /code/branches/audio/src/network/Client.cc
===================================================================
--- /code/branches/audio/src/network/Client.cc	(revision 310)
+++ /code/branches/audio/src/network/Client.cc	(revision 310)
@@ -0,0 +1,142 @@
+//
+// C++ Implementation: Client
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#include "Client.h"
+
+namespace network{
+
+  /**
+   * Constructor for the Client class
+   * initializes the address and the port to default localhost:NETWORK_PORT
+   */
+  Client::Client(): client_connection(NETWORK_PORT,"127.0.0.1"){
+    // set server address to localhost
+    //server_address="127.0.0.1";
+    //port = NETWORK_PORT;
+    isConnected=false;
+  }
+
+  /**
+   * Constructor for the Client class
+   * @param address the server address
+   * @param port port of the application on the server
+   */
+  Client::Client(std::string address, int port) : client_connection(port, address){
+    //server_address=address.c_str();
+    //this->port = port;
+    isConnected=false;
+  }
+
+  /**
+   * Constructor for the Client class
+   * @param address the server address
+   * @param port port of the application on the server
+   */
+  Client::Client(const char *address, int port) : client_connection(port, address){
+    //server_address = address;
+    //this->port = port;
+    isConnected=false;
+  }
+
+  /**
+   * Establish the Connection to the Server
+   * @return true/false
+   */
+  bool Client::establishConnection(){
+    isConnected=client_connection.createConnection();
+    return isConnected;
+  }
+
+  /**
+   * closes the Connection to the Server
+   * @return true/false
+   */
+  bool Client::closeConnection(){
+    isConnected=false;
+    return client_connection.closeConnection();
+  }
+
+  /**
+   * submits a MouseAction to the server
+   * @param x x Coordinate
+   * @param y y Coordinate
+   * @return true/false
+   */
+  bool Client::sendMouse(double x, double y){
+    ENetEvent event;
+    // generate packet and add it to the queue
+    if(!client_connection.addPacket(pck_gen.mousem(x, y)))
+        return false;
+    // send packets
+    client_connection.sendPackets(&event);
+    if(event.type==ENET_EVENT_TYPE_NONE)
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * submits a Keystrike to the server
+   * @param key_code code to submit
+   * @return true/false
+   */
+  bool Client::sendKeyboard(char key_code){
+    ENetEvent event;
+    // generate packet and add it to queue
+    if(!client_connection.addPacket(pck_gen.keystrike(key_code)))
+        return false;
+    // send packets
+    client_connection.sendPackets(&event);
+    if(event.type==ENET_EVENT_TYPE_NONE)
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * Adds a MouseAction to the PacketQueue
+   * @param x x Coordinate
+   * @param y y Coordinate
+   * @return true/false
+   */
+  bool Client::addMouse(double x, double y){
+    // generate packet and add it to the queue
+    if(client_connection.addPacket(pck_gen.mousem(x, y)))
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * Adds a Keystrike to the PacketQueue
+   * @param key_code
+   * @return true/false
+   */
+  bool Client::addKeyboard(char key_code){
+    ENetEvent event;
+    // generate packet and add it to queue
+    if(client_connection.addPacket(pck_gen.keystrike(key_code)))
+      return true;
+    else
+      return false;
+  }
+
+  /**
+   * Performs a GameState update
+   */
+  void Client::update(){
+    // to be implemented ==================
+
+
+  }
+
+}
Index: /code/branches/audio/src/network/Client.h
===================================================================
--- /code/branches/audio/src/network/Client.h	(revision 310)
+++ /code/branches/audio/src/network/Client.h	(revision 310)
@@ -0,0 +1,58 @@
+//
+// C++ Interface: Client
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef NETWORK_CLIENT_H
+#define NETWORK_CLIENT_H
+
+#include <string>
+
+#include "ClientConnection.h"
+#include "PacketManager.h"
+
+
+namespace network{
+
+/**
+ * The network/Client class
+ * This class implements all necessary function for the network communication
+ * It is the root class of the network module
+ *
+ */
+class Client : PacketDecoder{
+  public:
+  Client();
+  Client(std::string address, int port);
+  Client(const char *address, int port);
+
+  bool establishConnection();
+  bool closeConnection();
+
+  bool sendMouse(double x, double y);
+  bool sendKeyboard(char key_code);
+
+  bool addMouse(double x, double y);
+  bool addKeyboard(char key_code);
+
+  void update();
+
+  private:
+  ClientConnection client_connection;
+  PacketGenerator pck_gen;
+
+  //const char *server_address;
+  //int port;
+  bool isConnected;
+};
+
+}
+
+#endif
Index: /code/branches/audio/src/network/ClientConnection.cc
===================================================================
--- /code/branches/audio/src/network/ClientConnection.cc	(revision 310)
+++ /code/branches/audio/src/network/ClientConnection.cc	(revision 310)
@@ -0,0 +1,172 @@
+//
+// C++ Interface: ClientConnection
+//
+// Description: The Class ClientConnection manages the servers conenctions to the clients.
+// each connection is provided by a new process. communication between master process and
+// connection processes is provided by ...
+//
+//
+// Author:  Oliver Scheuss
+//
+
+#include "ClientConnection.h"
+
+namespace network{
+
+  boost::thread_group network_threads;
+
+  ClientConnection::ClientConnection(int port, std::string address){
+    quit=false;
+    server=NULL;
+    enet_address_set_host(&serverAddress, address.c_str());
+    serverAddress.port = NETWORK_PORT;
+    established=false;
+  }
+
+  ClientConnection::ClientConnection(int port, const char *address){
+    quit=false;
+    server=NULL;
+    enet_address_set_host(&serverAddress, address);
+    serverAddress.port = NETWORK_PORT;
+    established=false;
+  }
+
+  bool ClientConnection::waitEstablished(int milisec){
+    for(int i=0; i<=milisec && !established; i++)
+      usleep(1000);
+    return established;
+  }
+
+
+  ENetPacket *ClientConnection::getPacket(ENetAddress &address){
+    if(!buffer.isEmpty())
+      return buffer.pop(address);
+    else
+        return NULL;
+  }
+
+  bool ClientConnection::queueEmpty(){
+    return buffer.isEmpty();
+  }
+
+  bool ClientConnection::createConnection(){
+    network_threads.create_thread(boost::bind(boost::mem_fn(&ClientConnection::receiverThread), this));
+    // wait 10 seconds for the connection to be established
+    return waitEstablished(10000);
+  }
+
+  bool ClientConnection::closeConnection(){
+    quit=true;
+    network_threads.join_all();
+    established=false;
+    return true;
+  }
+
+
+  bool ClientConnection::addPacket(ENetPacket *packet){
+    if(server==NULL)
+      return false;
+    if(enet_peer_send(server, 1, packet)!=0)
+      return false;
+    else
+      return true;
+  }
+
+  bool ClientConnection::sendPackets(ENetEvent *event){
+    if(server==NULL)
+      return false;
+    if(enet_host_service(client, event, NETWORK_SEND_WAIT)>=0)
+      return true;
+    else
+      return false;
+  }
+
+  bool ClientConnection::sendPackets(){
+    ENetEvent event;
+    if(server==NULL)
+      return false;
+    if(enet_host_service(client, &event, NETWORK_SEND_WAIT)>=0)
+      return true;
+    else
+      return false;
+  }
+
+  void ClientConnection::receiverThread(){
+    // what about some error-handling here ?
+    enet_initialize();
+    atexit(enet_deinitialize);
+    ENetEvent event;
+    client = enet_host_create(NULL, NETWORK_CLIENT_MAX_CONNECTIONS, 0, 0);
+    if(client==NULL)
+      // add some error handling here ==========================
+      quit=true;
+    //connect to the server
+    if(!establishConnection())
+      quit=true;
+    //main loop
+    while(!quit){
+      if(enet_host_service(client, &event, NETWORK_WAIT_TIMEOUT)<0){
+        // we should never reach this point
+        quit=true;
+        // add some error handling here ========================
+      }
+      switch(event.type){
+        // log handling ================
+      case ENET_EVENT_TYPE_RECEIVE:
+        processData(&event);
+        break;
+      case ENET_EVENT_TYPE_DISCONNECT:
+        // add some error/log handling here
+        // extend =====================
+        break;
+      }
+    }
+    // now disconnect
+
+    if(!disconnectConnection())
+    // if disconnecting failed destroy conn.
+      enet_peer_reset(server);
+    return;
+  }
+
+  bool ClientConnection::disconnectConnection(){
+    ENetEvent event;
+//     enet_peer_disconnect(server);
+    enet_peer_disconnect(server, 0);
+    while(enet_host_service(client, &event, NETWORK_WAIT_TIMEOUT) > 0){
+      switch (event.type)
+      {
+        case ENET_EVENT_TYPE_RECEIVE:
+          enet_packet_destroy(event.packet);
+          break;
+        case ENET_EVENT_TYPE_DISCONNECT:
+          return true;
+      }
+    }
+    enet_peer_reset(server);
+  }
+
+  bool ClientConnection::establishConnection(){
+    ENetEvent event;
+    // connect to peer
+    server = enet_host_connect(client, &serverAddress, NETWORK_CLIENT_CHANNELS);
+    if(server==NULL)
+      // error handling
+      return false;
+    // handshake
+    if(enet_host_service(client, &event, NETWORK_WAIT_TIMEOUT)>0 && event.type == ENET_EVENT_TYPE_CONNECT){
+      established=true;
+      return true;
+    }
+    else
+      return false;
+  }
+
+  bool ClientConnection::processData(ENetEvent *event){
+    // just add packet to the buffer
+    // this can be extended with some preprocessing
+    return buffer.push(event);
+  }
+
+
+}
Index: /code/branches/audio/src/network/ClientConnection.h
===================================================================
--- /code/branches/audio/src/network/ClientConnection.h	(revision 310)
+++ /code/branches/audio/src/network/ClientConnection.h	(revision 310)
@@ -0,0 +1,79 @@
+//
+// C++ Interface: ClientConnection
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_CLIENTCONNECTION_H
+#define NETWORK_CLIENTCONNECTION_H
+
+#include <iostream>
+#include <string>
+// enet library for networking support
+#include <enet/enet.h>
+// boost.thread library for multithreading support
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+// headerfile
+#include "ClientConnection.h"
+#include "PacketBuffer.h"
+
+namespace network{
+  //
+#define NETWORK_PORT 55556
+#define NETWORK_CLIENT_MAX_CONNECTIONS 5
+#define NETWORK_WAIT_TIMEOUT 5000
+#define NETWORK_SEND_WAIT 5
+#define NETWORK_CLIENT_CHANNELS 2
+
+
+  class ClientConnection{
+    public:
+    ClientConnection(int port, std::string address);
+    ClientConnection(int port, const char* address);
+    ENetPacket *getPacket(ENetAddress &address); // thread1
+    // check wheter the packet queue is empty
+    bool queueEmpty();
+    // create a new listener thread
+    bool createConnection();
+    bool closeConnection();
+    // add a packet to queue for the server
+    bool addPacket(ENetPacket *packet);
+    // send out all queued packets
+    bool sendPackets();
+    // send out all queued packets and save result in event
+    bool sendPackets(ENetEvent *event);
+    bool waitEstablished(int milisec);
+    private:
+    bool processData(ENetEvent *event);
+    // implementation of the listener
+    void receiverThread(); //thread2
+    //packetbuffer
+    bool establishConnection();
+    bool disconnectConnection();
+    PacketBuffer buffer;
+    // enet stuff
+    ENetHost *client;
+    ENetAddress serverAddress;
+    // quit-variable (communication with threads)
+    bool quit;
+    bool established;
+    // clientlist
+    ENetPeer *server;
+  };
+
+
+
+
+
+
+
+
+}
+
+#endif
Index: /code/branches/audio/src/network/ConnectionManager.cc
===================================================================
--- /code/branches/audio/src/network/ConnectionManager.cc	(revision 310)
+++ /code/branches/audio/src/network/ConnectionManager.cc	(revision 310)
@@ -0,0 +1,206 @@
+//
+// C++ Interface: ConnectionManager
+//
+// Description: The Class ConnectionManager manages the servers conenctions to the clients.
+// each connection is provided by a new process. communication between master process and
+// connection processes is provided by ...
+//
+//
+// Author:  Oliver Scheuss
+//
+
+#include "ConnectionManager.h"
+
+namespace network{
+
+  boost::thread_group network_threads;
+
+  void test(){
+    return;
+  }
+
+  ConnectionManager::ConnectionManager(){
+    quit=false;
+    client=NULL;
+    bindAddress.host = ENET_HOST_ANY;
+    bindAddress.port = NETWORK_PORT;
+  }
+
+  ConnectionManager::ConnectionManager(int port, std::string address){
+    quit=false;
+    client=NULL;
+    enet_address_set_host (& bindAddress, address.c_str());
+    bindAddress.port = NETWORK_PORT;
+  }
+
+  ConnectionManager::ConnectionManager(int port, const char *address){
+    quit=false;
+    client=NULL;
+    enet_address_set_host (& bindAddress, address);
+    bindAddress.port = NETWORK_PORT;
+  }
+
+  ENetPacket *ConnectionManager::getPacket(ENetAddress &address){
+    if(!buffer.isEmpty())
+      return buffer.pop(address);
+    else
+        return NULL;
+  }
+
+  bool ConnectionManager::queueEmpty(){
+    return buffer.isEmpty();
+  }
+
+  void ConnectionManager::createListener(){
+    network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
+//     boost::thread thr(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
+    return;
+  }
+
+  bool ConnectionManager::quitListener(){
+    quit=true;
+    network_threads.join_all();
+    return true;
+  }
+
+  bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer){
+    if(client=NULL)
+      return false;
+    ClientList *temp=client;
+    while(peer->host != temp->event->peer->host){
+      temp=temp->next;
+      if(temp==NULL)
+        return false;
+    }
+    if(enet_peer_send(temp->event->peer, temp->ID, packet)!=0)
+      return false;
+    return true;
+  }
+
+  bool ConnectionManager::addPacket(ENetPacket *packet, int ID){
+    if(client==NULL)
+      return false;
+    ClientList *temp=client;
+    while(ID != temp->ID){
+      temp=temp->next;
+      if(temp==NULL)
+        return false;
+    }
+    if(enet_peer_send(temp->event->peer, temp->ID, packet)!=0)
+      return false;
+    else
+      return true;
+  }
+
+  bool ConnectionManager::addPacketAll(ENetPacket *packet){
+    ClientList *temp=client;
+    while(temp!=NULL){
+      if(enet_peer_send(temp->event->peer, temp->ID, packet)!=0)
+         return false;
+    }
+    return true;
+  }
+
+  bool ConnectionManager::sendPackets(ENetEvent *event){
+    if(server==NULL)
+      return false;
+    if(enet_host_service(server, event, NETWORK_SEND_WAIT)>=0)
+      return true;
+    else
+      return false;
+  }
+
+  void ConnectionManager::receiverThread(){
+    // what about some error-handling here ?
+    enet_initialize();
+    atexit(enet_deinitialize);
+    ENetEvent event;
+    server = enet_host_create(&bindAddress, NETWORK_MAX_CONNECTIONS, 0, 0);
+    if(server==NULL)
+      // add some error handling here ==========================
+      quit=true;
+
+    while(!quit){
+      if(enet_host_service(server, &event, NETWORK_WAIT_TIMEOUT)<0){
+        // we should never reach this point
+        quit=true;
+        // add some error handling here ========================
+      }
+      switch(event.type){
+        // log handling ================
+        case ENET_EVENT_TYPE_CONNECT:
+        addClient(&event);
+        break;
+      case ENET_EVENT_TYPE_RECEIVE:
+        processData(&event);
+        break;
+      case ENET_EVENT_TYPE_DISCONNECT:
+        // add some error/log handling here
+        clientDisconnect(event.peer);
+        break;
+      }
+    }
+    // if we're finishied, destroy server
+    enet_host_destroy(server);
+  }
+
+  bool ConnectionManager::processData(ENetEvent *event){
+    // just add packet to the buffer
+    // this can be extended with some preprocessing
+    return buffer.push(event);
+  }
+
+  bool ConnectionManager::clientDisconnect(ENetPeer *peer){
+    ClientList *temp=client;
+    // do we have to remove the first item ?
+    if(temp->event->peer->host==peer->host){
+      if(temp->next==NULL){
+        client=NULL;
+      } else{
+        client=temp->next;
+      }
+      delete temp;
+      return true;
+    } else {
+      while(temp->next!=NULL){
+        if(temp->next->event->peer->host==peer->host){
+          // do a correct relink and delete the disconnected client
+          ClientList *temp2=temp->next;
+          temp->next=temp2->next;
+          delete temp2;
+          return true;
+        } else
+          //otherwise keep on searching ;)
+          temp=temp->next;
+      }
+    }
+    return false;
+  }
+
+  bool ConnectionManager::addClient(ENetEvent *event){
+
+    // first client?
+    if(client==NULL){
+      client =new ClientList;
+      client->ID=1;
+      client->next=NULL;
+      client->event = event;
+    } else {
+      // otherwise add a new element to clientlist
+      ClientList *temp = client;
+      int i=1;
+      while(temp->next != NULL){
+        temp=temp->next;
+        i++;
+      }
+      temp->next=new ClientList;
+      temp=temp->next;
+      temp->ID=i+1;
+      temp->event=event;
+      temp->next=NULL;
+    }
+    return true;
+  }
+
+
+}
Index: /code/branches/audio/src/network/ConnectionManager.h
===================================================================
--- /code/branches/audio/src/network/ConnectionManager.h	(revision 310)
+++ /code/branches/audio/src/network/ConnectionManager.h	(revision 310)
@@ -0,0 +1,91 @@
+//
+// C++ Interface: ConnectionManager
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_CONNECTIONMANAGER_H
+#define NETWORK_CONNECTIONMANAGER_H
+
+#include <iostream>
+#include <string>
+// enet library for networking support
+#include <enet/enet.h>
+// boost.thread library for multithreading support
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
+// headerfile
+#include "ConnectionManager.h"
+#include "PacketBuffer.h"
+
+namespace network{
+  //
+#define NETWORK_PORT 55556
+#define NETWORK_MAX_CONNECTIONS 50
+#define NETWORK_WAIT_TIMEOUT 5000
+#define NETWORK_SEND_WAIT 5
+  //just some defines to make life easier ;)
+// #define ENetEvent std::ENetEvent
+// #define ENetHost std::ENetHost
+// #define ENetAddress std::ENetAddress
+// #define ENetPeer std::ENetPeer
+
+  struct ClientList{
+    ENetEvent *event;
+    int ID;
+    ClientList *next;
+  };
+
+  class ConnectionManager{
+    public:
+    ConnectionManager();
+    ConnectionManager(int port, const char *address);
+    ConnectionManager(int port, std::string address);
+    ENetPacket *getPacket(ENetAddress &address); // thread1
+    // check wheter the packet queue is empty
+    bool queueEmpty();
+    // create a new listener thread
+    void createListener();
+    bool quitListener();
+    // add a packet to queue for a specific client peer
+    bool addPacket(ENetPacket *packet, ENetPeer *peer);
+    // add ad packet to queue for a specific client ID
+    bool addPacket(ENetPacket *packet, int ID);
+    // add a packet to queue for all clients
+    bool addPacketAll(ENetPacket *packet);
+    // send out all queued packets
+    bool sendPackets(ENetEvent *event);
+    private:
+    bool clientDisconnect(ENetPeer *peer);
+    bool processData(ENetEvent *event);
+    bool addClient(ENetEvent *event);
+    // implementation of the listener
+    void receiverThread(); //thread2
+    //packetbuffer
+    PacketBuffer buffer;
+    // enet stuff
+    ENetHost *server;
+    ENetAddress bindAddress;
+    // quit-variable (communication with threads)
+    bool quit;
+    // clientlist
+    ClientList *client;
+//     thread group
+//     boost::thread_group threads;
+  };
+
+
+
+
+
+
+
+
+}
+
+#endif
Index: /code/branches/audio/src/network/GameStateManager.cc
===================================================================
--- /code/branches/audio/src/network/GameStateManager.cc	(revision 310)
+++ /code/branches/audio/src/network/GameStateManager.cc	(revision 310)
@@ -0,0 +1,32 @@
+//
+// C++ Implementation: GameStateManager
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "GameStateManager.h"
+
+namespace network {
+
+GameStateManager::GameStateManager()
+{
+}
+
+GameStateManager::~GameStateManager()
+{
+}
+
+GameState GameStateManager::getSnapshot(){
+  
+}
+
+bool GameStateManager::loadSnapshot(GameState state){
+  
+}
+
+}
Index: /code/branches/audio/src/network/GameStateManager.h
===================================================================
--- /code/branches/audio/src/network/GameStateManager.h	(revision 310)
+++ /code/branches/audio/src/network/GameStateManager.h	(revision 310)
@@ -0,0 +1,46 @@
+//
+// C++ Interface: GameStateManager
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_GAMESTATEMANAGER_H
+#define NETWORK_GAMESTATEMANAGER_H
+
+namespace network {
+
+/**
+ * This struct defines a gamestate:
+ * size: total size of the data in *data
+ * data: pointer to the data allocated in the memory
+ */
+struct GameState{
+  int size;
+  unsigned char *data;
+};
+
+/**
+ * This Class implements a manager for gamestates:
+ * - creating snapshots of gamestates
+ * - writing gamestates to universe
+ * - diffing gamestates ?
+ * @author Oliver Scheuss
+*/
+class GameStateManager{
+public:
+  GameStateManager();
+  ~GameStateManager();
+  GameState getSnapshot();
+  bool loadSnapshot(GameState state);
+private:
+  
+};
+
+}
+
+#endif
Index: /code/branches/audio/src/network/Makefile.norm
===================================================================
--- /code/branches/audio/src/network/Makefile.norm	(revision 310)
+++ /code/branches/audio/src/network/Makefile.norm	(revision 310)
@@ -0,0 +1,40 @@
+CC=g++
+MAIN_INC=..
+INC=-I ${MAIN_INC}
+
+all: server client
+
+# Link command:
+server: PacketBuffer.o ConnectionManager.o dummyserver.o PacketDecoder.o PacketGenerator.o
+	${CC} PacketDecoder.o PacketGenerator.o ConnectionManager.o dummyserver.o PacketBuffer.o -o server -lenet -lboost_thread -g
+
+dummyserver.o: dummyserver.cc
+	${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
+# Compilation commands:
+ConnectionManager.o: ConnectionManager.cc ConnectionManager.h
+	${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
+ClientConnection.o: ClientConnection.cc ClientConnection.h
+	${CC} -c ClientConnection.cc -o ClientConnection.o -g ${INC}
+
+PacketBuffer.o: PacketBuffer.cc
+	${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
+PacketGenerator.o: PacketGenerator.cc
+	${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
+PacketDecoder.o: PacketDecoder.cc
+	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
+Client.o: Client.cc
+	${CC} -c Client.cc -g ${INC}
+Server.o: Server.cc
+	${CC} -c Server.cc -g ${INC}
+Synchronisable.o: Synchronisable.cc
+	${CC} -c Synchronisable.cc -g ${INC}
+GameStateManager.o: GameStateManager.cc
+	${CC} -c GameStateManager.cc -g ${INC}
+
+clean:
+	rm -rf *.o
+
+client_old: PacketGenerator.o dummyclient.cc
+	${CC} dummyclient.cc PacketGenerator.o -o client -lenet -g ${INC}
+client: PacketGenerator.o ClientConnection.o PacketBuffer.o dummyclient2.cc 
+	${CC} dummyclient2.cc PacketGenerator.o PacketBuffer.o ClientConnection.o -o client -lenet -lboost_thread -g ${INC}
Index: /code/branches/audio/src/network/Makefile.tardis
===================================================================
--- /code/branches/audio/src/network/Makefile.tardis	(revision 310)
+++ /code/branches/audio/src/network/Makefile.tardis	(revision 310)
@@ -0,0 +1,39 @@
+all: server client
+
+CC=g++-4.1.1
+
+BOOST_INC=/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/include/boost-1_34_1/
+BOOST_LIB=/usr/pack/boost-1.34.1-sd/i686-debian-linux3.1/lib/
+MAIN_INC=..
+ENET_INC=/usr/pack/enet-2007-sd/include/
+ENET_LIB=/usr/pack/enet-2007-sd/i686-debian-linux3.1/lib/
+INC=-I ${BOOST_INC} -I ${MAIN_INC} -I ${ENET_INC}
+LIB=-L ${BOOST_LIB} -L ${ENET_LIB}
+
+# Link command:
+server: clean PacketBuffer.o ConnectionManager.o dummyserver.o PacketGenerator.o PacketDecoder.o
+	${CC} ConnectionManager.o dummyserver.o PacketBuffer.o PacketDecoder.o PacketGenerator.o -o server -lenet -lboost_thread-gcc41-mt -g ${INC} ${LIB} -Wl,-rpath,${BOOST_LIB} -Wl,-rpath,${ENET_LIB}
+
+dummyserver.o:
+	${CC} -c dummyserver.cc -o dummyserver.o -g ${INC}
+# Compilation commands:
+
+ConnectionManager.o:
+	${CC} -c ConnectionManager.cc -o ConnectionManager.o -g ${INC}
+
+PacketBuffer.o: 
+	${CC} -c PacketBuffer.cc -o PacketBuffer.o -g ${INC}
+PacketGenerator.o: PacketGenerator.cc
+	${CC} -c PacketGenerator.cc -o PacketGenerator.o -g ${INC}
+PacketDecoder.o: PacketDecoder.cc
+	${CC} -c PacketDecoder.cc -o PacketDecoder.o -g ${INC}
+Synchronisable.o: Synchronisable.cc
+	${CC} -c Synchronisable.cc -g ${INC}
+GameStateManager.o: GameStateManager.cc
+	${CC} -c GameStateManager.cc -g ${INC}
+
+clean:
+	rm -rf *.o
+
+client: dummyclient.cc PacketDecoder.o PacketGenerator.o
+	${CC} PacketGenerator.o PacketDecoder.o dummyclient.cc -o client -lenet ${LIB} ${INC} -Wl,-rpath,${BOOST_LIB}
Index: /code/branches/audio/src/network/PacketBuffer.cc
===================================================================
--- /code/branches/audio/src/network/PacketBuffer.cc	(revision 310)
+++ /code/branches/audio/src/network/PacketBuffer.cc	(revision 310)
@@ -0,0 +1,103 @@
+// C++ PacketBuffer
+// d
+// Author Oliver Scheuss
+
+#ifndef NETWORK_PACKETBUFFER_CC
+#define NETWORK_PACKETBUFFER_CC
+
+#include <iostream>
+#include "PacketBuffer.h"
+
+namespace network{
+
+   boost::mutex networkPacketBufferMutex;
+
+PacketBuffer::PacketBuffer(){
+  closed=false;
+  first=NULL;
+  last=NULL;
+}
+    //this is needed in order to make the packetbuffer threadsafe
+
+
+bool PacketBuffer::push(ENetEvent *ev){
+  boost::mutex::scoped_lock lock(networkPacketBufferMutex);
+//   if(closed)
+//     return false;
+  // first element?
+  if(first==NULL){
+    first=new QueueItem;
+    last=first;
+    last->next=NULL;
+    // change this!!!!!!!
+    last->packet = ev->packet;
+    last->address = ev->peer->address;
+    } else {
+    //insert a new element at the bottom
+    last->next = new QueueItem;
+    last=last->next;
+    // initialize last->next
+    last->next=NULL;
+    // save the packet to the new element
+    last->packet = ev->packet;
+    last->address = ev->peer->address;
+  }
+  return true;
+}
+
+ENetPacket *PacketBuffer::pop(){
+  boost::mutex::scoped_lock lock(networkPacketBufferMutex);
+  if(first!=NULL /*&& !closed*/){
+    QueueItem *temp = first;
+    // get packet
+    ENetPacket *pck=first->packet;
+    // remove first element
+    first = first->next;
+    delete temp;
+    return pck;
+  } else{
+    return NULL;
+  }
+}
+
+ENetPacket *PacketBuffer::pop(ENetAddress &address){
+  boost::mutex::scoped_lock lock(networkPacketBufferMutex);
+  if(first!=NULL /*&& !closed*/){
+    QueueItem *temp = first;
+    // get packet
+    ENetPacket *pck=first->packet;
+    address = first->address;
+    // remove first element
+    first = first->next;
+    delete temp;
+    return pck;
+  } else{
+    return NULL;
+  }
+}
+
+bool PacketBuffer::isEmpty(){
+  return (first==NULL);
+}
+
+void PacketBuffer::print(){
+  QueueItem *temp=first;
+  while(temp!=NULL){
+//    std::cout << temp->packet->data << std::endl;
+    temp=temp->next;
+  }
+
+}
+
+bool PacketBuffer::isClosed(){
+  return closed;
+}
+
+void PacketBuffer::setClosed(bool value){
+  closed=value;
+  return;
+}
+
+}// namespace network
+
+#endif
Index: /code/branches/audio/src/network/PacketBuffer.h
===================================================================
--- /code/branches/audio/src/network/PacketBuffer.h	(revision 310)
+++ /code/branches/audio/src/network/PacketBuffer.h	(revision 310)
@@ -0,0 +1,58 @@
+//
+// C++ Interface: PacketBuffer
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef NETWORK_PACKETBUFFER_H 
+#define NETWORK_PACKETBUFFER_H
+
+#include <queue>
+#include <string>
+#include <enet/enet.h>
+#include <boost/bind.hpp>
+#include <boost/thread/mutex.hpp>
+
+
+namespace network{
+
+
+struct PacketEnvelope{
+  int length;
+  int data;
+};
+
+struct QueueItem{
+  ENetPacket *packet;
+  ENetAddress address;
+  QueueItem *next;
+};
+
+class PacketBuffer{
+public:
+  PacketBuffer();
+  bool isEmpty();
+  bool isClosed();
+  void setClosed(bool value);
+  void print();
+  // pops a packet from the queue
+  ENetPacket *pop();
+  ENetPacket *pop(ENetAddress &address);
+  // pushs a packet to the queue
+  bool push(ENetEvent *ev);
+  
+private:
+  QueueItem *first;
+  QueueItem *last;
+  bool closed;
+  
+};
+
+} //namespace
+#endif /* NETWORK_PACKETBUFFER_H */
Index: /code/branches/audio/src/network/PacketBufferTest.cc
===================================================================
--- /code/branches/audio/src/network/PacketBufferTest.cc	(revision 310)
+++ /code/branches/audio/src/network/PacketBufferTest.cc	(revision 310)
@@ -0,0 +1,25 @@
+#include "PacketBuffer.h"
+#include "PacketBuffer.cc"
+#include <iostream>
+#include <string>
+
+using namespace network;
+
+int main(int argc, char **argv[]){
+  PacketBuffer test = PacketBuffer();
+  PacketEnvelope p={8, 5};
+  if(test.isEmpty())
+    std::cout << "empty buffer" << std::endl;
+  for(int i=0; i<10; i++){
+    p.data=i*i;
+    std::cout << i << ": pushing " << p.data << std::endl;
+    test.push(p);
+  }
+  std::cout << std::endl << "queue.print()" << std::endl;
+  test.print();
+  while(!test.isEmpty()){
+    int i=test.pop().data;
+    std::cout << "We popped the value " << i << std::endl;
+  }
+  return 0;
+}
Index: /code/branches/audio/src/network/PacketBufferTestExt.cc
===================================================================
--- /code/branches/audio/src/network/PacketBufferTestExt.cc	(revision 310)
+++ /code/branches/audio/src/network/PacketBufferTestExt.cc	(revision 310)
@@ -0,0 +1,51 @@
+#include <string>
+#include <iostream>
+#include <enet/enet.h>
+#include <boost/thread/thread.hpp>
+#include "PacketBuffer.h"
+#include "PacketBuffer.cc"
+
+using namespace network;
+
+
+void write(PacketBuffer *test){
+  ENetPacket *packet;
+  if(test->isEmpty())
+    std::cout << "empty buffer" << std::endl;
+  for(int i=0; i<10; i++){
+    std::string temp = "packet ";
+    packet = enet_packet_create("packet", strlen("packet ")+1,
+ENET_PACKET_FLAG_RELIABLE);
+    std::cout << i << ": pushing " << packet->data << std::endl;
+    test->push(packet);
+    if(i==5)
+      usleep(200000);
+  }
+  test->setClosed(true);
+  return;
+}
+
+void read(PacketBuffer *test){
+  //test->print();
+  // exit if the queue is closed and empty
+  while(!test->isClosed() || !test->isEmpty()){
+    // only pop if the queue isn't empty
+    while(!test->isEmpty()){
+      std::cout << "We popped the value " << test->pop()->data << std::endl;
+    }
+  }
+  return;
+}
+
+
+int main(int argc, char **argv[]){
+  PacketBuffer test = PacketBuffer();
+  boost::thread thrd1(boost::bind(&write, &test));
+  boost::thread thrd2(boost::bind(&read, &test));
+
+  thrd1.join();
+  thrd2.join();
+
+  return 0;
+}
+
Index: /code/branches/audio/src/network/PacketDecoder.cc
===================================================================
--- /code/branches/audio/src/network/PacketDecoder.cc	(revision 310)
+++ /code/branches/audio/src/network/PacketDecoder.cc	(revision 310)
@@ -0,0 +1,104 @@
+/*
+ * Class contains functions to determine and decode incomming packages
+ * 
+ * Autor: Dumeni Manatschal
+ * 
+*/
+
+
+#include "enet/enet.h"
+#include "PacketManager.h"
+#include <iostream>
+
+using namespace std;
+using namespace network;
+
+PacketDecoder::PacketDecoder(){}
+
+//call this function out of an instance of PacketDecoder
+//it will determine the type id and call the right decode function
+bool PacketDecoder::elaborate( ENetPacket* packet, int clientId )
+{
+	int client = clientId;
+	cout << "clientId: " << client << endl;
+	int id = (int)*packet->data;
+	switch( id ) {
+	case ACK:
+		acknowledgement( packet );
+		return true;
+		break;
+	case MOUSE:
+		mousem( packet );
+		return true;
+		break;
+	case KEYBOARD:
+		keystrike( packet );
+		return true;
+		break;
+	case CHAT:
+		chatMessage( packet );
+		return true;
+		break;
+	}
+	return false;
+}
+
+//following are the decode functions for the data of the packets
+
+void PacketDecoder::acknowledgement( ENetPacket* packet )
+{
+	ack* a = new ack;
+	*a = *(ack*)packet->data;
+	printAck( a );
+}
+
+void PacketDecoder::mousem( ENetPacket* packet )
+{
+	mouse* mouseMove = new mouse;
+	*mouseMove = *(mouse*)packet->data;
+	printMouse( mouseMove );
+}
+
+void PacketDecoder::keystrike( ENetPacket* packet )
+{
+	keyboard* key = new keyboard;
+	*key = *(keyboard*)packet->data;
+	printKey( key );
+}
+
+void PacketDecoder::chatMessage( ENetPacket* packet )
+{
+	chat* chatting = new chat;
+	chatting->id = (int)*packet->data;
+	char* reserve = new char[packet->dataLength-4];
+	memcpy( &reserve[0], packet->data+sizeof(int), packet->dataLength-4 );
+	chatting->message = reserve;
+	printChat( chatting );
+}
+
+//these are some print functions for test stuff
+
+void PacketDecoder::printAck( ack* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "data:    " << data->a << endl;
+}
+
+void PacketDecoder::printMouse( mouse* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "data:    " << data->x << " " << data->y << endl;
+}
+
+void PacketDecoder::printKey( keyboard* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "data:    " << (char)data->press << endl;
+}
+
+void PacketDecoder::printChat( chat* data )
+{
+	cout << "data id: " << data->id << endl;
+	cout << "blablabla" << endl;
+	cout << "data:    " << data->message << endl;
+}
Index: /code/branches/audio/src/network/PacketGenerator.cc
===================================================================
--- /code/branches/audio/src/network/PacketGenerator.cc	(revision 310)
+++ /code/branches/audio/src/network/PacketGenerator.cc	(revision 310)
@@ -0,0 +1,69 @@
+/*
+ *Class generates packets that can be send by enet
+ * 
+ * Autor: Dumeni Manatschal
+ *  
+*/
+
+#include "PacketManager.h"
+#include "enet/enet.h"
+#include <iostream>
+#include <list>
+#include <string>
+#include <cstring>
+
+using namespace std;
+using namespace network;
+
+PacketGenerator::PacketGenerator() {}
+
+//following functions create a packet in form of bytestream
+
+ENetPacket* PacketGenerator::acknowledgement( int state, int reliable )
+{
+	cout << "generating new acknowledgement" << endl;
+	ack* ackreq = new ack;
+	ackreq->id = ACK;
+	ackreq->a = state;
+	
+	ENetPacket *packet = enet_packet_create( ackreq , sizeof( *ackreq ), reliable );
+	
+	return packet;
+}
+/*### mouseupdates */
+ENetPacket* PacketGenerator::mousem( double x, double y, int reliable )
+{
+	cout << "generating new mouse" << endl;
+	mouse* mousemove = new mouse;
+	mousemove->id = MOUSE;
+	mousemove->x = x;
+	mousemove->y = y;
+	
+	ENetPacket *packet = enet_packet_create( mousemove , sizeof( *mousemove ), reliable );
+	
+	return packet;
+}
+/*### keystrikes updates */
+ENetPacket* PacketGenerator::keystrike( char press, int reliable )
+{
+	cout << "generating new keyboard" << endl;
+	keyboard* key = new keyboard;
+	key->id = KEYBOARD;
+	key->press = press;
+	
+	ENetPacket *packet = enet_packet_create( key , sizeof( *key ), reliable );
+	
+	return packet;
+}
+/*### chat messages packet */
+ENetPacket* PacketGenerator::chatMessage( const char* message, int reliable )
+{
+	int* trans = new int[sizeof(int) + strlen(message) + 1];
+	*trans = CHAT;
+	//be carefull here, don't forget to allocate the space before using it ;-)
+	memcpy( &trans[1], (const void*)message, strlen( message ) + 1);
+	ENetPacket *packet = enet_packet_create( trans , sizeof( int ) + strlen( message ) + 1, reliable );
+	
+	return packet;
+}
+
Index: /code/branches/audio/src/network/PacketManager.h
===================================================================
--- /code/branches/audio/src/network/PacketManager.h	(revision 310)
+++ /code/branches/audio/src/network/PacketManager.h	(revision 310)
@@ -0,0 +1,99 @@
+#ifndef PACKETMANAGER_H_
+#define PACKETMANAGER_H_
+
+#include <enet/enet.h>
+
+//enum netowk generaly used to set the type ID of a packet
+namespace network
+{
+enum packet_id {
+	ACK,
+	MOUSE,
+	KEYBOARD,
+	CHAT
+};
+
+/*
+ * class to generate packets
+ * 
+ * Autor: Dumeni Manatschal
+ * 
+*/ 
+class PacketGenerator
+{
+public:
+	PacketGenerator();
+	//call one of this functions out of an instance of PacketGenerator to create a packet
+	ENetPacket* acknowledgement( int state, int reliable = ENET_PACKET_FLAG_RELIABLE );
+	ENetPacket* mousem( double x, double y, int reliable = ENET_PACKET_FLAG_RELIABLE );
+	ENetPacket* keystrike( char press, int reliable = ENET_PACKET_FLAG_RELIABLE );
+	ENetPacket* chatMessage( const char* message, int reliable = ENET_PACKET_FLAG_RELIABLE );
+private:
+	//used to set the bytes in the right order
+	struct ack {
+		int id;
+		int a;
+	};
+
+	struct mouse {
+		int id;
+		double x;
+		double y;
+	};
+
+	struct keyboard {
+		int id;
+		char press;
+	};	
+};
+
+/*
+ * class used to decode incoming packets
+ * 
+ * Autor: Dumeni Manatschal
+ * 
+*/
+class PacketDecoder
+{
+public:
+	PacketDecoder();
+	//call this function to decode, it calls the right decoding function below
+	bool elaborate( ENetPacket* packet, int clientId );
+private:
+	struct ack {
+		int id;
+		int a;
+	};
+
+	struct mouse {
+		int id;
+		double x;
+		double y;
+	};
+
+	struct keyboard {
+		int id;
+		char press;
+	};
+	//only in this class, not PacketGenerator, used as pattern to put incoming
+	//bytes inside
+	struct chat {
+		int id;
+		const char* message;
+	};
+	
+	void acknowledgement( ENetPacket* packet );
+	void mousem( ENetPacket* packet );
+	void keystrike( ENetPacket* packet );
+	void chatMessage( ENetPacket* packet );
+	
+	//print functions
+	void printAck( ack* data );
+	void printMouse( mouse* data );
+	void printKey( keyboard* data );
+	void printChat( chat* data );
+	void printPeer( ENetPeer* peer );
+};
+}
+
+#endif /*PACKETMANAGER_H_*/
Index: /code/branches/audio/src/network/Server.cc
===================================================================
--- /code/branches/audio/src/network/Server.cc	(revision 310)
+++ /code/branches/audio/src/network/Server.cc	(revision 310)
@@ -0,0 +1,53 @@
+//
+// C++ Implementation: Server
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+
+#include "Server.h"
+
+namespace network{
+
+  /**
+   * Constructor for default values (bindaddress is set to ENET_HOST_ANY
+   *
+   */
+  Server::Server(){
+
+
+  }
+
+  /**
+   * Constructor
+   * @param port Port to listen on
+   * @param bindAddress Address to listen on
+   */
+  Server::Server(int port, std::string bindAddress) : connection(port, bindAddress){
+
+
+  }
+
+  /**
+   * Constructor
+   * @param port Port to listen on
+   * @param bindAddress Address to listen on
+   */
+  Server::Server(int port, const char *bindAddress) : connection(port, bindAddress){
+
+
+
+
+  }
+
+
+
+
+
+}
Index: /code/branches/audio/src/network/Server.h
===================================================================
--- /code/branches/audio/src/network/Server.h	(revision 310)
+++ /code/branches/audio/src/network/Server.h	(revision 310)
@@ -0,0 +1,51 @@
+//
+// C++ Interface: Server
+//
+// Description:
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef NETWORK_SERVER_H
+#define NETWORK_SERVER_H
+
+#include <string>
+
+#include "ConnectionManager.h"
+#include "PacketManager.h"
+
+
+namespace network{
+
+  /**
+   * This class is the root class of the network module for a server.
+   * It implements all functions necessary for a Server
+   */
+  class Server : PacketDecoder{
+    public:
+    Server();
+    Server(int port, std::string bindAddress);
+    Server(int port, const char *bindAddress);
+
+    private:
+    ConnectionManager connection;
+
+
+
+
+
+
+
+  };
+
+
+
+
+
+}
+
+#endif
Index: /code/branches/audio/src/network/Synchronisable.cc
===================================================================
--- /code/branches/audio/src/network/Synchronisable.cc	(revision 310)
+++ /code/branches/audio/src/network/Synchronisable.cc	(revision 310)
@@ -0,0 +1,141 @@
+//
+// C++ Implementation: synchronisable
+//
+// Description:
+//
+//
+// Author:  Dumeni, Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+
+#include "Synchronisable.h"
+
+namespace network {
+
+/**
+ * Constructor:
+ * calls registarAllVariables, that has to be implemented by the inheriting classID
+ */
+Synchronisable::Synchronisable()
+{
+  datasize=0;
+  registerAllVariables();
+}
+
+
+Synchronisable::~Synchronisable()
+{
+
+}
+
+/**
+ * This function is used to register a variable to be synchronized
+ * also counts the total datasize needed to save the variables
+ * @param var pointer to the variable
+ * @param size size of the datatype the variable consists of
+ */
+void Synchronisable::registerVar(const void *var, int size){
+  // create temporary synch.Var struct
+  synchronisableVariable temp={size, var};
+  // increase datasize
+  datasize+=sizeof(int)+size;
+  // push temp to syncList (at the bottom)
+  syncList.push_back(temp);
+}
+
+/**
+ * note: only use this function for debug use, because it's inefficient (in order to produce a gamestate, you have to copy the whole data again to another memory location after this process)
+ * This function takes all SynchronisableVariables out of the Synchronisable and saves it into a syncData struct
+ * structure of the bitstream:
+ * (var1_size,var1,var2_size,var2,...)
+ * varx_size: size = sizeof(int)
+ * varx: size = varx_size
+ * @return data containing all variables and their sizes
+ */
+syncData Synchronisable::getData(){
+  std::list<synchronisableVariable>::iterator i;
+  int totalsize=0;
+  //figure out size of data to be allocated
+  for(i=syncList.begin(); i!=syncList.end(); i++){
+    // increase size (size of variable and size of size of variable ;)
+    totalsize+=sizeof(int)+i->size;
+  }
+  syncData retVal;
+  retVal.objectID=this->objectID;
+  retVal.classID=this->classID;
+  retVal.length=totalsize;
+  // allocate memory
+  retVal.data = (unsigned char *)malloc(totalsize);
+  // copy to location
+  //CHANGED: REMOVED DECLARATION int n=0 FROM LOOP
+  int n=0;
+  for(i=syncList.begin(); n<totalsize && i!=syncList.end(); i++){
+	//CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID*
+    std::memcpy(retVal.data+n, (const void*)(i->size), sizeof(int));
+    n+=sizeof(int);
+    //CHANGED: i->var TO (const void*)(&(i->var)) SINCE var IS A POINTER, NO & BEFORE i
+    std::memcpy(retVal.data+n, (const void*)(i->var), i->size);
+    n+=i->size;
+  }
+  return retVal;
+}
+/**
+ * This function takes all SynchronisableVariables out of the Synchronisable and saves it into a syncData struct
+ * Difference to the above function:
+ * takes a pointer to already allocated memory (must have at least getSize bytes length)
+ * structure of the bitstream:
+ * (var1_size,var1,var2_size,var2,...)
+ * varx_size: size = sizeof(int)
+ * varx: size = varx_size
+ * @return data containing all variables and their sizes
+ */
+syncData Synchronisable::getData(unsigned char *mem){
+  std::list<synchronisableVariable>::iterator i;
+  syncData retVal;
+  retVal.objectID=this->objectID;
+  retVal.classID=this->classID;
+  retVal.length=datasize;
+  retVal.data=mem;
+  // copy to location
+  //CHANGED: REMOVED DECLARATION int n=0 FROM LOOP
+  int n=0;
+  for(i=syncList.begin(); n<datasize && i!=syncList.end(); i++){
+        //CHANGED: i->size TO (const void*)(&(i->size)) memcpy WANTS A CONST VOID* SO CONVERT INT TO CONST VOID*
+    std::memcpy(retVal.data+n, (const void*)(i->size), sizeof(int));
+    n+=sizeof(int);
+    //CHANGED: i->var TO (const void*)(&(i->var)) SINCE var IS A POINTER, NO & BEFORE i
+    std::memcpy(retVal.data+n, (const void*)(i->var), i->size);
+    n+=i->size;
+  }
+  return retVal;
+}
+
+/**
+ * This function takes a syncData struct and takes it to update the variables
+ * @param vars data of the variables
+ * @return true/false
+ */
+bool Synchronisable::updateData(syncData vars){
+  unsigned char *data=vars.data;
+  std::list<synchronisableVariable>::iterator i;
+  for(i=syncList.begin(); i!=syncList.end(); i++){
+    if((int)*data==i->size){
+      data+=sizeof(int);
+      //CHANGED: THIS FROM i->var TO (void*)i->var SINCE var IS A CONST VOID* AND memcpy NEEDS A VOID* AS FIRST ARGUMENT
+      memcpy((void*)i->var, data, i->size);
+      data+=i->size;
+    } else
+      return false; //there was some problem with registerVar
+  }
+}
+
+/**
+ * This function returns the total amount of bytes needed by getData to save the whole content of the variables
+ * @return amount of bytes
+ */
+int Synchronisable::getSize(){
+  return datasize;
+}
+
+}
Index: /code/branches/audio/src/network/Synchronisable.h
===================================================================
--- /code/branches/audio/src/network/Synchronisable.h	(revision 310)
+++ /code/branches/audio/src/network/Synchronisable.h	(revision 310)
@@ -0,0 +1,60 @@
+//
+// C++ Interface: synchronisable
+//
+// Description: 
+//
+//
+// Author:  Oliver Scheuss, (C) 2007
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef NETWORK_SYNCHRONISABLE_H
+#define NETWORK_SYNCHRONISABLE_H
+
+#include <list>
+
+namespace network {
+
+  
+struct syncData{
+  int length;
+  int classID;
+  int objectID;
+  unsigned char *data;
+};
+
+typedef struct synchronisableVariable{
+  int size;
+  const void *var;
+}SYNCVAR;
+
+  
+/**
+ * This class is the base class of all the Objects in the universe that need to be synchronised over the network
+ * Every class, that inherits from this class has to link the DATA THAT NEEDS TO BE SYNCHRONISED into the linked list. Additionally it also has to provide a Constructor, that takes exactly the variables in this linked list.
+ * @author Oliver Scheuss
+*/
+class Synchronisable{
+public:
+  Synchronisable();
+
+  ~Synchronisable();
+  int objectID;
+  int classID;
+    
+  void registerVar(const void *var, int size);
+  syncData getData();
+  syncData getData(unsigned char *mem);
+  int getSize();
+  bool updateData(syncData vars);
+  virtual void registerAllVariables();
+
+private:
+  std::list<SYNCVAR> syncList;
+  int datasize;
+};
+
+}
+
+#endif
Index: /code/branches/audio/src/network/dummyclient.cc
===================================================================
--- /code/branches/audio/src/network/dummyclient.cc	(revision 310)
+++ /code/branches/audio/src/network/dummyclient.cc	(revision 310)
@@ -0,0 +1,93 @@
+//
+// Dummy client to test ConnectionManager and PacketBuffer classes
+//
+// Author: Oliver Scheuss
+
+#include <iostream>
+#include <string>
+#include <enet/enet.h>
+#include "PacketManager.h"
+
+using namespace std;
+
+int main(){
+  ENetHost * client;
+  ENetAddress address;
+  ENetEvent event;
+  ENetPeer *peer;
+  network::PacketGenerator pck;
+
+  enet_initialize();
+  atexit(enet_deinitialize);
+
+  cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << endl;
+  string str;
+  getline(cin, str);
+  cout << "You entered: " << str << endl;
+  if(str.compare("")==0)
+    str="127.0.0.1";
+
+  enet_address_set_host(&address, str.c_str());
+  address.port = 55556;
+
+        // create client object
+  client = enet_host_create(NULL, 2, 0, 0);
+
+  if(client==NULL){
+    fprintf(stderr, "An error occured");
+    exit(EXIT_FAILURE);
+  }
+        // connect peer
+  peer = enet_host_connect(client, &address, 2);
+  if(peer==NULL){
+    fprintf(stderr, "Peer establishing error");
+    exit(EXIT_FAILURE);
+  }
+        // wait 5 seconds for the connection attempt to succeed
+  if(enet_host_service(client, &event, 5000) > 0 && event.type == ENET_EVENT_TYPE_CONNECT){
+    cout << "Connection to " << str << " succeeded." << endl;
+    //puts("Connection to localhost:5555 succeeded.");
+  }else{
+    enet_peer_reset(peer);
+    cout << "Connection to " << str << " failed." << endl;
+    //puts("Connection to localhost:5555 failed.");
+    exit(EXIT_FAILURE);
+  }
+
+  for(int i=0; i<10; i++){
+        // weihnachtsmann bringt packete
+    //ENetPacket *packet = enet_packet_create ("packet1234", strlen("packet1234") + 1, ENET_PACKET_FLAG_RELIABLE);
+        // extend the packet and append the string foo to it
+        // send packet to peer on channel id 0
+    enet_peer_send(peer, 1, pck.chatMessage("test2"));
+        // keep the timeout very small for low delay
+    if(enet_host_service(client, &event, 1)==0){
+      cout << "successfully sent: " << event.type << endl;
+    }else{
+      cout << "failed sending" << endl;
+    }
+    usleep(1000000);
+  }
+
+        // now disconnect
+//   enet_peer_disconnect (peer);
+  enet_peer_disconnect (peer, 0);
+        // 3 seconds timeout
+  while(enet_host_service(client, &event, 3000) > 0){
+    switch (event.type)
+    {
+      case ENET_EVENT_TYPE_RECEIVE:
+        enet_packet_destroy(event.packet);
+        break;
+      case ENET_EVENT_TYPE_DISCONNECT:
+        puts("Disconnection succeeded.");
+        return 0;
+    }
+  }
+        // if disconnect failed
+  enet_peer_reset(peer);
+
+
+
+  return 0;
+}
Index: /code/branches/audio/src/network/dummyclient2.cc
===================================================================
--- /code/branches/audio/src/network/dummyclient2.cc	(revision 310)
+++ /code/branches/audio/src/network/dummyclient2.cc	(revision 310)
@@ -0,0 +1,61 @@
+//
+// Dummy client to test ConnectionManager, PacketBuffer, ClientConnection and other classes
+//
+// Author: Oliver Scheuss
+
+#include <iostream>
+#include <string>
+#include <enet/enet.h>
+#include "PacketManager.h"
+#include "ClientConnection.h"
+
+using namespace network;
+
+int main(){
+  network::PacketGenerator pck;
+
+  std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
+  std::string str;
+  std::getline(std::cin, str);
+  std::cout << "You entered: " << str << std::endl;
+  if(str.compare("")==0)
+    str="127.0.0.1";
+
+  ClientConnection client = ClientConnection(55556, str);
+
+  client.createConnection();
+
+  if(client.waitEstablished(10000))
+    std::cout << "Connection established" << std::endl;
+  else
+    std::cout << "Connection failed" << std::endl;
+
+  ENetPacket *packet;
+  ENetEvent event;
+
+
+
+  for(int i=0; i<10; i++){
+        // weihnachtsmann bringt packete
+        // extend the packet and append the string foo to it
+        // send packet to peer on channel id 0
+    client.addPacket(pck.chatMessage("test"));
+        // keep the timeout very small for low delay
+    if(client.sendPackets(&event)){
+      std::cout << "successfully sent: " << event.type << std::endl;
+    }else{
+      std::cout << "failed sending" << std::endl;
+    }
+    //usleep(100000);
+  }
+
+        // now disconnect
+  if(client.closeConnection())
+    std::cout << "Connection successfully closed" << std::endl;
+  else
+    std::cout << "Connection closing failed" << std::endl;
+
+        // 3 seconds timeout
+  return 0;
+}
+
Index: /code/branches/audio/src/network/dummyserver.cc
===================================================================
--- /code/branches/audio/src/network/dummyserver.cc	(revision 310)
+++ /code/branches/audio/src/network/dummyserver.cc	(revision 310)
@@ -0,0 +1,42 @@
+//
+// Dummy server to test ConnectionManager and PacketBuffer classes
+//
+// Author: Oliver Scheuss
+
+
+#include <iostream>
+#include "enet/enet.h"
+#include "ConnectionManager.h"
+#include "PacketManager.h"
+
+using namespace network;
+
+int main(){
+  ConnectionManager server = ConnectionManager();
+  bool quit=false;
+  ENetPacket *packet;
+  ENetEvent event;
+  server.createListener();
+
+  PacketDecoder dec;
+
+  while(!quit){
+    if(server.queueEmpty())
+      usleep(100);
+    else{
+      ENetAddress addr;
+      packet=server.getPacket(addr);
+      if(packet==NULL){
+        // there was some error
+        //std::cout << "null pointer" << std::endl;
+        quit=true;
+      }
+      else{
+        //std::cout << "We received: " << packet->data << std::endl;
+        dec.elaborate(packet, 1);
+      }
+    }
+  }
+  server.quitListener();
+  return 0;
+}
Index: /code/branches/audio/src/ogre_control.cc
===================================================================
--- /code/branches/audio/src/ogre_control.cc	(revision 310)
+++ /code/branches/audio/src/ogre_control.cc	(revision 310)
@@ -0,0 +1,223 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgrePlatform.h"
+#include "OgreRoot.h"
+#include "OgreRenderWindow.h"
+#include "OgreString.h"
+#include "OgreConfigFile.h"
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+  #include <CoreFoundation/CoreFoundation.h>
+#endif
+
+#include "ogre_control.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+
+  /**
+  * Ogre control class.
+  * This is merely a convenient way to handle Ogre. It only holds the Root
+  * object and the render Window. These are the objects, that are independant
+  * of the game state (playing, menu browsing, loading, etc.).
+  * This class could easily be merged into the Orxnox class.
+  */
+
+
+  /**
+  * Provide support for mac users.
+  */
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+  // This function will locate the path to our application on OS X,
+  // unlike windows you can not rely on the curent working directory
+  // for locating your configuration files and resources.
+  std::string macBundlePath()
+  {
+	  char path[1024];
+	  CFBundleRef mainBundle = CFBundleGetMainBundle();
+	  assert(mainBundle);
+
+	  CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+	  assert(mainBundleURL);
+
+	  CFStringRef cfStringRef =
+          CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+	  assert(cfStringRef);
+
+	  CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+	  CFRelease(mainBundleURL);
+	  CFRelease(cfStringRef);
+
+	  return std::string(path);
+  }
+  #endif
+
+
+  /**
+  * Constructor that determines the resource path platform dependant.
+  */
+  OgreControl::OgreControl() : root_(0)
+  {
+	  // Provide a nice cross platform solution for locating the configuration
+	  // files. On windows files are searched for in the current working
+    // directory, on OS X however you must provide the full path, the helper
+    // function macBundlePath does this for us.
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+	  resourcePath_ = macBundlePath() + "/Contents/Resources/";
+  #else
+	  resourcePath_ = "";
+  #endif
+  }
+
+
+  /**
+  * Standard Destructor.
+  */
+  OgreControl::~OgreControl()
+  {
+	  if (root_)
+		  delete root_;
+  }
+
+
+  /* Sets up Ogre.
+  * First, the Root object is being created, then the resources are defined
+  * (not loaded!). And last but not least, the render settings (like resolution
+  * or AA level) are prompted to the user.
+  */
+  bool OgreControl::initialise(void)
+  {
+	  String pluginsPath;
+	  // only use plugins.cfg if not static
+  #ifndef OGRE_STATIC_LIB
+	  pluginsPath = resourcePath_ + "plugins.cfg";
+  #endif
+
+	  root_ = new Root(pluginsPath, 
+		  resourcePath_ + "ogre.cfg", resourcePath_ + "Ogre.log");
+
+	  setupResources();
+
+	  if (!configure())
+		  return false;
+
+	  return true;
+  }
+
+
+  /**
+  * Defines the source of the resources.
+  */
+  void OgreControl::setupResources(void)
+  {
+	  // Load resource paths from config file
+	  ConfigFile cf;
+	  cf.load(resourcePath_ + "resources.cfg");
+
+	  // Go through all sections & settings in the file
+	  ConfigFile::SectionIterator seci = cf.getSectionIterator();
+
+	  String secName, typeName, archName;
+	  while (seci.hasMoreElements())
+	  {
+		  secName = seci.peekNextKey();
+		  ConfigFile::SettingsMultiMap *settings = seci.getNext();
+		  ConfigFile::SettingsMultiMap::iterator i;
+		  for (i = settings->begin(); i != settings->end(); ++i)
+		  {
+			  typeName = i->first;
+			  archName = i->second;
+  #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+			  // OS X does not set the working directory relative to the app,
+			  // In order to make things portable on OS X we need to provide
+			  // the loading with it's own bundle path location
+			  ResourceGroupManager::getSingleton().addResourceLocation(
+				  String(macBundlePath() + "/" + archName), typeName, secName);
+  #else
+			  ResourceGroupManager::getSingleton().addResourceLocation(
+				  archName, typeName, secName);
+  #endif
+		  }
+	  }
+  }
+
+
+  /**
+  * Prompts a setting window for the render engine if that has not already
+  * been done.
+  * The method also calls the root initialiser in order to get a render window.
+  */
+  bool OgreControl::configure(void)
+  {
+	  // Show the configuration dialog and initialise the system
+	  // You can skip this and use root.restoreConfig() to load configuration
+	  // settings if you were sure there are valid ones saved in ogre.cfg
+	  if(!root_->restoreConfig() && !root_->showConfigDialog())
+		  return false;
+
+	  // user clicked OK so initialise
+	  // Here we choose to let the system create a default
+    // rendering window by passing 'true'
+	  root_->saveConfig();
+	  window_ = root_->initialise(true);
+	  return true;
+  }
+
+
+  /**
+  * Returns the root object.
+  * @return Root object.
+  */
+  Root* OgreControl::getRoot(void)
+  {
+	  return root_;
+  }
+
+
+  /**
+  * Returns the render window.
+  * @return Render window.
+  */
+  RenderWindow* OgreControl::getRenderWindow(void)
+  {
+	  return window_;
+  }
+
+
+  /**
+  * Returns the resource path.
+  * @return Resource path.
+  */
+  Ogre::String OgreControl::getResourcePath(void)
+  {
+	  return resourcePath_;
+  }
+
+}
Index: /code/branches/audio/src/ogre_control.h
===================================================================
--- /code/branches/audio/src/ogre_control.h	(revision 310)
+++ /code/branches/audio/src/ogre_control.h	(revision 310)
@@ -0,0 +1,71 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef OGRE_CONTROL_H
+#define OGRE_CONTROL_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OgreControl
+  {
+  public:
+	  OgreControl();
+
+	  virtual ~OgreControl();
+
+	  /** Sets up the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool initialise();
+
+    virtual Ogre::Root* getRoot();
+
+	  virtual Ogre::RenderWindow* getRenderWindow();
+
+	  virtual Ogre::String getResourcePath();
+
+  protected:
+	  /** Configures the application - returns false if the user chooses to abandon configuration. */
+	  virtual bool configure(void);
+
+	  /// Method which will define the source of resources (other than current folder)
+	  virtual void setupResources(void);
+
+  protected:
+	  Ogre::Root         *root_;
+	  Ogre::RenderWindow *window_;
+	  Ogre::String  resourcePath_;
+
+  };
+
+}
+
+#endif /* OGRE_CONTROL_H */
Index: /code/branches/audio/src/openal/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/openal/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/openal/CMakeLists.txt	(revision 310)
@@ -0,0 +1,6 @@
+PROJECT(Orxonox)
+
+ADD_SUBDIRECTORY(include)
+
+TARGET_LINK_LIBRARIES(lib)
+
Index: /code/branches/audio/src/openal/include/AL/al.h
===================================================================
--- /code/branches/audio/src/openal/include/AL/al.h	(revision 310)
+++ /code/branches/audio/src/openal/include/AL/al.h	(revision 310)
@@ -0,0 +1,744 @@
+#ifndef AL_AL_H
+#define AL_AL_H
+
+/**
+ * OpenAL cross platform audio library
+ * Copyright (C) 1999-2000 by authors.
+ * This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Library General Public
+ *  License as published by the Free Software Foundation; either
+ *  version 2 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
+ *  Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library 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.
+ * Or go to http://www.gnu.org/copyleft/lgpl.html
+ */
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(_XBOX)
+ /* _OPENAL32LIB is deprecated */
+ #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB)
+  #define AL_API __declspec(dllexport)
+ #else
+  #define AL_API __declspec(dllimport)
+ #endif
+#else
+ #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
+  #define AL_API __attribute__((visibility("default")))
+ #else
+  #define AL_API extern
+ #endif
+#endif
+
+#if defined(_WIN32)
+ #define AL_APIENTRY __cdecl
+#else
+ #define AL_APIENTRY
+#endif
+
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+ #pragma export on
+#endif
+
+/*
+ * The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and
+ * AL_ILLEGAL_COMMAND macros are deprecated, but are included for
+ * applications porting code from AL 1.0
+ */
+#define OPENAL
+#define ALAPI AL_API
+#define ALAPIENTRY AL_APIENTRY
+#define AL_INVALID                                (-1)
+#define AL_ILLEGAL_ENUM                           AL_INVALID_ENUM
+#define AL_ILLEGAL_COMMAND                        AL_INVALID_OPERATION
+
+#define AL_VERSION_1_0
+#define AL_VERSION_1_1
+
+
+/** 8-bit boolean */
+typedef char ALboolean;
+
+/** character */
+typedef char ALchar;
+
+/** signed 8-bit 2's complement integer */
+typedef char ALbyte;
+
+/** unsigned 8-bit integer */
+typedef unsigned char ALubyte;
+
+/** signed 16-bit 2's complement integer */
+typedef short ALshort;
+
+/** unsigned 16-bit integer */
+typedef unsigned short ALushort;
+
+/** signed 32-bit 2's complement integer */
+typedef int ALint;
+
+/** unsigned 32-bit integer */
+typedef unsigned int ALuint;
+
+/** non-negative 32-bit binary integer size */
+typedef int ALsizei;
+
+/** enumerated 32-bit value */
+typedef int ALenum;
+
+/** 32-bit IEEE754 floating-point */
+typedef float ALfloat;
+
+/** 64-bit IEEE754 floating-point */
+typedef double ALdouble;
+
+/** void type (for opaque pointers only) */
+typedef void ALvoid;
+
+
+/* Enumerant values begin at column 50. No tabs. */
+
+/* "no distance model" or "no buffer" */
+#define AL_NONE                                   0
+
+/* Boolean False. */
+#define AL_FALSE                                  0
+
+/** Boolean True. */
+#define AL_TRUE                                   1
+
+/** Indicate Source has relative coordinates. */
+#define AL_SOURCE_RELATIVE                        0x202
+
+
+
+/**
+ * Directional source, inner cone angle, in degrees.
+ * Range:    [0-360] 
+ * Default:  360
+ */
+#define AL_CONE_INNER_ANGLE                       0x1001
+
+/**
+ * Directional source, outer cone angle, in degrees.
+ * Range:    [0-360] 
+ * Default:  360
+ */
+#define AL_CONE_OUTER_ANGLE                       0x1002
+
+/**
+ * Specify the pitch to be applied, either at source,
+ *  or on mixer results, at listener.
+ * Range:   [0.5-2.0]
+ * Default: 1.0
+ */
+#define AL_PITCH                                  0x1003
+  
+/** 
+ * Specify the current location in three dimensional space.
+ * OpenAL, like OpenGL, uses a right handed coordinate system,
+ *  where in a frontal default view X (thumb) points right, 
+ *  Y points up (index finger), and Z points towards the
+ *  viewer/camera (middle finger). 
+ * To switch from a left handed coordinate system, flip the
+ *  sign on the Z coordinate.
+ * Listener position is always in the world coordinate system.
+ */ 
+#define AL_POSITION                               0x1004
+  
+/** Specify the current direction. */
+#define AL_DIRECTION                              0x1005
+  
+/** Specify the current velocity in three dimensional space. */
+#define AL_VELOCITY                               0x1006
+
+/**
+ * Indicate whether source is looping.
+ * Type: ALboolean?
+ * Range:   [AL_TRUE, AL_FALSE]
+ * Default: FALSE.
+ */
+#define AL_LOOPING                                0x1007
+
+/**
+ * Indicate the buffer to provide sound samples. 
+ * Type: ALuint.
+ * Range: any valid Buffer id.
+ */
+#define AL_BUFFER                                 0x1009
+  
+/**
+ * Indicate the gain (volume amplification) applied. 
+ * Type:   ALfloat.
+ * Range:  ]0.0-  ]
+ * A value of 1.0 means un-attenuated/unchanged.
+ * Each division by 2 equals an attenuation of -6dB.
+ * Each multiplicaton with 2 equals an amplification of +6dB.
+ * A value of 0.0 is meaningless with respect to a logarithmic
+ *  scale; it is interpreted as zero volume - the channel
+ *  is effectively disabled.
+ */
+#define AL_GAIN                                   0x100A
+
+/*
+ * Indicate minimum source attenuation
+ * Type: ALfloat
+ * Range:  [0.0 - 1.0]
+ *
+ * Logarthmic
+ */
+#define AL_MIN_GAIN                               0x100D
+
+/**
+ * Indicate maximum source attenuation
+ * Type: ALfloat
+ * Range:  [0.0 - 1.0]
+ *
+ * Logarthmic
+ */
+#define AL_MAX_GAIN                               0x100E
+
+/**
+ * Indicate listener orientation.
+ *
+ * at/up 
+ */
+#define AL_ORIENTATION                            0x100F
+
+/**
+ * Source state information.
+ */
+#define AL_SOURCE_STATE                           0x1010
+#define AL_INITIAL                                0x1011
+#define AL_PLAYING                                0x1012
+#define AL_PAUSED                                 0x1013
+#define AL_STOPPED                                0x1014
+
+/**
+ * Buffer Queue params
+ */
+#define AL_BUFFERS_QUEUED                         0x1015
+#define AL_BUFFERS_PROCESSED                      0x1016
+
+/**
+ * Source buffer position information
+ */
+#define AL_SEC_OFFSET                             0x1024
+#define AL_SAMPLE_OFFSET                          0x1025
+#define AL_BYTE_OFFSET                            0x1026
+
+/*
+ * Source type (Static, Streaming or undetermined)
+ * Source is Static if a Buffer has been attached using AL_BUFFER
+ * Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
+ * Source is undetermined when it has the NULL buffer attached
+ */
+#define AL_SOURCE_TYPE                            0x1027
+#define AL_STATIC                                 0x1028
+#define AL_STREAMING                              0x1029
+#define AL_UNDETERMINED                           0x1030
+
+/** Sound samples: format specifier. */
+#define AL_FORMAT_MONO8                           0x1100
+#define AL_FORMAT_MONO16                          0x1101
+#define AL_FORMAT_STEREO8                         0x1102
+#define AL_FORMAT_STEREO16                        0x1103
+
+/**
+ * source specific reference distance
+ * Type: ALfloat
+ * Range:  0.0 - +inf
+ *
+ * At 0.0, no distance attenuation occurs.  Default is
+ * 1.0.
+ */
+#define AL_REFERENCE_DISTANCE                     0x1020
+
+/**
+ * source specific rolloff factor
+ * Type: ALfloat
+ * Range:  0.0 - +inf
+ *
+ */
+#define AL_ROLLOFF_FACTOR                         0x1021
+
+/**
+ * Directional source, outer cone gain.
+ *
+ * Default:  0.0
+ * Range:    [0.0 - 1.0]
+ * Logarithmic
+ */
+#define AL_CONE_OUTER_GAIN                        0x1022
+
+/**
+ * Indicate distance above which sources are not
+ * attenuated using the inverse clamped distance model.
+ *
+ * Default: +inf
+ * Type: ALfloat
+ * Range:  0.0 - +inf
+ */
+#define AL_MAX_DISTANCE                           0x1023
+
+/** 
+ * Sound samples: frequency, in units of Hertz [Hz].
+ * This is the number of samples per second. Half of the
+ *  sample frequency marks the maximum significant
+ *  frequency component.
+ */
+#define AL_FREQUENCY                              0x2001
+#define AL_BITS                                   0x2002
+#define AL_CHANNELS                               0x2003
+#define AL_SIZE                                   0x2004
+
+/**
+ * Buffer state.
+ *
+ * Not supported for public use (yet).
+ */
+#define AL_UNUSED                                 0x2010
+#define AL_PENDING                                0x2011
+#define AL_PROCESSED                              0x2012
+
+
+/** Errors: No Error. */
+#define AL_NO_ERROR                               AL_FALSE
+
+/** 
+ * Invalid Name paramater passed to AL call.
+ */
+#define AL_INVALID_NAME                           0xA001
+
+/** 
+ * Invalid parameter passed to AL call.
+ */
+#define AL_INVALID_ENUM                           0xA002
+
+/** 
+ * Invalid enum parameter value.
+ */
+#define AL_INVALID_VALUE                          0xA003
+
+/** 
+ * Illegal call.
+ */
+#define AL_INVALID_OPERATION                      0xA004
+
+  
+/**
+ * No mojo.
+ */
+#define AL_OUT_OF_MEMORY                          0xA005
+
+
+/** Context strings: Vendor Name. */
+#define AL_VENDOR                                 0xB001
+#define AL_VERSION                                0xB002
+#define AL_RENDERER                               0xB003
+#define AL_EXTENSIONS                             0xB004
+
+/** Global tweakage. */
+
+/**
+ * Doppler scale.  Default 1.0
+ */
+#define AL_DOPPLER_FACTOR                         0xC000
+
+/**
+ * Tweaks speed of propagation.
+ */
+#define AL_DOPPLER_VELOCITY                       0xC001
+
+/**
+ * Speed of Sound in units per second
+ */
+#define AL_SPEED_OF_SOUND                         0xC003
+
+/**
+ * Distance models
+ *
+ * used in conjunction with DistanceModel
+ *
+ * implicit: NONE, which disances distance attenuation.
+ */
+#define AL_DISTANCE_MODEL                         0xD000
+#define AL_INVERSE_DISTANCE                       0xD001
+#define AL_INVERSE_DISTANCE_CLAMPED               0xD002
+#define AL_LINEAR_DISTANCE                        0xD003
+#define AL_LINEAR_DISTANCE_CLAMPED                0xD004
+#define AL_EXPONENT_DISTANCE                      0xD005
+#define AL_EXPONENT_DISTANCE_CLAMPED              0xD006
+
+/*
+ * Renderer State management
+ */
+AL_API void AL_APIENTRY alEnable( ALenum capability );
+
+AL_API void AL_APIENTRY alDisable( ALenum capability ); 
+
+AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability ); 
+
+
+/*
+ * State retrieval
+ */
+AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
+
+AL_API void AL_APIENTRY alGetBooleanv( ALenum param, ALboolean* data );
+
+AL_API void AL_APIENTRY alGetIntegerv( ALenum param, ALint* data );
+
+AL_API void AL_APIENTRY alGetFloatv( ALenum param, ALfloat* data );
+
+AL_API void AL_APIENTRY alGetDoublev( ALenum param, ALdouble* data );
+
+AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param );
+
+AL_API ALint AL_APIENTRY alGetInteger( ALenum param );
+
+AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param );
+
+AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param );
+
+
+/*
+ * Error support.
+ * Obtain the most recent error generated in the AL state machine.
+ */
+AL_API ALenum AL_APIENTRY alGetError( void );
+
+
+/* 
+ * Extension support.
+ * Query for the presence of an extension, and obtain any appropriate
+ * function pointers and enum values.
+ */
+AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
+
+AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname );
+
+AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
+
+
+/*
+ * LISTENER
+ * Listener represents the location and orientation of the
+ * 'user' in 3D-space.
+ *
+ * Properties include: -
+ *
+ * Gain         AL_GAIN         ALfloat
+ * Position     AL_POSITION     ALfloat[3]
+ * Velocity     AL_VELOCITY     ALfloat[3]
+ * Orientation  AL_ORIENTATION  ALfloat[6] (Forward then Up vectors)
+*/
+
+/*
+ * Set Listener parameters
+ */
+AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value );
+
+AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values ); 
+
+AL_API void AL_APIENTRY alListeneri( ALenum param, ALint value );
+
+AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
+
+AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values );
+
+/*
+ * Get Listener parameters
+ */
+AL_API void AL_APIENTRY alGetListenerf( ALenum param, ALfloat* value );
+
+AL_API void AL_APIENTRY alGetListener3f( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
+
+AL_API void AL_APIENTRY alGetListenerfv( ALenum param, ALfloat* values );
+
+AL_API void AL_APIENTRY alGetListeneri( ALenum param, ALint* value );
+
+AL_API void AL_APIENTRY alGetListener3i( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
+
+AL_API void AL_APIENTRY alGetListeneriv( ALenum param, ALint* values );
+
+
+/**
+ * SOURCE
+ * Sources represent individual sound objects in 3D-space.
+ * Sources take the PCM data provided in the specified Buffer,
+ * apply Source-specific modifications, and then
+ * submit them to be mixed according to spatial arrangement etc.
+ * 
+ * Properties include: -
+ *
+ * Gain                              AL_GAIN                 ALfloat
+ * Min Gain                          AL_MIN_GAIN             ALfloat
+ * Max Gain                          AL_MAX_GAIN             ALfloat
+ * Position                          AL_POSITION             ALfloat[3]
+ * Velocity                          AL_VELOCITY             ALfloat[3]
+ * Direction                         AL_DIRECTION            ALfloat[3]
+ * Head Relative Mode                AL_SOURCE_RELATIVE      ALint (AL_TRUE or AL_FALSE)
+ * Reference Distance                AL_REFERENCE_DISTANCE   ALfloat
+ * Max Distance                      AL_MAX_DISTANCE         ALfloat
+ * RollOff Factor                    AL_ROLLOFF_FACTOR       ALfloat
+ * Inner Angle                       AL_CONE_INNER_ANGLE     ALint or ALfloat
+ * Outer Angle                       AL_CONE_OUTER_ANGLE     ALint or ALfloat
+ * Cone Outer Gain                   AL_CONE_OUTER_GAIN      ALint or ALfloat
+ * Pitch                             AL_PITCH                ALfloat
+ * Looping                           AL_LOOPING              ALint (AL_TRUE or AL_FALSE)
+ * MS Offset                         AL_MSEC_OFFSET          ALint or ALfloat
+ * Byte Offset                       AL_BYTE_OFFSET          ALint or ALfloat
+ * Sample Offset                     AL_SAMPLE_OFFSET        ALint or ALfloat
+ * Attached Buffer                   AL_BUFFER               ALint
+ * State (Query only)                AL_SOURCE_STATE         ALint
+ * Buffers Queued (Query only)       AL_BUFFERS_QUEUED       ALint
+ * Buffers Processed (Query only)    AL_BUFFERS_PROCESSED    ALint
+ */
+
+/* Create Source objects */
+AL_API void AL_APIENTRY alGenSources( ALsizei n, ALuint* sources ); 
+
+/* Delete Source objects */
+AL_API void AL_APIENTRY alDeleteSources( ALsizei n, const ALuint* sources );
+
+/* Verify a handle is a valid Source */ 
+AL_API ALboolean AL_APIENTRY alIsSource( ALuint sid ); 
+
+/*
+ * Set Source parameters
+ */
+AL_API void AL_APIENTRY alSourcef( ALuint sid, ALenum param, ALfloat value ); 
+
+AL_API void AL_APIENTRY alSource3f( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+AL_API void AL_APIENTRY alSourcefv( ALuint sid, ALenum param, const ALfloat* values ); 
+
+AL_API void AL_APIENTRY alSourcei( ALuint sid, ALenum param, ALint value ); 
+
+AL_API void AL_APIENTRY alSource3i( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
+
+AL_API void AL_APIENTRY alSourceiv( ALuint sid, ALenum param, const ALint* values );
+
+/*
+ * Get Source parameters
+ */
+AL_API void AL_APIENTRY alGetSourcef( ALuint sid, ALenum param, ALfloat* value );
+
+AL_API void AL_APIENTRY alGetSource3f( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+
+AL_API void AL_APIENTRY alGetSourcefv( ALuint sid, ALenum param, ALfloat* values );
+
+AL_API void AL_APIENTRY alGetSourcei( ALuint sid,  ALenum param, ALint* value );
+
+AL_API void AL_APIENTRY alGetSource3i( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+
+AL_API void AL_APIENTRY alGetSourceiv( ALuint sid,  ALenum param, ALint* values );
+
+
+/*
+ * Source vector based playback calls
+ */
+
+/* Play, replay, or resume (if paused) a list of Sources */
+AL_API void AL_APIENTRY alSourcePlayv( ALsizei ns, const ALuint *sids );
+
+/* Stop a list of Sources */
+AL_API void AL_APIENTRY alSourceStopv( ALsizei ns, const ALuint *sids );
+
+/* Rewind a list of Sources */
+AL_API void AL_APIENTRY alSourceRewindv( ALsizei ns, const ALuint *sids );
+
+/* Pause a list of Sources */
+AL_API void AL_APIENTRY alSourcePausev( ALsizei ns, const ALuint *sids );
+
+/*
+ * Source based playback calls
+ */
+
+/* Play, replay, or resume a Source */
+AL_API void AL_APIENTRY alSourcePlay( ALuint sid );
+
+/* Stop a Source */
+AL_API void AL_APIENTRY alSourceStop( ALuint sid );
+
+/* Rewind a Source (set playback postiton to beginning) */
+AL_API void AL_APIENTRY alSourceRewind( ALuint sid );
+
+/* Pause a Source */
+AL_API void AL_APIENTRY alSourcePause( ALuint sid );
+
+/*
+ * Source Queuing 
+ */
+AL_API void AL_APIENTRY alSourceQueueBuffers( ALuint sid, ALsizei numEntries, const ALuint *bids );
+
+AL_API void AL_APIENTRY alSourceUnqueueBuffers( ALuint sid, ALsizei numEntries, ALuint *bids );
+
+
+/**
+ * BUFFER
+ * Buffer objects are storage space for sample data.
+ * Buffers are referred to by Sources. One Buffer can be used
+ * by multiple Sources.
+ *
+ * Properties include: -
+ *
+ * Frequency (Query only)    AL_FREQUENCY      ALint
+ * Size (Query only)         AL_SIZE           ALint
+ * Bits (Query only)         AL_BITS           ALint
+ * Channels (Query only)     AL_CHANNELS       ALint
+ */
+
+/* Create Buffer objects */
+AL_API void AL_APIENTRY alGenBuffers( ALsizei n, ALuint* buffers );
+
+/* Delete Buffer objects */
+AL_API void AL_APIENTRY alDeleteBuffers( ALsizei n, const ALuint* buffers );
+
+/* Verify a handle is a valid Buffer */
+AL_API ALboolean AL_APIENTRY alIsBuffer( ALuint bid );
+
+/* Specify the data to be copied into a buffer */
+AL_API void AL_APIENTRY alBufferData( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
+
+/*
+ * Set Buffer parameters
+ */
+AL_API void AL_APIENTRY alBufferf( ALuint bid, ALenum param, ALfloat value );
+
+AL_API void AL_APIENTRY alBuffer3f( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+
+AL_API void AL_APIENTRY alBufferfv( ALuint bid, ALenum param, const ALfloat* values );
+
+AL_API void AL_APIENTRY alBufferi( ALuint bid, ALenum param, ALint value );
+
+AL_API void AL_APIENTRY alBuffer3i( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
+
+AL_API void AL_APIENTRY alBufferiv( ALuint bid, ALenum param, const ALint* values );
+
+/*
+ * Get Buffer parameters
+ */
+AL_API void AL_APIENTRY alGetBufferf( ALuint bid, ALenum param, ALfloat* value );
+
+AL_API void AL_APIENTRY alGetBuffer3f( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+
+AL_API void AL_APIENTRY alGetBufferfv( ALuint bid, ALenum param, ALfloat* values );
+
+AL_API void AL_APIENTRY alGetBufferi( ALuint bid, ALenum param, ALint* value );
+
+AL_API void AL_APIENTRY alGetBuffer3i( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+
+AL_API void AL_APIENTRY alGetBufferiv( ALuint bid, ALenum param, ALint* values );
+
+
+/*
+ * Global Parameters
+ */
+AL_API void AL_APIENTRY alDopplerFactor( ALfloat value );
+
+AL_API void AL_APIENTRY alDopplerVelocity( ALfloat value );
+
+AL_API void AL_APIENTRY alSpeedOfSound( ALfloat value );
+
+AL_API void AL_APIENTRY alDistanceModel( ALenum distanceModel );
+
+/*
+ * Pointer-to-function types, useful for dynamically getting AL entry points.
+ */
+typedef void           (AL_APIENTRY *LPALENABLE)( ALenum capability );
+typedef void           (AL_APIENTRY *LPALDISABLE)( ALenum capability ); 
+typedef ALboolean      (AL_APIENTRY *LPALISENABLED)( ALenum capability ); 
+typedef const ALchar*  (AL_APIENTRY *LPALGETSTRING)( ALenum param );
+typedef void           (AL_APIENTRY *LPALGETBOOLEANV)( ALenum param, ALboolean* data );
+typedef void           (AL_APIENTRY *LPALGETINTEGERV)( ALenum param, ALint* data );
+typedef void           (AL_APIENTRY *LPALGETFLOATV)( ALenum param, ALfloat* data );
+typedef void           (AL_APIENTRY *LPALGETDOUBLEV)( ALenum param, ALdouble* data );
+typedef ALboolean      (AL_APIENTRY *LPALGETBOOLEAN)( ALenum param );
+typedef ALint          (AL_APIENTRY *LPALGETINTEGER)( ALenum param );
+typedef ALfloat        (AL_APIENTRY *LPALGETFLOAT)( ALenum param );
+typedef ALdouble       (AL_APIENTRY *LPALGETDOUBLE)( ALenum param );
+typedef ALenum         (AL_APIENTRY *LPALGETERROR)( void );
+typedef ALboolean      (AL_APIENTRY *LPALISEXTENSIONPRESENT)(const ALchar* extname );
+typedef void*          (AL_APIENTRY *LPALGETPROCADDRESS)( const ALchar* fname );
+typedef ALenum         (AL_APIENTRY *LPALGETENUMVALUE)( const ALchar* ename );
+typedef void           (AL_APIENTRY *LPALLISTENERF)( ALenum param, ALfloat value );
+typedef void           (AL_APIENTRY *LPALLISTENER3F)( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+typedef void           (AL_APIENTRY *LPALLISTENERFV)( ALenum param, const ALfloat* values );
+typedef void           (AL_APIENTRY *LPALLISTENERI)( ALenum param, ALint value );
+typedef void           (AL_APIENTRY *LPALLISTENER3I)( ALenum param, ALint value1, ALint value2, ALint value3 );
+typedef void           (AL_APIENTRY *LPALLISTENERIV)( ALenum param, const ALint* values );
+typedef void           (AL_APIENTRY *LPALGETLISTENERF)( ALenum param, ALfloat* value );
+typedef void           (AL_APIENTRY *LPALGETLISTENER3F)( ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3 );
+typedef void           (AL_APIENTRY *LPALGETLISTENERFV)( ALenum param, ALfloat* values );
+typedef void           (AL_APIENTRY *LPALGETLISTENERI)( ALenum param, ALint* value );
+typedef void           (AL_APIENTRY *LPALGETLISTENER3I)( ALenum param, ALint *value1, ALint *value2, ALint *value3 );
+typedef void           (AL_APIENTRY *LPALGETLISTENERIV)( ALenum param, ALint* values );
+typedef void           (AL_APIENTRY *LPALGENSOURCES)( ALsizei n, ALuint* sources ); 
+typedef void           (AL_APIENTRY *LPALDELETESOURCES)( ALsizei n, const ALuint* sources );
+typedef ALboolean      (AL_APIENTRY *LPALISSOURCE)( ALuint sid ); 
+typedef void           (AL_APIENTRY *LPALSOURCEF)( ALuint sid, ALenum param, ALfloat value); 
+typedef void           (AL_APIENTRY *LPALSOURCE3F)( ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+typedef void           (AL_APIENTRY *LPALSOURCEFV)( ALuint sid, ALenum param, const ALfloat* values );
+typedef void           (AL_APIENTRY *LPALSOURCEI)( ALuint sid, ALenum param, ALint value); 
+typedef void           (AL_APIENTRY *LPALSOURCE3I)( ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3 );
+typedef void           (AL_APIENTRY *LPALSOURCEIV)( ALuint sid, ALenum param, const ALint* values );
+typedef void           (AL_APIENTRY *LPALGETSOURCEF)( ALuint sid, ALenum param, ALfloat* value );
+typedef void           (AL_APIENTRY *LPALGETSOURCE3F)( ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+typedef void           (AL_APIENTRY *LPALGETSOURCEFV)( ALuint sid, ALenum param, ALfloat* values );
+typedef void           (AL_APIENTRY *LPALGETSOURCEI)( ALuint sid, ALenum param, ALint* value );
+typedef void           (AL_APIENTRY *LPALGETSOURCE3I)( ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+typedef void           (AL_APIENTRY *LPALGETSOURCEIV)( ALuint sid, ALenum param, ALint* values );
+typedef void           (AL_APIENTRY *LPALSOURCEPLAYV)( ALsizei ns, const ALuint *sids );
+typedef void           (AL_APIENTRY *LPALSOURCESTOPV)( ALsizei ns, const ALuint *sids );
+typedef void           (AL_APIENTRY *LPALSOURCEREWINDV)( ALsizei ns, const ALuint *sids );
+typedef void           (AL_APIENTRY *LPALSOURCEPAUSEV)( ALsizei ns, const ALuint *sids );
+typedef void           (AL_APIENTRY *LPALSOURCEPLAY)( ALuint sid );
+typedef void           (AL_APIENTRY *LPALSOURCESTOP)( ALuint sid );
+typedef void           (AL_APIENTRY *LPALSOURCEREWIND)( ALuint sid );
+typedef void           (AL_APIENTRY *LPALSOURCEPAUSE)( ALuint sid );
+typedef void           (AL_APIENTRY *LPALSOURCEQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, const ALuint *bids );
+typedef void           (AL_APIENTRY *LPALSOURCEUNQUEUEBUFFERS)(ALuint sid, ALsizei numEntries, ALuint *bids );
+typedef void           (AL_APIENTRY *LPALGENBUFFERS)( ALsizei n, ALuint* buffers );
+typedef void           (AL_APIENTRY *LPALDELETEBUFFERS)( ALsizei n, const ALuint* buffers );
+typedef ALboolean      (AL_APIENTRY *LPALISBUFFER)( ALuint bid );
+typedef void           (AL_APIENTRY *LPALBUFFERDATA)( ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq );
+typedef void           (AL_APIENTRY *LPALBUFFERF)( ALuint bid, ALenum param, ALfloat value);
+typedef void           (AL_APIENTRY *LPALBUFFER3F)( ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
+typedef void           (AL_APIENTRY *LPALBUFFERFV)( ALuint bid, ALenum param, const ALfloat* values );
+typedef void           (AL_APIENTRY *LPALBUFFERI)( ALuint bid, ALenum param, ALint value);
+typedef void           (AL_APIENTRY *LPALBUFFER3I)( ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3 );
+typedef void           (AL_APIENTRY *LPALBUFFERIV)( ALuint bid, ALenum param, const ALint* values );
+typedef void           (AL_APIENTRY *LPALGETBUFFERF)( ALuint bid, ALenum param, ALfloat* value );
+typedef void           (AL_APIENTRY *LPALGETBUFFER3F)( ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3);
+typedef void           (AL_APIENTRY *LPALGETBUFFERFV)( ALuint bid, ALenum param, ALfloat* values );
+typedef void           (AL_APIENTRY *LPALGETBUFFERI)( ALuint bid, ALenum param, ALint* value );
+typedef void           (AL_APIENTRY *LPALGETBUFFER3I)( ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3);
+typedef void           (AL_APIENTRY *LPALGETBUFFERIV)( ALuint bid, ALenum param, ALint* values );
+typedef void           (AL_APIENTRY *LPALDOPPLERFACTOR)( ALfloat value );
+typedef void           (AL_APIENTRY *LPALDOPPLERVELOCITY)( ALfloat value );
+typedef void           (AL_APIENTRY *LPALSPEEDOFSOUND)( ALfloat value );
+typedef void           (AL_APIENTRY *LPALDISTANCEMODEL)( ALenum distanceModel );
+
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+ #pragma export off
+#endif
+
+#if defined(__cplusplus)
+}  /* extern "C" */
+#endif
+
+#endif /* AL_AL_H */
Index: /code/branches/audio/src/openal/include/AL/alc.h
===================================================================
--- /code/branches/audio/src/openal/include/AL/alc.h	(revision 310)
+++ /code/branches/audio/src/openal/include/AL/alc.h	(revision 310)
@@ -0,0 +1,275 @@
+#ifndef AL_ALC_H
+#define AL_ALC_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(_XBOX)
+ /* _OPENAL32LIB is deprecated */
+ #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB)
+  #define ALC_API __declspec(dllexport)
+ #else
+  #define ALC_API __declspec(dllimport)
+ #endif
+#else
+ #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
+  #define ALC_API __attribute__((visibility("default")))
+ #else
+  #define ALC_API extern
+ #endif
+#endif
+
+#if defined(_WIN32)
+ #define ALC_APIENTRY __cdecl
+#else
+ #define ALC_APIENTRY
+#endif
+
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+ #pragma export on
+#endif
+
+/*
+ * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are
+ * included for applications porting code from AL 1.0
+ */
+#define ALCAPI ALC_API
+#define ALCAPIENTRY ALC_APIENTRY
+#define ALC_INVALID 0
+
+
+#define ALC_VERSION_0_1         1
+
+typedef struct ALCdevice_struct ALCdevice;
+typedef struct ALCcontext_struct ALCcontext;
+
+
+/** 8-bit boolean */
+typedef char ALCboolean;
+
+/** character */
+typedef char ALCchar;
+
+/** signed 8-bit 2's complement integer */
+typedef char ALCbyte;
+
+/** unsigned 8-bit integer */
+typedef unsigned char ALCubyte;
+
+/** signed 16-bit 2's complement integer */
+typedef short ALCshort;
+
+/** unsigned 16-bit integer */
+typedef unsigned short ALCushort;
+
+/** signed 32-bit 2's complement integer */
+typedef int ALCint;
+
+/** unsigned 32-bit integer */
+typedef unsigned int ALCuint;
+
+/** non-negative 32-bit binary integer size */
+typedef int ALCsizei;
+
+/** enumerated 32-bit value */
+typedef int ALCenum;
+
+/** 32-bit IEEE754 floating-point */
+typedef float ALCfloat;
+
+/** 64-bit IEEE754 floating-point */
+typedef double ALCdouble;
+
+/** void type (for opaque pointers only) */
+typedef void ALCvoid;
+
+
+/* Enumerant values begin at column 50. No tabs. */
+
+/* Boolean False. */
+#define ALC_FALSE                                0
+
+/* Boolean True. */
+#define ALC_TRUE                                 1
+
+/**
+ * followed by <int> Hz
+ */
+#define ALC_FREQUENCY                            0x1007
+
+/**
+ * followed by <int> Hz
+ */
+#define ALC_REFRESH                              0x1008
+
+/**
+ * followed by AL_TRUE, AL_FALSE
+ */
+#define ALC_SYNC                                 0x1009
+
+/**
+ * followed by <int> Num of requested Mono (3D) Sources
+ */
+#define ALC_MONO_SOURCES                         0x1010
+
+/**
+ * followed by <int> Num of requested Stereo Sources
+ */
+#define ALC_STEREO_SOURCES                       0x1011
+
+/**
+ * errors
+ */
+
+/**
+ * No error
+ */
+#define ALC_NO_ERROR                             ALC_FALSE
+
+/**
+ * No device
+ */
+#define ALC_INVALID_DEVICE                       0xA001
+
+/**
+ * invalid context ID
+ */
+#define ALC_INVALID_CONTEXT                      0xA002
+
+/**
+ * bad enum
+ */
+#define ALC_INVALID_ENUM                         0xA003
+
+/**
+ * bad value
+ */
+#define ALC_INVALID_VALUE                        0xA004
+
+/**
+ * Out of memory.
+ */
+#define ALC_OUT_OF_MEMORY                        0xA005
+
+
+/**
+ * The Specifier string for default device
+ */
+#define ALC_DEFAULT_DEVICE_SPECIFIER             0x1004
+#define ALC_DEVICE_SPECIFIER                     0x1005
+#define ALC_EXTENSIONS                           0x1006
+
+#define ALC_MAJOR_VERSION                        0x1000
+#define ALC_MINOR_VERSION                        0x1001
+
+#define ALC_ATTRIBUTES_SIZE                      0x1002
+#define ALC_ALL_ATTRIBUTES                       0x1003
+
+/**
+ * Capture extension
+ */
+#define ALC_CAPTURE_DEVICE_SPECIFIER             0x310
+#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER     0x311
+#define ALC_CAPTURE_SAMPLES                      0x312
+
+
+/*
+ * Context Management
+ */
+ALC_API ALCcontext *    ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
+
+ALC_API ALCboolean      ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
+
+ALC_API void            ALC_APIENTRY alcProcessContext( ALCcontext *context );
+
+ALC_API void            ALC_APIENTRY alcSuspendContext( ALCcontext *context );
+
+ALC_API void            ALC_APIENTRY alcDestroyContext( ALCcontext *context );
+
+ALC_API ALCcontext *    ALC_APIENTRY alcGetCurrentContext( ALCvoid );
+
+ALC_API ALCdevice*      ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
+
+
+/*
+ * Device Management
+ */
+ALC_API ALCdevice *     ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
+
+ALC_API ALCboolean      ALC_APIENTRY alcCloseDevice( ALCdevice *device );
+
+
+/*
+ * Error support.
+ * Obtain the most recent Context error
+ */
+ALC_API ALCenum         ALC_APIENTRY alcGetError( ALCdevice *device );
+
+
+/* 
+ * Extension support.
+ * Query for the presence of an extension, and obtain any appropriate
+ * function pointers and enum values.
+ */
+ALC_API ALCboolean      ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
+
+ALC_API void  *         ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
+
+ALC_API ALCenum         ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
+
+
+/*
+ * Query functions
+ */
+ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
+
+ALC_API void            ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
+
+
+/*
+ * Capture functions
+ */
+ALC_API ALCdevice*      ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
+
+ALC_API ALCboolean      ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
+
+ALC_API void            ALC_APIENTRY alcCaptureStart( ALCdevice *device );
+
+ALC_API void            ALC_APIENTRY alcCaptureStop( ALCdevice *device );
+
+ALC_API void            ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
+
+/*
+ * Pointer-to-function types, useful for dynamically getting ALC entry points.
+ */
+typedef ALCcontext *   (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
+typedef ALCboolean     (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
+typedef void           (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
+typedef void           (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
+typedef void           (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
+typedef ALCcontext *   (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( ALCvoid );
+typedef ALCdevice *    (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
+typedef ALCdevice *    (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
+typedef ALCboolean     (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
+typedef ALCenum        (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
+typedef ALCboolean     (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
+typedef void *         (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
+typedef ALCenum        (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
+typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
+typedef void           (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
+typedef ALCdevice *    (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
+typedef ALCboolean     (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
+typedef void           (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
+typedef void           (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
+typedef void           (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
+
+#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
+ #pragma export off
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* AL_ALC_H */
Index: /code/branches/audio/src/openal/include/AL/alext.h
===================================================================
--- /code/branches/audio/src/openal/include/AL/alext.h	(revision 310)
+++ /code/branches/audio/src/openal/include/AL/alext.h	(revision 310)
@@ -0,0 +1,164 @@
+#ifndef _AL_ALEXT_H
+#define _AL_ALEXT_H
+
+#include <AL/al.h>
+#include <AL/alc.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* format base 0x10000 */
+#define AL_FORMAT_IMA_ADPCM_MONO16_EXT            0x10000
+#define AL_FORMAT_IMA_ADPCM_STEREO16_EXT          0x10001
+#define AL_FORMAT_WAVE_EXT                        0x10002
+#define AL_FORMAT_VORBIS_EXT                      0x10003
+
+/* four point formats */
+#define AL_FORMAT_QUAD8_LOKI                      0x10004
+#define AL_FORMAT_QUAD16_LOKI                     0x10005
+
+/**
+ * token extensions, base 0x20000
+ */
+
+/* deprecated, use AL_GAIN */
+#define AL_GAIN_LINEAR_LOKI                      0x20000
+
+/*
+ * types for special loaders.  This should be deprecated in favor
+ * of the special format tags.
+ */
+
+typedef struct WaveFMT {
+	ALushort encoding;
+	ALushort channels;	/* 1 = mono, 2 = stereo */
+	ALuint frequency;	/* One of 11025, 22050, or 44100 Hz */
+	ALuint byterate;	/* Average bytes per second */
+	ALushort blockalign;	/* Bytes per sample block */
+	ALushort bitspersample;
+} alWaveFMT_LOKI;
+
+typedef struct _MS_ADPCM_decodestate {
+	ALubyte hPredictor;
+	ALushort iDelta;
+	ALshort iSamp1;
+	ALshort iSamp2;
+} alMSADPCM_decodestate_LOKI;
+
+typedef struct MS_ADPCM_decoder {
+	alWaveFMT_LOKI wavefmt;
+	ALushort wSamplesPerBlock;
+	ALushort wNumCoef;
+	ALshort aCoeff[7][2];
+	/* * * */
+	alMSADPCM_decodestate_LOKI state[2];
+} alMSADPCM_state_LOKI;
+
+typedef struct IMA_ADPCM_decodestate_s {
+	ALint valprev;		/* Previous output value */
+	ALbyte index;		/* Index into stepsize table */
+} alIMAADPCM_decodestate_LOKI;
+
+typedef struct IMA_ADPCM_decoder {
+	alWaveFMT_LOKI wavefmt;
+	ALushort wSamplesPerBlock;
+	/* * * */
+	alIMAADPCM_decodestate_LOKI state[2];
+} alIMAADPCM_state_LOKI;
+
+/**
+ * Context creation extension tokens
+ * base 0x200000
+ */
+
+/**
+ * followed by ### of sources
+ */
+#define ALC_SOURCES_LOKI                         0x200000
+
+/**
+ * followed by ### of buffers
+ */
+#define ALC_BUFFERS_LOKI                         0x200001
+
+/*
+ *  Channel operations are probably a big no-no and destined
+ *  for obsolesence.
+ *
+ *  base 0x300000
+ */
+#define	ALC_CHAN_MAIN_LOKI                       0x300000
+#define	ALC_CHAN_PCM_LOKI                        0x300001
+#define	ALC_CHAN_CD_LOKI                         0x300002
+
+/* loki */
+
+ALC_API ALfloat  ALC_APIENTRY alcGetAudioChannel_LOKI( ALuint channel );
+ALC_API void     ALC_APIENTRY alcSetAudioChannel_LOKI( ALuint channel, ALfloat volume );
+AL_API  void     AL_APIENTRY  alBombOnError_LOKI( void );
+AL_API  void     AL_APIENTRY  alBufferi_LOKI( ALuint bid, ALenum param, ALint value );
+AL_API  void     AL_APIENTRY  alBufferDataWithCallback_LOKI( ALuint bid, int ( *Callback ) ( ALuint, ALuint, ALshort *, ALenum, ALint, ALint ) );
+AL_API  void     AL_APIENTRY  alBufferWriteData_LOKI( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
+AL_API  void     AL_APIENTRY  alGenStreamingBuffers_LOKI( ALsizei n, ALuint *samples );
+AL_API  ALsizei  AL_APIENTRY  alBufferAppendData_LOKI( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq );
+AL_API  ALsizei  AL_APIENTRY  alBufferAppendWriteData_LOKI( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
+
+/* binary compatibility */
+AL_API  ALsizei  AL_APIENTRY alBufferAppendData( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq );
+
+/*
+ * Don't use these.  If you're reading this, you should remove these functions
+ * and all other reverb functions.  Now.
+ */
+AL_API void AL_APIENTRY alReverbScale_LOKI(ALuint sid, ALfloat param);
+AL_API void AL_APIENTRY alReverbDelay_LOKI(ALuint sid, ALfloat param);
+
+/* Capture api */
+
+ALC_API ALboolean ALC_APIENTRY alCaptureInit_EXT( ALenum format, ALuint rate, ALsizei bufferSize );
+ALC_API ALboolean ALC_APIENTRY alCaptureDestroy_EXT( void );
+ALC_API ALboolean ALC_APIENTRY alCaptureStart_EXT( void );
+ALC_API ALboolean ALC_APIENTRY alCaptureStop_EXT( void );
+
+/* Non-blocking device read */
+
+ALC_API ALsizei   ALC_APIENTRY alCaptureGetData_EXT( ALvoid *data, ALsizei n, ALenum format, ALuint rate );
+
+/* custom loaders */
+
+AL_API ALboolean AL_APIENTRY alutLoadVorbis_LOKI( ALuint bid, const ALvoid *data, ALint size );
+AL_API ALboolean AL_APIENTRY alutLoadMP3_LOKI( ALuint bid, ALvoid *data, ALint size );
+
+/* function pointers */
+
+typedef ALfloat   ( ALC_APIENTRY *PFNALCGETAUDIOCHANNELPROC ) ( ALuint channel );
+typedef void      ( ALC_APIENTRY *PFNALCSETAUDIOCHANNELPROC ) ( ALuint channel, ALfloat volume );
+typedef void      ( AL_APIENTRY *PFNALBOMBONERRORPROC ) ( void );
+typedef void      ( AL_APIENTRY *PFNALBUFFERIPROC ) ( ALuint bid, ALenum param, ALint value );
+typedef void      ( AL_APIENTRY *PFNALBUFFERDATAWITHCALLBACKPROC ) ( ALuint bid, int ( *Callback ) ( ALuint, ALuint, ALshort *, ALenum, ALint, ALint ) );
+typedef void      ( AL_APIENTRY *PFNALBUFFERWRITEDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
+typedef void      ( AL_APIENTRY *PFNALGENSTREAMINGBUFFERSPROC ) ( ALsizei n, ALuint *samples );
+typedef ALsizei   ( AL_APIENTRY *PFNALBUFFERAPPENDDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq );
+typedef ALsizei   ( AL_APIENTRY *PFNALBUFFERAPPENDWRITEDATAPROC ) ( ALuint buffer, ALenum format, ALvoid *data, ALsizei size, ALsizei freq, ALenum internalFormat );
+
+typedef ALboolean ( ALC_APIENTRY *PFNALCAPTUREINITPROC ) ( ALenum format, ALuint rate, ALsizei bufferSize );
+typedef ALboolean ( ALC_APIENTRY *PFNALCAPTUREDESTROYPROC ) ( void );
+typedef ALboolean ( ALC_APIENTRY *PFNALCAPTURESTARTPROC ) ( void );
+typedef ALboolean ( ALC_APIENTRY *PFNALCAPTURESTOPPROC ) ( void );
+
+typedef ALsizei   ( ALC_APIENTRY *PFNALCAPTUREGETDATAPROC ) ( ALvoid *data, ALsizei n, ALenum format, ALuint rate );
+
+typedef ALboolean ( AL_APIENTRY *PFNALUTLOADVORBISPROC ) ( ALuint bid, ALvoid *data, ALint size );
+typedef ALboolean ( AL_APIENTRY *PFNALUTLOADRAW_ADPCMDATAPROC ) ( ALuint bid, ALvoid *data, ALuint size, ALuint freq, ALenum format );
+typedef ALboolean ( AL_APIENTRY *ALUTLOADIMA_ADPCMDATAPROC ) ( ALuint bid, ALvoid *data, ALuint size, alIMAADPCM_state_LOKI *ias );
+typedef ALboolean ( AL_APIENTRY *ALUTLOADMS_ADPCMDATAPROC ) ( ALuint bid, void *data, int size, alMSADPCM_state_LOKI *mss );
+
+typedef void      ( AL_APIENTRY *PFNALREVERBSCALEPROC ) ( ALuint sid, ALfloat param );
+typedef void      ( AL_APIENTRY *PFNALREVERBDELAYPROC ) ( ALuint sid, ALfloat param );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif				/* _AL_ALEXT_H */
Index: /code/branches/audio/src/openal/include/AL/alut.h
===================================================================
--- /code/branches/audio/src/openal/include/AL/alut.h	(revision 310)
+++ /code/branches/audio/src/openal/include/AL/alut.h	(revision 310)
@@ -0,0 +1,126 @@
+#if !defined(AL_ALUT_H)
+#define AL_ALUT_H
+
+#if defined(_MSC_VER)
+#include <alc.h>
+#include <al.h>
+#elif defined(__APPLE__)
+#include <OpenAL/alc.h>
+#include <OpenAL/al.h>
+#else
+#include <AL/al.h>
+#include <AL/alc.h>
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if defined(_WIN32) && !defined(_XBOX)
+ #if defined (ALUT_BUILD_LIBRARY)
+  #define ALUT_API __declspec(dllexport)
+ #else
+  #define ALUT_API __declspec(dllimport)
+ #endif
+#else
+ #if defined(ALUT_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
+  #define ALUT_API __attribute__((visibility("default")))
+ #else
+  #define ALUT_API extern
+ #endif
+#endif
+
+#if defined(_WIN32)
+ #define ALUT_APIENTRY __cdecl
+#else
+ #define ALUT_APIENTRY
+#endif
+
+#if defined(__MWERKS_)
+ #pragma export on
+#endif
+
+/* Flag deprecated functions if possible (VisualC++ .NET and GCC >= 3.1.1). */
+#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(MIDL_PASS)
+#define ALUT_ATTRIBUTE_DEPRECATED __declspec(deprecated)
+#elif defined(__GNUC__) &&  (__GNUC__ > 3 || (__GNUC__ == 3 && (__GNUC_MINOR__ > 1 || (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 1))))
+#define ALUT_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
+#else
+#define ALUT_ATTRIBUTE_DEPRECATED
+#endif
+
+#define ALUT_API_MAJOR_VERSION                 1
+#define ALUT_API_MINOR_VERSION                 1
+
+#define ALUT_ERROR_NO_ERROR                    0
+#define ALUT_ERROR_OUT_OF_MEMORY               0x200
+#define ALUT_ERROR_INVALID_ENUM                0x201
+#define ALUT_ERROR_INVALID_VALUE               0x202
+#define ALUT_ERROR_INVALID_OPERATION           0x203
+#define ALUT_ERROR_NO_CURRENT_CONTEXT          0x204
+#define ALUT_ERROR_AL_ERROR_ON_ENTRY           0x205
+#define ALUT_ERROR_ALC_ERROR_ON_ENTRY          0x206
+#define ALUT_ERROR_OPEN_DEVICE                 0x207
+#define ALUT_ERROR_CLOSE_DEVICE                0x208
+#define ALUT_ERROR_CREATE_CONTEXT              0x209
+#define ALUT_ERROR_MAKE_CONTEXT_CURRENT        0x20A
+#define ALUT_ERROR_DESTROY_CONTEXT             0x20B
+#define ALUT_ERROR_GEN_BUFFERS                 0x20C
+#define ALUT_ERROR_BUFFER_DATA                 0x20D
+#define ALUT_ERROR_IO_ERROR                    0x20E
+#define ALUT_ERROR_UNSUPPORTED_FILE_TYPE       0x20F
+#define ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE    0x210
+#define ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA   0x211
+
+#define ALUT_WAVEFORM_SINE                     0x100
+#define ALUT_WAVEFORM_SQUARE                   0x101
+#define ALUT_WAVEFORM_SAWTOOTH                 0x102
+#define ALUT_WAVEFORM_WHITENOISE               0x103
+#define ALUT_WAVEFORM_IMPULSE                  0x104
+
+#define ALUT_LOADER_BUFFER                     0x300
+#define ALUT_LOADER_MEMORY                     0x301
+
+ALUT_API ALboolean ALUT_APIENTRY alutInit (int *argcp, char **argv);
+ALUT_API ALboolean ALUT_APIENTRY alutInitWithoutContext (int *argcp, char **argv);
+ALUT_API ALboolean ALUT_APIENTRY alutExit (void);
+
+ALUT_API ALenum ALUT_APIENTRY alutGetError (void);
+ALUT_API const char *ALUT_APIENTRY alutGetErrorString (ALenum error);
+
+ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFile (const char *fileName);
+ALUT_API ALuint ALUT_APIENTRY alutCreateBufferFromFileImage (const ALvoid *data, ALsizei length);
+ALUT_API ALuint ALUT_APIENTRY alutCreateBufferHelloWorld (void);
+ALUT_API ALuint ALUT_APIENTRY alutCreateBufferWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration);
+
+ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFile (const char *fileName, ALenum *format, ALsizei *size, ALfloat *frequency);
+ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryFromFileImage (const ALvoid *data, ALsizei length, ALenum *format, ALsizei *size, ALfloat *frequency);
+ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryHelloWorld (ALenum *format, ALsizei *size, ALfloat *frequency);
+ALUT_API ALvoid *ALUT_APIENTRY alutLoadMemoryWaveform (ALenum waveshape, ALfloat frequency, ALfloat phase, ALfloat duration, ALenum *format, ALsizei *size, ALfloat *freq);
+
+ALUT_API const char *ALUT_APIENTRY alutGetMIMETypes (ALenum loader);
+
+ALUT_API ALint ALUT_APIENTRY alutGetMajorVersion (void);
+ALUT_API ALint ALUT_APIENTRY alutGetMinorVersion (void);
+
+ALUT_API ALboolean ALUT_APIENTRY alutSleep (ALfloat duration);
+
+/* Nasty Compatibility stuff, WARNING: THESE FUNCTIONS ARE STRONGLY DEPRECATED */
+#if defined(__APPLE__)
+ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency);
+ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency);
+#else
+ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop);
+ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutLoadWAVMemory (ALbyte *buffer, ALenum *format, void **data, ALsizei *size, ALsizei *frequency, ALboolean *loop);
+#endif
+ALUT_API ALUT_ATTRIBUTE_DEPRECATED void ALUT_APIENTRY alutUnloadWAV (ALenum format, ALvoid *data, ALsizei size, ALsizei frequency);
+
+#if defined(__MWERKS_)
+ #pragma export off
+#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
Index: /code/branches/audio/src/openal/include/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/openal/include/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/openal/include/CMakeLists.txt	(revision 310)
@@ -0,0 +1,6 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES Client.cc ConnectionManager.cc PacketBuffer.cc PacketGenerator.cc Synchronisable.cc dummyclient2.cc ClientConnection.cc GameStateManager.cc PacketDecoder.cc Server.cc dummyclient.cc dummyserver.cc)
+SET(INC_FILES Client.h ClientConnection.h ConnectionManager.h GameStateManager.h PacketBuffer.h PacketManager.h Server.h Synchronisable.h)
+
+ADD_LIBRARY(network ${SRC_FILES} ${INC_FILES})
Index: /code/branches/audio/src/openal/lib/libalut.so.0
===================================================================
--- /code/branches/audio/src/openal/lib/libalut.so.0	(revision 310)
+++ /code/branches/audio/src/openal/lib/libalut.so.0	(revision 310)
@@ -0,0 +1,1 @@
+link libalut.so.0.1.0
Index: /code/branches/audio/src/openal/lib/libopenal.so.0
===================================================================
--- /code/branches/audio/src/openal/lib/libopenal.so.0	(revision 310)
+++ /code/branches/audio/src/openal/lib/libopenal.so.0	(revision 310)
@@ -0,0 +1,1 @@
+link libopenal.so.0.0.0
Index: /code/branches/audio/src/orxonox.h
===================================================================
--- /code/branches/audio/src/orxonox.h	(revision 310)
+++ /code/branches/audio/src/orxonox.h	(revision 310)
@@ -0,0 +1,59 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_H
+#define ORXONOX_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+namespace orxonox {
+
+  class Orxonox
+  {
+  public:
+    Orxonox();
+    virtual ~Orxonox();
+	  virtual void go();
+
+  protected:
+	  virtual bool setup(void);
+
+	  virtual void destroy(void);
+
+  protected:
+	  OgreControl *ogre_;
+	  RunManager  *runMgr_;
+	  Ogre::Timer *timer_;
+
+  };
+
+}
+
+#endif /* ORXONOX_H */
Index: /code/branches/audio/src/orxonox/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/orxonox/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/orxonox/CMakeLists.txt	(revision 310)
@@ -0,0 +1,15 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES orxonox.cc)
+SET(INC_FILES)
+
+ADD_EXECUTABLE(../../bin/main ${SRC_FILES} ${INC_FILES})
+
+TARGET_LINK_LIBRARIES(../../bin/main ${OGRE_LIBRARIES} ${OIS_LIBRARIES} loader )
+
+INCLUDE_DIRECTORIES(..)
+
+ADD_SUBDIRECTORY(core)
+ADD_SUBDIRECTORY(objects)
+ADD_SUBDIRECTORY(hud)
+ADD_SUBDIRECTORY(weapon)
Index: /code/branches/audio/src/orxonox/core/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/orxonox/core/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/orxonox/core/CMakeLists.txt	(revision 310)
@@ -0,0 +1,6 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES IdentifierList.cc Identifier.cc MetaObjectList.cc Factory.cc OrxonoxClass.cc)
+SET(INC_FILES IdentifierIncludes.h Identifier.h Factory.h ClassFactory.h IdentifierList.h ObjectList.h MetaObjectList.h Iterator.h OrxonoxClass.h)
+
+ADD_LIBRARY(core ${SRC_FILES} ${INC_FILES})
Index: /code/branches/audio/src/orxonox/core/ClassFactory.h
===================================================================
--- /code/branches/audio/src/orxonox/core/ClassFactory.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/ClassFactory.h	(revision 310)
@@ -0,0 +1,55 @@
+#ifndef _ClassFactory_H__
+#define _ClassFactory_H__
+
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###      ClassFactory       ###
+    // ###############################
+    template <class T>
+    class ClassFactory : public BaseFactory
+    {
+        public:
+            static bool create();
+            BaseObject* fabricate();
+
+        private:
+            ClassFactory() {}
+            ClassFactory(const ClassFactory& factory) {}
+            ~ClassFactory() {}
+
+            static T* createNewObject();
+    };
+
+    template <class T>
+    bool ClassFactory<T>::create()
+    {
+        ClassIdentifier<T>::getIdentifier()->addFactory(new ClassFactory<T>);
+
+        ClassIdentifier<T>::getIdentifier()->startCreatingHierarchy();
+#if HIERARCHY_VERBOSE
+        std::cout << "*** Create Factory -> Create Class\n";
+#endif
+        BaseObject* temp = ClassIdentifier<T>::getIdentifier()->fabricate();
+        delete temp;
+        ClassIdentifier<T>::getIdentifier()->stopCreatingHierarchy();
+
+        return true;
+    }
+
+    template <class T>
+    BaseObject* ClassFactory<T>::fabricate()
+    {
+        return ClassFactory<T>::createNewObject();
+    }
+
+    template <class T>
+    T* ClassFactory<T>::createNewObject()
+    {
+        return new T;
+    }
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/core/Factory.cc
===================================================================
--- /code/branches/audio/src/orxonox/core/Factory.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/core/Factory.cc	(revision 310)
@@ -0,0 +1,23 @@
+#include "Factory.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    Factory* Factory::pointer_s = NULL;
+
+    Identifier* Factory::getIdentifier(const std::string& name)
+    {
+        if (!pointer_s)
+            pointer_s = new Factory;
+
+        return pointer_s->identifierMap_[name];
+    }
+
+    void Factory::add(const std::string& name, Identifier* identifier)
+    {
+        if (!pointer_s)
+            pointer_s = new Factory;
+
+        pointer_s->identifierMap_[name] = identifier;
+    }
+}
Index: /code/branches/audio/src/orxonox/core/Factory.h
===================================================================
--- /code/branches/audio/src/orxonox/core/Factory.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/Factory.h	(revision 310)
@@ -0,0 +1,40 @@
+#ifndef _Factory_H__
+#define _Factory_H__
+
+#include <map>
+#include <string>
+
+namespace orxonox
+{
+    class BaseObject;
+    class Identifier;
+
+    // ###############################
+    // ###         Factory         ###
+    // ###############################
+    class Factory
+    {
+        public:
+            static Identifier* getIdentifier(const std::string& name);
+            static void add(const std::string& name, Identifier* identifier);
+
+        private:
+            Factory() {}
+            Factory(const Factory& factory) {}
+            ~Factory() {}
+
+            static Factory* pointer_s;
+            std::map<std::string, Identifier*> identifierMap_;
+    };
+
+    // ###############################
+    // ###       BaseFactory       ###
+    // ###############################
+    class BaseFactory
+    {
+        public:
+            virtual BaseObject* fabricate() = 0;
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/core/Identifier.cc
===================================================================
--- /code/branches/audio/src/orxonox/core/Identifier.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/core/Identifier.cc	(revision 310)
@@ -0,0 +1,78 @@
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
+    int Identifier::hierarchyCreatingCounter_s = 0;
+
+    Identifier::Identifier()
+    {
+        this->bCreatedOneObject_ = false;
+        this->factory_ = 0;
+
+        this->children_ = new IdentifierList;
+    }
+
+    Identifier::~Identifier()
+    {
+        delete &this->name_;
+
+        delete this->children_;
+    }
+
+    void Identifier::initialize(const IdentifierList* parents)
+    {
+#if HIERARCHY_VERBOSE
+        std::cout << "*** Initialize " << this->name_ << "-Singleton.\n";
+#endif
+        this->bCreatedOneObject_ = true;
+
+        if (parents)
+        {
+            IdentifierListElement* temp1 = parents->first_;
+            while (temp1)
+            {
+                this->parents_.add(temp1->identifier_);
+                temp1->identifier_->getChildren().add(this);
+
+                temp1 = temp1->next_;
+            }
+        }
+    }
+
+    BaseObject* Identifier::fabricate()
+    {
+        if (this->factory_)
+        {
+            return this->factory_->fabricate();
+        }
+        else
+        {
+            std::cout << "Error: Cannot create an object of type '" << this->name_ << "'. Class is abstract.\n";
+            std::cout << "Aborting...";
+            abort();
+        }
+    }
+
+    bool Identifier::isA(const Identifier* identifier) const
+    {
+        return (identifier == this || this->parents_.isInList(identifier));
+    }
+
+    bool Identifier::isDirectlyA(const Identifier* identifier) const
+    {
+        return (identifier == this);
+    }
+
+    bool Identifier::isChildOf(const Identifier* identifier) const
+    {
+        return this->parents_.isInList(identifier);
+    }
+
+    bool Identifier::isParentOf(const Identifier* identifier) const
+    {
+        return this->children_->isInList(identifier);
+    }
+}
Index: /code/branches/audio/src/orxonox/core/Identifier.h
===================================================================
--- /code/branches/audio/src/orxonox/core/Identifier.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/Identifier.h	(revision 310)
@@ -0,0 +1,249 @@
+#ifndef _Identifier_H__
+#define _Identifier_H__
+
+#include <iostream>
+
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "Factory.h"
+
+#define HIERARCHY_VERBOSE false
+
+
+namespace orxonox
+{
+    class BaseObject;
+
+    // ###############################
+    // ###       Identifier        ###
+    // ###############################
+    class Identifier
+    {
+        template <class T>
+        friend class ClassIdentifier;
+
+        template <class T>
+        friend class SubclassIdentifier;
+
+        template <class T>
+        friend class ClassFactory;
+
+        public:
+            inline void addFactory(BaseFactory* factory) { this->factory_ = factory; }
+            BaseObject* fabricate();
+
+            bool isA(const Identifier* identifier) const;
+            bool isDirectlyA(const Identifier* identifier) const;
+            bool isChildOf(const Identifier* identifier) const;
+            bool isParentOf(const Identifier* identifier) const;
+
+            inline const std::string& getName() const { return this->name_; }
+            inline const IdentifierList& getParents() const { return this->parents_; }
+            inline IdentifierList& getChildren() const { return *this->children_; }
+
+            inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); }
+
+        private:
+            Identifier();
+            Identifier(const Identifier& identifier) {}
+            virtual ~Identifier();
+            void initialize(const IdentifierList* parents);
+
+            inline static void startCreatingHierarchy()
+            {
+                hierarchyCreatingCounter_s++;
+#if HIERARCHY_VERBOSE
+                std::cout << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";
+#endif
+            }
+
+            inline static void stopCreatingHierarchy()
+            {
+                hierarchyCreatingCounter_s--;
+#if HIERARCHY_VERBOSE
+                std::cout << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n";
+#endif
+            }
+
+            IdentifierList parents_;
+            IdentifierList* children_;
+
+            std::string name_;
+
+            BaseFactory* factory_;
+            bool bCreatedOneObject_;
+            static int hierarchyCreatingCounter_s;
+    };
+
+
+    // ###############################
+    // ###     ClassIdentifier     ###
+    // ###############################
+    template <class T>
+    class ClassIdentifier : public Identifier
+    {
+        public:
+            static ClassIdentifier<T>* registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass);
+            static ClassIdentifier<T>* getIdentifier();
+            static void addObject(T* object);
+
+        private:
+            ClassIdentifier();
+            ClassIdentifier(const ClassIdentifier<T>& identifier) {}
+            ~ClassIdentifier();
+
+            static ClassIdentifier<T>* pointer_s;
+            ObjectList<T>* objects_;
+    };
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::pointer_s = NULL;
+
+    template <class T>
+    ClassIdentifier<T>::ClassIdentifier()
+    {
+        this->objects_ = new ObjectList<T>;
+    }
+
+    template <class T>
+    ClassIdentifier<T>::~ClassIdentifier()
+    {
+        delete this->objects_;
+        this->pointer_s = NULL;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass)
+    {
+#if HIERARCHY_VERBOSE
+        std::cout << "*** Register Class in " << name << "-Singleton.\n";
+#endif
+        if (!pointer_s)
+        {
+#if HIERARCHY_VERBOSE
+            std::cout << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n";
+#endif
+            pointer_s = new ClassIdentifier();
+        }
+
+        if (!pointer_s->bCreatedOneObject_)
+        {
+#if HIERARCHY_VERBOSE
+            std::cout << "*** Register Class in " << name << "-Singleton -> Initialize Singleton.\n";
+#endif
+            pointer_s->name_ = name;
+            Factory::add(name, pointer_s);
+
+            if (bRootClass)
+                pointer_s->initialize(NULL);
+            else
+                pointer_s->initialize(parents);
+        }
+
+        return pointer_s;
+    }
+
+    template <class T>
+    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
+    {
+        if (!pointer_s)
+        {
+#if HIERARCHY_VERBOSE
+            std::cout << "*** Create Singleton.\n";
+#endif
+            pointer_s = new ClassIdentifier();
+        }
+
+        return pointer_s;
+    }
+
+    template <class T>
+    void ClassIdentifier<T>::addObject(T* object)
+    {
+#if HIERARCHY_VERBOSE
+        std::cout << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n";
+#endif
+        object->getMetaList()->add(ClassIdentifier<T>::getIdentifier()->objects_, ClassIdentifier<T>::getIdentifier()->objects_->add(object));
+    }
+
+
+    // ###############################
+    // ###   SubclassIdentifier    ###
+    // ###############################
+    template <class B>
+    class SubclassIdentifier
+    {
+        public:
+            SubclassIdentifier();
+
+            SubclassIdentifier<B>& operator=(Identifier* identifier)
+            {
+                if (!identifier->isA(ClassIdentifier<B>::getIdentifier()))
+                {
+                    std::cout << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<B>::getIdentifier()->getName() << "!\n";
+                    std::cout << "Error: SubclassIdentifier<" << ClassIdentifier<B>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";
+                    std::cout << "Aborting...\n";
+                    abort();
+                }
+                this->identifier_ = identifier;
+                return *this;
+            }
+
+            Identifier* operator*()
+            {
+                return this->identifier_;
+            }
+
+            Identifier* operator->() const
+            {
+                return this->identifier_;
+            }
+
+            B* fabricate()
+            {
+                BaseObject* newObject = this->identifier_->fabricate();
+                if (newObject)
+                {
+                    return dynamic_cast<B*>(newObject);
+                }
+                else
+                {
+                    if (this->identifier_)
+                    {
+                        std::cout << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<B>::getIdentifier()->getName() << "!\n";
+                        std::cout << "Error: Couldn't fabricate a new Object.\n";
+                        std::cout << "Aborting...\n";
+                    }
+                    else
+                    {
+                        std::cout << "Error: Couldn't fabricate a new Object - Identifier is undefined.\n";
+                        std::cout << "Aborting...\n";
+                    }
+
+                    abort();
+                }
+            }
+
+            inline const Identifier* getIdentifier() const
+                { return this->identifier_; }
+            inline bool isA(const Identifier* identifier) const
+                { return this->identifier_->isA(identifier); }
+            inline bool isDirectlyA(const Identifier* identifier) const
+                { return this->identifier_->isDirectlyA(identifier); }
+            inline bool isChildOf(const Identifier* identifier) const
+                { return this->identifier_->isChildOf(identifier); }
+            inline bool isParentOf(const Identifier* identifier) const
+                { return this->identifier_->isParentOf(identifier); }
+
+        private:
+            Identifier* identifier_;
+    };
+
+    template <class B>
+    SubclassIdentifier<B>::SubclassIdentifier()
+    {
+        this->identifier_ = ClassIdentifier<B>::getIdentifier();
+    }
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/core/IdentifierIncludes.h
===================================================================
--- /code/branches/audio/src/orxonox/core/IdentifierIncludes.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/IdentifierIncludes.h	(revision 310)
@@ -0,0 +1,44 @@
+#include "Identifier.h"
+#include "Factory.h"
+#include "ClassFactory.h"
+#include "Iterator.h"
+#include "OrxonoxClass.h"
+
+
+#define InternRegisterObject(ClassName, bRootClass) \
+    this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, bRootClass)); \
+    if (Identifier::isCreatingHierarchy() && this->getParents()) \
+        this->getParents()->add(this->getIdentifier()); \
+    ClassIdentifier<ClassName>::addObject(this)
+
+#define InternRegisterRootObject(ClassName) \
+    if (Identifier::isCreatingHierarchy() && !this->getParents()) \
+        this->setParents(new IdentifierList()); \
+    InternRegisterObject(ClassName, true)
+
+#if HIERARCHY_VERBOSE
+#define RegisterObject(ClassName) \
+    std::cout << "*** Register Object: " << #ClassName << "\n"; \
+    InternRegisterObject(ClassName, false)
+#else
+#define RegisterObject(ClassName) \
+    InternRegisterObject(ClassName, false)
+#endif
+
+#if HIERARCHY_VERBOSE
+#define RegisterRootObject(ClassName) \
+    std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \
+    InternRegisterRootObject(ClassName)
+#else
+#define RegisterRootObject(ClassName) \
+    InternRegisterRootObject(ClassName)
+#endif
+
+#define Class(ClassName) \
+    ClassIdentifier<ClassName>::getIdentifier()
+
+#define CreateFactory(ClassName) \
+    bool bCreated##ClassName##Factory = ClassFactory<ClassName>::create()
+
+#define ID(Name) \
+    Factory::getIdentifier(Name)
Index: /code/branches/audio/src/orxonox/core/IdentifierList.cc
===================================================================
--- /code/branches/audio/src/orxonox/core/IdentifierList.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/core/IdentifierList.cc	(revision 310)
@@ -0,0 +1,105 @@
+#include "IdentifierList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    // ###############################
+    // ###     IdentifierList      ###
+    // ###############################
+    IdentifierList::IdentifierList()
+    {
+        this->first_ = 0;
+    }
+
+    IdentifierList::~IdentifierList()
+    {
+        IdentifierListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    void IdentifierList::add(const Identifier* identifier)
+    {
+        IdentifierListElement* temp = this->first_;
+        this->first_ = new IdentifierListElement(identifier);
+        this->first_->next_ = temp;
+    }
+
+    void IdentifierList::remove(const Identifier* identifier)
+    {
+        if (!identifier)
+            return;
+
+        if (this->first_->identifier_ == identifier)
+        {
+            IdentifierListElement* temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+
+            return;
+        }
+
+        IdentifierListElement* temp = this->first_;
+        while (temp->next_)
+        {
+            if (temp->next_->identifier_ == identifier)
+            {
+                IdentifierListElement* temp2 = temp->next_->next_;
+                delete temp->next_;
+                temp->next_ = temp2;
+
+                return;
+            }
+
+            temp = temp->next_;
+        }
+    }
+
+    bool IdentifierList::isInList(const Identifier* identifier) const
+    {
+        IdentifierListElement* temp = this->first_;
+        while (temp)
+        {
+            if (temp->identifier_ == identifier)
+                return true;
+
+            temp = temp->next_;
+        }
+
+        return false;
+    }
+
+    std::string IdentifierList::toString() const
+    {
+        IdentifierListElement* temp = this->first_;
+        std::string output = "";
+
+        while (temp)
+        {
+            output += temp->identifier_->getName();
+            output += " ";
+
+            temp = temp->next_;
+        }
+
+        return output;
+    }
+
+
+    // ###############################
+    // ###  IdentifierListElement  ###
+    // ###############################
+    IdentifierListElement::IdentifierListElement(const Identifier* identifier)
+    {
+        this->identifier_ = identifier;
+        this->next_ = 0;
+    }
+
+    IdentifierListElement::~IdentifierListElement()
+    {
+    }
+}
Index: /code/branches/audio/src/orxonox/core/IdentifierList.h
===================================================================
--- /code/branches/audio/src/orxonox/core/IdentifierList.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/IdentifierList.h	(revision 310)
@@ -0,0 +1,34 @@
+#ifndef _IdentifierList_H__
+#define _IdentifierList_H__
+
+#include <string>
+
+namespace orxonox
+{
+    class Identifier;
+
+    class IdentifierListElement
+    {
+        public:
+            IdentifierListElement(const Identifier* identifier);
+            ~IdentifierListElement();
+
+            const Identifier* identifier_;
+            IdentifierListElement* next_;
+    };
+
+    class IdentifierList
+    {
+        public:
+            IdentifierList();
+            ~IdentifierList();
+            void add(const Identifier* identifier);
+            void remove(const Identifier* identifier);
+            bool isInList(const Identifier* identifier) const;
+            std::string toString() const;
+
+            IdentifierListElement* first_;
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/core/Iterator.h
===================================================================
--- /code/branches/audio/src/orxonox/core/Iterator.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/Iterator.h	(revision 310)
@@ -0,0 +1,61 @@
+#ifndef _Iterator_H__
+#define _Iterator_H__
+
+namespace orxonox
+{
+    template <class T>
+    class Iterator
+    {
+        public:
+            Iterator()
+            {
+                this->element_ = 0;
+            }
+
+            Iterator(ObjectListElement<T>* element)
+            {
+                this->element_ = element;
+            }
+
+            Iterator<T> operator++()
+            {
+                this->element_ = this->element_->next_;
+                return *this;
+            }
+
+            Iterator<T> operator--()
+            {
+                this->element_ = this->element_->prev_;
+                return *this;
+            }
+
+            T* operator*()
+            {
+                return this->element_->object_;
+            }
+
+            T* operator->() const
+            {
+                return this->element_->object_;
+
+            }
+
+            operator bool()
+            {
+                return (this->element_ != 0);
+            }
+
+            bool operator!=(int compare)
+            {
+                if (compare != 0)
+                    std::cout << "Warning: Comparing the " << ClassIdentifier<T>::getIdentifier()->getName() << "-List-Iterator with " << compare << " has no effect. Only comparison with 0 works.\n";
+
+                return (this->element_ != 0);
+            }
+
+        private:
+            ObjectListElement<T>* element_;
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/core/MetaObjectList.cc
===================================================================
--- /code/branches/audio/src/orxonox/core/MetaObjectList.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/core/MetaObjectList.cc	(revision 310)
@@ -0,0 +1,20 @@
+#include "MetaObjectList.h"
+
+namespace orxonox
+{
+    MetaObjectList::MetaObjectList()
+    {
+        this->first_ = 0;
+    }
+
+    MetaObjectList::~MetaObjectList()
+    {
+        BaseMetaObjectListElement* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+}
Index: /code/branches/audio/src/orxonox/core/MetaObjectList.h
===================================================================
--- /code/branches/audio/src/orxonox/core/MetaObjectList.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/MetaObjectList.h	(revision 310)
@@ -0,0 +1,83 @@
+#ifndef _MetaObjectList_H__
+#define _MetaObjectList_H__
+
+#include "ObjectList.h"
+#include "Identifier.h"
+
+namespace orxonox
+{
+    class BaseMetaObjectListElement
+    {
+        public:
+            virtual ~BaseMetaObjectListElement() {};
+
+            BaseMetaObjectListElement* next_;
+    };
+
+    // ###############################
+    // ###  MetaObjectListElement  ###
+    // ###############################
+    template <class T>
+    class MetaObjectListElement : public BaseMetaObjectListElement
+    {
+        public:
+            MetaObjectListElement(ObjectList<T>* list, ObjectListElement<T>* element);
+            ~MetaObjectListElement();
+
+            ObjectListElement<T>* element_;
+            ObjectList<T>* list_;
+    };
+
+    template <class T>
+    MetaObjectListElement<T>::MetaObjectListElement(ObjectList<T>* list, ObjectListElement<T>* element)
+    {
+        this->element_ = element;
+        this->list_ = list;
+        this->next_ = 0;
+    }
+
+    template <class T>
+    MetaObjectListElement<T>::~MetaObjectListElement()
+    {
+        if (this->element_->next_)
+            this->element_->next_->prev_ = this->element_->prev_;
+        else
+            this->list_->last_ = this->element_->prev_;
+
+        if (this->element_->prev_)
+            this->element_->prev_->next_ = this->element_->next_;
+        else
+            this->list_->first_ = this->element_->next_;
+
+
+#if HIERARCHY_VERBOSE
+        std::cout << "*** Removing Object from " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n";
+#endif
+        delete this->element_;
+    }
+
+
+    // ###############################
+    // ###       ObjectList        ###
+    // ###############################
+    class MetaObjectList
+    {
+        public:
+            MetaObjectList();
+            ~MetaObjectList();
+            template <class T>
+            void add(ObjectList<T>* list, ObjectListElement<T>* element);
+
+            BaseMetaObjectListElement* first_;
+    };
+
+    template <class T>
+    void MetaObjectList::add(ObjectList<T>* list, ObjectListElement<T>* element)
+    {
+        BaseMetaObjectListElement* temp = this->first_;
+        this->first_ = new MetaObjectListElement<T>(list, element);
+        this->first_->next_ = temp;
+    }
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/core/ObjectList.h
===================================================================
--- /code/branches/audio/src/orxonox/core/ObjectList.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/ObjectList.h	(revision 310)
@@ -0,0 +1,190 @@
+#ifndef _ObjectList_H__
+#define _ObjectList_H__
+
+namespace orxonox
+{
+    class OrxonoxClass;
+
+    // ###############################
+    // ###    ObjectListElement    ###
+    // ###############################
+    template <class T>
+    class ObjectListElement
+    {
+        public:
+            ObjectListElement(T* object);
+            ~ObjectListElement();
+
+            T* object_;
+            ObjectListElement* next_;
+            ObjectListElement* prev_;
+    };
+
+    template <class T>
+    ObjectListElement<T>::ObjectListElement(T* object)
+    {
+        this->object_ = object;
+        this->next_ = 0;
+        this->prev_ = 0;
+    }
+
+    template <class T>
+    ObjectListElement<T>::~ObjectListElement()
+    {
+    }
+
+
+    // ###############################
+    // ###       ObjectList        ###
+    // ###############################
+    template <class T>
+    class Iterator;
+
+    template <class T>
+    class ObjectList
+    {
+        public:
+            ObjectList();
+            ~ObjectList();
+            ObjectListElement<T>* add(T* object);
+            void remove(OrxonoxClass* object, bool bIterateForwards = true);
+
+            inline static Iterator<T> start()
+                { return Iterator<T>(pointer_s->first_); }
+            inline static Iterator<T> end()
+                { return Iterator<T>(pointer_s->last_); }
+
+            ObjectListElement<T>* first_;
+            ObjectListElement<T>* last_;
+
+        private:
+            static ObjectList<T>* pointer_s;
+    };
+
+    template <class T>
+    ObjectList<T>* ObjectList<T>::pointer_s = 0;
+
+    template <class T>
+    ObjectList<T>::ObjectList()
+    {
+        this->first_ = 0;
+        this->last_ = 0;
+
+        this->pointer_s = this;
+    }
+
+    template <class T>
+    ObjectList<T>::~ObjectList()
+    {
+        ObjectListElement<T>* temp;
+        while (this->first_)
+        {
+            temp = this->first_->next_;
+            delete this->first_;
+            this->first_ = temp;
+        }
+    }
+
+    template <class T>
+    ObjectListElement<T>* ObjectList<T>::add(T* object)
+    {
+        if (!this->last_)
+        {
+            this->last_ = new ObjectListElement<T>(object);
+            this->first_ = this->last_;
+        }
+        else
+        {
+            ObjectListElement<T>* temp = this->last_;
+            this->last_ = new ObjectListElement<T>(object);
+            this->last_->prev_ = temp;
+            temp->next_ = this->last_;
+        }
+
+        return this->last_;
+    }
+
+    template <class T>
+    void ObjectList<T>::remove(OrxonoxClass* object, bool bIterateForwards)
+    {
+        if (!object || !this->first_ || !this->last_)
+            return;
+
+        if (this->first_ == this->last_)
+        {
+            if (this->first_->object_ == object)
+            {
+                delete this->first_;
+                this->first_ = 0;
+                this->last_ = 0;
+            }
+
+            return;
+        }
+
+        if (bIterateForwards)
+        {
+            if (this->first_->object_ == object)
+            {
+                ObjectListElement<T>* temp = this->first_->next_;
+                delete this->first_;
+                this->first_ = temp;
+                this->first_->prev_ = 0;
+
+                return;
+            }
+
+            ObjectListElement<T>* temp = this->first_;
+            while (temp->next_)
+            {
+                if (temp->next_->object_ == object)
+                {
+                    ObjectListElement<T>* temp2 = temp->next_->next_;
+                    delete temp->next_;
+                    temp->next_ = temp2;
+                    if (temp2)
+                        temp2->prev_ = temp;
+                    else
+                        this->last_ = temp;
+
+                    return;
+                }
+
+                temp = temp->next_;
+            }
+        }
+        else
+        {
+            if (this->last_->object_ == object)
+            {
+                ObjectListElement<T>* temp = this->last_->prev_;
+                delete this->last_;
+                this->last_ = temp;
+                this->last_->next_ = 0;
+
+                return;
+            }
+
+            ObjectListElement<T>* temp = this->last_;
+            while (temp->prev_)
+            {
+                if (temp->prev_->object_ == object)
+                {
+                    ObjectListElement<T>* temp2 = temp->prev_->prev_;
+                    delete temp->prev_;
+                    temp->prev_ = temp2;
+                    if (temp2)
+                        temp2->next_ = temp;
+                    else
+                        this->first_ = temp;
+
+                    return;
+                }
+
+                temp = temp->prev_;
+            }
+        }
+    }
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/core/OrxonoxClass.cc
===================================================================
--- /code/branches/audio/src/orxonox/core/OrxonoxClass.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/core/OrxonoxClass.cc	(revision 310)
@@ -0,0 +1,20 @@
+#include "OrxonoxClass.h"
+
+namespace orxonox
+{
+    OrxonoxClass::OrxonoxClass()
+    {
+        this->identifier_ = 0;
+        this->parents_ = 0;
+
+        this->metaList_ = new MetaObjectList;
+    }
+
+    OrxonoxClass::~OrxonoxClass()
+    {
+        if (this->parents_)
+            delete this->parents_;
+
+        delete this->metaList_;
+    }
+}
Index: /code/branches/audio/src/orxonox/core/OrxonoxClass.h
===================================================================
--- /code/branches/audio/src/orxonox/core/OrxonoxClass.h	(revision 310)
+++ /code/branches/audio/src/orxonox/core/OrxonoxClass.h	(revision 310)
@@ -0,0 +1,29 @@
+#ifndef _OrxonoxClass_H__
+#define _OrxonoxClass_H__
+
+#include "Identifier.h"
+#include "IdentifierList.h"
+#include "ObjectList.h"
+#include "MetaObjectList.h"
+
+namespace orxonox
+{
+    class OrxonoxClass
+    {
+        public:
+            OrxonoxClass();
+            virtual ~OrxonoxClass();
+            inline Identifier* getIdentifier() const { return this->identifier_; }
+            inline void setIdentifier(Identifier* identifier) { this->identifier_ = identifier; }
+            inline IdentifierList* getParents() const { return this->parents_; }
+            inline void setParents(IdentifierList* parents) { this->parents_ = parents; }
+            inline MetaObjectList* getMetaList() { return this->metaList_; }
+
+        private:
+            Identifier* identifier_;
+            IdentifierList* parents_;
+            MetaObjectList* metaList_;
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/hud/hud_overlay.cc
===================================================================
--- /code/branches/audio/src/orxonox/hud/hud_overlay.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/hud/hud_overlay.cc	(revision 310)
@@ -0,0 +1,151 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+//#include "OgreMath.h"
+//#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayElement.h"
+
+#include "hud_overlay.h"
+
+
+namespace orxonox {
+namespace hud {
+  using namespace Ogre;
+
+  HUDOverlay::HUDOverlay()
+  {
+    //TODO: write safe guard
+    overlay_ = OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
+  }
+
+
+  HUDOverlay::~HUDOverlay()
+  {
+  }
+
+
+  void HUDOverlay::show()
+  {
+    //TODO: safe guard
+    overlay_->show();
+  }
+
+
+  void HUDOverlay::hide()
+  {
+    //TODO: safe guard
+    overlay_->hide();
+  }
+
+
+  bool HUDOverlay::tick(unsigned long, Ogre::Real)
+  {
+		// set Time
+		int TimeMin = 99;
+		int TimeSec = 55;
+		OverlayElement* TimeText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/Time/Text");
+		TimeText->setCaption(StringConverter::toString(TimeMin) + ":" + StringConverter::toString(TimeSec));
+		
+		// set TargetWindow
+		String TargetWindowName = "HURRA";
+		int TargetWindowDistance = 12;
+		String TargetWindowStatus = "Dead";
+		int TargetWindowHitRating = 30;
+		OverlayElement* TargetWindowNameText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/Name");
+		TargetWindowNameText->setCaption( TargetWindowName);		
+		OverlayElement* TargetWindowDistanceText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/DistanceText");
+		TargetWindowDistanceText->setCaption(StringConverter::toString(TargetWindowDistance) + "km" );
+		OverlayElement* TargetWindowStatusText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/StatusText");
+		TargetWindowStatusText->setCaption( TargetWindowStatus );
+		OverlayElement* TargetWindowHitRatingText = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/TargetWindow/HitRatingText");
+		TargetWindowHitRatingText->setCaption(StringConverter::toString(TargetWindowHitRating) + "%" );
+		
+		// set Energy
+		int EnergyValue = 60.0;
+		OverlayElement* EnergyLength = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/EnergyBackground");
+		EnergyLength->setWidth((int)((double)60/(double)100*200));
+		
+		// set Shild
+		bool ShildLeftTopValue = true;
+		bool ShildRightTopValue = false;
+		bool ShildLeftBottomValue = false;
+		bool ShildRightBottomValue = true;
+		OverlayElement* ShildLeftTop = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildLeftTop");
+		if (ShildLeftTopValue) ShildLeftTop->show();
+		else ShildLeftTop->hide();
+		OverlayElement* ShildRightTop = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildRightTop");
+		if (ShildRightTopValue) ShildRightTop->show();
+		else ShildRightTop->hide();
+		OverlayElement* ShildLeftBottom = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildLeftBottom");
+		if (ShildLeftBottomValue) ShildLeftBottom->show();
+		else ShildLeftBottom->hide();
+		OverlayElement* ShildRightBottom = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/ShildRightBottom");
+		if (ShildRightBottomValue) ShildRightBottom->show();
+		else ShildRightBottom->hide();
+		
+		// set Rockets
+		int Rocket1 = 11;
+		int Rocket2 = 22;
+		int Rocket3 = 33;
+		int Rocket4 = 44;
+		OverlayElement* RocketNum1 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum1");
+		RocketNum1->setCaption(StringConverter::toString(Rocket1));
+		OverlayElement* RocketNum2 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum2");
+		RocketNum2->setCaption(StringConverter::toString(Rocket2));
+		OverlayElement* RocketNum3 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum3");
+		RocketNum3->setCaption(StringConverter::toString(Rocket3));
+		OverlayElement* RocketNum4 = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/RocketNum4");
+		RocketNum4->setCaption(StringConverter::toString(Rocket4));
+		
+		// set EnergyDistribution
+		double EnergyDistrPixelX = 100;
+		double EnergyDistrPixelY = 86;		
+		double EnergyDistrShild = 32;
+		double EnergyDistrEngine = 50;
+		double EnergyDistrLaser = 18;
+		double EnergyDistrShildInv = 100 - EnergyDistrShild;
+		double EnergyDistrEngineInv = 100 - EnergyDistrEngine;
+		double EnergyDistrLaserInv = 100 - EnergyDistrLaser;
+		double EnergyDistrY = (double)EnergyDistrEngineInv/((double)EnergyDistrEngineInv+(double)EnergyDistrLaserInv) * EnergyDistrPixelY;
+		double EnergyDistrX = EnergyDistrY/1.7321;
+		
+		
+		
+		OverlayElement* EnergyDistrPoint = OverlayManager::getSingleton().getOverlayElement("Orxonox/HUD1.2/EnergyDistrPoint");
+//		EnergyDistrPoint->setLeft();
+//		EnergyDistrPoint->setTop();
+
+
+    // keep rendering
+    return true;
+  }
+}
+}
Index: /code/branches/audio/src/orxonox/hud/hud_overlay.h
===================================================================
--- /code/branches/audio/src/orxonox/hud/hud_overlay.h	(revision 310)
+++ /code/branches/audio/src/orxonox/hud/hud_overlay.h	(revision 310)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+
+#ifndef HUD_OVERLAY_H
+#define HUD_OVERLAY_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace hud {
+
+  class HUDOverlay
+  {
+  public:
+    HUDOverlay();
+	  virtual ~HUDOverlay();
+
+    void show();
+
+    void hide();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+
+  protected:
+    Ogre::Overlay *overlay_;
+
+  };
+}
+}
+
+#endif /* HUD_OVERLAY_H */
Index: /code/branches/audio/src/orxonox/hud/test_overlay.cc
===================================================================
--- /code/branches/audio/src/orxonox/hud/test_overlay.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/hud/test_overlay.cc	(revision 310)
@@ -0,0 +1,124 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+//#include "OgreMath.h"
+//#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayElement.h"
+#include "OgreRenderWindow.h"
+#include "OgreRenderTarget.h"
+
+#include "test_overlay.h"
+
+
+namespace orxonox {
+namespace hud {
+  using namespace Ogre;
+
+  TestOverlay::TestOverlay(RenderWindow *window)
+    :window_(window)
+  {
+    //TODO: write safe guard
+    overlay_ = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+  }
+
+
+  TestOverlay::~TestOverlay()
+  {
+  }
+
+
+  void TestOverlay::show()
+  {
+    //TODO: safe guard
+    overlay_->show();
+  }
+
+
+  void TestOverlay::hide()
+  {
+    //TODO: safe guard
+    overlay_->hide();
+  }
+
+
+  void TestOverlay::setDebugText(Ogre::String &str)
+  {
+    debugText_ = str;
+  }
+
+
+  bool TestOverlay::tick(unsigned long, Ogre::Real)
+  {
+    static String currFps = "Current FPS: ";
+    static String avgFps = "Average FPS: ";
+    static String bestFps = "Best FPS: ";
+    static String worstFps = "Worst FPS: ";
+    static String tris = "Triangle Count: ";
+    static String batches = "Batch Count: ";
+
+    // update stats when necessary
+    try {
+      OverlayElement* guiAvg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/AverageFps");
+      OverlayElement* guiCurr = OverlayManager::getSingleton()
+        .getOverlayElement("Core/CurrFps");
+      OverlayElement* guiBest = OverlayManager::getSingleton()
+        .getOverlayElement("Core/BestFps");
+      OverlayElement* guiWorst = OverlayManager::getSingleton()
+        .getOverlayElement("Core/WorstFps");
+
+      const RenderTarget::FrameStats& stats = window_->getStatistics();
+      guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
+      guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
+      guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
+        +" "+StringConverter::toString(stats.bestFrameTime)+" ms");
+      guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
+        +" "+StringConverter::toString(stats.worstFrameTime)+" ms");
+
+      OverlayElement* guiTris = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumTris");
+      guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
+
+      OverlayElement* guiBatches = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumBatches");
+      guiBatches->setCaption(batches
+        + StringConverter::toString(stats.batchCount));
+
+      OverlayElement* guiDbg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/DebugText");
+      guiDbg->setCaption(debugText_);
+    }
+    catch(...) { /* ignore */ }
+
+    return true;
+  }
+}
+}
Index: /code/branches/audio/src/orxonox/hud/test_overlay.h
===================================================================
--- /code/branches/audio/src/orxonox/hud/test_overlay.h	(revision 310)
+++ /code/branches/audio/src/orxonox/hud/test_overlay.h	(revision 310)
@@ -0,0 +1,69 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+
+#ifndef TEST_OVERLAY_H
+#define TEST_OVERLAY_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace hud {
+
+  class TestOverlay
+  {
+  public:
+    TestOverlay(Ogre::RenderWindow*);
+	  virtual ~TestOverlay();
+
+    void show();
+
+    void hide();
+
+    void setDebugText(Ogre::String&);
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+
+  protected:
+    Ogre::Overlay *overlay_;
+    Ogre::RenderWindow *window_;
+
+    Ogre::String debugText_;
+
+  };
+}
+}
+
+#endif /* TEST_OVERLAY_H */
Index: /code/branches/audio/src/orxonox/objects/BaseObject.cc
===================================================================
--- /code/branches/audio/src/orxonox/objects/BaseObject.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/BaseObject.cc	(revision 310)
@@ -0,0 +1,15 @@
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    CreateFactory(BaseObject);
+
+    BaseObject::BaseObject()
+    {
+        RegisterRootObject(BaseObject);
+    }
+
+    BaseObject::~BaseObject()
+    {
+    }
+}
Index: /code/branches/audio/src/orxonox/objects/BaseObject.h
===================================================================
--- /code/branches/audio/src/orxonox/objects/BaseObject.h	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/BaseObject.h	(revision 310)
@@ -0,0 +1,55 @@
+#ifndef _BaseObject_H__
+#define _BaseObject_H__
+
+#include "../core/IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class BaseObject : virtual public OrxonoxClass
+    {
+        public:
+            BaseObject();
+            virtual ~BaseObject();
+
+            inline bool isA(const Identifier* identifier)
+                { this->getIdentifier()->isA(identifier); }
+            inline bool isDirectlyA(const Identifier* identifier)
+                { this->getIdentifier()->isDirectlyA(identifier); }
+            inline bool isChildOf(const Identifier* identifier)
+                { this->getIdentifier()->isChildOf(identifier); }
+            inline bool isParentOf(const Identifier* identifier)
+                { this->getIdentifier()->isParentOf(identifier); }
+
+            inline bool isA(const SubclassIdentifier<class B>* identifier)
+                { this->getIdentifier()->isA(identifier->getIdentifier()); }
+            inline bool isDirectlyA(const SubclassIdentifier<class B>* identifier)
+                { this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); }
+            inline bool isChildOf(const SubclassIdentifier<class B>* identifier)
+                { this->getIdentifier()->isChildOf(identifier->getIdentifier()); }
+            inline bool isParentOf(const SubclassIdentifier<class B>* identifier)
+                { this->getIdentifier()->isParentOf(identifier->getIdentifier()); }
+
+            inline bool isA(const SubclassIdentifier<class B> identifier)
+                { this->getIdentifier()->isA(identifier.getIdentifier()); }
+            inline bool isDirectlyA(const SubclassIdentifier<class B> identifier)
+                { this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); }
+            inline bool isChildOf(const SubclassIdentifier<class B> identifier)
+                { this->getIdentifier()->isChildOf(identifier.getIdentifier()); }
+            inline bool isParentOf(const SubclassIdentifier<class B> identifier)
+                { this->getIdentifier()->isParentOf(identifier.getIdentifier()); }
+
+            inline bool isA(const OrxonoxClass* object)
+                { this->getIdentifier()->isA(object->getIdentifier()); }
+            inline bool isDirectlyA(const OrxonoxClass* object)
+                { this->getIdentifier()->isDirectlyA(object->getIdentifier()); }
+            inline bool isChildOf(const OrxonoxClass* object)
+                { this->getIdentifier()->isChildOf(object->getIdentifier()); }
+            inline bool isParentOf(const OrxonoxClass* object)
+                { this->getIdentifier()->isParentOf(object->getIdentifier()); }
+
+            std::string name_; // test
+
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/objects/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/orxonox/objects/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/CMakeLists.txt	(revision 310)
@@ -0,0 +1,6 @@
+PROJECT(Orxonox)
+
+SET(SRC_FILES BaseObject.cc test1.cc test2.cc test3.cc)
+SET(INC_FILES BaseObject.h Test.h test1.h test2.h test3.h)
+
+ADD_LIBRARY(objects ${SRC_FILES} ${INC_FILES})
Index: /code/branches/audio/src/orxonox/objects/Test.h
===================================================================
--- /code/branches/audio/src/orxonox/objects/Test.h	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/Test.h	(revision 310)
@@ -0,0 +1,149 @@
+#ifndef _Test_H__
+#define _Test_H__
+
+#include "BaseObject.h"
+#include "../core/IdentifierIncludes.h"
+
+namespace orxonox
+{
+    class Interface1 : virtual public OrxonoxClass
+    {
+        protected:
+            Interface1() { RegisterRootObject(Interface1); }
+    };
+
+    class Interface2 : virtual public OrxonoxClass
+    {
+        protected:
+            Interface2() { RegisterRootObject(Interface2); }
+    };
+
+    class A1 : public BaseObject
+    {
+        public:
+            A1() { RegisterObject(A1); }
+    };
+
+    class A2 : public BaseObject
+    {
+        public:
+            A2() { RegisterObject(A2); }
+    };
+
+    class A3: public BaseObject, public Interface1
+    {
+        public:
+            A3() { RegisterObject(A3); }
+    };
+
+    class A1B1 : public A1
+    {
+        public:
+            A1B1() { RegisterObject(A1B1); }
+    };
+
+    class A1B2 : public A1
+    {
+        public:
+            A1B2() { RegisterObject(A1B2); }
+    };
+
+    class A2B1 : public A2
+    {
+        public:
+            A2B1() { RegisterObject(A2B1); }
+    };
+
+    class A2B2 : public A2, Interface1
+    {
+        public:
+            A2B2() { RegisterObject(A2B2); }
+    };
+
+    class A3B1 : public A3
+    {
+        public:
+            A3B1() { RegisterObject(A3B1); }
+    };
+
+    class A3B2 : public A3, Interface2
+    {
+        public:
+            A3B2() { RegisterObject(A3B2); }
+    };
+
+    class A1B1C1 : public A1B1
+    {
+        public:
+            A1B1C1() { RegisterObject(A1B1C1); }
+    };
+
+    class A1B1C2 : public A1B1
+    {
+        public:
+            A1B1C2() { RegisterObject(A1B1C2); }
+    };
+
+    class A1B2C1 : public A1B2
+    {
+        public:
+            A1B2C1() { RegisterObject(A1B2C1); }
+    };
+
+    class A2B1C1 : public A2B1, Interface2
+    {
+        public:
+            A2B1C1() { RegisterObject(A2B1C1); }
+    };
+
+    class A2B2C1 : public A2B2
+    {
+        public:
+            A2B2C1() { RegisterObject(A2B2C1); }
+    };
+
+    class A3B1C1 : public A3B1
+    {
+        public:
+            A3B1C1() { RegisterObject(A3B1C1); }
+    };
+
+    class A3B1C2 : public A3B1, Interface2
+    {
+        public:
+            A3B1C2() { RegisterObject(A3B1C2); }
+    };
+
+    class A3B2C1 : public A3B2
+    {
+        public:
+            A3B2C1() { RegisterObject(A3B2C1); }
+    };
+
+    class A3B2C2 : public A3B2
+    {
+        public:
+            A3B2C2() { RegisterObject(A3B2C2); }
+    };
+
+    CreateFactory(A1);
+    CreateFactory(A2);
+    CreateFactory(A3);
+    CreateFactory(A1B1);
+    CreateFactory(A1B2);
+    CreateFactory(A2B1);
+    CreateFactory(A2B2);
+    CreateFactory(A3B1);
+    CreateFactory(A3B2);
+    CreateFactory(A1B1C1);
+    CreateFactory(A1B1C2);
+    CreateFactory(A1B2C1);
+    CreateFactory(A2B1C1);
+    CreateFactory(A2B2C1);
+    CreateFactory(A3B1C1);
+    CreateFactory(A3B1C2);
+    CreateFactory(A3B2C1);
+    CreateFactory(A3B2C2);
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/objects/test1.cc
===================================================================
--- /code/branches/audio/src/orxonox/objects/test1.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/test1.cc	(revision 310)
@@ -0,0 +1,63 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    CreateFactory(Test1);
+
+    Test1::Test1()
+    {
+        RegisterObject(Test1);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test1::~Test1()
+    {
+    }
+
+    bool Test1::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test1::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test1::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test1::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test1::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test1::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test1: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: /code/branches/audio/src/orxonox/objects/test1.h
===================================================================
--- /code/branches/audio/src/orxonox/objects/test1.h	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/test1.h	(revision 310)
@@ -0,0 +1,30 @@
+#ifndef _Test1_H__
+#define _Test1_H__
+
+#include "BaseObject.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    class Test1 : public BaseObject
+    {
+        public:
+            Test1();
+            virtual ~Test1();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            SubclassIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/objects/test2.cc
===================================================================
--- /code/branches/audio/src/orxonox/objects/test2.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/test2.cc	(revision 310)
@@ -0,0 +1,63 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    CreateFactory(Test2);
+
+    Test2::Test2()
+    {
+        RegisterObject(Test2);
+
+        this->usefullClass1_ = Class(Test1);
+        this->usefullClass2_ = Class(Test2);
+        this->usefullClass3_ = Class(Test3);
+    }
+
+    Test2::~Test2()
+    {
+    }
+
+    bool Test2::usefullClass1isA(Identifier* identifier)
+    {
+        return this->usefullClass1_->isA(identifier);
+    }
+
+    bool Test2::usefullClass2isA(Identifier* identifier)
+    {
+        return this->usefullClass2_->isA(identifier);
+    }
+
+    bool Test2::usefullClass3isA(Identifier* identifier)
+    {
+        return this->usefullClass3_.isA(identifier);
+    }
+
+    void Test2::setUsefullClass1(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass1->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass1_ = identifier;
+    }
+
+    void Test2::setUsefullClass2(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass2->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass2_ = identifier;
+    }
+
+    void Test2::setUsefullClassOfTypeTest3(Identifier* identifier)
+    {
+        std::cout << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test1)): " << identifier->isA(Class(Test1)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test2)): " << identifier->isA(Class(Test2)) << "\n";
+        std::cout << "Test2: usefullClass3->isA(Class(Test3)): " << identifier->isA(Class(Test3)) << "\n";
+        this->usefullClass3_ = identifier;
+    }
+}
Index: /code/branches/audio/src/orxonox/objects/test2.h
===================================================================
--- /code/branches/audio/src/orxonox/objects/test2.h	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/test2.h	(revision 310)
@@ -0,0 +1,31 @@
+#ifndef _Test2_H__
+#define _Test2_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test3;
+
+    class Test2 : public BaseObject
+    {
+        public:
+            Test2();
+            virtual ~Test2();
+
+            bool usefullClass1isA(Identifier* identifier);
+            bool usefullClass2isA(Identifier* identifier);
+            bool usefullClass3isA(Identifier* identifier);
+            void setUsefullClass1(Identifier* identifier);
+            void setUsefullClass2(Identifier* identifier);
+            void setUsefullClassOfTypeTest3(Identifier* identifier);
+
+        private:
+            Identifier* usefullClass1_;
+            Identifier* usefullClass2_;
+            SubclassIdentifier<Test3> usefullClass3_;
+
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/objects/test3.cc
===================================================================
--- /code/branches/audio/src/orxonox/objects/test3.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/test3.cc	(revision 310)
@@ -0,0 +1,53 @@
+#include "test1.h"
+#include "test2.h"
+#include "test3.h"
+
+namespace orxonox
+{
+    CreateFactory(Test3);
+
+    Test3::Test3()
+    {
+        RegisterObject(Test3);
+    }
+
+    Test3::~Test3()
+    {
+    }
+        #define testandcout(code) \
+          std::cout << #code << " " << code << "\n"
+
+    bool Test3::usefullClassesIsATest(Test1* test1)
+    {
+        std::cout << "\n";
+        std::cout << "Test1:\n";
+        testandcout(test1->usefullClass1isA(Class(Test1)));
+        testandcout(test1->usefullClass1isA(Class(Test2)));
+        testandcout(test1->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass2isA(Class(Test1)));
+        testandcout(test1->usefullClass2isA(Class(Test2)));
+        testandcout(test1->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test1->usefullClass3isA(Class(Test1)));
+        testandcout(test1->usefullClass3isA(Class(Test2)));
+        testandcout(test1->usefullClass3isA(Class(Test3)));
+    }
+
+    bool Test3::usefullClassesIsATest(Test2* test2)
+    {
+        std::cout << "\n";
+        std::cout << "Test2:\n";
+        testandcout(test2->usefullClass1isA(Class(Test1)));
+        testandcout(test2->usefullClass1isA(Class(Test2)));
+        testandcout(test2->usefullClass1isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass2isA(Class(Test1)));
+        testandcout(test2->usefullClass2isA(Class(Test2)));
+        testandcout(test2->usefullClass2isA(Class(Test3)));
+        std::cout << "\n";
+        testandcout(test2->usefullClass3isA(Class(Test1)));
+        testandcout(test2->usefullClass3isA(Class(Test2)));
+        testandcout(test2->usefullClass3isA(Class(Test3)));
+    }
+}
Index: /code/branches/audio/src/orxonox/objects/test3.h
===================================================================
--- /code/branches/audio/src/orxonox/objects/test3.h	(revision 310)
+++ /code/branches/audio/src/orxonox/objects/test3.h	(revision 310)
@@ -0,0 +1,22 @@
+#ifndef _Test3_H__
+#define _Test3_H__
+
+#include "BaseObject.h"
+
+namespace orxonox
+{
+    class Test1;
+    class Test2;
+
+    class Test3 : public BaseObject
+    {
+        public:
+            Test3();
+            virtual ~Test3();
+
+            bool usefullClassesIsATest(Test1* test1);
+            bool usefullClassesIsATest(Test2* test2);
+    };
+}
+
+#endif
Index: /code/branches/audio/src/orxonox/orxonox.cc
===================================================================
--- /code/branches/audio/src/orxonox/orxonox.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/orxonox.cc	(revision 310)
@@ -0,0 +1,280 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+ @file  orxonox.cc
+ @brief Orxonox Main File
+ */
+
+#include <Ogre.h>
+#include <OIS/OIS.h>
+#include <CEGUI/CEGUI.h>
+#include <OgreCEGUIRenderer.h>
+
+#include <string>
+#include <iostream>
+
+#include "xml/xmlParser.h"
+#include "loader/LevelLoader.h"
+
+
+// some tests to see if enet works without includsion
+//#include <enet/enet.h>
+//#include <enet/protocol.h>
+
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+#include <CoreFoundation/CoreFoundation.h>
+
+// This function will locate the path to our application on OS X,
+// unlike windows you can not rely on the curent working directory
+// for locating your configuration files and resources.
+std::string macBundlePath()
+{
+  char path[1024];
+  CFBundleRef mainBundle = CFBundleGetMainBundle();
+  assert(mainBundle);
+
+  CFURLRef mainBundleURL = CFBundleCopyBundleURL(mainBundle);
+  assert(mainBundleURL);
+
+  CFStringRef cfStringRef = CFURLCopyFileSystemPath( mainBundleURL, kCFURLPOSIXPathStyle);
+  assert(cfStringRef);
+
+  CFStringGetCString(cfStringRef, path, 1024, kCFStringEncodingASCII);
+
+  CFRelease(mainBundleURL);
+  CFRelease(cfStringRef);
+
+  return std::string(path);
+}
+#endif
+
+namespace orxonox
+{
+  class OrxExitListener : public Ogre::FrameListener
+  {
+    public:
+      OrxExitListener(OIS::Keyboard *keyboard)
+    : mKeyboard(keyboard)
+      {
+      }
+
+      bool frameStarted(const Ogre::FrameEvent& evt)
+      {
+        mKeyboard->capture();
+        return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
+      }
+
+    private:
+      OIS::Keyboard *mKeyboard;
+  };
+
+  class OrxApplication
+  {
+    public:
+      void go()
+      {
+        createRoot();
+        defineResources();
+        setupRenderSystem();
+        createRenderWindow();
+        initializeResourceGroups();
+        createScene();
+        setupScene();
+        setupInputSystem();
+        setupCEGUI();
+        createFrameListener();
+        startRenderLoop();
+      }
+
+      ~OrxApplication()
+      {
+        mInputManager->destroyInputObject(mKeyboard);
+        OIS::InputManager::destroyInputSystem(mInputManager);
+
+//        delete mRenderer;
+//        delete mSystem;
+
+        delete mListener;
+        delete mRoot;
+      }
+
+    private:
+      Ogre::Root *mRoot;
+      OIS::Keyboard *mKeyboard;
+      OIS::Mouse *mMouse;
+      OIS::InputManager *mInputManager;
+      CEGUI::OgreCEGUIRenderer *mRenderer;
+      CEGUI::System *mSystem;
+      OrxExitListener *mListener;
+
+      void createRoot()
+      {
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        mRoot = new Ogre::Root(macBundlePath() + "/Contents/Resources/plugins.cfg");
+#else
+        mRoot = new Ogre::Root();
+#endif
+      }
+
+      void defineResources()
+      {
+        Ogre::String secName, typeName, archName;
+        Ogre::ConfigFile cf;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+        cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
+#else
+        cf.load("resources.cfg");
+#endif
+
+        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
+        while (seci.hasMoreElements())
+        {
+          secName = seci.peekNextKey();
+          Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
+          Ogre::ConfigFile::SettingsMultiMap::iterator i;
+          for (i = settings->begin(); i != settings->end(); ++i)
+          {
+            typeName = i->first;
+            archName = i->second;
+#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
+#else
+            Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
+#endif
+          }
+        }
+      }
+
+      void setupRenderSystem()
+      {
+        if (!mRoot->restoreConfig() && !mRoot->showConfigDialog())
+          throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
+      }
+
+      void createRenderWindow()
+      {
+        mRoot->initialise(true, "Ogre Render Window");
+      }
+
+      void initializeResourceGroups()
+      {
+        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
+        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+      }
+
+      void createScene(void)
+      {
+
+        string levelFile = "sp_level_moonstation.oxw";
+        loader::LevelLoader* loader = new loader::LevelLoader(levelFile);
+      }
+
+      void setupScene()
+      {
+        Ogre::SceneManager *mgr = mRoot->createSceneManager(Ogre::ST_GENERIC, "Default SceneManager");
+        Ogre::Camera *cam = mgr->createCamera("Camera");
+        Ogre::Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam);
+      }
+
+      void setupInputSystem()
+      {
+        size_t windowHnd = 0;
+        std::ostringstream windowHndStr;
+        OIS::ParamList pl;
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        win->getCustomAttribute("WINDOW", &windowHnd);
+        windowHndStr << windowHnd;
+        pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+        mInputManager = OIS::InputManager::createInputSystem(pl);
+
+        try
+        {
+          mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject(OIS::OISKeyboard, false));
+          mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject(OIS::OISMouse, false));
+        }
+        catch (const OIS::Exception &e)
+        {
+          throw new Ogre::Exception(42, e.eText, "OrxApplication::setupInputSystem");
+        }
+      }
+
+      void setupCEGUI()
+      {
+        Ogre::SceneManager *mgr = mRoot->getSceneManager("Default SceneManager");
+        Ogre::RenderWindow *win = mRoot->getAutoCreatedWindow();
+
+        // CEGUI setup
+//        mRenderer = new CEGUI::OgreCEGUIRenderer(win, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mgr);
+//        mSystem = new CEGUI::System(mRenderer);
+
+        // Other CEGUI setup here.
+      }
+
+      void createFrameListener()
+      {
+        mListener = new OrxExitListener(mKeyboard);
+        mRoot->addFrameListener(mListener);
+      }
+
+      void startRenderLoop()
+      {
+        mRoot->startRendering();
+      }
+  };
+}
+
+using namespace Ogre;
+
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+#define WIN32_LEAN_AND_MEAN
+#include "windows.h"
+
+             INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
+#else
+             int main(int argc, char **argv)
+#endif
+{
+  try
+  {
+    orxonox::OrxApplication orxonox;
+    orxonox.go();
+  }
+  catch(Exception& e)
+  {
+#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
+    MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
+#else
+    fprintf(stderr, "An exception has occurred: %s\n",
+            e.getFullDescription().c_str());
+#endif
+  }
+
+  return 0;
+}
+
Index: /code/branches/audio/src/orxonox/weapon/CMakeLists.txt
===================================================================
--- /code/branches/audio/src/orxonox/weapon/CMakeLists.txt	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/CMakeLists.txt	(revision 310)
@@ -0,0 +1,15 @@
+PROJECT(Orxonox)
+
+# create a few variables to simplify life
+SET( WEAPON_SRC
+	ammunition_dump.cc
+	barrel_gun.cc
+	base_weapon.cc
+	bullet.cc
+	bullet_manager.cc
+	weapon_station.cc
+)
+
+INCLUDE_DIRECTORIES(..)
+
+ADD_LIBRARY(weapon ${WEAPON_SRC})
Index: /code/branches/audio/src/orxonox/weapon/ammunition_dump.cc
===================================================================
--- /code/branches/audio/src/orxonox/weapon/ammunition_dump.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/ammunition_dump.cc	(revision 310)
@@ -0,0 +1,109 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "run_manager.h"
+
+#include "ammunition_dump.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  AmmunitionDump::AmmunitionDump()
+    : numberOfAmmos_(RunManager::getSingletonPtr()->getNumberOfAmmos()),
+      stock_(new int[numberOfAmmos_]),
+      capacity_(new int[numberOfAmmos_])
+  {
+    for (int i = 0; i < numberOfAmmos_; i++)
+    {
+      stock_[i] = 0;
+      capacity_[i] = 0;
+    }
+  }
+
+
+  AmmunitionDump::~AmmunitionDump()
+  {
+    if (stock_)
+      delete stock_;
+    if (capacity_)
+      delete capacity_;
+  }
+
+  void AmmunitionDump::setDumpSize(const Ogre::String &name, int size)
+  {
+    if (size < 0)
+      return;
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return;
+    capacity_[id] = size;
+  }
+
+  
+  int AmmunitionDump::store(const Ogre::String &name, int quantity)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return quantity;
+    stock_[id] += quantity;
+    if (stock_[id] > capacity_[id])
+    {
+      quantity = capacity_[id] - stock_[id];
+      stock_[id] = capacity_[id];
+      return quantity;
+    }
+    else
+      return 0;
+  }
+
+
+  int AmmunitionDump::getAmmunition(const Ogre::String &name, int quantity)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id == -1)
+      return 0;
+    if (stock_[id] >= quantity)
+      stock_[id] -= quantity;
+    else
+    {
+      quantity = stock_[id];
+      stock_[id] = 0;
+    }
+    return quantity;
+  }
+
+
+  int AmmunitionDump::getStockSize(const Ogre::String &name)
+  {
+    int id = RunManager::getSingletonPtr()->getAmmunitionID(name);
+    if (id = -1)
+      return -1;
+    return stock_[id];
+  }
+}
+}
Index: /code/branches/audio/src/orxonox/weapon/ammunition_dump.h
===================================================================
--- /code/branches/audio/src/orxonox/weapon/ammunition_dump.h	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/ammunition_dump.h	(revision 310)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef AmmunitionDump_H
+#define AmmunitionDump_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class AmmunitionDump
+  {
+  public:
+    AmmunitionDump();
+	  ~AmmunitionDump();
+
+    void setDumpSize(const Ogre::String &name, int size);
+
+    int store(const Ogre::String &name, int quantiy);
+
+    int getAmmunition(const Ogre::String &name, int quantity);
+
+    int getStockSize(const Ogre::String &name);
+
+  protected:
+    int numberOfAmmos_;
+    int *stock_;
+    int *capacity_;
+
+  protected:
+
+  };
+
+}
+}
+
+#endif /* AmmunitionDump_H */
Index: /code/branches/audio/src/orxonox/weapon/barrel_gun.cc
===================================================================
--- /code/branches/audio/src/orxonox/weapon/barrel_gun.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/barrel_gun.cc	(revision 310)
@@ -0,0 +1,140 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "bullet.h"
+#include "bullet_manager.h"
+#include "inertial_node.h"
+#include "ammunition_dump.h"
+#include "base_weapon.h"
+
+#include "barrel_gun.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BarrelGun::BarrelGun(InertialNode *node, AmmunitionDump *ammoDump)
+        : BaseWeapon(node, ammoDump)
+  {
+    name_ = "Barrel Gun";
+    primaryFirePower_ = 100;
+    secondaryFirePower_ = 500;
+    primaryFiringRate_ = 10;
+    secondaryFiringRate_ = 2;
+    primaryBulletSpeed_ = 1000;
+    secondaryBulletSpeed_ = 500;
+    magazineSize_ = 25;
+  }
+
+
+  BarrelGun::~BarrelGun()
+  {
+  }
+
+
+  void BarrelGun::primaryFire()
+  {
+    if (leftAmmo_ < 1)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * primaryBulletSpeed_;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 4);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    --leftAmmo_;
+  }
+
+
+  void BarrelGun::primaryFiring(unsigned int time)
+  {
+    if (time > (unsigned int)1000/primaryFiringRate_)
+    {
+      currentState_ = IDLE;
+    }
+  }
+
+
+
+  void BarrelGun::secondaryFire()
+  {
+    if (leftAmmo_ < 5)
+    {
+      currentState_ = IDLE;
+      return;
+    }
+
+    SceneNode *temp = sceneMgr_->getRootSceneNode()->createChildSceneNode(
+          node_->getSceneNode()->getWorldPosition(),
+          node_->getSceneNode()->getWorldOrientation());
+
+    Entity* bulletEntity = sceneMgr_->createEntity("BulletEntity"
+          + StringConverter::toString(bulletCounter_++), "Barrel.mesh");
+
+    Vector3 speed = (temp->getOrientation() * Vector3(0, 0, -1))
+          .normalisedCopy() * secondaryBulletSpeed_*0.5;
+    speed += node_->getWorldSpeed();
+
+	  temp->setScale(Vector3(1, 1, 1) * 10);
+	  temp->yaw(Degree(-90));
+
+	  bulletManager_->addBullet(new Bullet(temp, bulletEntity, speed));
+
+    leftAmmo_ -= 5;
+  }
+
+
+  void BarrelGun::secondaryFiring(unsigned int time)
+  {
+    if (time > (unsigned int)1000/secondaryFiringRate_)
+      currentState_ = IDLE;
+  }
+
+}
+}
Index: /code/branches/audio/src/orxonox/weapon/barrel_gun.h
===================================================================
--- /code/branches/audio/src/orxonox/weapon/barrel_gun.h	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/barrel_gun.h	(revision 310)
@@ -0,0 +1,65 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BARREL_GUN_H
+#define BARREL_GUN_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BarrelGun : public BaseWeapon
+  {
+ public:
+    BarrelGun(InertialNode*, AmmunitionDump*);
+	  virtual ~BarrelGun();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    void primaryFire();
+
+    void primaryFiring(unsigned int);
+
+    void secondaryFire();
+
+    void secondaryFiring(unsigned int);
+
+  public:
+
+  protected:
+
+  };
+}
+}
+
+#endif /* BARREL_GUN_H */
Index: /code/branches/audio/src/orxonox/weapon/base_weapon.cc
===================================================================
--- /code/branches/audio/src/orxonox/weapon/base_weapon.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/base_weapon.cc	(revision 310)
@@ -0,0 +1,180 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "bullet.h"
+#include "bullet_manager.h"
+#include "inertial_node.h"
+#include "ammunition_dump.h"
+#include "run_manager.h"
+
+#include "base_weapon.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BaseWeapon::BaseWeapon(InertialNode *node, AmmunitionDump *ammoDump)
+    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()), node_(node),
+      bulletCounter_(0), primaryFireRequest_(false), currentState_(IDLE),
+      secondaryFireRequest_(false),
+      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
+      secondaryFired_(false),
+      timeSinceNextActionAdded_(0), actionAdded_(false), nextAction_(NOTHING),
+      ammoDump_(ammoDump)
+  {
+    leftAmmo_ = 0;
+  }
+
+
+  BaseWeapon::~BaseWeapon()
+  {
+  }
+
+
+  bool BaseWeapon::addAction(const Action act)
+  {
+    if (nextAction_ == NOTHING)
+    {
+      nextAction_ = act;
+      actionAdded_ = true;
+      return true;
+    }
+    else
+      return false;
+  }
+
+
+  void BaseWeapon::primaryFireRequest()
+  {
+    primaryFireRequest_ = true;
+  }
+
+
+  void BaseWeapon::secondaryFireRequest()
+  {
+    secondaryFireRequest_ = true;
+  }
+
+
+  bool BaseWeapon::tick(unsigned long time, Real deltaTime)
+  {
+    // process action adder
+    if (actionAdded_)
+    {
+      timeSinceNextActionAdded_ = time;
+      actionAdded_ = false;
+    }
+
+    if (currentState_ != IDLE)
+    {
+      switch (currentState_)
+      {
+      case PRIMARY_FIRE:
+        primaryFiring((unsigned int)(time - actionStartTime_));
+        break;
+
+      case SECONDARY_FIRE:
+        secondaryFiring((unsigned int)(time - actionStartTime_));
+        break;
+
+      case RELOADING:
+        break;
+
+      case CHANGING_AMMO:
+        break;
+      }
+    }
+
+    if (currentState_ == IDLE)
+    {
+      // first, process next action
+      if (nextAction_ != NOTHING)
+      {
+        actionStartTime_ = time;
+        switch (nextAction_)
+        {
+        case RELOAD:
+          leftAmmo_ += ammoDump_->getAmmunition("Barrel", magazineSize_ - leftAmmo_);
+          break;
+
+        case CHANGE_AMMO:
+          break;
+
+        case SPECIAL:
+          break;
+
+        default:
+          break;
+        }
+
+        // pay attention when multithreaded!
+        nextAction_ = NOTHING;
+      }
+      else
+      {
+        // secondly, execute firing
+        if (primaryFireRequest_ && !(secondaryFired_ && secondaryFireRequest_))
+        {
+          actionStartTime_ = time;
+          currentState_ = PRIMARY_FIRE;
+          secondaryFired_ = false;
+          primaryFire();
+        }
+        else if (secondaryFireRequest_)
+        {
+          actionStartTime_ = time;
+          currentState_ = SECONDARY_FIRE;
+          secondaryFired_ = true;
+          secondaryFire();
+        }
+      }
+    }
+
+    primaryFireRequest_ = false;
+    secondaryFireRequest_ = false;
+
+    if (time - timeSinceNextActionAdded_ > nextActionValidityPeriod_)
+      nextAction_ = NOTHING;
+
+    return true;
+  }
+
+
+  int BaseWeapon::getAmmoState()
+  {
+    return leftAmmo_;
+  }
+}
+}
Index: /code/branches/audio/src/orxonox/weapon/base_weapon.h
===================================================================
--- /code/branches/audio/src/orxonox/weapon/base_weapon.h	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/base_weapon.h	(revision 310)
@@ -0,0 +1,124 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BASE_WEAPON_H
+#define BASE_WEAPON_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BaseWeapon
+  {
+  public:
+    enum Action {
+      NOTHING  = 0,
+      RELOAD   = 1,
+      CHANGE_AMMO  = 2,
+      SPECIAL  = 3
+    };
+
+  protected:
+    enum State {
+      IDLE = 0,
+      PRIMARY_FIRE = 1,
+      SECONDARY_FIRE = 2,
+      RELOADING = 3,
+      CHANGING_AMMO = 4,
+    };
+
+  public:
+    BaseWeapon(InertialNode*, AmmunitionDump*);
+	  virtual ~BaseWeapon();
+
+    bool addAction(const Action);
+
+    void primaryFireRequest();
+
+    void secondaryFireRequest();
+
+    int getAmmoState();
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+    virtual void primaryFire() = 0;
+
+    virtual void primaryFiring(unsigned int) = 0;
+
+    virtual void secondaryFire() = 0;
+
+    virtual void secondaryFiring(unsigned int) = 0;
+
+  public:
+
+  protected:
+    Ogre::SceneManager *sceneMgr_;
+    //Ogre::SceneNode *node_;
+    InertialNode* node_;
+
+    int bulletCounter_;
+    BulletManager *bulletManager_;
+
+    AmmunitionDump *ammoDump_;
+
+    bool primaryFireRequest_;
+    bool secondaryFireRequest_;
+
+    unsigned long actionStartTime_;
+
+    State currentState_;
+    bool secondaryFired_;
+
+    Action nextAction_;
+    bool actionAdded_;
+    unsigned long timeSinceNextActionAdded_;
+    static const unsigned long nextActionValidityPeriod_ = 500;
+
+    // weapon properties
+    int leftAmmo_;
+    Ogre::String name_;
+    int primaryFirePower_;
+    int secondaryFirePower_;
+    int primaryFiringRate_;
+    int secondaryFiringRate_;
+    Ogre::Real primaryBulletSpeed_;
+    Ogre::Real secondaryBulletSpeed_;
+
+    int magazineSize_;
+
+  };
+
+}
+}
+
+#endif /* BASE_WEAPON_H */
Index: /code/branches/audio/src/orxonox/weapon/bullet.cc
===================================================================
--- /code/branches/audio/src/orxonox/weapon/bullet.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/bullet.cc	(revision 310)
@@ -0,0 +1,51 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreVector3.h"
+
+#include "bullet.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  Bullet::Bullet(SceneNode *node, Entity *entity, Vector3 speed)
+    : node_(node), entity_(entity), speed_(speed)
+  {
+	  node_->attachObject(entity_);
+  }
+
+
+  Bullet::~Bullet()
+  {
+  }
+
+}
+}
Index: /code/branches/audio/src/orxonox/weapon/bullet.h
===================================================================
--- /code/branches/audio/src/orxonox/weapon/bullet.h	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/bullet.h	(revision 310)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BULLET_H
+#define BULLET_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class Bullet
+  {
+  public:
+	  Bullet(Ogre::SceneNode*, Ogre::Entity*, Ogre::Vector3);
+	  ~Bullet();
+
+  protected:
+
+  public:
+    Ogre::SceneNode *node_;
+	  Ogre::Entity *entity_;
+	  Ogre::Vector3 speed_;
+
+  protected:
+
+  };
+
+}
+}
+
+#endif /* BULLET_H */
Index: /code/branches/audio/src/orxonox/weapon/bullet_manager.cc
===================================================================
--- /code/branches/audio/src/orxonox/weapon/bullet_manager.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/bullet_manager.cc	(revision 310)
@@ -0,0 +1,90 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneManager.h"
+
+#include "bullet_manager.h"
+#include "bullet.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  BulletManager::BulletManager(SceneManager *sceneMgr) : sceneMgr_(sceneMgr),
+        bulletsIndex_(0), bulletsSize_(8)
+  {
+    bullets_ = new Bullet*[bulletsSize_];
+  }
+
+
+  BulletManager::~BulletManager()
+  {
+    // clean up the bullet list
+    if (bullets_)
+    {
+      for (int i = 0; i < bulletsIndex_; i++)
+        delete bullets_[i];
+      delete bullets_;
+    }
+  }
+
+
+  void BulletManager::addBullet(Bullet *bullet)
+  {
+    // resize array if neccessary (double the size then)
+    if (bulletsIndex_ >= bulletsSize_)
+    {
+      // redimension the array
+      Bullet **tempArray = new Bullet*[2*bulletsSize_];
+      for (int i = 0; i < bulletsSize_; i++)
+        tempArray[i] = bullets_[i];
+      bulletsSize_ *= 2;
+      delete bullets_;
+      bullets_ = tempArray;
+    }
+
+    // add the bullet to the list
+    bullets_[bulletsIndex_++] = bullet;
+  }
+
+
+  bool BulletManager::tick(unsigned long time, Real deltaTime)
+  {
+    // update the bullet positions
+    for (int i = 0; i < bulletsIndex_; i++)
+    {
+      bullets_[i]->node_->translate(bullets_[i]->speed_*deltaTime);
+      bullets_[i]->node_->yaw(Degree(deltaTime*100));
+      bullets_[i]->node_->roll(Degree(deltaTime*300));
+    }
+
+    return true;
+  }
+
+}
+}
Index: /code/branches/audio/src/orxonox/weapon/bullet_manager.h
===================================================================
--- /code/branches/audio/src/orxonox/weapon/bullet_manager.h	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/bullet_manager.h	(revision 310)
@@ -0,0 +1,66 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef BULLET_MANAGER_H
+#define BULLET_MANAGER_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class BulletManager
+  {
+  public:
+    BulletManager(Ogre::SceneManager*);
+	  virtual ~BulletManager();
+
+    void addBullet(Bullet*);
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+    Ogre::SceneManager *sceneMgr_;
+
+  protected:
+    // Bullet array
+	  Bullet **bullets_;
+	  int bulletsSize_;
+	  int bulletsIndex_;
+
+  };
+
+}
+}
+
+#endif /* BULLET_MANAGER_H */
Index: /code/branches/audio/src/orxonox/weapon/weapon_station.cc
===================================================================
--- /code/branches/audio/src/orxonox/weapon/weapon_station.cc	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/weapon_station.cc	(revision 310)
@@ -0,0 +1,80 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+
+#include "base_weapon.h"
+
+#include "weapon_station.h"
+
+
+namespace orxonox {
+namespace weapon {
+  using namespace Ogre;
+
+  WeaponStation::WeaponStation(int stationSize)
+        : stationSize_(stationSize), lastActiveSlotIndex_(-1),
+        slots_(new BaseWeapon*[stationSize])
+  {
+  	//slots_ = new BaseWeapon*[stationSize];
+  }
+
+
+  WeaponStation::~WeaponStation()
+  {
+    if (slots_)
+      delete slots_;
+    // when factory available: delete weapons too
+  }
+
+
+  bool WeaponStation::addWeapon(BaseWeapon *weapon)
+  {
+    if (lastActiveSlotIndex_ = stationSize_ - 1)
+      return false;
+
+    // this is ugly, but for the time being, it has to fit.
+    slots_[++lastActiveSlotIndex_] = weapon;
+    selectedSlot_ = slots_ + lastActiveSlotIndex_;
+    return true;
+  }
+
+
+  BaseWeapon* WeaponStation::selectWeapon(int slotNumber)
+  {
+    if (slotNumber < lastActiveSlotIndex_)
+      return NULL;
+    return slots_[slotNumber];
+  }
+
+}
+}
Index: /code/branches/audio/src/orxonox/weapon/weapon_station.h
===================================================================
--- /code/branches/audio/src/orxonox/weapon/weapon_station.h	(revision 310)
+++ /code/branches/audio/src/orxonox/weapon/weapon_station.h	(revision 310)
@@ -0,0 +1,69 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef WEAPON_STATION_H
+#define WEAPON_STATION_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace weapon {
+
+  class WeaponStation
+  {
+  public:
+    WeaponStation(int slotSize);
+	  ~WeaponStation();
+
+    bool addWeapon(BaseWeapon*);
+
+    //bool removeCurrentWeapon();
+
+    // TODO: access every weapon by name
+    BaseWeapon* selectWeapon(int slotNumber);
+
+  protected:
+
+  public:
+
+  protected:
+    // slot management
+    BaseWeapon **slots_;
+    BaseWeapon **selectedSlot_;
+    int lastActiveSlotIndex_;
+    int stationSize_;
+
+  };
+
+}
+}
+
+#endif /* WEAPON_STATION_H */
Index: /code/branches/audio/src/orxonox_prerequisites.h
===================================================================
--- /code/branches/audio/src/orxonox_prerequisites.h	(revision 310)
+++ /code/branches/audio/src/orxonox_prerequisites.h	(revision 310)
@@ -0,0 +1,64 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_PREREQUISITES_H
+#define ORXONOX_PREREQUISITES_H
+
+namespace orxonox {
+
+  class CameraManager;
+  class InertialNode;
+  class OgreControl;
+  class Orxonox;
+  class OrxonoxShip;
+  class OrxonoxScene;
+  class RunManager;
+
+
+  namespace weapon {
+
+    class AmmunitionDump;
+    class Bullet;
+    class BulletManager;
+    class BaseWeapon;
+    class BarrelGun;
+    class WeaponStation;
+
+  }
+
+
+  namespace hud {
+    
+    class HUDOverlay;
+    class TestOverlay;
+
+  }
+
+}
+
+#endif /* ORXONOX_PREREQUISITES_H */
Index: /code/branches/audio/src/orxonox_scene.cc
===================================================================
--- /code/branches/audio/src/orxonox_scene.cc	(revision 310)
+++ /code/branches/audio/src/orxonox_scene.cc	(revision 310)
@@ -0,0 +1,155 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreLight.h"
+#include "OgreBillboard.h"
+#include "OgreBillboardSet.h"
+#include "OgreVector3.h"
+
+#include "orxonox_scene.h"
+
+namespace orxonox {
+  using namespace Ogre;
+
+  /**
+  * The orxonox scene includes everything running in the background like terrain,
+  * static figures, dangling lamp, etc.
+  */
+
+
+  /**
+  * Empty Consructor except the initialiser list.
+  * @param sceneMgr The Scene Manager.
+  */
+  OrxonoxScene::OrxonoxScene(SceneManager *sceneMgr) : sceneMgr_(sceneMgr)
+  {
+  }
+
+  /**
+  * Empty Destructor.
+  */
+  OrxonoxScene::~OrxonoxScene()
+  {
+  }
+
+  /**
+  * Ogre initialisation method.
+  * This function is called by the Run Manager to load the neccessary recources
+  * and to create the scene.
+  * @return False if failed.
+  */
+  bool OrxonoxScene::initialise()
+  {
+	  // Load resources
+	  loadResources();
+
+	  distance_ = 0;
+	  radius_ = 100;
+
+	  createScene();
+
+	  return true;
+  }
+
+
+  /**
+  * Resource loader.
+  * Currently, this method loads everything! TODO: If done this ugly, it should
+  * at least be in the Run Manager.
+  */
+  void OrxonoxScene::loadResources()
+  {
+	  // Initialise, parse scripts etc
+	  ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+  }
+
+
+  /**
+  * Scene creation.
+  * Currently just a test scene with an ogre head an a surrounding light.
+  */
+  void OrxonoxScene::createScene()
+  {
+	  sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3)*2);
+
+	  //create first entity
+	  Entity *head = sceneMgr_->createEntity("head", "ogrehead.mesh");
+
+	  //create a scene node to attach the head to
+	  SceneNode *node = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
+	  //attach the ogre head
+	  node->attachObject(head);
+
+	  // set up skybox
+	  sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox1");
+
+	  // set up one light_ source
+	  light_ = sceneMgr_->createLight("Light1");
+	  light_->setType(Light::LT_POINT);
+	  light_->setPosition(Vector3(0, 0, 0));
+	  light_->setDiffuseColour(1.0, 1.0, 1.0);
+	  light_->setSpecularColour(1.0, 1.0, 1.0);
+
+	  //create billboard
+	  bbs_ = sceneMgr_->createBillboardSet("bb", 1);
+	  bbs_->createBillboard(Vector3::ZERO, ColourValue(1.0, 1.0, 1.0));
+	  bbs_->setMaterialName("Examples/Flare");
+
+	  lightNode_ = sceneMgr_->getRootSceneNode()
+          ->createChildSceneNode("lightNode_", Vector3(0, 100, 0));
+
+	  lightNode_->attachObject(bbs_);
+	  lightNode_->attachObject(light_);
+  }
+
+
+  /**
+  * Compute something between frames if neccessary.
+  * @param time Absolute time.
+  * @param deltaTime Relative time.
+  * @return Return true to continue rendering.
+  */
+  bool OrxonoxScene::tick(unsigned long time, Real deltaTime)
+  {
+	  Real t = time/1000.0;
+
+	  lightNode_->setPosition(radius_*sin(5*t), radius_*cos(5*t), sin(1*t)*distance_);
+  	
+	  light_->setDiffuseColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+	  light_->setSpecularColour(sin(1*t), sin(1*t + 2.09), sin(1*t + 2.09*2));
+
+	  bbs_->getBillboard(0)->setColour(ColourValue(sin(1*t),
+          sin(1*t + 2.09), sin(1*t + 2.09*2)));
+    
+    return true;
+  }
+
+}
Index: /code/branches/audio/src/orxonox_scene.h
===================================================================
--- /code/branches/audio/src/orxonox_scene.h	(revision 310)
+++ /code/branches/audio/src/orxonox_scene.h	(revision 310)
@@ -0,0 +1,70 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_SCENE_H
+#define ORXONOX_SCENE_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxScene
+  {
+  public:
+    OrxonoxScene(Ogre::SceneManager*);
+
+	  virtual ~OrxonoxScene();
+
+	  virtual bool initialise();
+
+	  virtual bool tick(unsigned long, Ogre::Real);
+
+  protected:
+	  /// method where you can perform resource group loading
+	  virtual void loadResources();
+
+	  /// Define what is in the scene
+	  virtual void createScene();
+
+  protected:
+	  Ogre::SceneManager* sceneMgr_;
+
+	  //specific variables for test purposes
+	  Ogre::Light        *light_;
+	  Ogre::SceneNode    *lightNode_;
+	  Ogre::BillboardSet *bbs_;
+	  Ogre::Real distance_;
+    Ogre::Real radius_;
+  };
+
+}
+
+#endif /* ORXONOX_SCENE_H */
Index: /code/branches/audio/src/orxonox_ship.cc
===================================================================
--- /code/branches/audio/src/orxonox_ship.cc	(revision 310)
+++ /code/branches/audio/src/orxonox_ship.cc	(revision 310)
@@ -0,0 +1,254 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "OgreMath.h"
+#include "OgreVector3.h"
+#include "OgreQuaternion.h"
+#include "OgreSceneNode.h"
+#include "OgreEntity.h"
+#include "OgreSceneManager.h"
+#include "OgreParticleSystem.h"
+
+#include "inertial_node.h"
+#include "run_manager.h"
+#include "weapon/bullet.h"
+#include "weapon/bullet_manager.h"
+#include "weapon/weapon_station.h"
+#include "weapon/base_weapon.h"
+#include "weapon/barrel_gun.h"
+#include "weapon/ammunition_dump.h"
+
+#include "orxonox_ship.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+
+  /**
+  * Base class for any kind of flyable ship in Orxonox.
+  * 
+  * The ship offers steering methods (like left, right, etc.) and translates
+  * them into movement. A ship can also hold more than one weapons (where each
+  * of these can be replaced during the game). This means that a ship can have
+  * many WeaponManagers but only one MunitionManager (independant object that
+  * is referenced in each WeaponManager).
+  * Furthermore a ship in Orxonox is responsible for its visualization, which is
+  * why it receives a pointer to the SceneManager.
+  */
+
+
+  /**
+  * Standard constructor, that only initalizes a few variables. Some of them
+  * could be made static, since any new ship would be derived from the BaseShip.
+  * Or even better: write config files for each ship so that manipulating
+  * its properties would be even easier.
+  * @param mSceneMgr The current main SceneManager
+  * @param mNode The scene node which the ship will be attached to later.
+  */
+  OrxonoxShip::OrxonoxShip(SceneNode *node)
+    : sceneMgr_(RunManager::getSingletonPtr()->getSceneManagerPtr()),
+      bulletManager_(RunManager::getSingletonPtr()->getBulletManagerPtr()),
+      baseThrust_(1000), currentThrust_(Vector3::ZERO), objectCounter_(0)
+  {
+    rootNode_ = new InertialNode(node, Vector3::ZERO);
+  }
+
+
+  /**
+  * Standard destructor.
+  * Doesn't have any work to do yet.
+  */
+  OrxonoxShip::~OrxonoxShip()
+  {
+    if (mainWeapon_)
+      delete mainWeapon_;
+    if (railGunStation_)
+      delete railGunStation_;
+    if (rootNode_)
+      delete rootNode_;
+  }
+
+
+  /**
+  * Initialises everything.
+  * Once that ResourceGroups are organised, this method loads them.
+  * It might be an idea to make this function static in order for the
+  * SceneManger to call the initialise method of every needed class (macros..)
+  * @return Returns false when failed.
+  */
+  bool OrxonoxShip::initialise()
+  {
+	  // load all the resources needed (no resource groups yet,
+    // so the allInit is not executed!)
+	  // ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+
+	  // create the "space ship" (currently a fish..)
+	  // TODO: names must be unique! use static variables..
+	  shipEntity_ = sceneMgr_->createEntity("Ship", "fish.mesh");
+	  InertialNode *fishNode = rootNode_->createChildNode();
+    fishNode->getSceneNode()->yaw(Degree(-90));
+	  fishNode->getSceneNode()->attachObject(shipEntity_);
+	  fishNode->getSceneNode()->setScale(Vector3(10, 10, 10));
+
+    // initialise weapon(s)
+    ammoDump_ = new AmmunitionDump();
+    ammoDump_->setDumpSize("Barrel", 1000);
+    ammoDump_->store("Barrel", 420);
+
+    InertialNode *mainWeaponNode = rootNode_->createChildNode();
+    mainWeapon_ = new BarrelGun(mainWeaponNode, ammoDump_);
+
+    railGunStation_ = new WeaponStation(4);
+    railGunStation_->addWeapon(mainWeapon_);
+    railGunStation_->selectWeapon(0);
+
+    // create some nice effects
+
+    ParticleSystem *particles = RunManager::getSingletonPtr()
+      ->getSceneManagerPtr()->createParticleSystem("asdf", "Examples/Smoke");
+
+    fishNode->getSceneNode()->attachObject(particles);
+
+
+
+
+	  return true;
+  }
+
+
+  /**
+  * Gets the ship to accelerate in the current direction.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setMainThrust(const Real value)
+  {
+    currentThrust_.z = value * baseThrust_;
+  }
+
+
+  /**
+  * Gets the ship to accelerate sideways regarding the current direction.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setSideThrust(const Real value)
+  {
+    currentThrust_.x = value * baseThrust_;
+  }
+
+
+  /**
+  * Gets the ship to accelerate up and down.
+  * The value should be between 0 and 1, with one beeing full thrust and 0 none
+  * @param value Acceleration between 0 and 1
+  */
+  void OrxonoxShip::setYThrust(const Real value)
+  {
+    currentThrust_.y = value * baseThrust_;
+  }
+
+
+  /**
+  * Rotate the ship along with the camera up and down.
+  * @param angle Pitch value.
+  */
+  void OrxonoxShip::turnUpAndDown(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->pitch(-angle, Node::TS_LOCAL);
+  }
+
+
+  /**
+  * Rotate the ship along with the camera left and right.
+  * @param angle Yaw value.
+  */
+  void OrxonoxShip::turnLeftAndRight(const Radian &angle)
+  {
+    rootNode_->getSceneNode()->yaw(-angle, Node::TS_PARENT);
+  }
+
+
+  /**
+  * Returns the current speed of the ship according to its parent node.
+  * @return The current speed.
+  */
+  Vector3 OrxonoxShip::getSpeed()
+  {
+    return rootNode_->getSpeed();
+  }
+
+  /**
+  * Returns the ship's root SceneNode.
+  * @return The Root Node.
+  */
+  InertialNode* OrxonoxShip::getRootNode()
+  {
+    return rootNode_;
+  }
+
+
+  /**
+  * Fire a bullet (Entity with SceneNode).
+  * This method creates a new Entity plus a SceneNode. But be sure not make
+  * the new Node a child of RootNode_!
+  * @return Bullet containing speed and entity.
+  */
+  BaseWeapon* OrxonoxShip::getMainWeapon()
+  {
+    return mainWeapon_;
+  }
+
+
+  int OrxonoxShip::getAmmoStock()
+  {
+    return ammoDump_->getStockSize("Barrel");
+  }
+
+
+  /**
+  * Standard tick() function.
+  * Currently, only the speed is applied according to the thrust values.
+  * @param time Absolute time.
+  * @param deltaTime Relative time.
+  * @return Return true to continue render
+  */
+  bool OrxonoxShip::tick(unsigned long time, Real deltaTime)
+  {
+    mainWeapon_->tick(time, deltaTime);
+
+    Quaternion quad = rootNode_->getSceneNode()->getOrientation();
+    quad.normalise();
+    rootNode_->addSpeed(quad * (Vector3(-1, -1, -1) * currentThrust_) * deltaTime);
+
+    rootNode_->getSceneNode()->translate(rootNode_->getSpeed() * deltaTime);
+
+	  return true;
+  }
+
+}
Index: /code/branches/audio/src/orxonox_ship.h
===================================================================
--- /code/branches/audio/src/orxonox_ship.h	(revision 310)
+++ /code/branches/audio/src/orxonox_ship.h	(revision 310)
@@ -0,0 +1,86 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef ORXONOX_SHIP_H
+#define ORXONOX_SHIP_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  class OrxonoxShip
+  {
+  public:
+    OrxonoxShip(Ogre::SceneNode*);
+	  virtual ~OrxonoxShip();
+
+	  virtual bool initialise();
+
+	  void setMainThrust(const Ogre::Real);
+	  void setSideThrust(const Ogre::Real);
+    void setYThrust(const Ogre::Real);
+	  void turnUpAndDown(const Ogre::Radian&);
+	  void turnLeftAndRight(const Ogre::Radian&);
+
+    InertialNode* getRootNode();
+    Ogre::Vector3 getSpeed();
+
+    weapon::BaseWeapon* getMainWeapon();
+
+    int getAmmoStock();
+
+	  bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  protected:
+	  Ogre::SceneManager *sceneMgr_;
+	  //Ogre::SceneNode *rootNode_;
+    InertialNode *rootNode_;
+	  Ogre::Entity *shipEntity_;
+
+	  //Ogre::Vector3 currentSpeed_;  // relative to space
+	  Ogre::Vector3 currentThrust_; // relative to the ship
+    Ogre::Real baseThrust_;
+	  int objectCounter_;
+
+    weapon::BulletManager *bulletManager_;
+	  //Ogre::Vector3 bulletSpeed_;
+
+    weapon::BaseWeapon *mainWeapon_;
+    weapon::WeaponStation *railGunStation_;
+
+    weapon::AmmunitionDump *ammoDump_;
+  };
+
+}
+
+#endif /* ORXONOX_SHIP_H */
Index: /code/branches/audio/src/run_manager.cc
===================================================================
--- /code/branches/audio/src/run_manager.cc	(revision 310)
+++ /code/branches/audio/src/run_manager.cc	(revision 310)
@@ -0,0 +1,512 @@
+/*
+*   ORXONOX - the hottest 3D action shooter ever to exist
+*
+*
+*   License notice:
+*
+*   This program is free software: you can redistribute it and/or modify
+*   it under the terms of the GNU General Public License as published by
+*   the Free Software Foundation, either version 3 of the License, or
+*   (at your option) any later version.
+*
+*   This program 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 General Public License for more details.
+*
+*   You should have received a copy of the GNU General Public License
+*   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*
+*
+*   Author:
+*      Reto Grieder
+*   Co-authors:
+*      ...
+*/
+
+
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreCamera.h"
+#include "OgreViewport.h"
+#include "OgreRenderWindow.h"
+#include "OgreTextureManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreLogManager.h"
+#include "OgreWindowEventUtilities.h"
+
+//Use this define to signify OIS will be used as a DLL
+//(so that dll import/export macros are in effect)
+#define OIS_DYNAMIC_LIB
+#include <OIS/OIS.h>
+
+#include "ogre_control.h"
+#include "orxonox_scene.h"
+#include "orxonox_ship.h"
+#include "inertial_node.h"
+
+#include "weapon/bullet.h"
+#include "weapon/bullet_manager.h"
+#include "weapon/base_weapon.h"
+
+#include "hud/hud_overlay.h"
+#include "hud/test_overlay.h"
+
+#include "run_manager.h"
+
+
+namespace orxonox {
+  using namespace Ogre;
+  using namespace weapon;
+  using namespace hud;
+
+  /**
+  * RunManager is the basic control object during the game.
+  * 
+  * The RunManger class is designed to actually "run" the main part of the
+  * game. The Idea is, that you could derive from the RunManager in order
+  * to distinguish between a first person shooter or a space craft shooter.
+  * RunManager loads and initialises everything in the scene (like the ship,
+  * the enemies in the scene, any scripts, the physics, window events,
+  * environment, HUD, etc.).
+  * It also captures any input from keyboard, mous, joystick (optional) or
+  * Ogre (window events).
+  */
+
+
+  RunManager* RunManager::singletonPtr_s = NULL;
+
+
+  /**
+  * Contructor only needs the Root object.
+  */
+  RunManager::RunManager()
+        : ogre_(NULL), window_(NULL), screenShotCounter_(0),
+        timeUntilNextToggle_(0), mouseSensitivity_(0.003), inputManager_(0),
+        mouse_(0), keyboard_(0), joystick_(0), statsOn_(true)
+  {
+  }
+
+  /**
+  * @param ogre_ The OgreControl object holding the render window and the Root
+  */
+  void RunManager::initialise(OgreControl *ogre)
+    {
+    ogre_ = ogre;
+    window_ = ogre->getRenderWindow();
+
+    // SETTING UP THE SCENE
+
+    // create one new SceneManger
+    sceneMgr_ = ogre_->getRoot()->createSceneManager(ST_GENERIC, "Orxonox Scene");
+
+    // background scene (world objects, skybox, lights, etc.)
+    backgroundScene_ = new OrxonoxScene(sceneMgr_);
+
+
+    // BULLET LIST FOR THE TEST APPLICATION
+
+    // create a bullet manager
+    bulletManager_ = new BulletManager(sceneMgr_);
+
+
+    // PLAYER SPACESHIP
+
+    // Create a space ship object and its SceneNode.
+    // It should also be considered, that the ship should provide another Node
+    // for a camera to be attached (otherwise the spaceship in front of the
+    // ship would be very static, never moving at all).
+
+    // Construct a new spaceship and give it the node
+    playerShip_ = new OrxonoxShip(sceneMgr_->getRootSceneNode()
+      ->createChildSceneNode("ShipNode", Vector3(20, 20, 20)));
+
+
+    // RESOURCE LOADING (using ResourceGroups if implemented)
+
+    // load all resources and create the entities by calling the initialise()
+    // methods for each object (no constructor initialisations!).
+    backgroundScene_->initialise();
+    playerShip_->initialise();
+
+
+    // CAMERA AND VIEWPORT
+
+    // create camera and viewport
+    createCamera();
+    createViewports();
+
+    // create HUD
+    hud_ = new hud::TestOverlay(window_);
+    hud_->show();
+
+
+    // Set default mipmap level (NB some APIs ignore this)
+    TextureManager::getSingleton().setDefaultNumMipmaps(5);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;    
+
+    LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
+    ParamList pl;
+    size_t windowHnd = 0;
+    std::ostringstream windowHndStr;
+
+    window_->getCustomAttribute("WINDOW", &windowHnd);
+    windowHndStr << windowHnd;
+    pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
+
+    inputManager_ = InputManager::createInputSystem( pl );
+
+    // Create all devices (We only catch joystick exceptions here,
+    // as, most people have Key/Mouse)
+    keyboard_ = static_cast<Keyboard*>(inputManager_
+      ->createInputObject( OISKeyboard, false ));
+    mouse_ = static_cast<Mouse*>(inputManager_
+      ->createInputObject( OISMouse, false ));
+    try {
+      joystick_ = static_cast<JoyStick*>(inputManager_
+        ->createInputObject( OISJoyStick, false ));
+    }
+    catch(...) {
+      joystick_ = 0;
+    }
+
+    //Set initial mouse clipping size
+    windowResized(window_);
+
+    //showDebugOverlay(true);
+
+    // REGISTER THIS OBJECT AS A WINDOW EVENT LISTENER IN OGRE
+    // It will then receive events liek windowClosed, windowResized, etc.
+    WindowEventUtilities::addWindowEventListener(window_, this);
+  }
+
+  /**
+  * Standard destructor.
+  * Removes this object as a window event listener and deletes all created
+  * variables.
+  */
+  RunManager::~RunManager()
+  {
+    //Remove ourself as a Window listener
+    WindowEventUtilities::removeWindowEventListener(window_, this);
+    windowClosed(window_);
+
+    if (backgroundScene_)
+      delete backgroundScene_;
+    if (playerShip_)
+      delete playerShip_;
+    if (bulletManager_)
+      delete bulletManager_;
+    if (hud_)
+      delete hud_;
+  }
+
+
+  /**
+  * Method to compute anything between 2 frames.
+  * 
+  * Everything that needs to be computed during the games happens right here.
+  * The only exception are the listeners (which should only set variables,
+  * not actually do something).
+  * 
+  * @param time Absolute play time
+  * @param deltaTime Time passed since last frame
+  * @return Return false to end rendering
+  */
+  bool RunManager::tick(unsigned long time, float deltaTime)
+  {
+    // synchronize with internal class timer
+    totalTime_ = time;
+
+    // Call tick() for every object
+    // This could be done by registering (needs a factory..)
+    backgroundScene_->tick(time, deltaTime);
+    playerShip_->tick(time, deltaTime);
+
+
+    // Update the HUD
+    Ogre::String tempStr = " | Speed = "
+      + StringConverter::toString(playerShip_->getSpeed())
+      + " | Left Ammo = "
+      + StringConverter::toString(playerShip_
+      ->getMainWeapon()->getAmmoState())
+      + " | Ammo stock = "
+      + StringConverter::toString(playerShip_->getAmmoStock());
+    hud_->setDebugText(tempStr);
+
+    hud_->tick(time, deltaTime);
+
+    // update the bullet positions
+    bulletManager_->tick(time, deltaTime);
+
+
+    // HUMAN INTERFACE
+
+    using namespace OIS;
+
+    if(window_->isClosed())	return false;
+
+    //Need to capture/update each device
+    keyboard_->capture();
+    mouse_->capture();
+    if( joystick_ ) joystick_->capture();
+
+    bool buffJ = (joystick_) ? joystick_->buffered() : true;
+
+    //Check if one of the devices is not buffered
+    if( !mouse_->buffered() || !keyboard_->buffered() || !buffJ )
+    {
+      // one of the input modes is immediate, so setup what
+      // is needed for immediate movement
+      if (timeUntilNextToggle_ >= 0)
+        timeUntilNextToggle_ -= deltaTime;
+    }
+
+    // handle HID devices
+    if( processUnbufferedKeyInput() == false )
+        return false;
+    if( processUnbufferedMouseInput() == false )
+        return false;
+
+    // keep rendering
+    return true;
+  }
+
+
+  SceneManager& RunManager::getSceneManager()
+  {
+    return *sceneMgr_;
+  }
+
+  SceneManager* RunManager::getSceneManagerPtr()
+  {
+    return sceneMgr_;
+  }
+
+  BulletManager* RunManager::getBulletManagerPtr()
+  {
+    return bulletManager_;
+  }
+
+  int RunManager::getAmmunitionID(const Ogre::String &ammoName)
+  {
+    Ogre::String ammoTypes[] = { "Energy Cell", "Barrel", "Lead Shot" };
+    int ammoTypesLength = 3;
+
+    for (int i = 0; i < ammoTypesLength; i++)
+    {
+      if (ammoTypes[i] == ammoName)
+        return i;
+    }
+    return -1;
+  }
+
+  int RunManager::getNumberOfAmmos()
+  {
+    return 3;
+  }
+
+
+  /**
+  * Adjust mouse clipping area.
+  * This method is called by Ogre without regards of tick()!
+  * Avoid doing too much in this call.
+  * @param rw render window
+  */
+  void RunManager::windowResized(RenderWindow* rw)
+  {
+    unsigned int width, height, depth;
+    int left, top;
+    rw->getMetrics(width, height, depth, left, top);
+
+    const OIS::MouseState &ms = mouse_->getMouseState();
+    ms.width = width;
+    ms.height = height;
+  }
+
+
+  /**
+  * Unattach OIS before window shutdown (very important under Linux).
+  * Again, avoid computing a lot in this function.
+  * @param rw Render Window
+  */
+  void RunManager::windowClosed(RenderWindow* rw)
+  {
+    //Only close for window that created OIS (the main window in these demos)
+    if( rw == window_ )
+    {
+      if( inputManager_ )
+      {
+        inputManager_->destroyInputObject( mouse_ );
+        inputManager_->destroyInputObject( keyboard_ );
+        inputManager_->destroyInputObject( joystick_ );
+
+        OIS::InputManager::destroyInputSystem(inputManager_);
+        inputManager_ = 0;
+      }
+    }
+  }
+
+  /**
+  * Processes the Keyboard input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind any key to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedKeyInput()
+  {
+    using namespace OIS;
+
+    if(keyboard_->isKeyDown(KC_A) || keyboard_->isKeyDown(KC_LEFT))
+      playerShip_->setSideThrust(1);
+    else if(keyboard_->isKeyDown(KC_D) || keyboard_->isKeyDown(KC_RIGHT))
+      playerShip_->setSideThrust(-1);
+    else
+      playerShip_->setSideThrust(0);
+
+    if(keyboard_->isKeyDown(KC_UP) || keyboard_->isKeyDown(KC_W) )
+      playerShip_->setMainThrust(1);
+    else if(keyboard_->isKeyDown(KC_DOWN) || keyboard_->isKeyDown(KC_S) )
+      playerShip_->setMainThrust(-1);
+    else
+      playerShip_->setMainThrust(0);
+
+    if (keyboard_->isKeyDown(KC_C))
+      playerShip_->setYThrust(1);
+    else if (keyboard_->isKeyDown(KC_SPACE))
+      playerShip_->setYThrust(-1);
+    else
+      playerShip_->setYThrust(0);
+
+    if (keyboard_->isKeyDown(KC_G))
+      playerShip_->getMainWeapon()->addAction(BaseWeapon::RELOAD);
+
+    if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) )
+      return false;
+
+    if( keyboard_->isKeyDown(KC_F) && timeUntilNextToggle_ <= 0 )
+    {
+      statsOn_ = !statsOn_;
+      timeUntilNextToggle_ = 1;
+    }
+
+    if(keyboard_->isKeyDown(KC_SYSRQ) && timeUntilNextToggle_ <= 0)
+    {
+      std::ostringstream ss;
+      ss << "screenshot_" << ++screenShotCounter_ << ".png";
+      window_->writeContentsToFile(ss.str());
+      timeUntilNextToggle_ = 0.5;
+    }
+
+    // Return true to continue rendering
+    return true;
+  }
+
+
+  /**
+  * Processes the Mouse input.
+  * TODO: Use listeners to improve performance.
+  * A lookup table should be implemented to bind ANY button or movement
+  * to a specific action.
+  * @return Return true to keep rendering
+  */
+  bool RunManager::processUnbufferedMouseInput()
+  {
+    using namespace OIS;
+
+    const MouseState &ms = mouse_->getMouseState();
+
+    if (ms.buttonDown(MB_Left))
+      playerShip_->getMainWeapon()->primaryFireRequest();
+
+    if (ms.buttonDown(MB_Right))
+      playerShip_->getMainWeapon()->secondaryFireRequest();
+
+    playerShip_->turnUpAndDown(Radian(ms.Y.rel * mouseSensitivity_));
+    playerShip_->turnLeftAndRight(Radian(ms.X.rel * mouseSensitivity_));
+
+    // keep rendering
+    return true;
+  }
+
+  /**
+  * Show an overlay desired.
+  * @param show Whether or not to show the debug overlay
+  */
+  void RunManager::showDebugOverlay(bool show)
+  {
+    if (hud_)
+    {
+      if (show)
+        hud_->show();
+      else
+        hud_->hide();
+    }
+  }
+
+
+  /**
+  * Simple camera creator.
+  * playerShip_Node->attachObject(camera_) should not be here! This is what
+  * the camera manager is for. Right now, this method should do just fine,
+  * setting the cam behind the ship.
+  */
+  void RunManager::createCamera()
+  {
+    camera_ = sceneMgr_->createCamera("PlayerCam");
+    playerShip_->getRootNode()->getSceneNode()->attachObject(camera_);
+    camera_->setNearClipDistance(5);
+    camera_->setPosition(Vector3(0,10,500));
+    camera_->lookAt(Vector3(0,0,0));
+  }
+
+  /**
+  * Simple viewport creator.
+  * For now the viewport uses the entire render window and is based on the one
+  * camera created so far.
+  */
+  void RunManager::createViewports()
+  {
+    // Create one viewport, entire window
+    Viewport* vp = window_->addViewport(camera_);
+    vp->setBackgroundColour(ColourValue(0,0,0));
+
+    // Alter the camera aspect ratio to match the viewport
+    camera_->setAspectRatio(
+      Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+  }
+
+
+  RunManager* RunManager::createSingleton()
+  {
+    if (singletonPtr_s)
+      return NULL;
+    singletonPtr_s = new RunManager();
+    return singletonPtr_s;
+  }
+
+  void RunManager::destroySingleton()
+  {
+    if (singletonPtr_s)
+      delete singletonPtr_s;
+  }
+
+
+  RunManager& RunManager::getSingleton()
+  {
+    return *singletonPtr_s;
+  }
+
+  RunManager* RunManager::getSingletonPtr()
+  {
+    return singletonPtr_s;
+  }
+
+}
Index: /code/branches/audio/src/run_manager.h
===================================================================
--- /code/branches/audio/src/run_manager.h	(revision 310)
+++ /code/branches/audio/src/run_manager.h	(revision 310)
@@ -0,0 +1,142 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program 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 General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+
+#ifndef RUN_MANAGER_H
+#define RUN_MANAGER_H
+
+#include "OgrePrerequisites.h"
+#include "OgreWindowEventUtilities.h"
+//#include "OgreTextureManager.h"
+
+#include <OIS/OISPrereqs.h>
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+
+  // let the class inherit from WindowEventListener in order for the RunMgr
+  // to act as the central point of all the calcuations in Orxonox
+  class RunManager : public Ogre::WindowEventListener
+  {
+  public:
+    virtual ~RunManager();
+    
+    void initialise(OgreControl*);
+
+    bool tick(unsigned long, Ogre::Real);
+
+    Ogre::SceneManager& getSceneManager();
+
+    Ogre::SceneManager* getSceneManagerPtr();
+
+    weapon::BulletManager* getBulletManagerPtr();
+
+    int getAmmunitionID(const Ogre::String&);
+
+    int getNumberOfAmmos();
+
+    static RunManager* createSingleton();
+
+    static void destroySingleton();
+
+    static RunManager& getSingleton(void);
+
+    static RunManager* getSingletonPtr(void);
+
+
+  protected:
+    RunManager();
+
+	  void createCamera(void);
+
+	  void createViewports(void);
+
+
+	  /** EVENT HANDLING **/
+
+	  //Adjust mouse clipping area
+	  void windowResized(Ogre::RenderWindow*);
+
+	  //Unattach OIS before window shutdown (very important under Linux)
+	  void windowClosed(Ogre::RenderWindow*);
+
+
+	  /** INPUT PROCESSING **/
+	  bool processUnbufferedKeyInput();
+
+	  bool processUnbufferedMouseInput();
+
+
+	  /** OUTPUT **/
+
+	  void showDebugOverlay(bool);
+
+  protected:
+    // directly Ogre related fields
+	  Ogre::SceneManager *sceneMgr_;
+	  Ogre::RenderWindow *window_;
+	  Ogre::Camera       *camera_;
+
+
+    // self made orxonox fields
+	  OgreControl  *ogre_;
+	  OrxonoxScene *backgroundScene_;
+	  OrxonoxShip  *playerShip_;
+    hud::TestOverlay *hud_;
+
+    // Bullet manager
+    weapon::BulletManager *bulletManager_;
+
+    const Ogre::Real mouseSensitivity_;
+
+	  // previously elapsed render time
+	  unsigned long totalTime_;
+
+
+    // fields from the example framework
+	  bool statsOn_;
+
+	  unsigned int screenShotCounter_;
+	  // just to stop toggles flipping too fast
+	  Ogre::Real timeUntilNextToggle_;
+
+	  //OIS Input devices
+	  OIS::InputManager* inputManager_;
+	  OIS::Mouse*    mouse_;
+	  OIS::Keyboard* keyboard_;
+	  OIS::JoyStick* joystick_;
+
+    // singleton pointer
+    static RunManager *singletonPtr_s;
+
+  };
+
+}
+
+#endif /* RUN_MANAGER_H */
Index: /code/branches/audio/src/xml/xmlParser.cc
===================================================================
--- /code/branches/audio/src/xml/xmlParser.cc	(revision 310)
+++ /code/branches/audio/src/xml/xmlParser.cc	(revision 310)
@@ -0,0 +1,2721 @@
+/**
+ ****************************************************************************
+ * <P> XML.c - implementation file for basic XML parser written in ANSI C++
+ * for portability. It works by using recursion and a node tree for breaking
+ * down the elements of an XML document.  </P>
+ *
+ * @version     V2.33
+ * @author      Frank Vanden Berghen
+ *
+ * NOTE:
+ *
+ *   If you add "#define STRICT_PARSING", on the first line of this file
+ *   the parser will see the following XML-stream:
+ *      <a><b>some text</b><b>other text    </a>
+ *   as an error. Otherwise, this tring will be equivalent to:
+ *      <a><b>some text</b><b>other text</b></a>
+ *
+ * NOTE:
+ *
+ *   If you add "#define APPROXIMATE_PARSING" on the first line of this file
+ *   the parser will see the following XML-stream:
+ *     <data name="n1">
+ *     <data name="n2">
+ *     <data name="n3" />
+ *   as equivalent to the following XML-stream:
+ *     <data name="n1" />
+ *     <data name="n2" />
+ *     <data name="n3" />
+ *   This can be useful for badly-formed XML-streams but prevent the use
+ *   of the following XML-stream (problem is: tags at contiguous levels
+ *   have the same names):
+ *     <data name="n1">
+ *        <data name="n2">
+ *            <data name="n3" />
+ *        </data>
+ *     </data>
+ *
+ * NOTE:
+ *
+ *   If you add "#define _XMLPARSER_NO_MESSAGEBOX_" on the first line of this file
+ *   the "openFileHelper" function will always display error messages inside the
+ *   console instead of inside a message-box-window. Message-box-windows are
+ *   available on windows 9x/NT/2000/XP/Vista only.
+ *
+ * BSD license:
+ * Copyright (c) 2002, Frank Vanden Berghen
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the Frank Vanden Berghen nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************
+ */
+#ifndef _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE
+#endif
+#include "xmlParser.h"
+#ifdef _XMLWINDOWS
+//#ifdef _DEBUG
+//#define _CRTDBG_MAP_ALLOC
+//#include <crtdbg.h>
+//#endif
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h> // to have IsTextUnicode, MultiByteToWideChar, WideCharToMultiByte to handle unicode files
+                     // to have "MessageBoxA" to display error messages for openFilHelper
+#endif
+
+#include <memory.h>
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+XMLCSTR XMLNode::getVersion() { return _X("v2.30"); }
+void freeXMLString(XMLSTR t){free(t);}
+
+static XMLNode::XMLCharEncoding characterEncoding=XMLNode::encoding_UTF8;
+static char guessWideCharChars=1, dropWhiteSpace=1;
+
+inline int mmin( const int t1, const int t2 ) { return t1 < t2 ? t1 : t2; }
+
+// You can modify the initialization of the variable "XMLClearTags" below
+// to change the clearTags that are currently recognized by the library.
+// The number on the second columns is the length of the string inside the
+// first column. The "<!DOCTYPE" declaration must be the second in the list.
+typedef struct { XMLCSTR lpszOpen; int openTagLen; XMLCSTR lpszClose;} ALLXMLClearTag;
+static ALLXMLClearTag XMLClearTags[] =
+{
+    {    _X("<![CDATA["),9,  _X("]]>")      },
+    {    _X("<!DOCTYPE"),9,  _X(">")        },
+    {    _X("<PRE>")    ,5,  _X("</PRE>")   },
+    {    _X("<Script>") ,8,  _X("</Script>")},
+    {    _X("<!--")     ,4,  _X("-->")      },
+    {    NULL           ,0,  NULL           }
+};
+
+// You can modify the initialization of the variable "XMLEntities" below
+// to change the character entities that are currently recognized by the library.
+// The number on the second columns is the length of the string inside the
+// first column. Additionally, the syntaxes "&#xA0;" and "&#160;" are recognized.
+typedef struct { XMLCSTR s; int l; XMLCHAR c;} XMLCharacterEntity;
+static XMLCharacterEntity XMLEntities[] =
+{
+    { _X("&amp;" ), 5, _X('&' )},
+    { _X("&lt;"  ), 4, _X('<' )},
+    { _X("&gt;"  ), 4, _X('>' )},
+    { _X("&quot;"), 6, _X('\"')},
+    { _X("&apos;"), 6, _X('\'')},
+    { NULL        , 0, '\0'    }
+};
+
+// When rendering the XMLNode to a string (using the "createXMLString" function),
+// you can ask for a beautiful formatting. This formatting is using the
+// following indentation character:
+#define INDENTCHAR _X('\t')
+
+// The following function parses the XML errors into a user friendly string.
+// You can edit this to change the output language of the library to something else.
+XMLCSTR XMLNode::getError(XMLError xerror)
+{
+    switch (xerror)
+    {
+    case eXMLErrorNone:                  return _X("No error");
+    case eXMLErrorMissingEndTag:         return _X("Warning: Unmatched end tag");
+    case eXMLErrorNoXMLTagFound:         return _X("Warning: No XML tag found");
+    case eXMLErrorEmpty:                 return _X("Error: No XML data");
+    case eXMLErrorMissingTagName:        return _X("Error: Missing start tag name");
+    case eXMLErrorMissingEndTagName:     return _X("Error: Missing end tag name");
+    case eXMLErrorUnmatchedEndTag:       return _X("Error: Unmatched end tag");
+    case eXMLErrorUnmatchedEndClearTag:  return _X("Error: Unmatched clear tag end");
+    case eXMLErrorUnexpectedToken:       return _X("Error: Unexpected token found");
+    case eXMLErrorNoElements:            return _X("Error: No elements found");
+    case eXMLErrorFileNotFound:          return _X("Error: File not found");
+    case eXMLErrorFirstTagNotFound:      return _X("Error: First Tag not found");
+    case eXMLErrorUnknownCharacterEntity:return _X("Error: Unknown character entity");
+    case eXMLErrorCharConversionError:   return _X("Error: unable to convert between WideChar and MultiByte chars");
+    case eXMLErrorCannotOpenWriteFile:   return _X("Error: unable to open file for writing");
+    case eXMLErrorCannotWriteFile:       return _X("Error: cannot write into file");
+
+    case eXMLErrorBase64DataSizeIsNotMultipleOf4: return _X("Warning: Base64-string length is not a multiple of 4");
+    case eXMLErrorBase64DecodeTruncatedData:      return _X("Warning: Base64-string is truncated");
+    case eXMLErrorBase64DecodeIllegalCharacter:   return _X("Error: Base64-string contains an illegal character");
+    case eXMLErrorBase64DecodeBufferTooSmall:     return _X("Error: Base64 decode output buffer is too small");
+    };
+    return _X("Unknown");
+}
+
+/////////////////////////////////////////////////////////////////////////
+//      Here start the abstraction layer to be OS-independent          //
+/////////////////////////////////////////////////////////////////////////
+
+// Here is an abstraction layer to access some common string manipulation functions.
+// The abstraction layer is currently working for gcc, Microsoft Visual Studio 6.0,
+// Microsoft Visual Studio .NET, CC (sun compiler) and Borland C++.
+// If you plan to "port" the library to a new system/compiler, all you have to do is
+// to edit the following lines.
+#ifdef XML_NO_WIDE_CHAR
+char myIsTextWideChar(const void *b, int len) { return FALSE; }
+#else
+    #if defined (UNDER_CE) || !defined(_XMLWINDOWS)
+    char myIsTextWideChar(const void *b, int len) // inspired by the Wine API: RtlIsTextUnicode
+    {
+#ifdef sun
+        // for SPARC processors: wchar_t* buffers must always be alligned, otherwise it's a char* buffer.
+        if ((((unsigned long)b)%sizeof(wchar_t))!=0) return FALSE;
+#endif
+        const wchar_t *s=(const wchar_t*)b;
+
+        // buffer too small:
+        if (len<(int)sizeof(wchar_t)) return FALSE;
+
+        // odd length test
+        if (len&1) return FALSE;
+
+        /* only checks the first 256 characters */
+        len=mmin(256,len/sizeof(wchar_t));
+
+        // Check for the special byte order:
+        if (*((unsigned short*)s) == 0xFFFE) return TRUE;     // IS_TEXT_UNICODE_REVERSE_SIGNATURE;
+        if (*((unsigned short*)s) == 0xFEFF) return TRUE;      // IS_TEXT_UNICODE_SIGNATURE
+
+        // checks for ASCII characters in the UNICODE stream
+        int i,stats=0;
+        for (i=0; i<len; i++) if (s[i]<=(unsigned short)255) stats++;
+        if (stats>len/2) return TRUE;
+
+        // Check for UNICODE NULL chars
+        for (i=0; i<len; i++) if (!s[i]) return TRUE;
+
+        return FALSE;
+    }
+    #else
+    char myIsTextWideChar(const void *b,int l) { return (char)IsTextUnicode((CONST LPVOID)b,l,NULL); };
+    #endif
+#endif
+
+#ifdef _XMLWINDOWS
+// for Microsoft Visual Studio 6.0 and Microsoft Visual Studio .NET,
+    #ifdef _XMLWIDECHAR
+        wchar_t *myMultiByteToWideChar(const char *s)
+        {
+            int i;
+            if (characterEncoding==XMLNode::encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8,0             ,s,-1,NULL,0);
+            else                                           i=(int)MultiByteToWideChar(CP_ACP ,MB_PRECOMPOSED,s,-1,NULL,0);
+            if (i<0) return NULL;
+            wchar_t *d=(wchar_t *)malloc((i+1)*sizeof(XMLCHAR));
+            if (characterEncoding==XMLNode::encoding_UTF8) i=(int)MultiByteToWideChar(CP_UTF8,0             ,s,-1,d,i);
+            else                                           i=(int)MultiByteToWideChar(CP_ACP ,MB_PRECOMPOSED,s,-1,d,i);
+            d[i]=0;
+            return d;
+        }
+        static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) { return _wfopen(filename,mode); }
+        static inline int xstrlen(XMLCSTR c)   { return (int)wcslen(c); }
+        static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return _wcsnicmp(c1,c2,l);}
+        static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1,c2,l);}
+        static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _wcsicmp(c1,c2); }
+        static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1,c2); }
+        static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1,c2); }
+    #else
+        char *myWideCharToMultiByte(const wchar_t *s)
+        {
+            UINT codePage=CP_ACP; if (characterEncoding==XMLNode::encoding_UTF8) codePage=CP_UTF8;
+            int i=(int)WideCharToMultiByte(codePage,  // code page
+                0,                       // performance and mapping flags
+                s,                       // wide-character string
+                -1,                       // number of chars in string
+                NULL,                       // buffer for new string
+                0,                       // size of buffer
+                NULL,                    // default for unmappable chars
+                NULL                     // set when default char used
+                );
+            if (i<0) return NULL;
+            char *d=(char*)malloc(i+1);
+            WideCharToMultiByte(codePage,  // code page
+                0,                       // performance and mapping flags
+                s,                       // wide-character string
+                -1,                       // number of chars in string
+                d,                       // buffer for new string
+                i,                       // size of buffer
+                NULL,                    // default for unmappable chars
+                NULL                     // set when default char used
+                );
+            d[i]=0;
+            return d;
+        }
+        static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) { return fopen(filename,mode); }
+        static inline int xstrlen(XMLCSTR c)   { return (int)strlen(c); }
+        static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return _strnicmp(c1,c2,l);}
+        static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1,c2,l);}
+        static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return _stricmp(c1,c2); }
+        static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1,c2); }
+        static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1,c2); }
+    #endif
+    #ifdef __BORLANDC__
+    static inline int _strnicmp(char *c1, char *c2, int l){ return strnicmp(c1,c2,l);}
+    #endif
+#else
+// for gcc and CC
+    #ifdef XML_NO_WIDE_CHAR
+        char *myWideCharToMultiByte(const wchar_t *s) { return NULL; }
+    #else
+        char *myWideCharToMultiByte(const wchar_t *s)
+        {
+            const wchar_t *ss=s;
+            int i=(int)wcsrtombs(NULL,&ss,0,NULL);
+            if (i<0) return NULL;
+            char *d=(char *)malloc(i+1);
+            wcsrtombs(d,&s,i,NULL);
+            d[i]=0;
+            return d;
+        }
+    #endif
+    #ifdef _XMLWIDECHAR
+        wchar_t *myMultiByteToWideChar(const char *s)
+        {
+            const char *ss=s;
+            int i=(int)mbsrtowcs(NULL,&ss,0,NULL);
+            if (i<0) return NULL;
+            wchar_t *d=(wchar_t *)malloc((i+1)*sizeof(wchar_t));
+            mbsrtowcs(d,&s,i,NULL);
+            d[i]=0;
+            return d;
+        }
+        int xstrlen(XMLCSTR c)   { return wcslen(c); }
+        #ifdef sun
+        // for CC
+           #include <widec.h>
+           static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncasecmp(c1,c2,l);}
+           static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wsncmp(c1,c2,l);}
+           static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wscasecmp(c1,c2); }
+        #else
+        // for gcc
+           static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncasecmp(c1,c2,l);}
+           static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return wcsncmp(c1,c2,l);}
+           static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return wcscasecmp(c1,c2); }
+        #endif
+        static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)wcsstr(c1,c2); }
+        static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)wcscpy(c1,c2); }
+        static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode)
+        {
+            char *filenameAscii=myWideCharToMultiByte(filename);
+            FILE *f;
+            if (mode[0]==_X('r')) f=fopen(filenameAscii,"rb");
+            else                  f=fopen(filenameAscii,"wb");
+            free(filenameAscii);
+            return f;
+        }
+    #else
+        static inline FILE *xfopen(XMLCSTR filename,XMLCSTR mode) { return fopen(filename,mode); }
+        static inline int xstrlen(XMLCSTR c)   { return strlen(c); }
+        static inline int xstrnicmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncasecmp(c1,c2,l);}
+        static inline int xstrncmp(XMLCSTR c1, XMLCSTR c2, int l) { return strncmp(c1,c2,l);}
+        static inline int xstricmp(XMLCSTR c1, XMLCSTR c2) { return strcasecmp(c1,c2); }
+        static inline XMLSTR xstrstr(XMLCSTR c1, XMLCSTR c2) { return (XMLSTR)strstr(c1,c2); }
+        static inline XMLSTR xstrcpy(XMLSTR c1, XMLCSTR c2) { return (XMLSTR)strcpy(c1,c2); }
+    #endif
+    static inline int _strnicmp(const char *c1,const char *c2, int l) { return strncasecmp(c1,c2,l);}
+#endif
+
+/////////////////////////////////////////////////////////////////////////
+//                    the "openFileHelper" function                    //
+/////////////////////////////////////////////////////////////////////////
+
+// Since each application has its own way to report and deal with errors, you should modify & rewrite
+// the following "openFileHelper" function to get an "error reporting mechanism" tailored to your needs.
+XMLNode XMLNode::openFileHelper(XMLCSTR filename, XMLCSTR tag)
+{
+    // guess the value of the global parameter "characterEncoding"
+    // (the guess is based on the first 200 bytes of the file).
+    FILE *f=xfopen(filename,_X("rb"));
+    if (f)
+    {
+        char bb[205];
+        int l=(int)fread(bb,1,200,f);
+        setGlobalOptions(guessCharEncoding(bb,l),guessWideCharChars,dropWhiteSpace);
+        fclose(f);
+    }
+
+    // parse the file
+    XMLResults pResults;
+    XMLNode xnode=XMLNode::parseFile(filename,tag,&pResults);
+
+    // display error message (if any)
+    if (pResults.error != eXMLErrorNone)
+    {
+        // create message
+        char message[2000],*s1=(char*)"",*s3=(char*)""; XMLCSTR s2=_X("");
+        if (pResults.error==eXMLErrorFirstTagNotFound) { s1=(char*)"First Tag should be '"; s2=tag; s3=(char*)"'.\n"; }
+        sprintf(message,
+#ifdef _XMLWIDECHAR
+            "XML Parsing error inside file '%S'.\n%S\nAt line %i, column %i.\n%s%S%s"
+#else
+            "XML Parsing error inside file '%s'.\n%s\nAt line %i, column %i.\n%s%s%s"
+#endif
+            ,filename,XMLNode::getError(pResults.error),pResults.nLine,pResults.nColumn,s1,s2,s3);
+
+        // display message
+#if defined(_XMLWINDOWS) && !defined(UNDER_CE) && !defined(_XMLPARSER_NO_MESSAGEBOX_)
+        MessageBoxA(NULL,message,"XML Parsing error",MB_OK|MB_ICONERROR|MB_TOPMOST);
+#else
+        printf("%s",message);
+#endif
+        exit(255);
+    }
+    return xnode;
+}
+
+/////////////////////////////////////////////////////////////////////////
+//      Here start the core implementation of the XMLParser library    //
+/////////////////////////////////////////////////////////////////////////
+
+// You should normally not change anything below this point.
+
+#ifndef _XMLWIDECHAR
+// If "characterEncoding=ascii" then we assume that all characters have the same length of 1 byte.
+// If "characterEncoding=UTF8" then the characters have different lengths (from 1 byte to 4 bytes).
+// If "characterEncoding=ShiftJIS" then the characters have different lengths (from 1 byte to 2 bytes).
+// This table is used as lookup-table to know the length of a character (in byte) based on the
+// content of the first byte of the character.
+// (note: if you modify this, you must always have XML_utf8ByteTable[0]=0 ).
+static const char XML_utf8ByteTable[256] =
+{
+    //  0 1 2 3 4 5 6 7 8 9 a b c d e f
+    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70End of ASCII range
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x80 0x80 to 0xc1 invalid
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x90
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xa0
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xb0
+    1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xc0 0xc2 to 0xdf 2 byte
+    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xd0
+    3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,// 0xe0 0xe0 to 0xef 3 byte
+    4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid
+};
+static const char XML_asciiByteTable[256] =
+{
+    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+};
+static const char XML_sjisByteTable[256] =
+{
+    //  0 1 2 3 4 5 6 7 8 9 a b c d e f
+    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x40
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x50
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x60
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x70 End of ASCII range
+    1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x80 0x81 to 0x9F 2 bytes
+    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0x90
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xa0
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xb0
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xc0
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0xd0
+    2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,// 0xe0 0xe0 to 0xef 2 bytes
+    1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 // 0xf0
+};
+static const char *XML_ByteTable=(const char *)XML_utf8ByteTable; // the default is "characterEncoding=XMLNode::encoding_UTF8"
+#endif
+
+
+XMLNode XMLNode::emptyXMLNode;
+XMLClear XMLNode::emptyXMLClear={ NULL, NULL, NULL};
+XMLAttribute XMLNode::emptyXMLAttribute={ NULL, NULL};
+
+// Enumeration used to decipher what type a token is
+typedef enum XMLTokenTypeTag
+{
+    eTokenText = 0,
+    eTokenQuotedText,
+    eTokenTagStart,         /* "<"            */
+    eTokenTagEnd,           /* "</"           */
+    eTokenCloseTag,         /* ">"            */
+    eTokenEquals,           /* "="            */
+    eTokenDeclaration,      /* "<?"           */
+    eTokenShortHandClose,   /* "/>"           */
+    eTokenClear,
+    eTokenError
+} XMLTokenType;
+
+// Main structure used for parsing XML
+typedef struct XML
+{
+    XMLCSTR                lpXML;
+    XMLCSTR                lpszText;
+    int                    nIndex,nIndexMissigEndTag;
+    enum XMLError          error;
+    XMLCSTR                lpEndTag;
+    int                    cbEndTag;
+    XMLCSTR                lpNewElement;
+    int                    cbNewElement;
+    int                    nFirst;
+} XML;
+
+typedef struct
+{
+    ALLXMLClearTag *pClr;
+    XMLCSTR     pStr;
+} NextToken;
+
+// Enumeration used when parsing attributes
+typedef enum Attrib
+{
+    eAttribName = 0,
+    eAttribEquals,
+    eAttribValue
+} Attrib;
+
+// Enumeration used when parsing elements to dictate whether we are currently
+// inside a tag
+typedef enum Status
+{
+    eInsideTag = 0,
+    eOutsideTag
+} Status;
+
+XMLError XMLNode::writeToFile(XMLCSTR filename, const char *encoding, char nFormat) const
+{
+    if (!d) return eXMLErrorNone;
+    FILE *f=xfopen(filename,_X("wb"));
+    if (!f) return eXMLErrorCannotOpenWriteFile;
+#ifdef _XMLWIDECHAR
+    unsigned char h[2]={ 0xFF, 0xFE };
+    if (!fwrite(h,2,1,f)) return eXMLErrorCannotWriteFile;
+    if ((!isDeclaration())&&((d->lpszName)||(!getChildNode().isDeclaration())))
+    {
+        if (!fwrite(_X("<?xml version=\"1.0\" encoding=\"utf-16\"?>\n"),sizeof(wchar_t)*40,1,f))
+            return eXMLErrorCannotWriteFile;
+    }
+#else
+    if ((!isDeclaration())&&((d->lpszName)||(!getChildNode().isDeclaration())))
+    {
+        if (characterEncoding==encoding_UTF8)
+        {
+            // header so that windows recognize the file as UTF-8:
+            unsigned char h[3]={0xEF,0xBB,0xBF}; if (!fwrite(h,3,1,f)) return eXMLErrorCannotWriteFile;
+            encoding="utf-8";
+        } else if (characterEncoding==encoding_ShiftJIS) encoding="SHIFT-JIS";
+
+        if (!encoding) encoding="ISO-8859-1";
+        if (fprintf(f,"<?xml version=\"1.0\" encoding=\"%s\"?>\n",encoding)<0) return eXMLErrorCannotWriteFile;
+    } else
+    {
+        if (characterEncoding==encoding_UTF8)
+        {
+            unsigned char h[3]={0xEF,0xBB,0xBF}; if (!fwrite(h,3,1,f)) return eXMLErrorCannotWriteFile;
+        }
+    }
+#endif
+    int i;
+    XMLSTR t=createXMLString(nFormat,&i);
+    if (!fwrite(t,sizeof(XMLCHAR)*i,1,f)) return eXMLErrorCannotWriteFile;
+    if (fclose(f)!=0) return eXMLErrorCannotWriteFile;
+    free(t);
+    return eXMLErrorNone;
+}
+
+// Duplicate a given string.
+XMLSTR stringDup(XMLCSTR lpszData, int cbData)
+{
+    if (lpszData==NULL) return NULL;
+
+    XMLSTR lpszNew;
+    if (cbData==0) cbData=(int)xstrlen(lpszData);
+    lpszNew = (XMLSTR)malloc((cbData+1) * sizeof(XMLCHAR));
+    if (lpszNew)
+    {
+        memcpy(lpszNew, lpszData, (cbData) * sizeof(XMLCHAR));
+        lpszNew[cbData] = (XMLCHAR)NULL;
+    }
+    return lpszNew;
+}
+
+XMLSTR toXMLStringUnSafe(XMLSTR dest,XMLCSTR source)
+{
+    XMLSTR dd=dest;
+    XMLCHAR ch;
+    XMLCharacterEntity *entity;
+    while ((ch=*source))
+    {
+        entity=XMLEntities;
+        do
+        {
+            if (ch==entity->c) {xstrcpy(dest,entity->s); dest+=entity->l; source++; goto out_of_loop1; }
+            entity++;
+        } while(entity->s);
+#ifdef _XMLWIDECHAR
+        *(dest++)=*(source++);
+#else
+        switch(XML_ByteTable[(unsigned char)ch])
+        {
+        case 4: *(dest++)=*(source++);
+        case 3: *(dest++)=*(source++);
+        case 2: *(dest++)=*(source++);
+        case 1: *(dest++)=*(source++);
+        }
+#endif
+out_of_loop1:
+        ;
+    }
+    *dest=0;
+    return dd;
+}
+
+// private (used while rendering):
+int lengthXMLString(XMLCSTR source)
+{
+    int r=0;
+    XMLCharacterEntity *entity;
+    XMLCHAR ch;
+    while ((ch=*source))
+    {
+        entity=XMLEntities;
+        do
+        {
+            if (ch==entity->c) { r+=entity->l; source++; goto out_of_loop1; }
+            entity++;
+        } while(entity->s);
+#ifdef _XMLWIDECHAR
+        r++; source++;
+#else
+        ch=XML_ByteTable[(unsigned char)ch]; r+=ch; source+=ch;
+#endif
+out_of_loop1:
+        ;
+    }
+    return r;
+}
+
+ToXMLStringTool::~ToXMLStringTool(){ freeBuffer(); }
+void ToXMLStringTool::freeBuffer(){ if (buf) free(buf); buf=NULL; buflen=0; }
+XMLSTR ToXMLStringTool::toXML(XMLCSTR source)
+{
+    int l=lengthXMLString(source)+1;
+    if (l>buflen) { buflen=l; buf=(XMLSTR)realloc(buf,l*sizeof(XMLCHAR)); }
+    return toXMLStringUnSafe(buf,source);
+}
+
+// private:
+XMLSTR fromXMLString(XMLCSTR s, int lo, XML *pXML)
+{
+    // This function is the opposite of the function "toXMLString". It decodes the escape
+    // sequences &amp;, &quot;, &apos;, &lt;, &gt; and replace them by the characters
+    // &,",',<,>. This function is used internally by the XML Parser. All the calls to
+    // the XML library will always gives you back "decoded" strings.
+    //
+    // in: string (s) and length (lo) of string
+    // out:  new allocated string converted from xml
+    if (!s) return NULL;
+
+    int ll=0,j;
+    XMLSTR d;
+    XMLCSTR ss=s;
+    XMLCharacterEntity *entity;
+    while ((lo>0)&&(*s))
+    {
+        if (*s==_X('&'))
+        {
+            if ((lo>2)&&(s[1]==_X('#')))
+            {
+                s+=2; lo-=2;
+                if ((*s==_X('X'))||(*s==_X('x'))) { s++; lo--; }
+                while ((*s)&&(*s!=_X(';'))&&((lo--)>0)) s++;
+                if (*s!=_X(';'))
+                {
+                    pXML->error=eXMLErrorUnknownCharacterEntity;
+                    return NULL;
+                }
+                s++; lo--;
+            } else
+            {
+                entity=XMLEntities;
+                do
+                {
+                    if ((lo>=entity->l)&&(xstrnicmp(s,entity->s,entity->l)==0)) { s+=entity->l; lo-=entity->l; break; }
+                    entity++;
+                } while(entity->s);
+                if (!entity->s)
+                {
+                    pXML->error=eXMLErrorUnknownCharacterEntity;
+                    return NULL;
+                }
+            }
+        } else
+        {
+#ifdef _XMLWIDECHAR
+            s++; lo--;
+#else
+            j=XML_ByteTable[(unsigned char)*s]; s+=j; lo-=j; ll+=j-1;
+#endif
+        }
+        ll++;
+    }
+
+    d=(XMLSTR)malloc((ll+1)*sizeof(XMLCHAR));
+    s=d;
+    while (ll-->0)
+    {
+        if (*ss==_X('&'))
+        {
+            if (ss[1]==_X('#'))
+            {
+                ss+=2; j=0;
+                if ((*ss==_X('X'))||(*ss==_X('x')))
+                {
+                    ss++;
+                    while (*ss!=_X(';'))
+                    {
+                        if ((*ss>=_X('0'))&&(*ss<=_X('9'))) j=(j<<4)+*ss-_X('0');
+                        else if ((*ss>=_X('A'))&&(*ss<=_X('F'))) j=(j<<4)+*ss-_X('A')+10;
+                        else if ((*ss>=_X('a'))&&(*ss<=_X('f'))) j=(j<<4)+*ss-_X('a')+10;
+                        else { free((void*)s); pXML->error=eXMLErrorUnknownCharacterEntity;return NULL;}
+                        ss++;
+                    }
+                } else
+                {
+                    while (*ss!=_X(';'))
+                    {
+                        if ((*ss>=_X('0'))&&(*ss<=_X('9'))) j=(j*10)+*ss-_X('0');
+                        else { free((void*)s); pXML->error=eXMLErrorUnknownCharacterEntity;return NULL;}
+                        ss++;
+                    }
+                }
+                (*d++)=(XMLCHAR)j; ss++;
+            } else
+            {
+                entity=XMLEntities;
+                do
+                {
+                    if (xstrnicmp(ss,entity->s,entity->l)==0) { *(d++)=entity->c; ss+=entity->l; break; }
+                    entity++;
+                } while(entity->s);
+            }
+        } else
+        {
+#ifdef _XMLWIDECHAR
+            *(d++)=*(ss++);
+#else
+            switch(XML_ByteTable[(unsigned char)*ss])
+            {
+            case 4: *(d++)=*(ss++); ll--;
+            case 3: *(d++)=*(ss++); ll--;
+            case 2: *(d++)=*(ss++); ll--;
+            case 1: *(d++)=*(ss++);
+            }
+#endif
+        }
+    }
+    *d=0;
+    return (XMLSTR)s;
+}
+
+#define XML_isSPACECHAR(ch) ((ch==_X('\n'))||(ch==_X(' '))||(ch== _X('\t'))||(ch==_X('\r')))
+
+// private:
+char myTagCompare(XMLCSTR cclose, XMLCSTR copen)
+// !!!! WARNING strange convention&:
+// return 0 if equals
+// return 1 if different
+{
+    if (!cclose) return 1;
+    int l=(int)xstrlen(cclose);
+    if (xstrnicmp(cclose, copen, l)!=0) return 1;
+    const XMLCHAR c=copen[l];
+    if (XML_isSPACECHAR(c)||
+        (c==_X('/' ))||
+        (c==_X('<' ))||
+        (c==_X('>' ))||
+        (c==_X('=' ))) return 0;
+    return 1;
+}
+
+// Obtain the next character from the string.
+static inline XMLCHAR getNextChar(XML *pXML)
+{
+    XMLCHAR ch = pXML->lpXML[pXML->nIndex];
+#ifdef _XMLWIDECHAR
+    if (ch!=0) pXML->nIndex++;
+#else
+    pXML->nIndex+=XML_ByteTable[(unsigned char)ch];
+#endif
+    return ch;
+}
+
+// Find the next token in a string.
+// pcbToken contains the number of characters that have been read.
+static NextToken GetNextToken(XML *pXML, int *pcbToken, enum XMLTokenTypeTag *pType)
+{
+    NextToken        result;
+    XMLCHAR            ch;
+    XMLCHAR            chTemp;
+    int              indexStart,nFoundMatch,nIsText=FALSE;
+    result.pClr=NULL; // prevent warning
+
+    // Find next non-white space character
+    do { indexStart=pXML->nIndex; ch=getNextChar(pXML); } while XML_isSPACECHAR(ch);
+
+    if (ch)
+    {
+        // Cache the current string pointer
+        result.pStr = &pXML->lpXML[indexStart];
+
+        // First check whether the token is in the clear tag list (meaning it
+        // does not need formatting).
+        ALLXMLClearTag *ctag=XMLClearTags;
+        do
+        {
+            if (xstrncmp(ctag->lpszOpen, result.pStr, ctag->openTagLen)==0)
+            {
+                result.pClr=ctag;
+                pXML->nIndex+=ctag->openTagLen-1;
+                *pType=eTokenClear;
+                return result;
+            }
+            ctag++;
+        } while(ctag->lpszOpen);
+
+        // If we didn't find a clear tag then check for standard tokens
+        switch(ch)
+        {
+        // Check for quotes
+        case _X('\''):
+        case _X('\"'):
+            // Type of token
+            *pType = eTokenQuotedText;
+            chTemp = ch;
+
+            // Set the size
+            nFoundMatch = FALSE;
+
+            // Search through the string to find a matching quote
+            while((ch = getNextChar(pXML)))
+            {
+                if (ch==chTemp) { nFoundMatch = TRUE; break; }
+                if (ch==_X('<')) break;
+            }
+
+            // If we failed to find a matching quote
+            if (nFoundMatch == FALSE)
+            {
+                pXML->nIndex=indexStart+1;
+                nIsText=TRUE;
+                break;
+            }
+
+//  4.02.2002
+//            if (FindNonWhiteSpace(pXML)) pXML->nIndex--;
+
+            break;
+
+        // Equals (used with attribute values)
+        case _X('='):
+            *pType = eTokenEquals;
+            break;
+
+        // Close tag
+        case _X('>'):
+            *pType = eTokenCloseTag;
+            break;
+
+        // Check for tag start and tag end
+        case _X('<'):
+
+            // Peek at the next character to see if we have an end tag '</',
+            // or an xml declaration '<?'
+            chTemp = pXML->lpXML[pXML->nIndex];
+
+            // If we have a tag end...
+            if (chTemp == _X('/'))
+            {
+                // Set the type and ensure we point at the next character
+                getNextChar(pXML);
+                *pType = eTokenTagEnd;
+            }
+
+            // If we have an XML declaration tag
+            else if (chTemp == _X('?'))
+            {
+
+                // Set the type and ensure we point at the next character
+                getNextChar(pXML);
+                *pType = eTokenDeclaration;
+            }
+
+            // Otherwise we must have a start tag
+            else
+            {
+                *pType = eTokenTagStart;
+            }
+            break;
+
+        // Check to see if we have a short hand type end tag ('/>').
+        case _X('/'):
+
+            // Peek at the next character to see if we have a short end tag '/>'
+            chTemp = pXML->lpXML[pXML->nIndex];
+
+            // If we have a short hand end tag...
+            if (chTemp == _X('>'))
+            {
+                // Set the type and ensure we point at the next character
+                getNextChar(pXML);
+                *pType = eTokenShortHandClose;
+                break;
+            }
+
+            // If we haven't found a short hand closing tag then drop into the
+            // text process
+
+        // Other characters
+        default:
+            nIsText = TRUE;
+        }
+
+        // If this is a TEXT node
+        if (nIsText)
+        {
+            // Indicate we are dealing with text
+            *pType = eTokenText;
+            while((ch = getNextChar(pXML)))
+            {
+                if XML_isSPACECHAR(ch)
+                {
+                    indexStart++; break;
+
+                } else if (ch==_X('/'))
+                {
+                    // If we find a slash then this maybe text or a short hand end tag
+                    // Peek at the next character to see it we have short hand end tag
+                    ch=pXML->lpXML[pXML->nIndex];
+                    // If we found a short hand end tag then we need to exit the loop
+                    if (ch==_X('>')) { pXML->nIndex--; break; }
+
+                } else if ((ch==_X('<'))||(ch==_X('>'))||(ch==_X('=')))
+                {
+                    pXML->nIndex--; break;
+                }
+            }
+        }
+        *pcbToken = pXML->nIndex-indexStart;
+    } else
+    {
+        // If we failed to obtain a valid character
+        *pcbToken = 0;
+        *pType = eTokenError;
+        result.pStr=NULL;
+    }
+
+    return result;
+}
+
+XMLCSTR XMLNode::updateName_WOSD(XMLSTR lpszName)
+{
+    if (!d) { free(lpszName); return NULL; }
+    if (d->lpszName&&(lpszName!=d->lpszName)) free((void*)d->lpszName);
+    d->lpszName=lpszName;
+    return lpszName;
+}
+
+// private:
+XMLNode::XMLNode(struct XMLNodeDataTag *p){ d=p; (p->ref_count)++; }
+XMLNode::XMLNode(XMLNodeData *pParent, XMLSTR lpszName, char isDeclaration)
+{
+    d=(XMLNodeData*)malloc(sizeof(XMLNodeData));
+    d->ref_count=1;
+
+    d->lpszName=NULL;
+    d->nChild= 0;
+    d->nText = 0;
+    d->nClear = 0;
+    d->nAttribute = 0;
+
+    d->isDeclaration = isDeclaration;
+
+    d->pParent = pParent;
+    d->pChild= NULL;
+    d->pText= NULL;
+    d->pClear= NULL;
+    d->pAttribute= NULL;
+    d->pOrder= NULL;
+
+    updateName_WOSD(lpszName);
+}
+
+XMLNode XMLNode::createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration) { return XMLNode(NULL,lpszName,isDeclaration); }
+XMLNode XMLNode::createXMLTopNode(XMLCSTR lpszName, char isDeclaration) { return XMLNode(NULL,stringDup(lpszName),isDeclaration); }
+
+#define MEMORYINCREASE 50
+
+static inline void myFree(void *p) { if (p) free(p); };
+static inline void *myRealloc(void *p, int newsize, int memInc, int sizeofElem)
+{
+    if (p==NULL) { if (memInc) return malloc(memInc*sizeofElem); return malloc(sizeofElem); }
+    if ((memInc==0)||((newsize%memInc)==0)) p=realloc(p,(newsize+memInc)*sizeofElem);
+//    if (!p)
+//    {
+//        printf("XMLParser Error: Not enough memory! Aborting...\n"); exit(220);
+//    }
+    return p;
+}
+
+// private:
+XMLElementPosition XMLNode::findPosition(XMLNodeData *d, int index, XMLElementType xxtype)
+{
+    if (index<0) return -1;
+    int i=0,j=(int)((index<<2)+xxtype),*o=d->pOrder; while (o[i]!=j) i++; return i;
+}
+
+// private:
+// update "order" information when deleting a content of a XMLNode
+int XMLNode::removeOrderElement(XMLNodeData *d, XMLElementType t, int index)
+{
+    int n=d->nChild+d->nText+d->nClear, *o=d->pOrder,i=findPosition(d,index,t);
+    memmove(o+i, o+i+1, (n-i)*sizeof(int));
+    for (;i<n;i++)
+        if ((o[i]&3)==(int)t) o[i]-=4;
+    // We should normally do:
+    // d->pOrder=(int)realloc(d->pOrder,n*sizeof(int));
+    // but we skip reallocation because it's too time consuming.
+    // Anyway, at the end, it will be free'd completely at once.
+    return i;
+}
+
+void *XMLNode::addToOrder(int memoryIncrease,int *_pos, int nc, void *p, int size, XMLElementType xtype)
+{
+    //  in: *_pos is the position inside d->pOrder ("-1" means "EndOf")
+    // out: *_pos is the index inside p
+    p=myRealloc(p,(nc+1),memoryIncrease,size);
+    int n=d->nChild+d->nText+d->nClear;
+    d->pOrder=(int*)myRealloc(d->pOrder,n+1,memoryIncrease*3,sizeof(int));
+    int pos=*_pos,*o=d->pOrder;
+
+    if ((pos<0)||(pos>=n)) { *_pos=nc; o[n]=(int)((nc<<2)+xtype); return p; }
+
+    int i=pos;
+    memmove(o+i+1, o+i, (n-i)*sizeof(int));
+
+    while ((pos<n)&&((o[pos]&3)!=(int)xtype)) pos++;
+    if (pos==n) { *_pos=nc; o[n]=(int)((nc<<2)+xtype); return p; }
+
+    o[i]=o[pos];
+    for (i=pos+1;i<=n;i++) if ((o[i]&3)==(int)xtype) o[i]+=4;
+
+    *_pos=pos=o[pos]>>2;
+    memmove(((char*)p)+(pos+1)*size,((char*)p)+pos*size,(nc-pos)*size);
+
+    return p;
+}
+
+// Add a child node to the given element.
+XMLNode XMLNode::addChild_priv(int memoryIncrease, XMLSTR lpszName, char isDeclaration, int pos)
+{
+    if (!lpszName) return emptyXMLNode;
+    d->pChild=(XMLNode*)addToOrder(memoryIncrease,&pos,d->nChild,d->pChild,sizeof(XMLNode),eNodeChild);
+    d->pChild[pos].d=NULL;
+    d->pChild[pos]=XMLNode(d,lpszName,isDeclaration);
+    d->nChild++;
+    return d->pChild[pos];
+}
+
+// Add an attribute to an element.
+XMLAttribute *XMLNode::addAttribute_priv(int memoryIncrease,XMLSTR lpszName, XMLSTR lpszValuev)
+{
+    if (!lpszName) return &emptyXMLAttribute;
+    if (!d) { myFree(lpszName); myFree(lpszValuev); return &emptyXMLAttribute; }
+    int nc=d->nAttribute;
+    d->pAttribute=(XMLAttribute*)myRealloc(d->pAttribute,(nc+1),memoryIncrease,sizeof(XMLAttribute));
+    XMLAttribute *pAttr=d->pAttribute+nc;
+    pAttr->lpszName = lpszName;
+    pAttr->lpszValue = lpszValuev;
+    d->nAttribute++;
+    return pAttr;
+}
+
+// Add text to the element.
+XMLCSTR XMLNode::addText_priv(int memoryIncrease, XMLSTR lpszValue, int pos)
+{
+    if (!lpszValue) return NULL;
+    if (!d) { myFree(lpszValue); return NULL; }
+    d->pText=(XMLCSTR*)addToOrder(memoryIncrease,&pos,d->nText,d->pText,sizeof(XMLSTR),eNodeText);
+    d->pText[pos]=lpszValue;
+    d->nText++;
+    return lpszValue;
+}
+
+// Add clear (unformatted) text to the element.
+XMLClear *XMLNode::addClear_priv(int memoryIncrease, XMLSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, int pos)
+{
+    if (!lpszValue) return &emptyXMLClear;
+    if (!d) { myFree(lpszValue); return &emptyXMLClear; }
+    d->pClear=(XMLClear *)addToOrder(memoryIncrease,&pos,d->nClear,d->pClear,sizeof(XMLClear),eNodeClear);
+    XMLClear *pNewClear=d->pClear+pos;
+    pNewClear->lpszValue = lpszValue;
+    if (!lpszOpen) lpszOpen=XMLClearTags->lpszOpen;
+    if (!lpszClose) lpszClose=XMLClearTags->lpszClose;
+    pNewClear->lpszOpenTag = lpszOpen;
+    pNewClear->lpszCloseTag = lpszClose;
+    d->nClear++;
+    return pNewClear;
+}
+
+// private:
+// Parse a clear (unformatted) type node.
+char XMLNode::parseClearTag(void *px, void *_pClear)
+{
+    XML *pXML=(XML *)px;
+    ALLXMLClearTag pClear=*((ALLXMLClearTag*)_pClear);
+    int cbTemp=0;
+    XMLCSTR lpszTemp=NULL;
+    XMLCSTR lpXML=&pXML->lpXML[pXML->nIndex];
+    static XMLCSTR docTypeEnd=_X("]>");
+
+    // Find the closing tag
+    // Seems the <!DOCTYPE need a better treatment so lets handle it
+    if (pClear.lpszOpen==XMLClearTags[1].lpszOpen)
+    {
+        XMLCSTR pCh=lpXML;
+        while (*pCh)
+        {
+            if (*pCh==_X('<')) { pClear.lpszClose=docTypeEnd; lpszTemp=xstrstr(lpXML,docTypeEnd); break; }
+            else if (*pCh==_X('>')) { lpszTemp=pCh; break; }
+#ifdef _XMLWIDECHAR
+            pCh++;
+#else
+            pCh+=XML_ByteTable[(unsigned char)(*pCh)];
+#endif
+        }
+    } else lpszTemp=xstrstr(lpXML, pClear.lpszClose);
+
+    if (lpszTemp)
+    {
+        // Cache the size and increment the index
+        cbTemp = (int)(lpszTemp - lpXML);
+
+        pXML->nIndex += cbTemp+(int)xstrlen(pClear.lpszClose);
+
+        // Add the clear node to the current element
+        addClear_priv(MEMORYINCREASE,stringDup(lpXML,cbTemp), pClear.lpszOpen, pClear.lpszClose,-1);
+        return 0;
+    }
+
+    // If we failed to find the end tag
+    pXML->error = eXMLErrorUnmatchedEndClearTag;
+    return 1;
+}
+
+void XMLNode::exactMemory(XMLNodeData *d)
+{
+    if (d->pOrder)     d->pOrder=(int*)realloc(d->pOrder,(d->nChild+d->nText+d->nClear)*sizeof(int));
+    if (d->pChild)     d->pChild=(XMLNode*)realloc(d->pChild,d->nChild*sizeof(XMLNode));
+    if (d->pAttribute) d->pAttribute=(XMLAttribute*)realloc(d->pAttribute,d->nAttribute*sizeof(XMLAttribute));
+    if (d->pText)      d->pText=(XMLCSTR*)realloc(d->pText,d->nText*sizeof(XMLSTR));
+    if (d->pClear)     d->pClear=(XMLClear *)realloc(d->pClear,d->nClear*sizeof(XMLClear));
+}
+
+char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr)
+{
+    XML *pXML=(XML *)pa;
+    XMLCSTR lpszText=pXML->lpszText;
+    if (!lpszText) return 0;
+    if (dropWhiteSpace) while (XML_isSPACECHAR(*lpszText)&&(lpszText!=tokenPStr)) lpszText++;
+    int cbText = (int)(tokenPStr - lpszText);
+    if (!cbText) { pXML->lpszText=NULL; return 0; }
+    if (dropWhiteSpace) { cbText--; while ((cbText)&&XML_isSPACECHAR(lpszText[cbText])) cbText--; cbText++; }
+    if (!cbText) { pXML->lpszText=NULL; return 0; }
+    XMLSTR lpt=fromXMLString(lpszText,cbText,pXML);
+    if (!lpt) return 1;
+    addText_priv(MEMORYINCREASE,lpt,-1);
+    pXML->lpszText=NULL;
+    return 0;
+}
+// private:
+// Recursively parse an XML element.
+int XMLNode::ParseXMLElement(void *pa)
+{
+    XML *pXML=(XML *)pa;
+    int cbToken;
+    enum XMLTokenTypeTag xtype;
+    NextToken token;
+    XMLCSTR lpszTemp=NULL;
+    int cbTemp=0;
+    char nDeclaration;
+    XMLNode pNew;
+    enum Status status; // inside or outside a tag
+    enum Attrib attrib = eAttribName;
+
+    assert(pXML);
+
+    // If this is the first call to the function
+    if (pXML->nFirst)
+    {
+        // Assume we are outside of a tag definition
+        pXML->nFirst = FALSE;
+        status = eOutsideTag;
+    } else
+    {
+        // If this is not the first call then we should only be called when inside a tag.
+        status = eInsideTag;
+    }
+
+    // Iterate through the tokens in the document
+    for(;;)
+    {
+        // Obtain the next token
+        token = GetNextToken(pXML, &cbToken, &xtype);
+
+        if (xtype != eTokenError)
+        {
+            // Check the current status
+            switch(status)
+            {
+
+            // If we are outside of a tag definition
+            case eOutsideTag:
+
+                // Check what type of token we obtained
+                switch(xtype)
+                {
+                // If we have found text or quoted text
+                case eTokenText:
+                case eTokenCloseTag:          /* '>'         */
+                case eTokenShortHandClose:    /* '/>'        */
+                case eTokenQuotedText:
+                case eTokenEquals:
+                    break;
+
+                // If we found a start tag '<' and declarations '<?'
+                case eTokenTagStart:
+                case eTokenDeclaration:
+
+                    // Cache whether this new element is a declaration or not
+                    nDeclaration = (xtype == eTokenDeclaration);
+
+                    // If we have node text then add this to the element
+                    if (maybeAddTxT(pXML,token.pStr)) return FALSE;
+
+                    // Find the name of the tag
+                    token = GetNextToken(pXML, &cbToken, &xtype);
+
+                    // Return an error if we couldn't obtain the next token or
+                    // it wasnt text
+                    if (xtype != eTokenText)
+                    {
+                        pXML->error = eXMLErrorMissingTagName;
+                        return FALSE;
+                    }
+
+                    // If we found a new element which is the same as this
+                    // element then we need to pass this back to the caller..
+
+#ifdef APPROXIMATE_PARSING
+                    if (d->lpszName &&
+                        myTagCompare(d->lpszName, token.pStr) == 0)
+                    {
+                        // Indicate to the caller that it needs to create a
+                        // new element.
+                        pXML->lpNewElement = token.pStr;
+                        pXML->cbNewElement = cbToken;
+                        return TRUE;
+                    } else
+#endif
+                    {
+                        // If the name of the new element differs from the name of
+                        // the current element we need to add the new element to
+                        // the current one and recurse
+                        pNew = addChild_priv(MEMORYINCREASE,stringDup(token.pStr,cbToken), nDeclaration,-1);
+
+                        while (!pNew.isEmpty())
+                        {
+                            // Callself to process the new node.  If we return
+                            // FALSE this means we dont have any more
+                            // processing to do...
+
+                            if (!pNew.ParseXMLElement(pXML)) return FALSE;
+                            else
+                            {
+                                // If the call to recurse this function
+                                // evented in a end tag specified in XML then
+                                // we need to unwind the calls to this
+                                // function until we find the appropriate node
+                                // (the element name and end tag name must
+                                // match)
+                                if (pXML->cbEndTag)
+                                {
+                                    // If we are back at the root node then we
+                                    // have an unmatched end tag
+                                    if (!d->lpszName)
+                                    {
+                                        pXML->error=eXMLErrorUnmatchedEndTag;
+                                        return FALSE;
+                                    }
+
+                                    // If the end tag matches the name of this
+                                    // element then we only need to unwind
+                                    // once more...
+
+                                    if (myTagCompare(d->lpszName, pXML->lpEndTag)==0)
+                                    {
+                                        pXML->cbEndTag = 0;
+                                    }
+
+                                    return TRUE;
+                                } else
+                                    if (pXML->cbNewElement)
+                                    {
+                                        // If the call indicated a new element is to
+                                        // be created on THIS element.
+
+                                        // If the name of this element matches the
+                                        // name of the element we need to create
+                                        // then we need to return to the caller
+                                        // and let it process the element.
+
+                                        if (myTagCompare(d->lpszName, pXML->lpNewElement)==0)
+                                        {
+                                            return TRUE;
+                                        }
+
+                                        // Add the new element and recurse
+                                        pNew = addChild_priv(MEMORYINCREASE,stringDup(pXML->lpNewElement,pXML->cbNewElement),0,-1);
+                                        pXML->cbNewElement = 0;
+                                    }
+                                    else
+                                    {
+                                        // If we didn't have a new element to create
+                                        pNew = emptyXMLNode;
+
+                                    }
+                            }
+                        }
+                    }
+                    break;
+
+                // If we found an end tag
+                case eTokenTagEnd:
+
+                    // If we have node text then add this to the element
+                    if (maybeAddTxT(pXML,token.pStr)) return FALSE;
+
+                    // Find the name of the end tag
+                    token = GetNextToken(pXML, &cbTemp, &xtype);
+
+                    // The end tag should be text
+                    if (xtype != eTokenText)
+                    {
+                        pXML->error = eXMLErrorMissingEndTagName;
+                        return FALSE;
+                    }
+                    lpszTemp = token.pStr;
+
+                    // After the end tag we should find a closing tag
+                    token = GetNextToken(pXML, &cbToken, &xtype);
+                    if (xtype != eTokenCloseTag)
+                    {
+                        pXML->error = eXMLErrorMissingEndTagName;
+                        return FALSE;
+                    }
+                    pXML->lpszText=pXML->lpXML+pXML->nIndex;
+
+                    // We need to return to the previous caller.  If the name
+                    // of the tag cannot be found we need to keep returning to
+                    // caller until we find a match
+                    if (myTagCompare(d->lpszName, lpszTemp) != 0)
+#ifdef STRICT_PARSING
+                    {
+                        pXML->error=eXMLErrorUnmatchedEndTag;
+                        pXML->nIndexMissigEndTag=pXML->nIndex;
+                        return FALSE;
+                    }
+#else
+                    {
+                        pXML->error=eXMLErrorMissingEndTag;
+                        pXML->nIndexMissigEndTag=pXML->nIndex;
+                        pXML->lpEndTag = lpszTemp;
+                        pXML->cbEndTag = cbTemp;
+                    }
+#endif
+
+                    // Return to the caller
+                    exactMemory(d);
+                    return TRUE;
+
+                // If we found a clear (unformatted) token
+                case eTokenClear:
+                    // If we have node text then add this to the element
+                    if (maybeAddTxT(pXML,token.pStr)) return FALSE;
+                    if (parseClearTag(pXML, token.pClr)) return FALSE;
+                    pXML->lpszText=pXML->lpXML+pXML->nIndex;
+                    break;
+
+                default:
+                    break;
+                }
+                break;
+
+            // If we are inside a tag definition we need to search for attributes
+            case eInsideTag:
+
+                // Check what part of the attribute (name, equals, value) we
+                // are looking for.
+                switch(attrib)
+                {
+                // If we are looking for a new attribute
+                case eAttribName:
+
+                    // Check what the current token type is
+                    switch(xtype)
+                    {
+                    // If the current type is text...
+                    // Eg.  'attribute'
+                    case eTokenText:
+                        // Cache the token then indicate that we are next to
+                        // look for the equals
+                        lpszTemp = token.pStr;
+                        cbTemp = cbToken;
+                        attrib = eAttribEquals;
+                        break;
+
+                    // If we found a closing tag...
+                    // Eg.  '>'
+                    case eTokenCloseTag:
+                        // We are now outside the tag
+                        status = eOutsideTag;
+                        pXML->lpszText=pXML->lpXML+pXML->nIndex;
+                        break;
+
+                    // If we found a short hand '/>' closing tag then we can
+                    // return to the caller
+                    case eTokenShortHandClose:
+                        exactMemory(d);
+                        pXML->lpszText=pXML->lpXML+pXML->nIndex;
+                        return TRUE;
+
+                    // Errors...
+                    case eTokenQuotedText:    /* '"SomeText"'   */
+                    case eTokenTagStart:      /* '<'            */
+                    case eTokenTagEnd:        /* '</'           */
+                    case eTokenEquals:        /* '='            */
+                    case eTokenDeclaration:   /* '<?'           */
+                    case eTokenClear:
+                        pXML->error = eXMLErrorUnexpectedToken;
+                        return FALSE;
+                    default: break;
+                    }
+                    break;
+
+                // If we are looking for an equals
+                case eAttribEquals:
+                    // Check what the current token type is
+                    switch(xtype)
+                    {
+                    // If the current type is text...
+                    // Eg.  'Attribute AnotherAttribute'
+                    case eTokenText:
+                        // Add the unvalued attribute to the list
+                        addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp), NULL);
+                        // Cache the token then indicate.  We are next to
+                        // look for the equals attribute
+                        lpszTemp = token.pStr;
+                        cbTemp = cbToken;
+                        break;
+
+                    // If we found a closing tag 'Attribute >' or a short hand
+                    // closing tag 'Attribute />'
+                    case eTokenShortHandClose:
+                    case eTokenCloseTag:
+                        // If we are a declaration element '<?' then we need
+                        // to remove extra closing '?' if it exists
+                        pXML->lpszText=pXML->lpXML+pXML->nIndex;
+
+                        if (d->isDeclaration &&
+                            (lpszTemp[cbTemp-1]) == _X('?'))
+                        {
+                            cbTemp--;
+                        }
+
+                        if (cbTemp)
+                        {
+                            // Add the unvalued attribute to the list
+                            addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp), NULL);
+                        }
+
+                        // If this is the end of the tag then return to the caller
+                        if (xtype == eTokenShortHandClose)
+                        {
+                            exactMemory(d);
+                            return TRUE;
+                        }
+
+                        // We are now outside the tag
+                        status = eOutsideTag;
+                        break;
+
+                    // If we found the equals token...
+                    // Eg.  'Attribute ='
+                    case eTokenEquals:
+                        // Indicate that we next need to search for the value
+                        // for the attribute
+                        attrib = eAttribValue;
+                        break;
+
+                    // Errors...
+                    case eTokenQuotedText:    /* 'Attribute "InvalidAttr"'*/
+                    case eTokenTagStart:      /* 'Attribute <'            */
+                    case eTokenTagEnd:        /* 'Attribute </'           */
+                    case eTokenDeclaration:   /* 'Attribute <?'           */
+                    case eTokenClear:
+                        pXML->error = eXMLErrorUnexpectedToken;
+                        return FALSE;
+                    default: break;
+                    }
+                    break;
+
+                // If we are looking for an attribute value
+                case eAttribValue:
+                    // Check what the current token type is
+                    switch(xtype)
+                    {
+                    // If the current type is text or quoted text...
+                    // Eg.  'Attribute = "Value"' or 'Attribute = Value' or
+                    // 'Attribute = 'Value''.
+                    case eTokenText:
+                    case eTokenQuotedText:
+                        // If we are a declaration element '<?' then we need
+                        // to remove extra closing '?' if it exists
+                        if (d->isDeclaration &&
+                            (token.pStr[cbToken-1]) == _X('?'))
+                        {
+                            cbToken--;
+                        }
+
+                        if (cbTemp)
+                        {
+                            // Add the valued attribute to the list
+                            if (xtype==eTokenQuotedText) { token.pStr++; cbToken-=2; }
+                            XMLSTR attrVal=(XMLSTR)token.pStr;
+                            if (attrVal)
+                            {
+                                attrVal=fromXMLString(attrVal,cbToken,pXML);
+                                if (!attrVal) return FALSE;
+                            }
+                            addAttribute_priv(MEMORYINCREASE,stringDup(lpszTemp,cbTemp),attrVal);
+                        }
+
+                        // Indicate we are searching for a new attribute
+                        attrib = eAttribName;
+                        break;
+
+                    // Errors...
+                    case eTokenTagStart:        /* 'Attr = <'          */
+                    case eTokenTagEnd:          /* 'Attr = </'         */
+                    case eTokenCloseTag:        /* 'Attr = >'          */
+                    case eTokenShortHandClose:  /* "Attr = />"         */
+                    case eTokenEquals:          /* 'Attr = ='          */
+                    case eTokenDeclaration:     /* 'Attr = <?'         */
+                    case eTokenClear:
+                        pXML->error = eXMLErrorUnexpectedToken;
+                        return FALSE;
+                        break;
+                    default: break;
+                    }
+                }
+            }
+        }
+        // If we failed to obtain the next token
+        else
+        {
+            if ((!d->isDeclaration)&&(d->pParent))
+            {
+#ifdef STRICT_PARSING
+                pXML->error=eXMLErrorUnmatchedEndTag;
+#else
+                pXML->error=eXMLErrorMissingEndTag;
+#endif
+                pXML->nIndexMissigEndTag=pXML->nIndex;
+            }
+            maybeAddTxT(pXML,pXML->lpXML+pXML->nIndex);
+            return FALSE;
+        }
+    }
+}
+
+// Count the number of lines and columns in an XML string.
+static void CountLinesAndColumns(XMLCSTR lpXML, int nUpto, XMLResults *pResults)
+{
+    XMLCHAR ch;
+    assert(lpXML);
+    assert(pResults);
+
+    struct XML xml={ lpXML,lpXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
+
+    pResults->nLine = 1;
+    pResults->nColumn = 1;
+    while (xml.nIndex<nUpto)
+    {
+        ch = getNextChar(&xml);
+        if (ch != _X('\n')) pResults->nColumn++;
+        else
+        {
+            pResults->nLine++;
+            pResults->nColumn=1;
+        }
+    }
+}
+
+// Parse XML and return the root element.
+XMLNode XMLNode::parseString(XMLCSTR lpszXML, XMLCSTR tag, XMLResults *pResults)
+{
+    if (!lpszXML)
+    {
+        if (pResults)
+        {
+            pResults->error=eXMLErrorNoElements;
+            pResults->nLine=0;
+            pResults->nColumn=0;
+        }
+        return emptyXMLNode;
+    }
+
+    XMLNode xnode(NULL,NULL,FALSE);
+    struct XML xml={ lpszXML, lpszXML, 0, 0, eXMLErrorNone, NULL, 0, NULL, 0, TRUE };
+
+    // Create header element
+    xnode.ParseXMLElement(&xml);
+    enum XMLError error = xml.error;
+    if (!xnode.nChildNode()) error=eXMLErrorNoXMLTagFound;
+    if ((xnode.nChildNode()==1)&&(xnode.nElement()==1)) xnode=xnode.getChildNode(); // skip the empty node
+
+    // If no error occurred
+    if ((error==eXMLErrorNone)||(error==eXMLErrorMissingEndTag)||(error==eXMLErrorNoXMLTagFound))
+    {
+        XMLCSTR name=xnode.getName();
+        if (tag&&xstrlen(tag)&&((!name)||(xstricmp(xnode.getName(),tag))))
+        {
+            XMLNode nodeTmp;
+            int i=0;
+            while (i<xnode.nChildNode())
+            {
+                nodeTmp=xnode.getChildNode(i);
+                if (xstricmp(nodeTmp.getName(),tag)==0) break;
+                if (nodeTmp.isDeclaration()) { xnode=nodeTmp; i=0; } else i++;
+            }
+            if (i>=xnode.nChildNode())
+            {
+                if (pResults)
+                {
+                    pResults->error=eXMLErrorFirstTagNotFound;
+                    pResults->nLine=0;
+                    pResults->nColumn=0;
+                }
+                return emptyXMLNode;
+            }
+            xnode=nodeTmp;
+        }
+    } else
+    {
+        // Cleanup: this will destroy all the nodes
+        xnode = emptyXMLNode;
+    }
+
+
+    // If we have been given somewhere to place results
+    if (pResults)
+    {
+        pResults->error = error;
+
+        // If we have an error
+        if (error!=eXMLErrorNone)
+        {
+            if (error==eXMLErrorMissingEndTag) xml.nIndex=xml.nIndexMissigEndTag;
+            // Find which line and column it starts on.
+            CountLinesAndColumns(xml.lpXML, xml.nIndex, pResults);
+        }
+    }
+    return xnode;
+}
+
+XMLNode XMLNode::parseFile(XMLCSTR filename, XMLCSTR tag, XMLResults *pResults)
+{
+    if (pResults) { pResults->nLine=0; pResults->nColumn=0; }
+    FILE *f=xfopen(filename,_X("rb"));
+    if (f==NULL) { if (pResults) pResults->error=eXMLErrorFileNotFound; return emptyXMLNode; }
+    fseek(f,0,SEEK_END);
+    int l=ftell(f),headerSz=0;
+    if (!l) { if (pResults) pResults->error=eXMLErrorEmpty; fclose(f); return emptyXMLNode; }
+    fseek(f,0,SEEK_SET);
+    unsigned char *buf=(unsigned char*)malloc(l+4);
+    fread(buf,l,1,f);
+    fclose(f);
+    buf[l]=0;buf[l+1]=0;buf[l+2]=0;buf[l+3]=0;
+#ifdef _XMLWIDECHAR
+    if (guessWideCharChars)
+    {
+        if (!myIsTextWideChar(buf,l))
+        {
+            if ((buf[0]==0xef)&&(buf[1]==0xbb)&&(buf[2]==0xbf)) headerSz=3;
+            XMLSTR b2=myMultiByteToWideChar((const char*)(buf+headerSz));
+            free(buf); buf=(unsigned char*)b2; headerSz=0;
+        } else
+        {
+            if ((buf[0]==0xef)&&(buf[1]==0xff)) headerSz=2;
+            if ((buf[0]==0xff)&&(buf[1]==0xfe)) headerSz=2;
+        }
+    }
+#else
+    if (guessWideCharChars)
+    {
+        if (myIsTextWideChar(buf,l))
+        {
+            l/=sizeof(wchar_t);
+            if ((buf[0]==0xef)&&(buf[1]==0xff)) headerSz=2;
+            if ((buf[0]==0xff)&&(buf[1]==0xfe)) headerSz=2;
+            char *b2=myWideCharToMultiByte((const wchar_t*)(buf+headerSz));
+            free(buf); buf=(unsigned char*)b2; headerSz=0;
+        } else
+        {
+            if ((buf[0]==0xef)&&(buf[1]==0xbb)&&(buf[2]==0xbf)) headerSz=3;
+        }
+    }
+#endif
+
+    if (!buf) { if (pResults) pResults->error=eXMLErrorCharConversionError; return emptyXMLNode; }
+    XMLNode x=parseString((XMLSTR)(buf+headerSz),tag,pResults);
+    free(buf);
+    return x;
+}
+
+static inline void charmemset(XMLSTR dest,XMLCHAR c,int l) { while (l--) *(dest++)=c; }
+// private:
+// Creates an user friendly XML string from a given element with
+// appropriate white space and carriage returns.
+//
+// This recurses through all subnodes then adds contents of the nodes to the
+// string.
+int XMLNode::CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat)
+{
+    int nResult = 0;
+    int cb;
+    int cbElement;
+    int nChildFormat=-1;
+    int nElementI=pEntry->nChild+pEntry->nText+pEntry->nClear;
+    int i,j;
+
+    assert(pEntry);
+
+#define LENSTR(lpsz) (lpsz ? xstrlen(lpsz) : 0)
+
+    // If the element has no name then assume this is the head node.
+    cbElement = (int)LENSTR(pEntry->lpszName);
+
+    if (cbElement)
+    {
+        // "<elementname "
+        cb = nFormat == -1 ? 0 : nFormat;
+
+        if (lpszMarker)
+        {
+            if (cb) charmemset(lpszMarker, INDENTCHAR, sizeof(XMLCHAR)*cb);
+            nResult = cb;
+            lpszMarker[nResult++]=_X('<');
+            if (pEntry->isDeclaration) lpszMarker[nResult++]=_X('?');
+            xstrcpy(&lpszMarker[nResult], pEntry->lpszName);
+            nResult+=cbElement;
+            lpszMarker[nResult++]=_X(' ');
+
+        } else
+        {
+            nResult+=cbElement+2+cb;
+            if (pEntry->isDeclaration) nResult++;
+        }
+
+        // Enumerate attributes and add them to the string
+        XMLAttribute *pAttr=pEntry->pAttribute;
+        for (i=0; i<pEntry->nAttribute; i++)
+        {
+            // "Attrib
+            cb = (int)LENSTR(pAttr->lpszName);
+            if (cb)
+            {
+                if (lpszMarker) xstrcpy(&lpszMarker[nResult], pAttr->lpszName);
+                nResult += cb;
+                // "Attrib=Value "
+                if (pAttr->lpszValue)
+                {
+                    cb=(int)lengthXMLString(pAttr->lpszValue);
+                    if (lpszMarker)
+                    {
+                        lpszMarker[nResult]=_X('=');
+                        lpszMarker[nResult+1]=_X('"');
+                        if (cb) toXMLStringUnSafe(&lpszMarker[nResult+2],pAttr->lpszValue);
+                        lpszMarker[nResult+cb+2]=_X('"');
+                    }
+                    nResult+=cb+3;
+                }
+                if (lpszMarker) lpszMarker[nResult] = _X(' ');
+                nResult++;
+            }
+            pAttr++;
+        }
+
+        if (pEntry->isDeclaration)
+        {
+            if (lpszMarker)
+            {
+                lpszMarker[nResult-1]=_X('?');
+                lpszMarker[nResult]=_X('>');
+            }
+            nResult++;
+            if (nFormat!=-1)
+            {
+                if (lpszMarker) lpszMarker[nResult]=_X('\n');
+                nResult++;
+            }
+        } else
+            // If there are child nodes we need to terminate the start tag
+            if (nElementI)
+            {
+                if (lpszMarker) lpszMarker[nResult-1]=_X('>');
+                if (nFormat!=-1)
+                {
+                    if (lpszMarker) lpszMarker[nResult]=_X('\n');
+                    nResult++;
+                }
+            } else nResult--;
+    }
+
+    // Calculate the child format for when we recurse.  This is used to
+    // determine the number of spaces used for prefixes.
+    if (nFormat!=-1)
+    {
+        if (cbElement&&(!pEntry->isDeclaration)) nChildFormat=nFormat+1;
+        else nChildFormat=nFormat;
+    }
+
+    // Enumerate through remaining children
+    for (i=0; i<nElementI; i++)
+    {
+        j=pEntry->pOrder[i];
+        switch((XMLElementType)(j&3))
+        {
+        // Text nodes
+        case eNodeText:
+            {
+                // "Text"
+                XMLCSTR pChild=pEntry->pText[j>>2];
+                cb = (int)lengthXMLString(pChild);
+                if (cb)
+                {
+                    if (nFormat!=-1)
+                    {
+                        if (lpszMarker)
+                        {
+                            charmemset(&lpszMarker[nResult],INDENTCHAR,sizeof(XMLCHAR)*(nFormat + 1));
+                            toXMLStringUnSafe(&lpszMarker[nResult+nFormat+1],pChild);
+                            lpszMarker[nResult+nFormat+1+cb]=_X('\n');
+                        }
+                        nResult+=cb+nFormat+2;
+                    } else
+                    {
+                        if (lpszMarker) toXMLStringUnSafe(&lpszMarker[nResult], pChild);
+                        nResult += cb;
+                    }
+                }
+                break;
+            }
+
+        // Clear type nodes
+        case eNodeClear:
+            {
+                XMLClear *pChild=pEntry->pClear+(j>>2);
+                // "OpenTag"
+                cb = (int)LENSTR(pChild->lpszOpenTag);
+                if (cb)
+                {
+                    if (nFormat!=-1)
+                    {
+                        if (lpszMarker)
+                        {
+                            charmemset(&lpszMarker[nResult], INDENTCHAR, sizeof(XMLCHAR)*(nFormat + 1));
+                            xstrcpy(&lpszMarker[nResult+nFormat+1], pChild->lpszOpenTag);
+                        }
+                        nResult+=cb+nFormat+1;
+                    }
+                    else
+                    {
+                        if (lpszMarker)xstrcpy(&lpszMarker[nResult], pChild->lpszOpenTag);
+                        nResult += cb;
+                    }
+                }
+
+                // "OpenTag Value"
+                cb = (int)LENSTR(pChild->lpszValue);
+                if (cb)
+                {
+                    if (lpszMarker) xstrcpy(&lpszMarker[nResult], pChild->lpszValue);
+                    nResult += cb;
+                }
+
+                // "OpenTag Value CloseTag"
+                cb = (int)LENSTR(pChild->lpszCloseTag);
+                if (cb)
+                {
+                    if (lpszMarker) xstrcpy(&lpszMarker[nResult], pChild->lpszCloseTag);
+                    nResult += cb;
+                }
+
+                if (nFormat!=-1)
+                {
+                    if (lpszMarker) lpszMarker[nResult] = _X('\n');
+                    nResult++;
+                }
+                break;
+            }
+
+        // Element nodes
+        case eNodeChild:
+            {
+                // Recursively add child nodes
+                nResult += CreateXMLStringR(pEntry->pChild[j>>2].d, lpszMarker ? lpszMarker + nResult : 0, nChildFormat);
+                break;
+            }
+        default: break;
+        }
+    }
+
+    if ((cbElement)&&(!pEntry->isDeclaration))
+    {
+        // If we have child entries we need to use long XML notation for
+        // closing the element - "<elementname>blah blah blah</elementname>"
+        if (nElementI)
+        {
+            // "</elementname>\0"
+            if (lpszMarker)
+            {
+                if (nFormat != -1)
+                {
+                    if (nFormat)
+                    {
+                        charmemset(&lpszMarker[nResult], INDENTCHAR,sizeof(XMLCHAR)*nFormat);
+                        nResult+=nFormat;
+                    }
+                }
+
+                xstrcpy(&lpszMarker[nResult], _X("</"));
+                nResult += 2;
+                xstrcpy(&lpszMarker[nResult], pEntry->lpszName);
+                nResult += cbElement;
+
+                if (nFormat == -1)
+                {
+                    xstrcpy(&lpszMarker[nResult], _X(">"));
+                    nResult++;
+                } else
+                {
+                    xstrcpy(&lpszMarker[nResult], _X(">\n"));
+                    nResult+=2;
+                }
+            } else
+            {
+                if (nFormat != -1) nResult+=cbElement+4+nFormat;
+                else nResult+=cbElement+3;
+            }
+        } else
+        {
+            // If there are no children we can use shorthand XML notation -
+            // "<elementname/>"
+            // "/>\0"
+            if (lpszMarker)
+            {
+                if (nFormat == -1)
+                {
+                    xstrcpy(&lpszMarker[nResult], _X("/>"));
+                    nResult += 2;
+                }
+                else
+                {
+                    xstrcpy(&lpszMarker[nResult], _X("/>\n"));
+                    nResult += 3;
+                }
+            }
+            else
+            {
+                nResult += nFormat == -1 ? 2 : 3;
+            }
+        }
+    }
+
+    return nResult;
+}
+
+#undef LENSTR
+
+// Create an XML string
+// @param       int nFormat             - 0 if no formatting is required
+//                                        otherwise nonzero for formatted text
+//                                        with carriage returns and indentation.
+// @param       int *pnSize             - [out] pointer to the size of the
+//                                        returned string not including the
+//                                        NULL terminator.
+// @return      XMLSTR                  - Allocated XML string, you must free
+//                                        this with free().
+XMLSTR XMLNode::createXMLString(int nFormat, int *pnSize) const
+{
+    if (!d) { if (pnSize) *pnSize=0; return NULL; }
+
+    XMLSTR lpszResult = NULL;
+    int cbStr;
+
+    // Recursively Calculate the size of the XML string
+    if (!dropWhiteSpace) nFormat=0;
+    nFormat = nFormat ? 0 : -1;
+    cbStr = CreateXMLStringR(d, 0, nFormat);
+    assert(cbStr);
+    // Alllocate memory for the XML string + the NULL terminator and
+    // create the recursively XML string.
+    lpszResult=(XMLSTR)malloc((cbStr+1)*sizeof(XMLCHAR));
+    CreateXMLStringR(d, lpszResult, nFormat);
+    if (pnSize) *pnSize = cbStr;
+    return lpszResult;
+}
+
+int XMLNode::detachFromParent(XMLNodeData *d)
+{
+    XMLNode *pa=d->pParent->pChild;
+    int i=0;
+    while (((void*)(pa[i].d))!=((void*)d)) i++;
+    d->pParent->nChild--;
+    if (d->pParent->nChild) memmove(pa+i,pa+i+1,(d->pParent->nChild-i)*sizeof(XMLNode));
+    else { free(pa); d->pParent->pChild=NULL; }
+    return removeOrderElement(d->pParent,eNodeChild,i);
+}
+
+XMLNode::~XMLNode() { deleteNodeContent_priv(1,0); }
+void XMLNode::deleteNodeContent(){ deleteNodeContent_priv(0,1); }
+void XMLNode::deleteNodeContent_priv(char isInDestuctor, char force)
+{
+    if (!d) return;
+    if (isInDestuctor) (d->ref_count)--;
+    if ((d->ref_count==0)||force)
+    {
+        int i;
+        if (d->pParent) detachFromParent(d);
+        for(i=0; i<d->nChild; i++) { d->pChild[i].d->pParent=NULL; d->pChild[i].deleteNodeContent_priv(1,force); }
+        myFree(d->pChild);
+        for(i=0; i<d->nText; i++) free((void*)d->pText[i]);
+        myFree(d->pText);
+        for(i=0; i<d->nClear; i++) free((void*)d->pClear[i].lpszValue);
+        myFree(d->pClear);
+        for(i=0; i<d->nAttribute; i++)
+        {
+            free((void*)d->pAttribute[i].lpszName);
+            if (d->pAttribute[i].lpszValue) free((void*)d->pAttribute[i].lpszValue);
+        }
+        myFree(d->pAttribute);
+        myFree(d->pOrder);
+        myFree((void*)d->lpszName);
+        d->nChild=0;    d->nText=0;    d->nClear=0;    d->nAttribute=0;
+        d->pChild=NULL; d->pText=NULL; d->pClear=NULL; d->pAttribute=NULL;
+        d->pOrder=NULL; d->lpszName=NULL; d->pParent=NULL;
+    }
+    if (d->ref_count==0)
+    {
+        free(d);
+        d=NULL;
+    }
+}
+
+XMLNode XMLNode::deepCopy() const
+{
+    if (!d) return XMLNode::emptyXMLNode;
+    XMLNode x(NULL,stringDup(d->lpszName),d->isDeclaration);
+    XMLNodeData *p=x.d;
+    int n=d->nAttribute;
+    if (n)
+    {
+        p->nAttribute=n; p->pAttribute=(XMLAttribute*)malloc(n*sizeof(XMLAttribute));
+        while (n--)
+        {
+            p->pAttribute[n].lpszName=stringDup(d->pAttribute[n].lpszName);
+            p->pAttribute[n].lpszValue=stringDup(d->pAttribute[n].lpszValue);
+        }
+    }
+    if (d->pOrder)
+    {
+        n=(d->nChild+d->nText+d->nClear)*sizeof(int); p->pOrder=(int*)malloc(n); memcpy(p->pOrder,d->pOrder,n);
+    }
+    n=d->nText;
+    if (n)
+    {
+        p->nText=n; p->pText=(XMLCSTR*)malloc(n*sizeof(XMLCSTR));
+        while(n--) p->pText[n]=stringDup(d->pText[n]);
+    }
+    n=d->nClear;
+    if (n)
+    {
+        p->nClear=n; p->pClear=(XMLClear*)malloc(n*sizeof(XMLClear));
+        while (n--)
+        {
+            p->pClear[n].lpszCloseTag=d->pClear[n].lpszCloseTag;
+            p->pClear[n].lpszOpenTag=d->pClear[n].lpszOpenTag;
+            p->pClear[n].lpszValue=stringDup(d->pClear[n].lpszValue);
+        }
+    }
+    n=d->nChild;
+    if (n)
+    {
+        p->nChild=n; p->pChild=(XMLNode*)malloc(n*sizeof(XMLNode));
+        while (n--)
+        {
+            p->pChild[n].d=NULL;
+            p->pChild[n]=d->pChild[n].deepCopy();
+            p->pChild[n].d->pParent=p;
+        }
+    }
+    return x;
+}
+
+XMLNode XMLNode::addChild(XMLNode childNode, int pos)
+{
+    XMLNodeData *dc=childNode.d;
+    if ((!dc)||(!d)) return childNode;
+    if (dc->pParent) { if ((detachFromParent(dc)<=pos)&&(dc->pParent==d)) pos--; } else dc->ref_count++;
+    dc->pParent=d;
+//     int nc=d->nChild;
+//     d->pChild=(XMLNode*)myRealloc(d->pChild,(nc+1),memoryIncrease,sizeof(XMLNode));
+    d->pChild=(XMLNode*)addToOrder(0,&pos,d->nChild,d->pChild,sizeof(XMLNode),eNodeChild);
+    d->pChild[pos].d=dc;
+    d->nChild++;
+    return childNode;
+}
+
+void XMLNode::deleteAttribute(int i)
+{
+    if ((!d)||(i<0)||(i>=d->nAttribute)) return;
+    d->nAttribute--;
+    XMLAttribute *p=d->pAttribute+i;
+    free((void*)p->lpszName);
+    if (p->lpszValue) free((void*)p->lpszValue);
+    if (d->nAttribute) memmove(p,p+1,(d->nAttribute-i)*sizeof(XMLAttribute)); else { free(p); d->pAttribute=NULL; }
+}
+
+void XMLNode::deleteAttribute(XMLAttribute *a){ if (a) deleteAttribute(a->lpszName); }
+void XMLNode::deleteAttribute(XMLCSTR lpszName)
+{
+    int j=0;
+    getAttribute(lpszName,&j);
+    if (j) deleteAttribute(j-1);
+}
+
+XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,int i)
+{
+    if (!d) { if (lpszNewValue) free(lpszNewValue); if (lpszNewName) free(lpszNewName); return NULL; }
+    if (i>=d->nAttribute)
+    {
+        if (lpszNewName) return addAttribute_WOSD(lpszNewName,lpszNewValue);
+        return NULL;
+    }
+    XMLAttribute *p=d->pAttribute+i;
+    if (p->lpszValue&&p->lpszValue!=lpszNewValue) free((void*)p->lpszValue);
+    p->lpszValue=lpszNewValue;
+    if (lpszNewName&&p->lpszName!=lpszNewName) { free((void*)p->lpszName); p->lpszName=lpszNewName; };
+    return p;
+}
+
+XMLAttribute *XMLNode::updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute)
+{
+    if (oldAttribute) return updateAttribute_WOSD((XMLSTR)newAttribute->lpszValue,(XMLSTR)newAttribute->lpszName,oldAttribute->lpszName);
+    return addAttribute_WOSD((XMLSTR)newAttribute->lpszName,(XMLSTR)newAttribute->lpszValue);
+}
+
+XMLAttribute *XMLNode::updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName)
+{
+    int j=0;
+    getAttribute(lpszOldName,&j);
+    if (j) return updateAttribute_WOSD(lpszNewValue,lpszNewName,j-1);
+    else
+    {
+        if (lpszNewName) return addAttribute_WOSD(lpszNewName,lpszNewValue);
+        else             return addAttribute_WOSD(stringDup(lpszOldName),lpszNewValue);
+    }
+}
+
+int XMLNode::indexText(XMLCSTR lpszValue) const
+{
+    if (!d) return -1;
+    int i,l=d->nText;
+    if (!lpszValue) { if (l) return 0; return -1; }
+    XMLCSTR *p=d->pText;
+    for (i=0; i<l; i++) if (lpszValue==p[i]) return i;
+    return -1;
+}
+
+void XMLNode::deleteText(int i)
+{
+    if ((!d)||(i<0)||(i>=d->nText)) return;
+    d->nText--;
+    XMLCSTR *p=d->pText+i;
+    free((void*)*p);
+    if (d->nText) memmove(p,p+1,(d->nText-i)*sizeof(XMLCSTR)); else { free(p); d->pText=NULL; }
+    removeOrderElement(d,eNodeText,i);
+}
+
+void XMLNode::deleteText(XMLCSTR lpszValue) { deleteText(indexText(lpszValue)); }
+
+XMLCSTR XMLNode::updateText_WOSD(XMLSTR lpszNewValue, int i)
+{
+    if (!d) { if (lpszNewValue) free(lpszNewValue); return NULL; }
+    if (i>=d->nText) return addText_WOSD(lpszNewValue);
+    XMLCSTR *p=d->pText+i;
+    if (*p!=lpszNewValue) { free((void*)*p); *p=lpszNewValue; }
+    return lpszNewValue;
+}
+
+XMLCSTR XMLNode::updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue)
+{
+    if (!d) { if (lpszNewValue) free(lpszNewValue); return NULL; }
+    int i=indexText(lpszOldValue);
+    if (i>=0) return updateText_WOSD(lpszNewValue,i);
+    return addText_WOSD(lpszNewValue);
+}
+
+void XMLNode::deleteClear(int i)
+{
+    if ((!d)||(i<0)||(i>=d->nClear)) return;
+    d->nClear--;
+    XMLClear *p=d->pClear+i;
+    free((void*)p->lpszValue);
+    if (d->nClear) memmove(p,p+1,(d->nClear-i)*sizeof(XMLClear)); else { free(p); d->pClear=NULL; }
+    removeOrderElement(d,eNodeClear,i);
+}
+
+int XMLNode::indexClear(XMLCSTR lpszValue) const
+{
+    if (!d) return -1;
+    int i,l=d->nClear;
+    if (!lpszValue) { if (l) return 0; return -1; }
+    XMLClear *p=d->pClear;
+    for (i=0; i<l; i++) if (lpszValue==p[i].lpszValue) return i;
+    return -1;
+}
+
+void XMLNode::deleteClear(XMLCSTR lpszValue) { deleteClear(indexClear(lpszValue)); }
+void XMLNode::deleteClear(XMLClear *a) { if (a) deleteClear(a->lpszValue); }
+
+XMLClear *XMLNode::updateClear_WOSD(XMLSTR lpszNewContent, int i)
+{
+    if (!d) { if (lpszNewContent) free(lpszNewContent); return NULL; }
+    if (i>=d->nClear) return addClear_WOSD(lpszNewContent);
+    XMLClear *p=d->pClear+i;
+    if (lpszNewContent!=p->lpszValue) { free((void*)p->lpszValue); p->lpszValue=lpszNewContent; }
+    return p;
+}
+
+XMLClear *XMLNode::updateClear_WOSD(XMLSTR lpszNewContent, XMLCSTR lpszOldValue)
+{
+    if (!d) { if (lpszNewContent) free(lpszNewContent); return NULL; }
+    int i=indexClear(lpszOldValue);
+    if (i>=0) return updateClear_WOSD(lpszNewContent,i);
+    return addClear_WOSD(lpszNewContent);
+}
+
+XMLClear *XMLNode::updateClear_WOSD(XMLClear *newP,XMLClear *oldP)
+{
+    if (oldP) return updateClear_WOSD((XMLSTR)newP->lpszValue,(XMLSTR)oldP->lpszValue);
+    return NULL;
+}
+
+XMLNode& XMLNode::operator=( const XMLNode& A )
+{
+    // shallow copy
+    if (this != &A)
+    {
+        deleteNodeContent_priv(1,0);
+        d=A.d;
+        if (d) (d->ref_count) ++ ;
+    }
+    return *this;
+}
+
+XMLNode::XMLNode(const XMLNode &A)
+{
+    // shallow copy
+    d=A.d;
+    if (d) (d->ref_count)++ ;
+}
+
+int XMLNode::nChildNode(XMLCSTR name) const
+{
+    if (!d) return 0;
+    int i,j=0,n=d->nChild;
+    XMLNode *pc=d->pChild;
+    for (i=0; i<n; i++)
+    {
+        if (xstricmp(pc->d->lpszName, name)==0) j++;
+        pc++;
+    }
+    return j;
+}
+
+XMLNode XMLNode::getChildNode(XMLCSTR name, int *j) const
+{
+    if (!d) return emptyXMLNode;
+    int i=0,n=d->nChild;
+    if (j) i=*j;
+    XMLNode *pc=d->pChild+i;
+    for (; i<n; i++)
+    {
+        if (xstricmp(pc->d->lpszName, name)==0)
+        {
+            if (j) *j=i+1;
+            return *pc;
+        }
+        pc++;
+    }
+    return emptyXMLNode;
+}
+
+XMLNode XMLNode::getChildNode(XMLCSTR name, int j) const
+{
+    if (!d) return emptyXMLNode;
+    int i=0;
+    while (j-->0) getChildNode(name,&i);
+    return getChildNode(name,&i);
+}
+
+XMLElementPosition XMLNode::positionOfText     (int i) const { if (i>=d->nText ) i=d->nText-1;  return findPosition(d,i,eNodeText ); }
+XMLElementPosition XMLNode::positionOfClear    (int i) const { if (i>=d->nClear) i=d->nClear-1; return findPosition(d,i,eNodeClear); }
+XMLElementPosition XMLNode::positionOfChildNode(int i) const { if (i>=d->nChild) i=d->nChild-1; return findPosition(d,i,eNodeChild); }
+XMLElementPosition XMLNode::positionOfText (XMLCSTR lpszValue) const { return positionOfText (indexText (lpszValue)); }
+XMLElementPosition XMLNode::positionOfClear(XMLCSTR lpszValue) const { return positionOfClear(indexClear(lpszValue)); }
+XMLElementPosition XMLNode::positionOfClear(XMLClear *a) const { if (a) return positionOfClear(a->lpszValue); return positionOfClear(); }
+XMLElementPosition XMLNode::positionOfChildNode(XMLNode x)  const
+{
+    if ((!d)||(!x.d)) return -1;
+    XMLNodeData *dd=x.d;
+    XMLNode *pc=d->pChild;
+    int i=d->nChild;
+    while (i--) if (pc[i].d==dd) return findPosition(d,i,eNodeChild);
+    return -1;
+}
+XMLElementPosition XMLNode::positionOfChildNode(XMLCSTR name, int count) const
+{
+    if (!name) return positionOfChildNode(count);
+    int j=0;
+    do { getChildNode(name,&j); if (j<0) return -1; } while (count--);
+    return findPosition(d,j-1,eNodeChild);
+}
+
+XMLNode XMLNode::getChildNodeWithAttribute(XMLCSTR name,XMLCSTR attributeName,XMLCSTR attributeValue, int *k) const
+{
+     int i=0,j;
+     if (k) i=*k;
+     XMLNode x;
+     XMLCSTR t;
+     do
+     {
+         x=getChildNode(name,&i);
+         if (!x.isEmpty())
+         {
+             if (attributeValue)
+             {
+                 j=0;
+                 do
+                 {
+                     t=x.getAttribute(attributeName,&j);
+                     if (t&&(xstricmp(attributeValue,t)==0)) { if (k) *k=i+1; return x; }
+                 } while (t);
+             } else
+             {
+                 if (x.isAttributeSet(attributeName)) { if (k) *k=i+1; return x; }
+             }
+         }
+     } while (!x.isEmpty());
+     return emptyXMLNode;
+}
+
+// Find an attribute on an node.
+XMLCSTR XMLNode::getAttribute(XMLCSTR lpszAttrib, int *j) const
+{
+    if (!d) return NULL;
+    int i=0,n=d->nAttribute;
+    if (j) i=*j;
+    XMLAttribute *pAttr=d->pAttribute+i;
+    for (; i<n; i++)
+    {
+        if (xstricmp(pAttr->lpszName, lpszAttrib)==0)
+        {
+            if (j) *j=i+1;
+            return pAttr->lpszValue;
+        }
+        pAttr++;
+    }
+    return NULL;
+}
+
+char XMLNode::isAttributeSet(XMLCSTR lpszAttrib) const
+{
+    if (!d) return FALSE;
+    int i,n=d->nAttribute;
+    XMLAttribute *pAttr=d->pAttribute;
+    for (i=0; i<n; i++)
+    {
+        if (xstricmp(pAttr->lpszName, lpszAttrib)==0)
+        {
+            return TRUE;
+        }
+        pAttr++;
+    }
+    return FALSE;
+}
+
+XMLCSTR XMLNode::getAttribute(XMLCSTR name, int j) const
+{
+    if (!d) return NULL;
+    int i=0;
+    while (j-->0) getAttribute(name,&i);
+    return getAttribute(name,&i);
+}
+
+XMLNodeContents XMLNode::enumContents(int i) const
+{
+    XMLNodeContents c;
+    if (!d) { c.etype=eNodeNULL; return c; }
+    if (i<d->nAttribute)
+    {
+        c.etype=eNodeAttribute;
+        c.attrib=d->pAttribute[i];
+        return c;
+    }
+    i-=d->nAttribute;
+    c.etype=(XMLElementType)(d->pOrder[i]&3);
+    i=(d->pOrder[i])>>2;
+    switch (c.etype)
+    {
+    case eNodeChild:     c.child = d->pChild[i];      break;
+    case eNodeText:      c.text  = d->pText[i];       break;
+    case eNodeClear:     c.clear = d->pClear[i];      break;
+    default: break;
+    }
+    return c;
+}
+
+XMLCSTR XMLNode::getName() const { if (!d) return NULL; return d->lpszName;   }
+int XMLNode::nText()       const { if (!d) return 0;    return d->nText;      }
+int XMLNode::nChildNode()  const { if (!d) return 0;    return d->nChild;     }
+int XMLNode::nAttribute()  const { if (!d) return 0;    return d->nAttribute; }
+int XMLNode::nClear()      const { if (!d) return 0;    return d->nClear;     }
+int XMLNode::nElement()    const { if (!d) return 0;    return d->nAttribute+d->nChild+d->nText+d->nClear; }
+XMLClear     XMLNode::getClear         (int i) const { if ((!d)||(i>=d->nClear    )) return emptyXMLClear;     return d->pClear[i];     }
+XMLAttribute XMLNode::getAttribute     (int i) const { if ((!d)||(i>=d->nAttribute)) return emptyXMLAttribute; return d->pAttribute[i]; }
+XMLCSTR      XMLNode::getAttributeName (int i) const { if ((!d)||(i>=d->nAttribute)) return NULL;              return d->pAttribute[i].lpszName;  }
+XMLCSTR      XMLNode::getAttributeValue(int i) const { if ((!d)||(i>=d->nAttribute)) return NULL;              return d->pAttribute[i].lpszValue; }
+XMLCSTR      XMLNode::getText          (int i) const { if ((!d)||(i>=d->nText     )) return NULL;              return d->pText[i];      }
+XMLNode      XMLNode::getChildNode     (int i) const { if ((!d)||(i>=d->nChild    )) return emptyXMLNode;      return d->pChild[i];     }
+XMLNode      XMLNode::getParentNode    (     ) const { if ((!d)||(!d->pParent     )) return emptyXMLNode;      return XMLNode(d->pParent); }
+char         XMLNode::isDeclaration    (     ) const { if (!d) return 0;             return d->isDeclaration; }
+char         XMLNode::isEmpty          (     ) const { return (d==NULL); }
+XMLNode       XMLNode::emptyNode       (     )       { return XMLNode::emptyXMLNode; }
+
+XMLNode       XMLNode::addChild(XMLCSTR lpszName, char isDeclaration, XMLElementPosition pos)
+              { return addChild_priv(0,stringDup(lpszName),isDeclaration,pos); }
+XMLNode       XMLNode::addChild_WOSD(XMLSTR lpszName, char isDeclaration, XMLElementPosition pos)
+              { return addChild_priv(0,lpszName,isDeclaration,pos); }
+XMLAttribute *XMLNode::addAttribute(XMLCSTR lpszName, XMLCSTR lpszValue)
+              { return addAttribute_priv(0,stringDup(lpszName),stringDup(lpszValue)); }
+XMLAttribute *XMLNode::addAttribute_WOSD(XMLSTR lpszName, XMLSTR lpszValuev)
+              { return addAttribute_priv(0,lpszName,lpszValuev); }
+XMLCSTR       XMLNode::addText(XMLCSTR lpszValue, XMLElementPosition pos)
+              { return addText_priv(0,stringDup(lpszValue),pos); }
+XMLCSTR       XMLNode::addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos)
+              { return addText_priv(0,lpszValue,pos); }
+XMLClear     *XMLNode::addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, XMLElementPosition pos)
+              { return addClear_priv(0,stringDup(lpszValue),lpszOpen,lpszClose,pos); }
+XMLClear     *XMLNode::addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen, XMLCSTR lpszClose, XMLElementPosition pos)
+              { return addClear_priv(0,lpszValue,lpszOpen,lpszClose,pos); }
+XMLCSTR       XMLNode::updateName(XMLCSTR lpszName)
+              { return updateName_WOSD(stringDup(lpszName)); }
+XMLAttribute *XMLNode::updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute)
+              { return updateAttribute_WOSD(stringDup(newAttribute->lpszValue),stringDup(newAttribute->lpszName),oldAttribute->lpszName); }
+XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,int i)
+              { return updateAttribute_WOSD(stringDup(lpszNewValue),stringDup(lpszNewName),i); }
+XMLAttribute *XMLNode::updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName)
+              { return updateAttribute_WOSD(stringDup(lpszNewValue),stringDup(lpszNewName),lpszOldName); }
+XMLCSTR       XMLNode::updateText(XMLCSTR lpszNewValue, int i)
+              { return updateText_WOSD(stringDup(lpszNewValue),i); }
+XMLCSTR       XMLNode::updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue)
+              { return updateText_WOSD(stringDup(lpszNewValue),lpszOldValue); }
+XMLClear     *XMLNode::updateClear(XMLCSTR lpszNewContent, int i)
+              { return updateClear_WOSD(stringDup(lpszNewContent),i); }
+XMLClear     *XMLNode::updateClear(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue)
+              { return updateClear_WOSD(stringDup(lpszNewValue),lpszOldValue); }
+XMLClear     *XMLNode::updateClear(XMLClear *newP,XMLClear *oldP)
+              { return updateClear_WOSD(stringDup(newP->lpszValue),oldP->lpszValue); }
+
+char XMLNode::setGlobalOptions(XMLCharEncoding _characterEncoding, char _guessWideCharChars, char _dropWhiteSpace)
+{
+    guessWideCharChars=_guessWideCharChars; dropWhiteSpace=_dropWhiteSpace;
+#ifdef _XMLWIDECHAR
+    if (_characterEncoding) characterEncoding=_characterEncoding;
+#else
+    switch(_characterEncoding)
+    {
+    case encoding_UTF8:     characterEncoding=_characterEncoding; XML_ByteTable=XML_utf8ByteTable; break;
+    case encoding_ascii:    characterEncoding=_characterEncoding; XML_ByteTable=XML_asciiByteTable; break;
+    case encoding_ShiftJIS: characterEncoding=_characterEncoding; XML_ByteTable=XML_sjisByteTable; break;
+    default: return 1;
+    }
+#endif
+    return 0;
+}
+
+XMLNode::XMLCharEncoding XMLNode::guessCharEncoding(void *buf,int l, char useXMLEncodingAttribute)
+{
+#ifdef _XMLWIDECHAR
+    return (XMLCharEncoding)0;
+#else
+    if (l<25) return (XMLCharEncoding)0;
+    if (guessWideCharChars&&(myIsTextWideChar(buf,l))) return (XMLCharEncoding)0;
+    unsigned char *b=(unsigned char*)buf;
+    if ((b[0]==0xef)&&(b[1]==0xbb)&&(b[2]==0xbf)) return encoding_UTF8;
+
+    // Match utf-8 model ?
+    XMLCharEncoding bestGuess=encoding_UTF8;
+    int i=0;
+    while (i<l)
+        switch (XML_utf8ByteTable[b[i]])
+        {
+        case 4: i++; if ((i<l)&&(b[i]& 0xC0)!=0x80) { bestGuess=encoding_ascii; i=l; } // 10bbbbbb ?
+        case 3: i++; if ((i<l)&&(b[i]& 0xC0)!=0x80) { bestGuess=encoding_ascii; i=l; } // 10bbbbbb ?
+        case 2: i++; if ((i<l)&&(b[i]& 0xC0)!=0x80) { bestGuess=encoding_ascii; i=l; } // 10bbbbbb ?
+        case 1: i++; break;
+        case 0: i=l;
+        }
+    if (!useXMLEncodingAttribute) return bestGuess;
+    // if encoding is specified and different from utf-8 than it's non-utf8
+    // otherwise it's utf-8
+    char bb[201];
+    l=mmin(l,200);
+    memcpy(bb,buf,l); // copy buf into bb to be able to do "bb[l]=0"
+    bb[l]=0;
+    b=(unsigned char*)strstr(bb,"encoding");
+    if (!b) return bestGuess;
+    b+=8; while XML_isSPACECHAR(*b) b++; if (*b!='=') return bestGuess;
+    b++;  while XML_isSPACECHAR(*b) b++; if ((*b!='\'')&&(*b!='"')) return bestGuess;
+    b++;  while XML_isSPACECHAR(*b) b++;
+
+    if ((_strnicmp((char*)b,"utf-8",5)==0)||
+        (_strnicmp((char*)b,"utf8",4)==0))
+    {
+        if (bestGuess==encoding_ascii) return (XMLCharEncoding)0;
+        return encoding_UTF8;
+    }
+
+    if ((_strnicmp((char*)b,"shiftjis",8)==0)||
+        (_strnicmp((char*)b,"shift-jis",9)==0)||
+        (_strnicmp((char*)b,"sjis",4)==0)) return encoding_ShiftJIS;
+
+    return encoding_ascii;
+#endif
+}
+#undef XML_isSPACECHAR
+
+//////////////////////////////////////////////////////////
+//      Here starts the base64 conversion functions.    //
+//////////////////////////////////////////////////////////
+
+static const char base64Fillchar = _X('='); // used to mark partial words at the end
+
+// this lookup table defines the base64 encoding
+XMLCSTR base64EncodeTable=_X("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
+
+// Decode Table gives the index of any valid base64 character in the Base64 table]
+// 96: '='  -   97: space char   -   98: illegal char   -   99: end of string
+const unsigned char base64DecodeTable[] = {
+    99,98,98,98,98,98,98,98,98,97,  97,98,98,97,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  //00 -29
+    98,98,97,98,98,98,98,98,98,98,  98,98,98,62,98,98,98,63,52,53,  54,55,56,57,58,59,60,61,98,98,  //30 -59
+    98,96,98,98,98, 0, 1, 2, 3, 4,   5, 6, 7, 8, 9,10,11,12,13,14,  15,16,17,18,19,20,21,22,23,24,  //60 -89
+    25,98,98,98,98,98,98,26,27,28,  29,30,31,32,33,34,35,36,37,38,  39,40,41,42,43,44,45,46,47,48,  //90 -119
+    49,50,51,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  //120 -149
+    98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  //150 -179
+    98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  //180 -209
+    98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98,98,98,98,98,  //210 -239
+    98,98,98,98,98,98,98,98,98,98,  98,98,98,98,98,98                                               //240 -255
+};
+
+XMLParserBase64Tool::~XMLParserBase64Tool(){ freeBuffer(); }
+
+void XMLParserBase64Tool::freeBuffer(){ if (buf) free(buf); buf=NULL; buflen=0; }
+
+int XMLParserBase64Tool::encodeLength(int inlen, char formatted)
+{
+    unsigned int i=((inlen-1)/3*4+4+1);
+    if (formatted) i+=inlen/54;
+    return i;
+}
+
+XMLSTR XMLParserBase64Tool::encode(unsigned char *inbuf, unsigned int inlen, char formatted)
+{
+    int i=encodeLength(inlen,formatted),k=17,eLen=inlen/3,j;
+    alloc(i*sizeof(XMLCHAR));
+    XMLSTR curr=(XMLSTR)buf;
+    for(i=0;i<eLen;i++)
+    {
+        // Copy next three bytes into lower 24 bits of int, paying attention to sign.
+        j=(inbuf[0]<<16)|(inbuf[1]<<8)|inbuf[2]; inbuf+=3;
+        // Encode the int into four chars
+        *(curr++)=base64EncodeTable[ j>>18      ];
+        *(curr++)=base64EncodeTable[(j>>12)&0x3f];
+        *(curr++)=base64EncodeTable[(j>> 6)&0x3f];
+        *(curr++)=base64EncodeTable[(j    )&0x3f];
+        if (formatted) { if (!k) { *(curr++)=_X('\n'); k=18; } k--; }
+    }
+    eLen=inlen-eLen*3; // 0 - 2.
+    if (eLen==1)
+    {
+        *(curr++)=base64EncodeTable[ inbuf[0]>>2      ];
+        *(curr++)=base64EncodeTable[(inbuf[0]<<4)&0x3F];
+        *(curr++)=base64Fillchar;
+        *(curr++)=base64Fillchar;
+    } else if (eLen==2)
+    {
+        j=(inbuf[0]<<8)|inbuf[1];
+        *(curr++)=base64EncodeTable[ j>>10      ];
+        *(curr++)=base64EncodeTable[(j>> 4)&0x3f];
+        *(curr++)=base64EncodeTable[(j<< 2)&0x3f];
+        *(curr++)=base64Fillchar;
+    }
+    *(curr++)=0;
+    return (XMLSTR)buf;
+}
+
+unsigned int XMLParserBase64Tool::decodeSize(XMLCSTR data,XMLError *xe)
+{
+     if (xe) *xe=eXMLErrorNone;
+    int size=0;
+    unsigned char c;
+    //skip any extra characters (e.g. newlines or spaces)
+    while (*data)
+    {
+#ifdef _XMLWIDECHAR
+        if (*data>255) { if (xe) *xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+#endif
+        c=base64DecodeTable[(unsigned char)(*data)];
+        if (c<97) size++;
+        else if (c==98) { if (xe) *xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+        data++;
+    }
+    if (xe&&(size%4!=0)) *xe=eXMLErrorBase64DataSizeIsNotMultipleOf4;
+    if (size==0) return 0;
+    do { data--; size--; } while(*data==base64Fillchar); size++;
+    return (unsigned int)((size*3)/4);
+}
+
+unsigned char XMLParserBase64Tool::decode(XMLCSTR data, unsigned char *buf, int len, XMLError *xe)
+{
+    if (xe) *xe=eXMLErrorNone;
+    int i=0,p=0;
+    unsigned char d,c;
+    for(;;)
+    {
+
+#ifdef _XMLWIDECHAR
+#define BASE64DECODE_READ_NEXT_CHAR(c)                                              \
+        do {                                                                        \
+            if (data[i]>255){ c=98; break; }                                        \
+            c=base64DecodeTable[(unsigned char)data[i++]];                       \
+        }while (c==97);                                                             \
+        if(c==98){ if(xe)*xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+#else
+#define BASE64DECODE_READ_NEXT_CHAR(c)                                           \
+        do { c=base64DecodeTable[(unsigned char)data[i++]]; }while (c==97);   \
+        if(c==98){ if(xe)*xe=eXMLErrorBase64DecodeIllegalCharacter; return 0; }
+#endif
+
+        BASE64DECODE_READ_NEXT_CHAR(c)
+        if (c==99) { return 2; }
+        if (c==96)
+        {
+            if (p==(int)len) return 2;
+            if (xe) *xe=eXMLErrorBase64DecodeTruncatedData;
+            return 1;
+        }
+
+        BASE64DECODE_READ_NEXT_CHAR(d)
+        if ((d==99)||(d==96)) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData;  return 1; }
+        if (p==(int)len) {      if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall; return 0; }
+        buf[p++]=(unsigned char)((c<<2)|((d>>4)&0x3));
+
+        BASE64DECODE_READ_NEXT_CHAR(c)
+        if (c==99) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData;  return 1; }
+        if (p==(int)len)
+        {
+            if (c==96) return 2;
+            if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall;
+            return 0;
+        }
+        if (c==96) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData;  return 1; }
+        buf[p++]=(unsigned char)(((d<<4)&0xf0)|((c>>2)&0xf));
+
+        BASE64DECODE_READ_NEXT_CHAR(d)
+        if (d==99 ) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData;  return 1; }
+        if (p==(int)len)
+        {
+            if (d==96) return 2;
+            if (xe) *xe=eXMLErrorBase64DecodeBufferTooSmall;
+            return 0;
+        }
+        if (d==96) { if (xe) *xe=eXMLErrorBase64DecodeTruncatedData;  return 1; }
+        buf[p++]=(unsigned char)(((c<<6)&0xc0)|d);
+    }
+}
+#undef BASE64DECODE_READ_NEXT_CHAR
+
+void XMLParserBase64Tool::alloc(int newsize)
+{
+    if ((!buf)&&(newsize)) { buf=malloc(newsize); buflen=newsize; return; }
+    if (newsize>buflen) { buf=realloc(buf,newsize); buflen=newsize; }
+}
+
+unsigned char *XMLParserBase64Tool::decode(XMLCSTR data, int *outlen, XMLError *xe)
+{
+    if (xe) *xe=eXMLErrorNone;
+    unsigned int len=decodeSize(data,xe);
+    if (outlen) *outlen=len;
+    if (!len) return NULL;
+    alloc(len+1);
+    if(!decode(data,(unsigned char*)buf,len,xe)){ return NULL; }
+    return (unsigned char*)buf;
+}
+
Index: /code/branches/audio/src/xml/xmlParser.h
===================================================================
--- /code/branches/audio/src/xml/xmlParser.h	(revision 310)
+++ /code/branches/audio/src/xml/xmlParser.h	(revision 310)
@@ -0,0 +1,554 @@
+/**
+ ****************************************************************************
+ * <P> XML.c - implementation file for basic XML parser written in ANSI C++
+ * for portability. It works by using recursion and a node tree for breaking
+ * down the elements of an XML document.  </P>
+ *
+ * @version     V2.33
+ * @author      Frank Vanden Berghen
+ *
+ * BSD license:
+ * Copyright (c) 2002, Frank Vanden Berghen
+ * All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the Frank Vanden Berghen nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ ****************************************************************************
+ */
+#ifndef __INCLUDE_XML_NODE__
+#define __INCLUDE_XML_NODE__
+
+#include <stdlib.h>
+
+#ifdef _UNICODE
+// If you comment the next "define" line then the library will never "switch to" _UNICODE (wchar_t*) mode (16/32 bits per characters).
+// This is useful when you get error messages like:
+//    'XMLNode::openFileHelper' : cannot convert parameter 2 from 'const char [5]' to 'const wchar_t *'
+// The _XMLWIDECHAR preprocessor variable force the XMLParser library into either utf16/32-mode (the proprocessor variable
+// must be defined) or utf8-mode(the pre-processor variable must be undefined).
+#define _XMLWIDECHAR
+#endif
+
+#if defined(WIN32) || defined(UNDER_CE)
+// comment the next line if you are under windows and the compiler is not Microsoft Visual Studio (6.0 or .NET)
+#define _XMLWINDOWS
+#endif
+
+#ifdef XMLDLLENTRY
+#undef XMLDLLENTRY
+#endif
+#ifdef _USE_XMLPARSER_DLL
+#ifdef _DLL_EXPORTS_
+#define XMLDLLENTRY __declspec(dllexport)
+#else
+#define XMLDLLENTRY __declspec(dllimport)
+#endif
+#else
+#define XMLDLLENTRY
+#endif
+
+// uncomment the next line if you want no support for wchar_t* (no need for the <wchar.h> or <tchar.h> libraries anymore to compile)
+//#define XML_NO_WIDE_CHAR
+
+#ifdef XML_NO_WIDE_CHAR
+#undef _XMLWINDOWS
+#undef _XMLWIDECHAR
+#endif
+
+#ifdef _XMLWINDOWS
+#include <tchar.h>
+#else
+#define XMLDLLENTRY
+#ifndef XML_NO_WIDE_CHAR
+#include <wchar.h> // to have 'wcsrtombs' for ANSI version
+                   // to have 'mbsrtowcs' for WIDECHAR version
+#endif
+#endif
+
+// Some common types for char set portable code
+#ifdef _XMLWIDECHAR
+    #ifndef _X
+        #define _X(c) L ## c
+    #endif
+    #define XMLCSTR const wchar_t *
+    #define XMLSTR  wchar_t *
+    #define XMLCHAR wchar_t
+#else
+    #ifndef _X
+        #define _X(c) c
+    #endif
+    #define XMLCSTR const char *
+    #define XMLSTR  char *
+    #define XMLCHAR char
+#endif
+#ifndef FALSE
+    #define FALSE 0
+#endif /* FALSE */
+#ifndef TRUE
+    #define TRUE 1
+#endif /* TRUE */
+
+
+// Enumeration for XML parse errors.
+typedef enum XMLError
+{
+    eXMLErrorNone = 0,
+    eXMLErrorMissingEndTag,
+    eXMLErrorNoXMLTagFound,
+    eXMLErrorEmpty,
+    eXMLErrorMissingTagName,
+    eXMLErrorMissingEndTagName,
+    eXMLErrorUnmatchedEndTag,
+    eXMLErrorUnmatchedEndClearTag,
+    eXMLErrorUnexpectedToken,
+    eXMLErrorNoElements,
+    eXMLErrorFileNotFound,
+    eXMLErrorFirstTagNotFound,
+    eXMLErrorUnknownCharacterEntity,
+    eXMLErrorCharConversionError,
+    eXMLErrorCannotOpenWriteFile,
+    eXMLErrorCannotWriteFile,
+
+    eXMLErrorBase64DataSizeIsNotMultipleOf4,
+    eXMLErrorBase64DecodeIllegalCharacter,
+    eXMLErrorBase64DecodeTruncatedData,
+    eXMLErrorBase64DecodeBufferTooSmall
+} XMLError;
+
+
+// Enumeration used to manage type of data. Use in conjunction with structure XMLNodeContents
+typedef enum XMLElementType
+{
+    eNodeChild=0,
+    eNodeAttribute=1,
+    eNodeText=2,
+    eNodeClear=3,
+    eNodeNULL=4
+} XMLElementType;
+
+// Structure used to obtain error details if the parse fails.
+typedef struct XMLResults
+{
+    enum XMLError error;
+    int  nLine,nColumn;
+} XMLResults;
+
+// Structure for XML clear (unformatted) node (usually comments)
+typedef struct XMLClear {
+    XMLCSTR lpszValue; XMLCSTR lpszOpenTag; XMLCSTR lpszCloseTag;
+} XMLClear;
+
+// Structure for XML attribute.
+typedef struct XMLAttribute {
+    XMLCSTR lpszName; XMLCSTR lpszValue;
+} XMLAttribute;
+
+// XMLElementPosition are not interchangeable with simple indexes
+typedef int XMLElementPosition;
+
+struct XMLNodeContents;
+
+typedef struct XMLDLLENTRY XMLNode
+{
+  private:
+
+    struct XMLNodeDataTag;
+
+    // protected constructors: use one of these four methods to get your first instance of XMLNode:
+    //  - parseString
+    //  - parseFile
+    //  - openFileHelper
+    //  - createXMLTopNode
+    XMLNode(struct XMLNodeDataTag *pParent, XMLSTR lpszName, char isDeclaration);
+    XMLNode(struct XMLNodeDataTag *p);
+
+  public:
+
+    // You can create your first instance of XMLNode with these 4 functions:
+    // (see complete explanation of parameters below)
+
+    static XMLNode createXMLTopNode(XMLCSTR lpszName, char isDeclaration=FALSE);
+    static XMLNode parseString   (XMLCSTR  lpXMLString, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
+    static XMLNode parseFile     (XMLCSTR     filename, XMLCSTR tag=NULL, XMLResults *pResults=NULL);
+    static XMLNode openFileHelper(XMLCSTR     filename, XMLCSTR tag=NULL                           );
+
+    // The tag parameter should be the name of the first tag inside the XML file.
+    // If the tag parameter is omitted, the 3 functions return a node that represents
+    // the head of the xml document including the declaration term (<? ... ?>).
+
+    // The "openFileHelper" reports to the screen all the warnings & errors that occurred during
+    // parsing of the XML file. Since each application has its own way to report and deal with errors,
+    // you should rather use the "parseFile" function to parse XML files and program yourself thereafter
+    // an "error reporting" tailored for your needs (instead of using the very crude "error reporting"
+    // mechanism included inside the "openFileHelper" function).
+
+    // If the XML document is corrupted:
+    //   * The "openFileHelper" method will:
+    //         - display an error message on the console (or inside a messageBox for windows).
+    //         - stop execution (exit).
+    //     I suggest that you write your own "openFileHelper" method tailored to your needs.
+    //   * The 2 other methods will initialize the "pResults" variable with some information that
+    //     can be used to trace the error.
+    //   * If you still want to parse the file, you can use the APPROXIMATE_PARSING option as
+    //     explained inside the note at the beginning of the "xmlParser.cpp" file.
+    // You can have a user-friendly explanation of the parsing error with this function:
+    static XMLCSTR getError(XMLError error);
+    static XMLCSTR getVersion();
+
+    XMLCSTR getName() const;                                         // name of the node
+    XMLCSTR getText(int i=0) const;                                  // return ith text field
+    int nText() const;                                               // nbr of text field
+    XMLNode getParentNode() const;                                   // return the parent node
+    XMLNode getChildNode(int i=0) const;                             // return ith child node
+    XMLNode getChildNode(XMLCSTR name, int i)  const;                // return ith child node with specific name
+                                                                     //     (return an empty node if failing)
+    XMLNode getChildNode(XMLCSTR name, int *i=NULL) const;           // return next child node with specific name
+                                                                     //     (return an empty node if failing)
+    XMLNode getChildNodeWithAttribute(XMLCSTR tagName,               // return child node with specific name/attribute
+                                      XMLCSTR attributeName,         //     (return an empty node if failing)
+                                      XMLCSTR attributeValue=NULL,   //
+                                      int *i=NULL)  const;           //
+    int nChildNode(XMLCSTR name) const;                              // return the number of child node with specific name
+    int nChildNode() const;                                          // nbr of child node
+    XMLAttribute getAttribute(int i=0) const;                        // return ith attribute
+    XMLCSTR      getAttributeName(int i=0) const;                    // return ith attribute name
+    XMLCSTR      getAttributeValue(int i=0) const;                   // return ith attribute value
+    char  isAttributeSet(XMLCSTR name) const;                        // test if an attribute with a specific name is given
+    XMLCSTR getAttribute(XMLCSTR name, int i) const;                 // return ith attribute content with specific name
+                                                                     //     (return a NULL if failing)
+    XMLCSTR getAttribute(XMLCSTR name, int *i=NULL) const;           // return next attribute content with specific name
+                                                                     //     (return a NULL if failing)
+    int nAttribute() const;                                          // nbr of attribute
+    XMLClear getClear(int i=0) const;                                // return ith clear field (comments)
+    int nClear() const;                                              // nbr of clear field
+    XMLSTR createXMLString(int nFormat=1, int *pnSize=NULL) const;   // create XML string starting from current XMLNode
+                                                                     // if nFormat==0, no formatting is required
+                                                                     // otherwise this returns an user friendly XML string from a
+                                                                     // given element with appropriate white spaces and carriage returns.
+                                                                     // if pnSize is given it returns the size in character of the string.
+    XMLError writeToFile(XMLCSTR filename, const char *encoding=NULL, char nFormat=1) const;
+                                                                     // Save the content of an xmlNode inside a file.
+                                                                     // The nFormat parameter has the same meaning as in the
+                                                                     // createXMLString function. If the global parameter
+                                                                     // "characterEncoding==encoding_UTF8", then the "encoding" parameter is
+                                                                     // ignored and always set to "utf-8". If the global parameter
+                                                                     // "characterEncoding==encoding_ShiftJIS", then the "encoding" parameter
+                                                                     // is ignored and always set to "SHIFT-JIS". If "_XMLWIDECHAR=1", then
+                                                                     // the "encoding" parameter is ignored and always set to "utf-16".
+                                                                     // If no "encoding" parameter is given the "ISO-8859-1" encoding is used.
+    XMLNodeContents enumContents(XMLElementPosition i) const;           // enumerate all the different contents (attribute,child,text,
+                                                                     //     clear) of the current XMLNode. The order is reflecting
+                                                                     //     the order of the original file/string.
+                                                                     //     NOTE: 0 <= i < nElement();
+    int nElement() const;                                            // nbr of different contents for current node
+    char isEmpty() const;                                            // is this node Empty?
+    char isDeclaration() const;                                      // is this node a declaration <? .... ?>
+    XMLNode deepCopy() const;                                        // deep copy (duplicate/clone) a XMLNode
+    static XMLNode emptyNode();                                      // return XMLNode::emptyXMLNode;
+
+// to allow shallow/fast copy:
+    ~XMLNode();
+    XMLNode(const XMLNode &A);
+    XMLNode& operator=( const XMLNode& A );
+
+    XMLNode(): d(NULL){};
+    static XMLNode emptyXMLNode;
+    static XMLClear emptyXMLClear;
+    static XMLAttribute emptyXMLAttribute;
+
+    // The following functions allows you to create from scratch (or update) a XMLNode structure
+    // Start by creating your top node with the "createXMLTopNode" function and then add new nodes with the "addChild" function.
+    // The parameter 'pos' gives the position where the childNode, the text or the XMLClearTag will be inserted.
+    // The default value (pos=-1) inserts at the end. The value (pos=0) insert at the beginning (Insertion at the beginning is slower than at the end).
+    // REMARK: 0 <= pos < nChild()+nText()+nClear()
+    XMLNode       addChild(XMLCSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1);
+    XMLAttribute *addAttribute(XMLCSTR lpszName, XMLCSTR lpszValuev);
+    XMLCSTR       addText(XMLCSTR lpszValue, XMLElementPosition pos=-1);
+    XMLClear     *addClear(XMLCSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1);
+                                                                       // default values: lpszOpen ="<![CDATA["
+                                                                       //                 lpszClose="]]>"
+    XMLNode       addChild(XMLNode nodeToAdd, XMLElementPosition pos=-1); // If the "nodeToAdd" has some parents, it will be detached
+                                                                       // from it's parents before being attached to the current XMLNode
+    // Some update functions:
+    XMLCSTR       updateName(XMLCSTR lpszName);                                                    // change node's name
+    XMLAttribute *updateAttribute(XMLAttribute *newAttribute, XMLAttribute *oldAttribute);         // if the attribute to update is missing, a new one will be added
+    XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName=NULL,int i=0);         // if the attribute to update is missing, a new one will be added
+    XMLAttribute *updateAttribute(XMLCSTR lpszNewValue, XMLCSTR lpszNewName,XMLCSTR lpszOldName);  // set lpszNewName=NULL if you don't want to change the name of the attribute
+                                                                                                   // if the attribute to update is missing, a new one will be added
+    XMLCSTR       updateText(XMLCSTR lpszNewValue, int i=0);                                       // if the text to update is missing, a new one will be added
+    XMLCSTR       updateText(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue);                          // if the text to update is missing, a new one will be added
+    XMLClear     *updateClear(XMLCSTR lpszNewContent, int i=0);                                    // if the clearTag to update is missing, a new one will be added
+    XMLClear     *updateClear(XMLClear *newP,XMLClear *oldP);                                      // if the clearTag to update is missing, a new one will be added
+    XMLClear     *updateClear(XMLCSTR lpszNewValue, XMLCSTR lpszOldValue);                         // if the clearTag to update is missing, a new one will be added
+
+    // Some deletion functions:
+    void deleteNodeContent();  // delete the content of this XMLNode and the subtree.
+    void deleteAttribute(XMLCSTR lpszName);
+    void deleteAttribute(int i=0);
+    void deleteAttribute(XMLAttribute *anAttribute);
+    void deleteText(int i=0);
+    void deleteText(XMLCSTR lpszValue);
+    void deleteClear(int i=0);
+    void deleteClear(XMLClear *p);
+    void deleteClear(XMLCSTR lpszValue);
+
+    // The strings given as parameters for the following add and update methods (all these methods have
+    // a name with the postfix "_WOSD" that means "WithOut String Duplication" ) will be free'd by the
+    // XMLNode class. For example, it means that this is incorrect:
+    //    xNode.addText_WOSD("foo");
+    //    xNode.updateAttribute_WOSD("#newcolor" ,NULL,"color");
+    // In opposition, this is correct:
+    //    xNode.addText("foo");
+    //    xNode.addText_WOSD(stringDup("foo"));
+    //    xNode.updateAttribute("#newcolor" ,NULL,"color");
+    //    xNode.updateAttribute_WOSD(stringDup("#newcolor"),NULL,"color");
+    // Typically, you will never do:
+    //    char *b=(char*)malloc(...);
+    //    xNode.addText(b);
+    //    free(b);
+    // ... but rather:
+    //    char *b=(char*)malloc(...);
+    //    xNode.addText_WOSD(b);
+    //    ('free(b)' is performed by the XMLNode class)
+
+    static XMLNode createXMLTopNode_WOSD(XMLSTR lpszName, char isDeclaration=FALSE);
+    XMLNode        addChild_WOSD(XMLSTR lpszName, char isDeclaration=FALSE, XMLElementPosition pos=-1);
+    XMLAttribute  *addAttribute_WOSD(XMLSTR lpszName, XMLSTR lpszValue);
+    XMLCSTR        addText_WOSD(XMLSTR lpszValue, XMLElementPosition pos=-1);
+    XMLClear      *addClear_WOSD(XMLSTR lpszValue, XMLCSTR lpszOpen=NULL, XMLCSTR lpszClose=NULL, XMLElementPosition pos=-1);
+
+    XMLCSTR        updateName_WOSD(XMLSTR lpszName);
+    XMLAttribute  *updateAttribute_WOSD(XMLAttribute *newAttribute, XMLAttribute *oldAttribute);
+    XMLAttribute  *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName=NULL,int i=0);
+    XMLAttribute  *updateAttribute_WOSD(XMLSTR lpszNewValue, XMLSTR lpszNewName,XMLCSTR lpszOldName);
+    XMLCSTR        updateText_WOSD(XMLSTR lpszNewValue, int i=0);
+    XMLCSTR        updateText_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue);
+    XMLClear      *updateClear_WOSD(XMLSTR lpszNewContent, int i=0);
+    XMLClear      *updateClear_WOSD(XMLClear *newP,XMLClear *oldP);
+    XMLClear      *updateClear_WOSD(XMLSTR lpszNewValue, XMLCSTR lpszOldValue);
+
+    // These are some useful functions when you want to insert a childNode, a text or a XMLClearTag in the
+    // middle (at a specified position) of a XMLNode tree already constructed. The value returned by these
+    // methods is to be used as last parameter (parameter 'pos') of addChild, addText or addClear.
+    XMLElementPosition positionOfText(int i=0) const;
+    XMLElementPosition positionOfText(XMLCSTR lpszValue) const;
+    XMLElementPosition positionOfClear(int i=0) const;
+    XMLElementPosition positionOfClear(XMLCSTR lpszValue) const;
+    XMLElementPosition positionOfClear(XMLClear *a) const;
+    XMLElementPosition positionOfChildNode(int i=0) const;
+    XMLElementPosition positionOfChildNode(XMLNode x) const;
+    XMLElementPosition positionOfChildNode(XMLCSTR name, int i=0) const; // return the position of the ith childNode with the specified name
+                                                                      // if (name==NULL) return the position of the ith childNode
+
+    // The setGlobalOptions function allows you to change tree global parameters that affect string&file
+    // parsing. First of all, you most-probably will never have to change these 3 global parameters.
+    // The return value of the setGlobalOptions function is "0" when there are no errors. If you try to
+    // set an unrecognized encoding then the return value will be "1" to signal an error.
+    //
+    // About the "guessWideCharChars" parameter:
+    //     If "guessWideCharChars=1" and if this library is compiled in WideChar mode, then the
+    //     "parseFile" and "openFileHelper" functions will test if the file contains ASCII
+    //     characters. If this is the case, then the file will be loaded and converted in memory to
+    //     WideChar before being parsed. If "guessWideCharChars=0", no conversion will
+    //     be performed.
+    //
+    //     If "guessWideCharChars=1" and if this library is compiled in ASCII/UTF8/char* mode, then the
+    //     "parseFile" and "openFileHelper" functions will test if the file contains WideChar
+    //     characters. If this is the case, then the file will be loaded and converted in memory to
+    //     ASCII/UTF8/char* before being parsed. If "guessWideCharChars=0", no conversion will
+    //     be performed
+    //
+    //     Sometime, it's useful to set "guessWideCharChars=0" to disable any conversion
+    //     because the test to detect the file-type (ASCII/UTF8/char* or WideChar) may fail (rarely).
+    //
+    // About the "characterEncoding" parameter:
+    //     This parameter is only meaningful when compiling in char* mode (multibyte character mode).
+    //     In wchar_t* (wide char mode), this parameter is ignored. This parameter should be one of the
+    //     three currently recognized encodings: XMLNode::encoding_UTF8, XMLNode::encoding_ascii,
+    //     XMLNode::encoding_ShiftJIS.
+    //
+    // About the "dropWhiteSpace" parameter:
+    //     In most situations, text fields containing only white spaces (and carriage returns)
+    //     are useless. Even more, these "empty" text fields are annoying because they increase the
+    //     complexity of the user's code for parsing. So, 99% of the time, it's better to drop
+    //     the "empty" text fields. However The XML specification indicates that no white spaces
+    //     should be lost when parsing the file. So to be perfectly XML-compliant, you should set
+    //     dropWhiteSpace=0. A note of caution: if you set "dropWhiteSpace=0", the parser will be
+    //     slower and your code will be more complex.
+
+    // Enumeration for XML character encoding.
+    typedef enum XMLCharEncoding { encoding_UTF8=1, encoding_ascii=2, encoding_ShiftJIS=3 } XMLCharEncoding;
+
+    static char setGlobalOptions(XMLCharEncoding characterEncoding=XMLNode::encoding_UTF8, char guessWideCharChars=1, char dropWhiteSpace=1);
+
+    // The next function try to guess the character encoding. You most-probably will never
+    // have to use this function. It then returns the appropriate value of the global parameter
+    // "characterEncoding" described above. The guess is based on the content of a buffer of length
+    // "bufLen" bytes that contains the first bytes (minimum 25 bytes; 200 bytes is a good value) of the
+    // file to be parsed. The "openFileHelper" function is using this function to automatically compute
+    // the value of the "characterEncoding" global parameter. There are several heuristics used to do the
+    // guess. One of the heuristic is based on the "encoding" attribute. The original XML specifications
+    // forbids to use this attribute to do the guess but you can still use it if you set
+    // "useXMLEncodingAttribute" to 1 (this is the default behavior and the behavior of most parsers).
+    // If an inconsistency in the encoding is detected, then the return value is "0".
+
+    static XMLCharEncoding guessCharEncoding(void *buffer, int bufLen, char useXMLEncodingAttribute=1);
+
+  private:
+
+// these are functions and structures used internally by the XMLNode class (don't bother about them):
+
+      typedef struct XMLNodeDataTag // to allow shallow copy and "intelligent/smart" pointers (automatic delete):
+      {
+          XMLCSTR                lpszName;        // Element name (=NULL if root)
+          int                    nChild,          // Number of child nodes
+                                 nText,           // Number of text fields
+                                 nClear,          // Number of Clear fields (comments)
+                                 nAttribute;      // Number of attributes
+          char                   isDeclaration;   // Whether node is an XML declaration - '<?xml ?>'
+          struct XMLNodeDataTag  *pParent;        // Pointer to parent element (=NULL if root)
+          XMLNode                *pChild;         // Array of child nodes
+          XMLCSTR                *pText;          // Array of text fields
+          XMLClear               *pClear;         // Array of clear fields
+          XMLAttribute           *pAttribute;     // Array of attributes
+          int                    *pOrder;         // order of the child_nodes,text_fields,clear_fields
+          int                    ref_count;       // for garbage collection (smart pointers)
+      } XMLNodeData;
+      XMLNodeData *d;
+
+      char parseClearTag(void *px, void *pa);
+      char maybeAddTxT(void *pa, XMLCSTR tokenPStr);
+      int ParseXMLElement(void *pXML);
+      void *addToOrder(int memInc, int *_pos, int nc, void *p, int size, XMLElementType xtype);
+      int indexText(XMLCSTR lpszValue) const;
+      int indexClear(XMLCSTR lpszValue) const;
+      XMLNode addChild_priv(int,XMLSTR,char,int);
+      XMLAttribute *addAttribute_priv(int,XMLSTR,XMLSTR);
+      XMLCSTR addText_priv(int,XMLSTR,int);
+      XMLClear *addClear_priv(int,XMLSTR,XMLCSTR,XMLCSTR,int);
+      void deleteNodeContent_priv(char,char);
+      static inline XMLElementPosition findPosition(XMLNodeData *d, int index, XMLElementType xtype);
+      static int CreateXMLStringR(XMLNodeData *pEntry, XMLSTR lpszMarker, int nFormat);
+      static int removeOrderElement(XMLNodeData *d, XMLElementType t, int index);
+      static void exactMemory(XMLNodeData *d);
+      static int detachFromParent(XMLNodeData *d);
+} XMLNode;
+
+// This structure is given by the function "enumContents".
+typedef struct XMLNodeContents
+{
+    // This dictates what's the content of the XMLNodeContent
+    enum XMLElementType etype;
+    // should be an union to access the appropriate data.
+    // compiler does not allow union of object with constructor... too bad.
+    XMLNode child;
+    XMLAttribute attrib;
+    XMLCSTR text;
+    XMLClear clear;
+
+} XMLNodeContents;
+
+XMLDLLENTRY void freeXMLString(XMLSTR t); // {free(t);}
+
+// Duplicate (copy in a new allocated buffer) the source string. This is
+// a very handy function when used with all the "XMLNode::*_WOSD" functions.
+// (If (cbData!=0) then cbData is the number of chars to duplicate)
+XMLDLLENTRY XMLSTR stringDup(XMLCSTR source, int cbData=0);
+
+// The following class is processing strings so that all the characters
+// &,",',<,> are replaced by their XML equivalent: &amp;, &quot;, &apos;, &lt;, &gt;.
+// This  class is useful when creating from scratch an XML file using the
+// "printf", "fprintf", "cout",... functions. If you are creating from scratch an
+// XML file using the provided XMLNode class you must not use the "ToXMLStringTool"
+// class (the "XMLNode" class does the processing job for you during rendering).
+// Using the "ToXMLStringTool class" and the "fprintf function" is THE most efficient
+// way to produce VERY large XML documents VERY fast.
+typedef struct XMLDLLENTRY ToXMLStringTool
+{
+public:
+    ToXMLStringTool(): buf(NULL),buflen(0){}
+    ~ToXMLStringTool();
+    void freeBuffer();
+
+    XMLSTR toXML(XMLCSTR source);
+
+    // The next function is deprecated because there is a possibility of
+    // "destination-buffer-overflow". It converts the string
+    // "source" to the string "dest".
+    static XMLSTR toXMLUnSafe(XMLSTR dest,XMLCSTR source);
+
+private:
+    XMLSTR buf;
+    int buflen;
+}ToXMLStringTool;
+
+// Below is a class that allows you to include any binary data (images, sounds,...)
+// into an XML document using "Base64 encoding". This class is completely
+// separated from the rest of the xmlParser library and can be removed without any problem.
+// To include some binary data into an XML file, you must convert the binary data into
+// standard text (using "encode"). To retrieve the original binary data from the
+// b64-encoded text included inside the XML file use "decode". Alternatively, these
+// functions can also be used to "encrypt/decrypt" some critical data contained inside
+// the XML (it's not a strong encryption at all, but sometimes it can be useful).
+
+typedef struct XMLDLLENTRY XMLParserBase64Tool
+{
+public:
+    XMLParserBase64Tool(): buf(NULL),buflen(0){}
+    ~XMLParserBase64Tool();
+    void freeBuffer();
+
+    // returns the length of the base64 string that encodes a data buffer of size inBufLen bytes.
+    // If "formatted" parameter is true, some space will be reserved for a carriage-return every 72 chars.
+    static int encodeLength(int inBufLen, char formatted=0);
+
+    // The "base64Encode" function returns a string containing the base64 encoding of "inByteLen" bytes
+    // from "inByteBuf". If "formatted" parameter is true, then there will be a carriage-return every 72 chars.
+    // The string will be free'd when the XMLParserBase64Tool object is deleted.
+    // All returned strings are sharing the same memory space.
+    XMLSTR encode(unsigned char *inByteBuf, unsigned int inByteLen, char formatted=0);
+
+    // returns the number of bytes which will be decoded from "inString".
+    static unsigned int decodeSize(XMLCSTR inString, XMLError *xe=NULL);
+
+    // returns a pointer to a buffer containing the binary data decoded from "inString"
+    // If "inString" is malformed NULL will be returned
+    // The output buffer will be free'd when the XMLParserBase64Tool object is deleted.
+    // All output buffer are sharing the same memory space.
+    unsigned char* decode(XMLCSTR inString, int *outByteLen=NULL, XMLError *xe=NULL);
+
+    // The next function is deprecated.
+    // decodes data from "inString" to "outByteBuf". You need to provide the size (in byte) of "outByteBuf"
+    // in "inMaxByteOutBuflen". If "outByteBuf" is not large enough or if data is malformed, then "FALSE"
+    // will be returned; otherwise "TRUE".
+    static unsigned char decode(XMLCSTR inString, unsigned char *outByteBuf, int inMaxByteOutBuflen, XMLError *xe=NULL);
+
+private:
+    void *buf;
+    int buflen;
+    void alloc(int newsize);
+}XMLParserBase64Tool;
+
+#undef XMLDLLENTRY
+
+#endif
