Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of http://git.rim.net/gaming/alut

  • Loading branch information...
commit 639f215d09987d0a40c7eb5d4ef1b10a152e7b29 2 parents ca27324 + 7b6652d
Eduardo Pelegri-Llopart authored
View
387 .cproject
@@ -0,0 +1,387 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.1280869741">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.1280869741" moduleId="org.eclipse.cdt.core.settings" name="Device-Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.1280869741" name="Device-Debug" parent="com.qnx.qcc.configuration.staticLib.debug">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.debug.1280869741." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.debug.71863158" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.929984826" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1195531021" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/alut/Device-Debug}" id="com.qnx.nto.1735594869" keepEnvironmentInBuildfile="false" name="CDT Internal Builder.Debug" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1283443387" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.490934746" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.481517431" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.defines.1100045282" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.includePath.1747663502" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.2046202124" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.924188273" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.1443033201" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.195579426" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1133980237" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.1394834892" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.15898288" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.1469460824" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.libraryPaths.1123128183" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+ </option>
+ </tool>
+ <tool id="com.qnx.qcc.tool.archiver.2134263578" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.release.1349017165">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.release.1349017165" moduleId="org.eclipse.cdt.core.settings" name="Device-Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.release.1349017165" name="Device-Release" parent="com.qnx.qcc.configuration.staticLib.release">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.release.1349017165." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.release.1832319602" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.835246404" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.773066467" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/alut/Device-Release}" id="com.qnx.nto.287435737" keepEnvironmentInBuildfile="false" name="CDT Internal Builder.Release" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1802851689" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compiler.optlevel.1217838770" superClass="com.qnx.qcc.option.compiler.optlevel" value="com.qnx.qcc.option.compiler.optlevel.2" valueType="enumerated"/>
+ <option id="com.qnx.qcc.option.compiler.security.901345397" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.defines.572341059" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.includePath.1921284490" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.1805001673" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1929683021" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <inputType id="com.qnx.qcc.inputType.assembler.1713775467" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.353684277" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.langcpp.328679912" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.1592960567" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.libraryPaths.490896059" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+ </option>
+ </tool>
+ <tool id="com.qnx.qcc.tool.archiver.1057926200" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.853968972">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.853968972" moduleId="org.eclipse.cdt.core.settings" name="Device-Profile">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.853968972" name="Device-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.profile.853968972." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.profile.642440412" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.1016088625" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.489178899" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/alut/Device-Profile}" id="com.qnx.nto.1042812501" keepEnvironmentInBuildfile="false" name="CDT Internal Builder.Profile" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1580481020" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.12080435" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.profile2.1815163653" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.416663754" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.defines.563883409" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.includePath.1243226471" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.78269207" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1375960948" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.1578562308" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.573438044" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1353297655" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.1468495153" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.profile2.1633514343" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.1456179751" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.1706078807" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.libraryPaths.1470478924" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+ </option>
+ </tool>
+ <tool id="com.qnx.qcc.tool.archiver.1330991589" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.788725495">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.788725495" moduleId="org.eclipse.cdt.core.settings" name="Device-Coverage">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.788725495" name="Device-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.788725495." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1346539703" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <option id="com.qnx.qcc.option.cpu.1869381116" superClass="com.qnx.qcc.option.cpu" value="com.qnx.qcc.option.gen.cpu.armle-v7" valueType="enumerated"/>
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.372649035" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/alut/Device-Coverage}" id="com.qnx.nto.524442869" keepEnvironmentInBuildfile="false" name="CDT Internal Builder.Coverage" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1535157941" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.1028038816" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.coverage.1359809093" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.2876250" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.defines.1037911359" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.includePath.280969258" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.1155659181" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1974968658" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.848431405" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.713245309" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.1144687617" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.2029490594" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.coverage.334126556" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.434893488" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.2111432558" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.libraryPaths.22870789" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/lib"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/armle-v7/usr/lib"/>
+ </option>
+ </tool>
+ <tool id="com.qnx.qcc.tool.archiver.764619178" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.debug.943907155">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.debug.943907155" moduleId="org.eclipse.cdt.core.settings" name="Simulator">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="" id="com.qnx.qcc.configuration.staticLib.debug.943907155" name="Simulator" parent="com.qnx.qcc.configuration.staticLib.debug">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.debug.943907155." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.debug.1755334719" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1823310215" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/alut/Simulator}" id="com.qnx.nto.16268844" keepEnvironmentInBuildfile="false" name="CDT Internal Builder.Debug" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.582668489" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.952854180" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.334033842" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.defines.1511907618" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.includePath.1671903024" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.1893799646" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.118230624" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.1722163836" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.414662287" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.2037856087" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.963321263" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.39606880" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.2038513226" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.libraryPaths.609401461" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
+ </option>
+ </tool>
+ <tool id="com.qnx.qcc.tool.archiver.86917835" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.profile.1438114431">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.profile.1438114431" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Profile">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.profile,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build for Profiling" id="com.qnx.qcc.configuration.staticLib.profile.1438114431" name="Simulator-Profile" parent="com.qnx.qcc.configuration.staticLib.profile">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.profile.1438114431." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.profile.1087013141" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.1027583214" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/alut/Simulator-Profile}" id="com.qnx.nto.1522332975" keepEnvironmentInBuildfile="false" name="CDT Internal Builder.Profile" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1262445158" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.1065033894" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.profile2.1659724796" superClass="com.qnx.qcc.option.compiler.profile2" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.665019983" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.defines.2129533722" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.includePath.993244199" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.32234876" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1907069716" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.2017312688" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.931659374" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.379135734" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.20538864" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.profile2.1660990944" superClass="com.qnx.qcc.option.linker.profile2" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.145324369" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.1452693633" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.libraryPaths.1346889155" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
+ </option>
+ </tool>
+ <tool id="com.qnx.qcc.tool.archiver.253500053" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="com.qnx.qcc.configuration.staticLib.coverage.432256357">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.qnx.qcc.configuration.staticLib.coverage.432256357" moduleId="org.eclipse.cdt.core.settings" name="Simulator-Coverage">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.qnx.tools.ide.qde.core.QDEBynaryParser" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactExtension="a" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.staticLib" buildProperties="org.eclipse.cdt.build.core.buildType=com.qnx.buildType.coverage,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.staticLib" description="Build with Code Coverage" id="com.qnx.qcc.configuration.staticLib.coverage.432256357" name="Simulator-Coverage" parent="com.qnx.qcc.configuration.staticLib.coverage">
+ <folderInfo id="com.qnx.qcc.configuration.staticLib.coverage.432256357." name="/" resourcePath="">
+ <toolChain id="com.qnx.qcc.toolChain.staticLib.coverage.1966266119" name="QNX QCC" superClass="com.qnx.qcc.toolChain">
+ <targetPlatform archList="all" binaryParser="com.qnx.tools.ide.qde.core.QDEBynaryParser" id="com.qnx.qcc.targetPlatform.522226466" osList="all" superClass="com.qnx.qcc.targetPlatform"/>
+ <builder buildPath="${workspace_loc:/alut/Simulator-Coverage}" id="com.qnx.nto.358510575" keepEnvironmentInBuildfile="false" name="CDT Internal Builder.Coverage" superClass="com.qnx.nto"/>
+ <tool id="com.qnx.qcc.tool.compiler.1572431560" name="QCC Compiler" superClass="com.qnx.qcc.tool.compiler">
+ <option id="com.qnx.qcc.option.compile.debug.333255958" superClass="com.qnx.qcc.option.compile.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.coverage.589862553" superClass="com.qnx.qcc.option.compiler.coverage" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.security.2098416316" superClass="com.qnx.qcc.option.compiler.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.compiler.defines.1652291949" superClass="com.qnx.qcc.option.compiler.defines" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="_FORTIFY_SOURCE=2"/>
+ </option>
+ <option id="com.qnx.qcc.option.compiler.includePath.1798922506" superClass="com.qnx.qcc.option.compiler.includePath" valueType="includePath">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/usr/include/freetype2"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/usr/include"/>
+ </option>
+ <inputType id="com.qnx.qcc.inputType.compiler.1267737202" superClass="com.qnx.qcc.inputType.compiler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.assembler.1969348580" name="QCC Assembler" superClass="com.qnx.qcc.tool.assembler">
+ <option id="com.qnx.qcc.option.assembler.debug.712876677" superClass="com.qnx.qcc.option.assembler.debug" value="true" valueType="boolean"/>
+ <inputType id="com.qnx.qcc.inputType.assembler.145210111" superClass="com.qnx.qcc.inputType.assembler"/>
+ </tool>
+ <tool id="com.qnx.qcc.tool.linker.836161641" name="QCC Linker" superClass="com.qnx.qcc.tool.linker">
+ <option id="com.qnx.qcc.option.linker.debug.1495027310" superClass="com.qnx.qcc.option.linker.debug" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.coverage.320493371" superClass="com.qnx.qcc.option.linker.coverage" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.langcpp.2026260933" superClass="com.qnx.qcc.option.linker.langcpp" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.security.268038112" superClass="com.qnx.qcc.option.linker.security" value="true" valueType="boolean"/>
+ <option id="com.qnx.qcc.option.linker.libraryPaths.878601715" superClass="com.qnx.qcc.option.linker.libraryPaths" valueType="libPaths">
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/lib"/>
+ <listOptionValue builtIn="false" value="${QNX_TARGET}/../target-override/x86/usr/lib"/>
+ </option>
+ </tool>
+ <tool id="com.qnx.qcc.tool.archiver.403340115" name="QCC Archiver" superClass="com.qnx.qcc.tool.archiver"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="alut.null.790254411" name="alut"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.853968972">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.profile.1438114431">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.release.1349017165">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.432256357">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.1280869741">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.coverage.788725495">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="com.qnx.qcc.configuration.staticLib.debug.943907155">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.qnx.tools.ide.qde.managedbuilder.core.qccScannerInfo"/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+</cproject>
View
8 .gitignore
@@ -0,0 +1,8 @@
+
+/Device-Debug
+/Device-Profile
+/Device-Release
+/Simulator
+/Simulator-Coverage
+/Simulator-Profile
+/Device-Coverage
View
77 .project
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>alut</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ <dictionary>
+ <key>?name?</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.append_environment</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildArguments</key>
+ <value></value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildCommand</key>
+ <value>make</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.buildLocation</key>
+ <value>${workspace_loc:/alut/Device-Debug}</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.contents</key>
+ <value>org.eclipse.cdt.make.core.activeConfigSettings</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableAutoBuild</key>
+ <value>false</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableCleanBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.enableFullBuild</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.stopOnError</key>
+ <value>true</value>
+ </dictionary>
+ <dictionary>
+ <key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
+ <value>true</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.qnx.tools.bbt.xml.core.bbtXMLValidationBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ <nature>com.qnx.tools.ide.bbt.core.bbtnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ </natures>
+</projectDescription>
View
203 README
@@ -0,0 +1,203 @@
+The freealut library
+=====================
+
+freealut is a free implementation of OpenAL's ALUT standard. See the file
+AUTHORS for the people involved.
+
+
+Building and installing on *nix-alikes using autotools
+======================================================
+
+To build and run ALUT, you need an OpenAL somewhere (and a sound card, of course
+:-). If OpenAL is not installed in a standard place (let's say ${OPENAL_PREFIX})
+you'll have to tell the build system about it:
+
+ CPPFLAGS="-I${OPENAL_PREFIX}/include"
+ LDFLAGS="-L${OPENAL_PREFIX}/lib"
+ export CPPFLAGS LDFLAGS
+
+If you install ALUT from the CVS repository, you'll have to call
+
+ ./autogen.sh
+
+first, this will generate some necessary files for building ALUT.
+
+If these initial preparations are done, you can simply run:
+
+ ./configure
+ make
+ make install
+
+The last step is optional and must be done as 'root', you can build and use the
+test programs in 'test_suite' and the example programs in 'examples' without
+installing ALUT. To build these, just go to the respective subdirectories and
+run 'make'.
+
+Alternatively, there is a spec file in the admin/RPM subdirectory, which can be
+used to build an RPM.
+
+
+Building with VisualStudio
+==========================
+
+The admin subdirectory contains VisualStudio6 and VisualStudioDotNET
+subdirectories, which contain a Visual Studio 6 workspace and a Visual Studio
+.NET solution, respectively. These expect the OpenAL SDK (header and import
+library) at the standard path "C:\Program Files\OpenAL 1.1 with EFX SDK". If
+this is not the case for your setup, you can change this either directly with a
+text editor in the project files (the only way for *real* men ;-) or via the
+project settings within Visual Studio. When everything is OK, just build
+e.g. the hello_world project and you should get the ALUT library itself and a
+demo with Steve Baker saying an immortal phrase.
+
+
+Building with CMake
+===================
+
+The CMake build files are maintained by prakash@punnoor.de, so
+if you have troubles building Alut using CMake, please contact
+me and not the Alut devs, as the official build system is still
+the one using autotools. The CMake build files are currenty
+meant as an additional possibility to build Alut.
+
+The aim of using CMake is making portable development easier, as
+CMake containg generators for various build systems. On eg. Unix
+Makefiles will be built, and on Windows MS VC++ project files, if
+you wish. You can get CMake at cmake.org.
+
+Current status:
+The build system is feature complete, so it (should) build every-
+thing as the default one does.
+
+
+This document explains briefly how to build with CMake on Linux via out-
+of-tree build:
+
+- Change to the alut dir.
+- Create a dir, eg "default", and change into it.
+- Now (eg.) run:
+
+cmake .. -DCMAKE_INSTALL_PREFIX:STRING="/usr" -DCMAKE_C_FLAGS:STRING="-march=athlon-xp -O2"
+make
+make install
+
+ If you exported your CFLAGS, there is no need to specify them
+ explicitly, as CMake will pick them up.
+
+- OpenAL should get installed as you got used to it.
+
+
+I really would like to get CMake building Alut on every
+supported platform. So please contact me if it doesn't build
+on yours. I'll try to fix this with your help.
+
+
+Some Tips:
+
+- You can use a console GUI named ccmake for configuring cmake.
+ This also comes in handy, to find out about available options.
+ You can also set options via command-line:
+
+ccmake .. -DCMAKE_INSTALL_PREFIX:STRING="/usr" -DCMAKE_C_FLAGS:STRING="-march=athlon-xp -O2"
+
+ sets the two variables defined on command line and then starts
+ the GUI. Press 'c' the first time and every time you want to commit
+ changes in the config. Finally press 'g' to run the generator.
+ Btw, to set boolean vars from the command line, use -DVAR:BOOL=X,
+ where X is eg. ON or OFF.
+
+- If you want more output at compile time, use
+
+make VERBOSE=1
+
+- If you want to install to a different directory (using same prefix),
+ use
+
+make install DESTDIR=/foo/bar
+
+- CMake doesn't has a distclean target by default, so you better
+ really do an out-of-tree build, then you can simply delete its
+ content when you want a distclean... Furthermore it is easier to
+ have different builds using different parameters via out-of-tree
+ builds.
+
+- If you are interested in variables to set, take a look into
+ CMakeCache.txt after having run the configuring stage.
+
+- If you update your source tree via cvs and want to rebuild an pre-
+ viously built lib without cleaning, you better at least clear the
+ CMake cache (remove CMakeCache.txt) otherwise a modified CMake project
+ file could result to unwanted behaviour.
+
+
+Building for QNX from Windows
+==================================
+Run cmd.exe and execute the following commands:
+> cd [bbndk] where [bbndk] is where the QNX NDK was installed (i.e. C:\bbndk)
+> NativeSDK-env.bat
+> cd [alut]/qnx where [alut] is the directory where ALUT was extracted to
+> make
+Following this, the relevant binaries should reside in the following subdirectories:
+ libalut:
+ [alut]/qnx/arm/a.le.v7 (ARM release)
+ [alut]/qnx/arm/a.le.v7.g (ARM debug)
+ [alut]/qnx/x86/a (x86 simulator release)
+ [alut]/qnx/x86/a.g (x86 simulator debug)
+
+
+Support
+=======
+
+Please don't email me the authors directly, sign up to the OpenAL user's mailing
+list. Instructions can be found here:
+
+ http://www.openal.org/
+
+
+Licensing
+=========
+
+These libraries are offered as OpenSource freeware under the provisions of the
+GNU Library Public License (LGPL). Those terms and conditions are detailed in
+the file 'COPYING' in this directory.
+
+
+Portability and Dependencies
+============================
+
+This library is designed to be easily portable (and more importantly so that
+programs using it can be UTTERLY portable).
+
+
+Compiling/Linking with ALUT
+===========================
+
+In your source code, simply add:
+
+ #include <AL/alut.h>
+
+On *nix-alikes, use
+
+ openal-config --cflags
+ openal-config --libs
+
+to find out the compiler and linker flags needed for OpenAL, the flags needed
+for ALUT itself depend on the --prefix option given to configure.
+
+In a VisualStudio project, add the path to the ALUT header, import library and
+DLL to your project settings as usual.
+
+
+Directories
+===========
+
+Within this distribution, you will find the following directories:
+
+admin -- Administrative files needed for building ALUT
+doc -- The ALUT documentation
+examples -- For application authors, here is a small collection of example
+ programs that you can use to get you started
+include -- The ALUT header
+src -- The source code for the ALUT library itself
+test_suite -- A small suite of test programs to check that ALUT is installed and
+ working correctly
View
126 include/AL/alut.h
@@ -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
View
8 qnx/Makefile
@@ -0,0 +1,8 @@
+LIST=CPU
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
8 qnx/arm/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1  qnx/arm/a.le.v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
1  qnx/arm/so.le.v7.g/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
1  qnx/arm/so.le.v7/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
25 qnx/common.mk
@@ -0,0 +1,25 @@
+ifndef QCONFIG
+QCONFIG=qconfig.mk
+endif
+include $(QCONFIG)
+
+define PINFO
+PINFO DESCRIPTION=ALUT
+endef
+
+NAME=alut
+
+#===== EXTRA_INCVPATH - a space-separated list of directories to search for include files.
+PUBLIC_INCVPATH=$(PRODUCT_ROOT)/include
+EXTRA_INCVPATH+=$(PRODUCT_ROOT)/src/Include \
+ $(PRODUCT_ROOT)/../openal/include
+
+#===== EXTRA_SRCVPATH - a space-separated list of directories to search for source files.
+EXTRA_SRCVPATH+=$(PRODUCT_ROOT)/src
+
+INSTALLDIR=$(firstword $(INSTALLDIR_$(OS)) usr/lib)
+
+include $(MKFILES_ROOT)/qtargets.mk
+
+OPTIMIZE_TYPE_g=none
+OPTIMIZE_TYPE=$(OPTIMIZE_TYPE_$(filter g, $(VARIANTS)))
View
8 qnx/x86/Makefile
@@ -0,0 +1,8 @@
+LIST=VARIANT
+ifndef QRECURSE
+QRECURSE=recurse.mk
+ifdef QCONFIG
+QRDIR=$(dir $(QCONFIG))
+endif
+endif
+include $(QRDIR)$(QRECURSE)
View
1  qnx/x86/a/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
1  qnx/x86/so.g/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
1  qnx/x86/so/Makefile
@@ -0,0 +1 @@
+include ../../common.mk
View
13 src/README
@@ -0,0 +1,13 @@
+The files in this directory contain the code of the ALUT library. They typically
+compile to make 'libalut.so' on *nix platforms or to 'alut.dll' for Windows
+platforms.
+
+There is also a header file 'alut.h' in ../include/AL which gets installed into
+$(includedir)/AL/alut.h on *nix platforms and someplace else entirely on
+Windows platforms.
+
+The file 'helloworld.wav' is the original voice recording of Steve Baker saying
+this immortal phrase. It is converted into a large hexadecimal data block inside
+alutWaveform.c - but this file is retained in version control just in case
+anyone ever feels like re-doing it. The format is 16bit PCM, 1 channel, 44.1kHz
+sample rate.
View
147 src/alutBufferData.c
@@ -0,0 +1,147 @@
+#include "alutInternal.h"
+
+struct BufferData_struct
+{
+ ALvoid *data;
+ size_t length;
+ ALint numChannels;
+ ALint bitsPerSample;
+ ALfloat sampleFrequency;
+};
+
+BufferData *
+_alutBufferDataConstruct (ALvoid *data, size_t length, ALint numChannels,
+ ALint bitsPerSample, ALfloat sampleFrequency)
+{
+ BufferData *bufferData = (BufferData *) _alutMalloc (sizeof (BufferData));
+ if (bufferData == NULL)
+ {
+ return NULL;
+ }
+
+ bufferData->data = data;
+ bufferData->length = length;
+ bufferData->numChannels = numChannels;
+ bufferData->bitsPerSample = bitsPerSample;
+ bufferData->sampleFrequency = sampleFrequency;
+
+ return bufferData;
+}
+
+ALboolean
+_alutBufferDataDestroy (BufferData *bufferData)
+{
+ if (bufferData->data != NULL)
+ {
+ free (bufferData->data);
+ }
+ free (bufferData);
+ return AL_TRUE;
+}
+
+ALvoid *
+_alutBufferDataGetData (const BufferData *bufferData)
+{
+ return bufferData->data;
+}
+
+void
+_alutBufferDataDetachData (BufferData *bufferData)
+{
+ bufferData->data = NULL;
+}
+
+size_t
+_alutBufferDataGetLength (const BufferData *bufferData)
+{
+ return bufferData->length;
+}
+
+static ALint
+getNumChannels (const BufferData *bufferData)
+{
+ return bufferData->numChannels;
+}
+
+static ALint
+getBitsPerSample (const BufferData *bufferData)
+{
+ return bufferData->bitsPerSample;
+}
+
+ALfloat
+_alutBufferDataGetSampleFrequency (const BufferData *bufferData)
+{
+ return bufferData->sampleFrequency;
+}
+
+/****************************************************************************
+ * The utility functions below do not know the internal BufferData
+ * representation.
+ ****************************************************************************/
+
+ALboolean
+_alutGetFormat (const BufferData *bufferData, ALenum *format)
+{
+ if (!_alutFormatConstruct
+ (getNumChannels (bufferData), getBitsPerSample (bufferData), format))
+ {
+ _alutSetError (ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE);
+ return AL_FALSE;
+ }
+ return AL_TRUE;
+}
+
+static ALuint
+generateBuffer (void)
+{
+ ALuint buffer;
+ alGenBuffers (1, &buffer);
+ if (alGetError () != AL_NO_ERROR)
+ {
+ _alutSetError (ALUT_ERROR_GEN_BUFFERS);
+ return AL_NONE;
+ }
+ return buffer;
+}
+
+static ALboolean
+passBufferData (BufferData *bufferData, ALuint bid)
+{
+ ALenum format;
+ size_t size;
+ ALfloat frequency;
+ if (!_alutGetFormat (bufferData, &format))
+ {
+ return AL_FALSE;
+ }
+ /* GCC is a bit picky about casting function calls, so we do it in two
+ steps... */
+ size = _alutBufferDataGetLength (bufferData);
+ frequency = _alutBufferDataGetSampleFrequency (bufferData);
+ alBufferData (bid, format, _alutBufferDataGetData (bufferData),
+ (ALsizei) size, (ALsizei) frequency);
+ if (alGetError () != AL_NO_ERROR)
+ {
+ _alutSetError (ALUT_ERROR_BUFFER_DATA);
+ return AL_FALSE;
+ }
+ return AL_TRUE;
+}
+
+ALuint
+_alutPassBufferData (BufferData *bufferData)
+{
+ ALuint buffer = generateBuffer ();
+ if (buffer == AL_NONE)
+ {
+ return AL_NONE;
+ }
+
+ if (!passBufferData (bufferData, buffer))
+ {
+ return AL_NONE;
+ }
+
+ return buffer;
+}
View
129 src/alutCodec.c
@@ -0,0 +1,129 @@
+#include "alutInternal.h"
+
+ALvoid *
+_alutCodecLinear (ALvoid *data, size_t length, ALint numChannels,
+ ALint bitsPerSample, ALfloat sampleFrequency)
+{
+ return _alutBufferDataConstruct (data, length, numChannels, bitsPerSample,
+ sampleFrequency);
+}
+
+ALvoid *
+_alutCodecPCM8s (ALvoid *data, size_t length, ALint numChannels,
+ ALint bitsPerSample, ALfloat sampleFrequency)
+{
+ int8_t *d = (int8_t *) data;
+ size_t i;
+ for (i = 0; i < length; i++)
+ {
+ d[i] += (int8_t) 128;
+ }
+ return _alutBufferDataConstruct (data, length, numChannels, bitsPerSample,
+ sampleFrequency);
+}
+
+ALvoid *
+_alutCodecPCM16 (ALvoid *data, size_t length, ALint numChannels,
+ ALint bitsPerSample, ALfloat sampleFrequency)
+{
+ int16_t *d = (int16_t *) data;
+ size_t i, l = length / 2;
+ for (i = 0; i < l; i++)
+ {
+ int16_t x = d[i];
+ d[i] = ((x << 8) & 0xFF00) | ((x >> 8) & 0x00FF);
+ }
+ return _alutBufferDataConstruct (data, length, numChannels, bitsPerSample,
+ sampleFrequency);
+}
+
+/*
+ * From: http://www.multimedia.cx/simpleaudio.html#tth_sEc6.1
+ */
+static int16_t
+mulaw2linear (uint8_t mulawbyte)
+{
+ static const int16_t exp_lut[8] = {
+ 0, 132, 396, 924, 1980, 4092, 8316, 16764
+ };
+ int16_t sign, exponent, mantissa, sample;
+ mulawbyte = ~mulawbyte;
+ sign = (mulawbyte & 0x80);
+ exponent = (mulawbyte >> 4) & 0x07;
+ mantissa = mulawbyte & 0x0F;
+ sample = exp_lut[exponent] + (mantissa << (exponent + 3));
+ if (sign != 0)
+ {
+ sample = -sample;
+ }
+ return sample;
+}
+
+ALvoid *
+_alutCodecULaw (ALvoid *data, size_t length, ALint numChannels,
+ ALint bitsPerSample, ALfloat sampleFrequency)
+{
+ uint8_t *d = (uint8_t *) data;
+ int16_t *buf = (int16_t *) _alutMalloc (length * 2);
+ size_t i;
+ if (buf == NULL)
+ {
+ return NULL;
+ }
+ for (i = 0; i < length; i++)
+ {
+ buf[i] = mulaw2linear (d[i]);
+ }
+ free (data);
+ return _alutBufferDataConstruct (buf, length * 2, numChannels,
+ bitsPerSample, sampleFrequency);
+}
+
+/*
+ * From: http://www.multimedia.cx/simpleaudio.html#tth_sEc6.1
+ */
+#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */
+#define QUANT_MASK (0xf) /* Quantization field mask. */
+#define SEG_SHIFT (4) /* Left shift for segment number. */
+#define SEG_MASK (0x70) /* Segment field mask. */
+static int16_t
+alaw2linear (uint8_t a_val)
+{
+ int16_t t, seg;
+ a_val ^= 0x55;
+ t = (a_val & QUANT_MASK) << 4;
+ seg = ((int16_t) a_val & SEG_MASK) >> SEG_SHIFT;
+ switch (seg)
+ {
+ case 0:
+ t += 8;
+ break;
+ case 1:
+ t += 0x108;
+ break;
+ default:
+ t += 0x108;
+ t <<= seg - 1;
+ }
+ return (a_val & SIGN_BIT) ? t : -t;
+}
+
+ALvoid *
+_alutCodecALaw (ALvoid *data, size_t length, ALint numChannels,
+ ALint bitsPerSample, ALfloat sampleFrequency)
+{
+ uint8_t *d = (uint8_t *) data;
+ int16_t *buf = (int16_t *) _alutMalloc (length * 2);
+ size_t i;
+ if (buf == NULL)
+ {
+ return NULL;
+ }
+ for (i = 0; i < length; i++)
+ {
+ buf[i] = alaw2linear (d[i]);
+ }
+ free (data);
+ return _alutBufferDataConstruct (buf, length * 2, numChannels,
+ bitsPerSample, sampleFrequency);
+}
View
94 src/alutError.c
@@ -0,0 +1,94 @@
+#include "alutInternal.h"
+#include <stdio.h>
+
+static ALenum lastError = ALUT_ERROR_NO_ERROR;
+
+void
+_alutSetError (ALenum err)
+{
+ /* print a message to stderr if ALUT_DEBUG environment variable is defined */
+ if (getenv ("ALUT_DEBUG"))
+ {
+ fprintf (stderr, "ALUT error: %s\n", alutGetErrorString (err));
+ }
+
+ if (lastError == ALUT_ERROR_NO_ERROR)
+ {
+ lastError = err;
+ }
+}
+
+ALenum
+alutGetError (void)
+{
+ ALint ret = lastError;
+ lastError = ALUT_ERROR_NO_ERROR;
+ return ret;
+}
+
+const char *
+alutGetErrorString (ALenum error)
+{
+ switch (error)
+ {
+ case ALUT_ERROR_NO_ERROR:
+ return "No ALUT error found";
+
+ case ALUT_ERROR_OUT_OF_MEMORY:
+ return "ALUT ran out of memory";
+
+ case ALUT_ERROR_INVALID_ENUM:
+ return "ALUT was given an invalid enumeration token";
+
+ case ALUT_ERROR_INVALID_VALUE:
+ return "ALUT was given an invalid value";
+
+ case ALUT_ERROR_INVALID_OPERATION:
+ return "The operation was invalid in the current ALUT state";
+
+ case ALUT_ERROR_NO_CURRENT_CONTEXT:
+ return "There is no current AL context";
+
+ case ALUT_ERROR_AL_ERROR_ON_ENTRY:
+ return "There was already an AL error on entry to an ALUT function";
+
+ case ALUT_ERROR_ALC_ERROR_ON_ENTRY:
+ return "There was already an ALC error on entry to an ALUT function";
+
+ case ALUT_ERROR_OPEN_DEVICE:
+ return "There was an error opening the ALC device";
+
+ case ALUT_ERROR_CLOSE_DEVICE:
+ return "There was an error closing the ALC device";
+
+ case ALUT_ERROR_CREATE_CONTEXT:
+ return "There was an error creating an ALC context";
+
+ case ALUT_ERROR_MAKE_CONTEXT_CURRENT:
+ return "Could not change the current ALC context";
+
+ case ALUT_ERROR_DESTROY_CONTEXT:
+ return "There was an error destroying the ALC context";
+
+ case ALUT_ERROR_GEN_BUFFERS:
+ return "There was an error generating an AL buffer";
+
+ case ALUT_ERROR_BUFFER_DATA:
+ return "There was an error passing buffer data to AL";
+
+ case ALUT_ERROR_IO_ERROR:
+ return "I/O error";
+
+ case ALUT_ERROR_UNSUPPORTED_FILE_TYPE:
+ return "Unsupported file type";
+
+ case ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE:
+ return "Unsupported mode within an otherwise usable file type";
+
+ case ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA:
+ return "The sound data was corrupt or truncated";
+
+ default:
+ return "An impossible ALUT error condition was reported?!?";
+ }
+}
View
158 src/alutInit.c
@@ -0,0 +1,158 @@
+#include "alutInternal.h"
+
+static enum
+{
+ Unintialized, /* ALUT has not been initialized yet or has been de-initialised */
+ ALUTDeviceAndContext, /* alutInit has been called successfully */
+ ExternalDeviceAndContext /* alutInitWithoutContext has been called */
+} initialisationState = Unintialized;
+
+/*
+ * Note: alutContext contains something valid only when initialisationState
+ * contains ALUTDeviceAndContext.
+ */
+static ALCcontext *alutContext;
+
+ALboolean
+_alutSanityCheck (void)
+{
+ ALCcontext *context;
+
+ if (initialisationState == Unintialized)
+ {
+ _alutSetError (ALUT_ERROR_INVALID_OPERATION);
+ return AL_FALSE;
+ }
+
+ context = alcGetCurrentContext ();
+ if (context == NULL)
+ {
+ _alutSetError (ALUT_ERROR_NO_CURRENT_CONTEXT);
+ return AL_FALSE;
+ }
+
+ if (alGetError () != AL_NO_ERROR)
+ {
+ _alutSetError (ALUT_ERROR_AL_ERROR_ON_ENTRY);
+ return AL_FALSE;
+ }
+
+ if (alcGetError (alcGetContextsDevice (context)) != ALC_NO_ERROR)
+ {
+ _alutSetError (ALUT_ERROR_ALC_ERROR_ON_ENTRY);
+ return AL_FALSE;
+ }
+
+ return AL_TRUE;
+}
+
+ALboolean
+alutInit (int *argcp, char **argv)
+{
+ ALCdevice *device;
+ ALCcontext *context;
+
+ if (initialisationState != Unintialized)
+ {
+ _alutSetError (ALUT_ERROR_INVALID_OPERATION);
+ return AL_FALSE;
+ }
+
+ if ((argcp == NULL) != (argv == NULL))
+ {
+ _alutSetError (ALUT_ERROR_INVALID_VALUE);
+ return AL_FALSE;
+ }
+
+ device = alcOpenDevice (NULL);
+ if (device == NULL)
+ {
+ _alutSetError (ALUT_ERROR_OPEN_DEVICE);
+ return AL_FALSE;
+ }
+
+ context = alcCreateContext (device, NULL);
+ if (context == NULL)
+ {
+ alcCloseDevice (device);
+ _alutSetError (ALUT_ERROR_CREATE_CONTEXT);
+ return AL_FALSE;
+ }
+
+ if (!alcMakeContextCurrent (context))
+ {
+ alcDestroyContext (context);
+ alcCloseDevice (device);
+ _alutSetError (ALUT_ERROR_MAKE_CONTEXT_CURRENT);
+ return AL_FALSE;
+ }
+
+ initialisationState = ALUTDeviceAndContext;
+ alutContext = context;
+ return AL_TRUE;
+}
+
+ALboolean
+alutInitWithoutContext (int *argcp, char **argv)
+{
+ if (initialisationState != Unintialized)
+ {
+ _alutSetError (ALUT_ERROR_INVALID_OPERATION);
+ return AL_FALSE;
+ }
+
+ if ((argcp == NULL) != (argv == NULL))
+ {
+ _alutSetError (ALUT_ERROR_INVALID_VALUE);
+ return AL_FALSE;
+ }
+
+ initialisationState = ExternalDeviceAndContext;
+ return AL_TRUE;
+}
+
+ALboolean
+alutExit (void)
+{
+ ALCdevice *device;
+
+ if (initialisationState == Unintialized)
+ {
+ _alutSetError (ALUT_ERROR_INVALID_OPERATION);
+ return AL_FALSE;
+ }
+
+ if (initialisationState == ExternalDeviceAndContext)
+ {
+ initialisationState = Unintialized;
+ return AL_TRUE;
+ }
+
+ if (!_alutSanityCheck ())
+ {
+ return AL_FALSE;
+ }
+
+ if (!alcMakeContextCurrent (NULL))
+ {
+ _alutSetError (ALUT_ERROR_MAKE_CONTEXT_CURRENT);
+ return AL_FALSE;
+ }
+
+ device = alcGetContextsDevice (alutContext);
+ alcDestroyContext (alutContext);
+ if (alcGetError (device) != ALC_NO_ERROR)
+ {
+ _alutSetError (ALUT_ERROR_DESTROY_CONTEXT);
+ return AL_FALSE;
+ }
+
+ if (!alcCloseDevice (device))
+ {
+ _alutSetError (ALUT_ERROR_CLOSE_DEVICE);
+ return AL_FALSE;
+ }
+
+ initialisationState = Unintialized;
+ return AL_TRUE;
+}
View
249 src/alutInputStream.c
@@ -0,0 +1,249 @@
+#include "alutInternal.h"
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if HAVE_STAT
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#define structStat struct stat
+#elif HAVE__STAT
+#define stat(p,b) _stat((p),(b))
+#define structStat struct _stat
+#else
+#error No stat-like function on this platform
+#endif
+
+struct InputStream_struct
+{
+ ALboolean isFileStream;
+ char *fileName;
+ size_t remainingLength;
+ union
+ {
+ FILE *fileDescriptor; /* for file streams */
+ const ALvoid *data; /* for memory streams */
+ } u;
+};
+
+/****************************************************************************
+ * The functions below know the internal InputStream representation.
+ ****************************************************************************/
+
+InputStream *
+_alutInputStreamConstructFromFile (const char *fileName)
+{
+ InputStream *stream;
+ structStat statBuf;
+ FILE *fileDescriptor;
+ char *fileNameBuffer;
+
+ stream = (InputStream *) _alutMalloc (sizeof (InputStream));
+ if (stream == NULL)
+ {
+ return NULL;
+ }
+
+ if (stat (fileName, &statBuf))
+ {
+ _alutSetError (ALUT_ERROR_IO_ERROR);
+ free (stream);
+ return NULL;
+ }
+
+ fileDescriptor = fopen (fileName, "rb");
+ if (fileDescriptor == NULL)
+ {
+ _alutSetError (ALUT_ERROR_IO_ERROR);
+ free (stream);
+ return NULL;
+ }
+
+ fileNameBuffer = (char *) _alutMalloc (strlen (fileName) + 1);
+ if (fileNameBuffer == NULL)
+ {
+ free (stream);
+ return NULL;
+ }
+
+ stream->isFileStream = AL_TRUE;
+ stream->fileName = strcpy (fileNameBuffer, fileName);
+ stream->remainingLength = statBuf.st_size;
+ stream->u.fileDescriptor = fileDescriptor;
+ return stream;
+}
+
+InputStream *
+_alutInputStreamConstructFromMemory (const ALvoid *data, size_t length)
+{
+ InputStream *stream = (InputStream *) _alutMalloc (sizeof (InputStream));
+ if (stream == NULL)
+ {
+ return NULL;
+ }
+
+ stream->isFileStream = AL_FALSE;
+ stream->fileName = NULL;
+ stream->remainingLength = length;
+ stream->u.data = data;
+ return stream;
+}
+
+ALboolean
+_alutInputStreamDestroy (InputStream *stream)
+{
+ ALboolean status =
+ (stream->isFileStream && fclose (stream->u.fileDescriptor)) ?
+ AL_FALSE : AL_TRUE;
+ if (stream->fileName)
+ {
+ free (stream->fileName);
+ }
+ free (stream);
+ return status;
+}
+
+const char *
+_alutInputStreamGetFileName (const InputStream *stream)
+{
+ return stream->fileName;
+}
+
+size_t
+_alutInputStreamGetRemainingLength (const InputStream *stream)
+{
+ return stream->remainingLength;
+}
+
+ALboolean
+_alutInputStreamEOF (InputStream *stream)
+{
+ if (stream->isFileStream)
+ {
+ int c = fgetc (stream->u.fileDescriptor);
+ if (c != EOF)
+ {
+ ungetc (c, stream->u.fileDescriptor);
+ }
+ return (c == EOF) ? AL_TRUE : AL_FALSE;
+ }
+ else
+ {
+ return (stream->remainingLength == 0) ? AL_TRUE : AL_FALSE;
+ }
+}
+
+static ALboolean
+streamRead (InputStream *stream, void *ptr, size_t numBytesToRead)
+{
+ if (stream->isFileStream)
+ {
+ size_t numBytesRead =
+ fread (ptr, 1, numBytesToRead, stream->u.fileDescriptor);
+ if (numBytesToRead != numBytesRead)
+ {
+ _alutSetError (ferror (stream->u.fileDescriptor) ?
+ ALUT_ERROR_IO_ERROR :
+ ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA);
+ return AL_FALSE;
+ }
+ return AL_TRUE;
+ }
+ else
+ {
+ if (stream->remainingLength < numBytesToRead)
+ {
+ _alutSetError (ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA);
+ return AL_FALSE;
+ }
+ memcpy (ptr, stream->u.data, numBytesToRead);
+ stream->u.data = ((const char *) (stream->u.data) + numBytesToRead);
+ return AL_TRUE;
+ }
+}
+
+/****************************************************************************
+ * The utility functions below do not know the internal InputStream
+ * representation.
+ ****************************************************************************/
+
+ALvoid *
+_alutInputStreamRead (InputStream *stream, size_t length)
+{
+ ALvoid *data = _alutMalloc (length);
+ if (data == NULL)
+ {
+ return NULL;
+ }
+
+ if (!streamRead (stream, data, length))
+ {
+ free (data);
+ return NULL;
+ }
+
+ return data;
+}
+
+ALboolean
+_alutInputStreamSkip (InputStream *stream, size_t numBytesToSkip)
+{
+ ALboolean status;
+ char *buf;
+ if (numBytesToSkip == 0)
+ {
+ return AL_TRUE;
+ }
+ buf = (char *) _alutMalloc (numBytesToSkip);
+ if (buf == NULL)
+ {
+ return AL_FALSE;
+ }
+ status = streamRead (stream, buf, numBytesToSkip);
+ free (buf);
+ return status;
+}
+
+ALboolean
+_alutInputStreamReadUInt16LE (InputStream *stream, UInt16LittleEndian *value)
+{
+ unsigned char buf[2];
+ if (!streamRead (stream, buf, sizeof (buf)))
+ {
+ return AL_FALSE;
+ }
+ *value = ((UInt16LittleEndian) buf[1] << 8) | ((UInt16LittleEndian) buf[0]);
+ return AL_TRUE;
+}
+
+ALboolean
+_alutInputStreamReadInt32BE (InputStream *stream, Int32BigEndian *value)
+{
+ unsigned char buf[4];
+ if (!streamRead (stream, buf, sizeof (buf)))
+ {
+ return AL_FALSE;
+ }
+ *value =
+ ((Int32BigEndian) buf[0] << 24) |
+ ((Int32BigEndian) buf[1] << 16) |
+ ((Int32BigEndian) buf[2] << 8) | ((Int32BigEndian) buf[3]);
+ return AL_TRUE;
+}
+
+ALboolean
+_alutInputStreamReadUInt32LE (InputStream *stream, UInt32LittleEndian *value)
+{
+ unsigned char buf[4];
+ if (!streamRead (stream, buf, sizeof (buf)))
+ {
+ return AL_FALSE;
+ }
+ *value =
+ ((UInt32LittleEndian) buf[3] << 24) |
+ ((UInt32LittleEndian) buf[2] << 16) |
+ ((UInt32LittleEndian) buf[1] << 8) | ((UInt32LittleEndian) buf[0]);
+ return AL_TRUE;
+}
View
140 src/alutInternal.h
@@ -0,0 +1,140 @@
+/*
+ * This file should be #included as the first header in all *.c files.
+ */
+
+#if !defined(ALUT_INTERNAL_H)
+#define ALUT_INTERNAL_H
+
+#define HAVE_CONFIG_H 1
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#elif _MSC_VER < 1300
+typedef char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned int uint32_t;
+#elif HAVE_BASETSD_H
+#include <basetsd.h>
+typedef INT8 int8_t;
+typedef UINT8 uint8_t;
+typedef INT16 int16_t;
+typedef UINT16 uint16_t;
+typedef INT32 int32_t;
+typedef UINT32 uint32_t;
+#else
+#error Do not know sized types on this platform
+#endif
+
+typedef int16_t Int16BigEndian;
+typedef uint16_t UInt16LittleEndian;
+typedef int32_t Int32BigEndian;
+typedef uint32_t UInt32LittleEndian;
+
+#if HAVE___ATTRIBUTE__
+#define UNUSED(x) x __attribute__((unused))
+#else
+#define UNUSED(x) x
+#endif
+
+#include <AL/alut.h>
+
+#define AU_HEADER_SIZE 24
+
+/* see: http://en.wikipedia.org/wiki/Au_file_format, G.72x are missing */
+enum AUEncoding
+{
+ AU_ULAW_8 = 1, /* 8-bit ISDN u-law */
+ AU_PCM_8 = 2, /* 8-bit linear PCM (signed) */
+ AU_PCM_16 = 3, /* 16-bit linear PCM (signed, big-endian) */
+ AU_PCM_24 = 4, /* 24-bit linear PCM */
+ AU_PCM_32 = 5, /* 32-bit linear PCM */
+ AU_FLOAT_32 = 6, /* 32-bit IEEE floating point */
+ AU_FLOAT_64 = 7, /* 64-bit IEEE floating point */
+ AU_ALAW_8 = 27 /* 8-bit ISDN a-law */
+};
+
+/* in alutCodec.c */
+typedef ALvoid *Codec (ALvoid *data, size_t length, ALint numChannels,
+ ALint bitsPerSample, ALfloat sampleFrequency);
+extern Codec _alutCodecLinear;
+extern Codec _alutCodecPCM8s;
+extern Codec _alutCodecPCM16;
+extern Codec _alutCodecULaw;
+extern Codec _alutCodecALaw;
+
+/* in alutError.c */
+extern void _alutSetError (ALenum err);
+
+/* in alutInit.c */
+extern ALboolean _alutSanityCheck (void);
+
+/* in alutInputStream.c */
+typedef struct InputStream_struct InputStream;
+extern InputStream *_alutInputStreamConstructFromFile (const char *fileName);
+extern InputStream *_alutInputStreamConstructFromMemory (const ALvoid *data,
+ size_t length);
+extern const char *_alutInputStreamGetFileName (const InputStream *stream);
+extern size_t _alutInputStreamGetRemainingLength (const InputStream *stream);
+extern ALboolean _alutInputStreamDestroy (InputStream *stream);
+extern ALboolean _alutInputStreamEOF (InputStream *stream);
+extern ALvoid *_alutInputStreamRead (InputStream *stream, size_t length);
+extern ALboolean _alutInputStreamSkip (InputStream *stream,
+ size_t numBytesToSkip);
+extern ALboolean _alutInputStreamReadUInt16LE (InputStream *stream,
+ UInt16LittleEndian *value);
+extern ALboolean _alutInputStreamReadInt32BE (InputStream *stream,
+ Int32BigEndian *value);
+extern ALboolean _alutInputStreamReadUInt32LE (InputStream *stream,
+ UInt32LittleEndian *value);
+
+/* in alutLoader.c */
+extern ALuint _alutCreateBufferFromInputStream (InputStream *stream);
+extern void *_alutLoadMemoryFromInputStream (InputStream *stream,
+ ALenum *format, ALsizei *size,
+ ALfloat *frequency);
+
+/* in alutOutputStream.c */
+typedef struct OutputStream_struct OutputStream;
+extern OutputStream *_alutOutputStreamConstruct (size_t maximumLength);
+extern ALboolean _alutOutputStreamDestroy (OutputStream *stream);
+extern void *_alutOutputStreamGetData (OutputStream *stream);
+extern size_t _alutOutputStreamGetLength (OutputStream *stream);
+extern ALboolean _alutOutputStreamWriteInt16BE (OutputStream *stream,
+ Int16BigEndian value);
+extern ALboolean _alutOutputStreamWriteInt32BE (OutputStream *stream,
+ Int32BigEndian value);
+
+/* in alutUtil.c */
+extern ALvoid *_alutMalloc (size_t size);
+extern ALboolean _alutFormatConstruct (ALint numChannels, ALint bitsPerSample,
+ ALenum *format);
+extern ALboolean _alutFormatGetNumChannels (ALenum format,
+ ALint *numChannels);
+extern ALboolean _alutFormatGetBitsPerSample (ALenum format,
+ ALint *bitsPerSample);
+
+/* in alutWaveform.c */
+typedef struct BufferData_struct BufferData;
+extern BufferData *_alutBufferDataConstruct (ALvoid *data, size_t length,
+ ALint numChannels,
+ ALint bitsPerSample,
+ ALfloat sampleFrequency);
+extern ALboolean _alutBufferDataDestroy (BufferData *bufferData);
+extern void _alutBufferDataDetachData (BufferData *bufferData);
+extern ALvoid *_alutBufferDataGetData (const BufferData *bufferData);
+extern size_t _alutBufferDataGetLength (const BufferData *bufferData);
+extern ALfloat _alutBufferDataGetSampleFrequency (const BufferData
+ *bufferData);
+extern ALboolean _alutGetFormat (const BufferData *bufferData,
+ ALenum *format);
+extern ALuint _alutPassBufferData (BufferData *bufferData);
+
+#endif /* not ALUT_INTERNAL_H */
View
526 src/alutLoader.c
@@ -0,0 +1,526 @@
+#include "alutInternal.h"
+#include <ctype.h>
+
+/****************************************************************************/
+
+typedef enum
+{
+ LittleEndian,
+ BigEndian,
+ UnknwonEndian /* has anybody still a PDP11? :-) */
+} Endianess;
+
+/* test from Harbison & Steele, "C - A Reference Manual", section 6.1.2 */
+static Endianess
+endianess (void)
+{
+ union
+ {
+ long l;
+ char c[sizeof (long)];
+ } u;
+
+ u.l = 1;
+ return (u.c[0] == 1) ? LittleEndian :
+ ((u.c[sizeof (long) - 1] == 1) ? BigEndian : UnknwonEndian);
+}
+
+/****************************************************************************/
+
+static int
+safeToLower (int c)
+{
+ return isupper (c) ? tolower (c) : c;
+}
+
+static int
+hasSuffixIgnoringCase (const char *string, const char *suffix)
+{
+ const char *stringPointer = string;
+ const char *suffixPointer = suffix;
+
+ if (suffix[0] == '\0')
+ {
+ return 1;
+ }
+
+ while (*stringPointer != '\0')
+ {
+ stringPointer++;
+ }
+
+ while (*suffixPointer != '\0')
+ {
+ suffixPointer++;
+ }
+
+ if (stringPointer - string < suffixPointer - suffix)
+ {
+ return 0;
+ }
+
+ while (safeToLower (*--suffixPointer) == safeToLower (*--stringPointer))
+ {
+ if (suffixPointer == suffix)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static BufferData *
+loadWavFile (InputStream *stream)
+{
+ ALboolean found_header = AL_FALSE;
+ UInt32LittleEndian chunkLength;
+ Int32BigEndian magic;
+ UInt16LittleEndian audioFormat;
+ UInt16LittleEndian numChannels;
+ UInt32LittleEndian sampleFrequency;
+ UInt32LittleEndian byteRate;
+ UInt16LittleEndian blockAlign;
+ UInt16LittleEndian bitsPerSample;
+ Codec *codec = _alutCodecLinear;
+
+ if (!_alutInputStreamReadUInt32LE (stream, &chunkLength) ||
+ !_alutInputStreamReadInt32BE (stream, &magic))
+ {
+ return NULL;
+ }
+
+ if (magic != 0x57415645) /* "WAVE" */
+ {
+ _alutSetError (ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE);
+ return NULL;
+ }
+
+ while (1)
+ {
+ if (!_alutInputStreamReadInt32BE (stream, &magic) ||
+ !_alutInputStreamReadUInt32LE (stream, &chunkLength))
+ {
+ return NULL;
+ }
+
+ if (magic == 0x666d7420) /* "fmt " */
+ {
+ found_header = AL_TRUE;
+
+ if (chunkLength < 16)
+ {
+ _alutSetError (ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA);
+ return NULL;
+ }
+
+ if (!_alutInputStreamReadUInt16LE (stream, &audioFormat) ||
+ !_alutInputStreamReadUInt16LE (stream, &numChannels) ||
+ !_alutInputStreamReadUInt32LE (stream, &sampleFrequency) ||
+ !_alutInputStreamReadUInt32LE (stream, &byteRate) ||
+ !_alutInputStreamReadUInt16LE (stream, &blockAlign) ||
+ !_alutInputStreamReadUInt16LE (stream, &bitsPerSample))
+ {
+ return NULL;
+ }
+
+ if (!_alutInputStreamSkip (stream, chunkLength - 16))
+ {
+ return NULL;
+ }
+
+ switch (audioFormat)
+ {
+ case 1: /* PCM */
+ codec = (bitsPerSample == 8
+ || endianess () ==
+ LittleEndian) ? _alutCodecLinear : _alutCodecPCM16;
+ break;
+ case 7: /* uLaw */
+ bitsPerSample *= 2; /* ToDo: ??? */
+ codec = _alutCodecULaw;
+ break;
+ default:
+ _alutSetError (ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE);
+ return NULL;
+ }
+ }
+ else if (magic == 0x64617461) /* "data" */
+ {
+ ALvoid *data;
+ if (!found_header)
+ {
+ /* ToDo: A bit wrong to check here, fmt chunk could come later... */
+ _alutSetError (ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA);
+ return NULL;
+ }
+ data = _alutInputStreamRead (stream, chunkLength);
+ if (data == NULL)
+ {
+ return NULL;
+ }
+ return codec (data, chunkLength, numChannels, bitsPerSample,
+ (ALfloat) sampleFrequency);
+ }
+ else
+ {
+ if (!_alutInputStreamSkip (stream, chunkLength))
+ {
+ return NULL;
+ }
+ }
+
+ if ((chunkLength & 1) && !_alutInputStreamEOF (stream)
+ && !_alutInputStreamSkip (stream, 1))
+ {
+ return NULL;
+ }
+ }
+}
+
+static BufferData *
+loadAUFile (InputStream *stream)
+{
+ Int32BigEndian dataOffset; /* byte offset to data part, minimum 24 */
+ Int32BigEndian len; /* number of bytes in the data part, -1 = not known */
+ Int32BigEndian encoding; /* encoding of the data part, see AUEncoding */
+ Int32BigEndian sampleFrequency; /* number of samples per second */
+ Int32BigEndian numChannels; /* number of interleaved channels */
+ size_t length;
+ Codec *codec;
+ char *data;
+ ALint bitsPerSample;
+
+ if (!_alutInputStreamReadInt32BE (stream, &dataOffset) ||
+ !_alutInputStreamReadInt32BE (stream, &len) ||
+ !_alutInputStreamReadInt32BE (stream, &encoding) ||
+ !_alutInputStreamReadInt32BE (stream, &sampleFrequency) ||
+ !_alutInputStreamReadInt32BE (stream, &numChannels))
+ {
+ return AL_FALSE;
+ }
+
+ length = (len == -1) ?
+ (_alutInputStreamGetRemainingLength (stream) - AU_HEADER_SIZE -
+ dataOffset) : (size_t) len;
+
+ if (!
+ (dataOffset >= AU_HEADER_SIZE && length > 0 && sampleFrequency >= 1
+ && numChannels >= 1))
+ {
+ _alutSetError (ALUT_ERROR_CORRUPT_OR_TRUNCATED_DATA);
+ return AL_FALSE;
+ }
+
+ if (!_alutInputStreamSkip (stream, dataOffset - AU_HEADER_SIZE))
+ {
+ return AL_FALSE;
+ }
+
+ switch (encoding)
+ {
+ case AU_ULAW_8:
+ bitsPerSample = 16;
+ codec = _alutCodecULaw;
+ break;
+ case AU_PCM_8:
+ bitsPerSample = 8;
+ codec = _alutCodecPCM8s;
+ break;
+ case AU_PCM_16:
+ bitsPerSample = 16;
+ codec =
+ (endianess () == BigEndian) ? _alutCodecLinear : _alutCodecPCM16;
+ break;
+ case AU_ALAW_8:
+ bitsPerSample = 16;
+ codec = _alutCodecALaw;
+ break;
+ default:
+ _alutSetError (ALUT_ERROR_UNSUPPORTED_FILE_SUBTYPE);
+ return AL_FALSE;
+ }
+
+ data = _alutInputStreamRead (stream, length);
+ if (data == NULL)
+ {
+ return NULL;
+ }
+ return codec (data, length, numChannels, bitsPerSample,
+ (ALfloat) sampleFrequency);
+}
+
+static BufferData *
+loadRawFile (InputStream *stream)
+{
+ size_t length = _alutInputStreamGetRemainingLength (stream);
+ ALvoid *data = _alutInputStreamRead (stream, length);
+ if (data == NULL)
+ {
+ return NULL;
+ }
+ /* Guesses */
+ return _alutCodecLinear (data, length, 1, 8, 8000);
+}
+
+static BufferData *
+loadFile (InputStream *stream)
+{
+ const char *fileName;
+ Int32BigEndian magic;
+
+ /* Raw files have no magic number - so use the fileName extension */
+
+ fileName = _alutInputStreamGetFileName (stream);
+ if (fileName != NULL && hasSuffixIgnoringCase (fileName, ".raw"))
+ {
+ return loadRawFile (stream);
+ }
+
+ /* For other file formats, read the quasi-standard four byte magic number */
+ if (!_alutInputStreamReadInt32BE (stream, &magic))
+ {
+ return AL_FALSE;
+ }
+
+ /* Magic number 'RIFF' == Microsoft '.wav' format */
+ if (magic == 0x52494646)
+ {
+ return loadWavFile (stream);
+ }
+
+ /* Magic number '.snd' == Sun & Next's '.au' format */
+ if (magic == 0x2E736E64)
+ {
+ return loadAUFile (stream);
+ }
+
+ _alutSetError (ALUT_ERROR_UNSUPPORTED_FILE_TYPE);
+ return AL_FALSE;
+}
+
+ALuint
+_alutCreateBufferFromInputStream (InputStream *stream)
+{
+ BufferData *bufferData;
+ ALuint buffer;
+
+ if (stream == NULL)
+ {
+ return AL_NONE;
+ }
+
+ bufferData = loadFile (stream);
+ _alutInputStreamDestroy (stream);
+ if (bufferData == NULL)
+ {
+ return AL_NONE;
+ }
+
+ buffer = _alutPassBufferData (bufferData);
+ _alutBufferDataDestroy (bufferData);
+
+ return buffer;
+}
+
+ALuint
+alutCreateBufferFromFile (const char *fileName)
+{
+ InputStream *stream;
+ if (!_alutSanityCheck ())
+ {
+ return AL_NONE;
+ }
+ stream = _alutInputStreamConstructFromFile (fileName);
+ return _alutCreateBufferFromInputStream (stream);
+}
+
+ALuint
+alutCreateBufferFromFileImage (const ALvoid *data, ALsizei length)
+{
+ InputStream *stream;
+ if (!_alutSanityCheck ())
+ {
+ return AL_NONE;
+ }
+ stream = _alutInputStreamConstructFromMemory (data, length);
+ return _alutCreateBufferFromInputStream (stream);
+}
+
+void *
+_alutLoadMemoryFromInputStream (InputStream *stream, ALenum *format,
+ ALsizei *size, ALfloat *frequency)
+{
+ BufferData *bufferData;
+ ALenum fmt;
+ void *data;
+
+ if (stream == NULL)
+ {
+ return NULL;
+ }
+
+ bufferData = loadFile (stream);
+ if (bufferData == NULL)
+ {
+ _alutInputStreamDestroy (stream);
+ return NULL;
+ }
+ _alutInputStreamDestroy (stream);
+
+ if (!_alutGetFormat (bufferData, &fmt))
+ {
+ _alutBufferDataDestroy (bufferData);
+ return NULL;
+ }
+
+ if (size != NULL)
+ {
+ *size = (ALsizei) _alutBufferDataGetLength (bufferData);
+ }
+
+ if (format != NULL)
+ {
+ *format = fmt;
+ }
+
+ if (frequency != NULL)
+ {
+ *frequency = _alutBufferDataGetSampleFrequency (bufferData);
+ }
+
+ data = _alutBufferDataGetData (bufferData);
+ _alutBufferDataDetachData (bufferData);
+ _alutBufferDataDestroy (bufferData);
+ return data;
+}
+
+ALvoid *
+alutLoadMemoryFromFile (const char *fileName, ALenum *format,
+ ALsizei *size, ALfloat *frequency)
+{
+ InputStream *stream;
+ if (!_alutSanityCheck ())
+ {
+ return NULL;
+ }
+ stream = _alutInputStreamConstructFromFile (fileName);
+ return _alutLoadMemoryFromInputStream (stream, format, size, frequency);
+}
+
+ALvoid *
+alutLoadMemoryFromFileImage (const ALvoid *data, ALsizei length,
+ ALenum *format, ALsizei *size,
+ ALfloat *frequency)
+{
+ InputStream *stream;
+ if (!_alutSanityCheck ())
+ {
+ return NULL;
+ }
+ stream = _alutInputStreamConstructFromMemory (data, length);
+ return _alutLoadMemoryFromInputStream (stream, format, size, frequency);
+}
+
+/*
+ Yukky backwards compatibility crap.
+*/
+
+void
+alutLoadWAVFile (ALbyte *fileName, ALenum *format, void **data, ALsizei *size,
+ ALsizei *frequency
+#if !defined(__APPLE__)
+ , ALboolean *loop
+#endif