mirror of
https://github.com/ZDoom/zduke.git
synced 2025-03-13 19:53:29 +00:00
- import
This commit is contained in:
commit
129a83b4e4
290 changed files with 109951 additions and 0 deletions
BIN
AudioLib.zip
Normal file
BIN
AudioLib.zip
Normal file
Binary file not shown.
30
Duke3D.sln
Normal file
30
Duke3D.sln
Normal file
|
@ -0,0 +1,30 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Duke3D", "Duke3D.vcproj", "{FA6A8277-8C69-41CD-8FA5-BE8949B81DFA}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{873F2EEA-24DF-454C-B245-CB9738BA993E} = {873F2EEA-24DF-454C-B245-CB9738BA993E}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FLAC", "source\FLAC\FLAC.vcproj", "{873F2EEA-24DF-454C-B245-CB9738BA993E}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{FA6A8277-8C69-41CD-8FA5-BE8949B81DFA}.Debug.ActiveCfg = Debug|Win32
|
||||
{FA6A8277-8C69-41CD-8FA5-BE8949B81DFA}.Debug.Build.0 = Debug|Win32
|
||||
{FA6A8277-8C69-41CD-8FA5-BE8949B81DFA}.Release.ActiveCfg = Release|Win32
|
||||
{FA6A8277-8C69-41CD-8FA5-BE8949B81DFA}.Release.Build.0 = Release|Win32
|
||||
{873F2EEA-24DF-454C-B245-CB9738BA993E}.Debug.ActiveCfg = Debug|Win32
|
||||
{873F2EEA-24DF-454C-B245-CB9738BA993E}.Debug.Build.0 = Debug|Win32
|
||||
{873F2EEA-24DF-454C-B245-CB9738BA993E}.Release.ActiveCfg = Release|Win32
|
||||
{873F2EEA-24DF-454C-B245-CB9738BA993E}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
582
Duke3D.vcproj
Normal file
582
Duke3D.vcproj
Normal file
|
@ -0,0 +1,582 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="Duke3D"
|
||||
ProjectGUID="{FA6A8277-8C69-41CD-8FA5-BE8949B81DFA}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="source\engine;source\doomlayer;source\win32;source\sound;source;source\FLAC"
|
||||
PreprocessorDefinitions="UDP_NETWORKING=1;WIN32;_WINDOWS;_DEBUG"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="dinput8.lib winmm.lib comctl32.lib ws2_32.lib f:\fmodapi362win32\api\lib\fmodvc.lib"
|
||||
OutputFile="$(OutDir)/Duke3D.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/Duke3D.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OmitFramePointers="TRUE"
|
||||
AdditionalIncludeDirectories="source\engine;source\doomlayer;source\win32;source\sound;source;source\FLAC"
|
||||
PreprocessorDefinitions="UDP_NETWORKING=1;WIN32;_WINDOWS;NDEBUG"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
DefaultCharIsUnsigned="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="FALSE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="dinput8.lib winmm.lib comctl32.lib ws2_32.lib fmodvc.lib"
|
||||
OutputFile="$(OutDir)/Duke3D.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
GenerateMapFile="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||
<File
|
||||
RelativePath="source\ACTORS.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\animlib.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\CONFIG.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\GAME.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\GAMEDEF.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\GLOBAL.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\keyboard.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\MENUES.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\PLAYER.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\PREMAP.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\RTS.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\SECTOR.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\SOUNDS.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\stub.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc">
|
||||
<File
|
||||
RelativePath="source\_ANIMLIB.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\_FUNCTIO.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\_RTS.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\ANIMLIB.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\CONFIG.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\CONTROL.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\DEVELOP.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\DUKE3D.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\FILE_LIB.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\FUNCT.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\FUNCTION.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\FX_MAN.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\GAMEDEFS.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\KEYBOARD.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\MOUSE.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\MUSIC.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\NAMES.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\RTS.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\SCRIPLIB.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\SNDCARDS.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\SOUNDEFS.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\SOUNDS.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\TASK_MAN.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\TYPES.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\UTIL_LIB.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="BUILD Engine"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="source\engine\a.nasm">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling texture mapping routines"
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling texture mapping routines"
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\BUILD.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\buildprotos.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\cache1d.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\engine.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\mmulti.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\mscinlines.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\multi.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\engine\PRAGMAS.H">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Doom Layer"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_bind.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_bind.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_console.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_console.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_cvars.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_cvars.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_dispatch.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_dispatch.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\c_expr.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\cmdlib.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\cmdlib.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\crc32.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\d_event.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\d_gui.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\doomdef.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\doomerrors.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\doomtype.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\i_video.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\m_alloc.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\m_alloc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\m_argv.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\m_argv.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\m_crc32.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\s_playlist.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\s_playlist.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\s_sound.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\s_sound.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\stats.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\stats.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\tarray.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\templates.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\v_palette.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\v_palette.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\v_pfx.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\v_pfx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\v_video.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\doomlayer\v_video.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Win32"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="source\win32\hardware.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\hardware.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\helperthread.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\helperthread.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_cd.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_cd.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_crash.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_input.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_input.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_main.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_net.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_net.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_system.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\i_system.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\win32iface.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\win32video.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\win32video.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\win32\zdoom.rc">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="MACT Substitute"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="source\mactsubstitute\file_lib.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\mactsubstitute\mathutil.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Sound Stuff"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="source\sound\i_music.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\i_music.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\i_musicinterns.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\i_sound.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\i_sound.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_cd.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_flac.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_midi_midiout.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_midi_stream.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_midi_timidity.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_mod.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_mus_midiout.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_mus_opl.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="TRUE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_spc.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\music_stream.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\PITCH.C">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\PITCH.H">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\sample_flac.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="source\sound\sample_flac.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="source\rh-log.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
87
GNU.TXT
Normal file
87
GNU.TXT
Normal file
|
@ -0,0 +1,87 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
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.
|
||||
|
||||
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
|
114
README.TXT
Normal file
114
README.TXT
Normal file
|
@ -0,0 +1,114 @@
|
|||
===================================================================
|
||||
Duke Nukem 3D (v1.5 CD Version) Source Code Release - April 1, 2003
|
||||
===================================================================
|
||||
|
||||
LEGAL STUFF
|
||||
-----------
|
||||
|
||||
"Duke Nukem" is a registered trademark of Apogee Software, Ltd. (a.k.a. 3D Realms).
|
||||
"Duke Nukem 3D" copyright 1996 - 2003 3D Realms. All trademarks and copyrights reserved.
|
||||
|
||||
This is the complete source code for Duke Nukem 3D version 1.5, buildable as detailed in the next section.
|
||||
|
||||
The code is licensed under the terms of the GPL (gnu public license). You should read the entire license (filename "GNU.TXT" in this archive), so you understand your rights and what you can and cannot do with the source code from this release.
|
||||
|
||||
All of the Duke Nukem 3D data files remain copyrighted and licensed by 3D Realms under the original terms. You cannot redistribute our data or data files from the original game. You can use our data for personal entertainment or educational purposes. If you need the data, you can order a Duke Nukem 3D CD from our store on our website.
|
||||
|
||||
Please do not contact us for possible commercial exploitation of Duke Nukem 3D -- we will not be interested.
|
||||
|
||||
Please note that this is being released without any kind of support from Apogee Software, Ltd / 3D Realms Entertainment. We cannot help in getting this running and we do not guarantee that you will be able to get it to work, nor do we guarantee that it won't blow up your computer if you do try and use it. Use at your own risk.
|
||||
|
||||
SPECIAL THANKS
|
||||
--------------
|
||||
|
||||
First, we'd like to thank all the fans of 3D Realms and Duke Nukem. We wouldn't be where we are without you and without your support.
|
||||
|
||||
Second, we'd like to thank Charlie Wiederhold for putting this release together. We had decided some time ago to release the source code, but people are busy and it always seemed to be low priority. A couple of weeks ago, Charlie got a source archive from Scott, and came back a few days later with it all compiling.
|
||||
|
||||
Thanks also to Ken Silverman and Jim Dose for allowing us to include some of their source in this build, so we have it all in one archive.
|
||||
|
||||
Finally, we'd like to thank the whole Duke Nukem Forever team. These guys are all working incredibly hard on the next installment of Duke Nukem.
|
||||
|
||||
Enjoy the source code. We can't wait to see what people do with it. And we really look forward to being able to play the game under XP, with sound, internet play, hardware acceleration and whatever else you're clever enough to put in :)
|
||||
|
||||
George Broussard & Scott Miller
|
||||
3D Realms
|
||||
|
||||
======================================================
|
||||
HOW TO COMPILE THE SOURCE CODE (by Charlie Wiederhold)
|
||||
======================================================
|
||||
|
||||
This source code release was compiled on March 20th, 2003 using the materials in this archive.
|
||||
|
||||
Duke was originally written with the Watcom 10.0 C/C++ compiler. This code has been updated to allow it to compile under the free version of the Watcom compiler available from their webpage (http://www.openwatcom.org).
|
||||
|
||||
It was compiled under both Open Watcom 1.0 and Watcom 11.0c for Windows. Both are free to download, and I didn't notice much of a difference between the two when using them. This means, thankfully, that anybody can work with this code right away without trying to find an out of production compiler or wait for someone to port it to other modern compilers.
|
||||
|
||||
Step 1) Install Watcom C/C++ onto your system.
|
||||
|
||||
Step 2) When you install, make sure that you select DOS 32 Bit as one of your target environments to build for.
|
||||
|
||||
Step 3) Choose a place you want to work from and unzip the contents of this .ZIP file into that directory.
|
||||
|
||||
From here you have two choices on how to work. You can use the command line compiler that comes with Watcom, or you can use the IDE (basically the development studio that manages your files, options for compiling, editing files, debugger, etc). Whichever one you choose depends on what you are comfortable with.
|
||||
|
||||
IF YOU USE THE COMMAND LINE COMPILER
|
||||
------------------------------------
|
||||
|
||||
- In a Command Prompt, go into the Source directory where you should find a MAKEFILE. and a MAKEFILE.LNK file.
|
||||
- At the Command Prompt type "wmake" or "wmake makefile" without the quotes.
|
||||
- This should compile and create a DUKE3D.EXE file which you can then copy into the directory with your Duke 3D data and run.
|
||||
|
||||
IF YOU USE THE IDE
|
||||
------------------
|
||||
|
||||
- Start up the Watcom IDE and go to File -> Open Project.
|
||||
- Find the directory where you've unzipped the Source files into, and you should see a DUKE3D.WPJ, select this and hit "OK".
|
||||
- Click the "Make Current Target" button, or press "F4" or go to the menu Targets -> Make. You'll see lots of Warnings as it compiles, that's normal.
|
||||
- This will create a DUKE3D.EXE file in the same directory where the DUKE3D.WPJ was located, which can then be copied in the directory with your Duke 3D data and run.
|
||||
|
||||
ONCE YOU HAVE DUKE3D.EXE COMPILED
|
||||
---------------------------------
|
||||
|
||||
- If you own Duke 3D version 1.5, you are set... simply copy your new .EXE into the directory and run it.
|
||||
- If you own Duke 3D version 1.4 or 1.3d, follow the same steps below except don't download the shareware data.
|
||||
- If you own neither versions: Download the shareware version of Duke 3D from http://www.3drealms.com (go to Downloads).
|
||||
- In the directory you have Duke 3D installed now, copy the four files in the TESTDATA directory into your Duke 3D directory. Now you should be able to play the game well enough to test, though unfortunately there will still be some minor issues. Your best results will come from owning a copy of Duke 3D version 1.5, which can still be purchased from the 3D Realms website.
|
||||
|
||||
This should be enough to get you started. Unfortunately nobody at 3D Realms will be able to devote the time to answer any support questions if you do encounter problems. However, go to http://www.3drealms.com/forums.html and you will find people discussing the source code in the Duke 3D Source category and able to answer questions. I will try to answer extremely common questions there shortly after the release, but I promise, within a very short time the community will outgrow my knowledge/understanding of this source and be better suited to answer any questions itself.
|
||||
|
||||
MISC NOTES ABOUT THIS RELEASE
|
||||
-----------------------------
|
||||
|
||||
- All changes I made from the original are indicated by a "// CTW" style comment. In all but one case I commented out the original code so that it would still be there. I made as few changes as possible since the fun for people is working on the Duke 3D original code, not my personal rewrite/interpretation.
|
||||
|
||||
- Unfortunately the source to the SETUP.EXE and SETMAIN.EXE programs used for creating setup configuration files for Duke 3D is nowhere to be found, so if you need a setup utility to create custom .CFG files you'll need to write your own. If we find the source code we'll update this release to include that as well. The code to read .CFG files is within the Duke 3D CONFIG.C source itself, so it gives you something to start with.
|
||||
|
||||
- This source includes the Build Engine data (.OBJ files) needed for compiling. The Build Engine is a seperate entity from Duke 3D, though Duke 3D is built upon the Build Engine.
|
||||
|
||||
- The BUILDENGINE.ZIP file contains all of the data you need from Ken Silverman's released version to compile the Build Engine itself. Instructions for doing this are contained within that file. I have tested this with the free versions of Watcom and it works. More information about this code at Ken's webpage here: http://www.advsys.net/ken/buildsrc/default.htm
|
||||
|
||||
- The AUDIOLIB.ZIP file contains all of the data you need from Jim Dose's sound engine that was used in both Rise of the Triad and Duke 3D to compile the actual Audio Library itself. Instructions for doing this are contained in that file. I have not tested this personally to see if it compiles under the free version of Watcom.
|
||||
|
||||
- Sound will be sketchy if you are on any modern system. It does work, but only as well as the original Duke 3D's does.
|
||||
|
||||
- Networking works. Scott Miller and I fired up a quick game and it worked fine. The only catch is you need to disable sound for this to work in modern systems. No testing over a modem was done.
|
||||
|
||||
- The original .DMO demo files do not work. However recording new ones and playing those back does work, sometimes. I've disabled playback of demos in the source for stability when people first try to run their compiled version. It shouldn't be too hard to find how to re-enable it for those who want to go in and fix it.
|
||||
|
||||
- If you would like to play Duke 3D in high res Vesa modes instead of 320x200, download Ken's utility here: http://www.advsys.net/ken/build.htm
|
||||
|
||||
- The files in the EXTRAS folder are there purely for curiosity and educational purposes. Things like Allen Blum's experiments with room over room can be found in there, as well as older versions of the source files that ultimately made it into the game. None of these are necessary and are purely, well, extra.
|
||||
|
||||
- Duke 3D used DOS/4GW for it's DOS Extender. Watcom 1.0/11.0c comes with a couple free DOS Extenders, however you will need to bind it to the extender in order to distribute the EXE you create to other computers where it wasn't compiled. How you do this depends on which extender you choose to use. I trust that once you get to the point of distributing an EXE you can figure out how to bind it to the extender. Since DOS/4GW was a commercial licensed product, we can't distribute the resources we used to do this.
|
||||
|
||||
- All references to TEN (Total Entertainment Network) have been commented out of the version that will be compiled, but left in for the curious to look at.
|
||||
|
||||
- This page was an invaluable learning tool for me when working on preparing the source code for release: http://www.clipx.net/ ... The actual information I used can be found here: http://www.clipx.net/ng/zcpp/index.php
|
||||
|
||||
- I started working on this having no knowledge of Watcom, DOS based C programming, etc. and got it up and going within a night (and a half...ish) after work hours. So if you have a basic understanding of programming, you shouldn't have much trouble getting this up and running.
|
||||
|
||||
- The first things I think everyone would like to see done is an update to the sound engine and an update to the networking to allow play over the internet. But there is no end to the changes people can make, so everyone at 3D Realms looks forward to what people will do now that the source code is finally out there. It's been a long time coming (too long probably), but here you go, have fun!
|
||||
|
||||
Charlie Wiederhold
|
||||
3D Realms
|
130
VOC.TXT
Normal file
130
VOC.TXT
Normal file
|
@ -0,0 +1,130 @@
|
|||
Creative Voice (VOC) file format
|
||||
--------------------------------
|
||||
|
||||
~From: galt@dsd.es.com
|
||||
|
||||
(byte numbers are hex!)
|
||||
|
||||
HEADER (bytes 00-19)
|
||||
Series of DATA BLOCKS (bytes 1A+) [Must end w/ Terminator Block]
|
||||
|
||||
- ---------------------------------------------------------------
|
||||
|
||||
HEADER:
|
||||
=======
|
||||
byte # Description
|
||||
------ ------------------------------------------
|
||||
00-12 "Creative Voice File"
|
||||
13 1A (eof to abort printing of file)
|
||||
14-15 Offset of first datablock in .voc file (std 1A 00
|
||||
in Intel Notation)
|
||||
16-17 Version number (minor,major) (VOC-HDR puts 0A 01)
|
||||
18-19 1's Comp of Ver. # + 1234h (VOC-HDR puts 29 11)
|
||||
|
||||
- ---------------------------------------------------------------
|
||||
|
||||
DATA BLOCK:
|
||||
===========
|
||||
|
||||
Data Block: TYPE(1-byte), SIZE(3-bytes), INFO(0+ bytes)
|
||||
NOTE: Terminator Block is an exception -- it has only the TYPE byte.
|
||||
|
||||
TYPE Description Size (3-byte int) Info
|
||||
---- ----------- ----------------- -----------------------
|
||||
00 Terminator (NONE) (NONE)
|
||||
01 Sound data 2+length of data *
|
||||
02 Sound continue length of data Voice Data
|
||||
03 Silence 3 **
|
||||
04 Marker 2 Marker# (2 bytes)
|
||||
05 ASCII length of string null terminated string
|
||||
06 Repeat 2 Count# (2 bytes)
|
||||
07 End repeat 0 (NONE)
|
||||
08 Extended 4 ***
|
||||
|
||||
*Sound Info Format: **Silence Info Format:
|
||||
--------------------- ----------------------------
|
||||
00 Sample Rate 00-01 Length of silence - 1
|
||||
01 Compression Type 02 Sample Rate
|
||||
02+ Voice Data
|
||||
|
||||
***Extended Info Format:
|
||||
---------------------
|
||||
00-01 Time Constant: Mono: 65536 - (256000000/sample_rate)
|
||||
Stereo: 65536 - (25600000/(2*sample_rate))
|
||||
02 Pack
|
||||
03 Mode: 0 = mono
|
||||
1 = stereo
|
||||
|
||||
|
||||
Marker# -- Driver keeps the most recent marker in a status byte
|
||||
Count# -- Number of repetitions + 1
|
||||
Count# may be 1 to FFFE for 0 - FFFD repetitions
|
||||
or FFFF for endless repetitions
|
||||
Sample Rate -- SR byte = 256-(1000000/sample_rate)
|
||||
Length of silence -- in units of sampling cycle
|
||||
Compression Type -- of voice data
|
||||
8-bits = 0
|
||||
4-bits = 1
|
||||
2.6-bits = 2
|
||||
2-bits = 3
|
||||
Multi DAC = 3+(# of channels) [interesting--
|
||||
this isn't in the developer's manual]
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------
|
||||
Addendum submitted by Votis Kokavessis:
|
||||
|
||||
After some experimenting with .VOC files I found out that there is a Data Block Type 9, which is not covered in the VOC.TXT file. Here is what I was able to discover about this block type:
|
||||
|
||||
|
||||
TYPE: 09
|
||||
SIZE: 12 + length of data
|
||||
INFO: 12 (twelve) bytes
|
||||
|
||||
INFO STRUCTURE:
|
||||
|
||||
Bytes 0-1: (Word) Sample Rate (e.g. 44100)
|
||||
Bytes 2-3: zero (could be that bytes 0-3 are a DWord for Sample Rate)
|
||||
Byte 4: Sample Size in bits (e.g. 16)
|
||||
Byte 5: Number of channels (e.g. 1 for mono, 2 for stereo)
|
||||
Byte 6: Unknown (equal to 4 in all files I examined)
|
||||
Bytes 7-11: zero
|
||||
----------------------------------------------------------------------------------
|
||||
Detailed description of new data blocks (VOC files version 1.20 and above):
|
||||
|
||||
(Source is fax from Barry Boone at Creative Labs, 405/742-6622)
|
||||
|
||||
BLOCK 8 - digitized sound attribute extension, must preceed block 1.
|
||||
Used to define stereo, 8 bit audio
|
||||
BYTE bBlockID; // = 8
|
||||
BYTE nBlockLen[3]; // 3 byte length
|
||||
WORD wTimeConstant; // time constant = same as block 1
|
||||
BYTE bPackMethod; // same as in block 1
|
||||
BYTE bVoiceMode; // 0-mono, 1-stereo
|
||||
|
||||
Data is stored left, right
|
||||
|
||||
BLOCK 9 - data block that supersedes blocks 1 and 8.
|
||||
Used for stereo, 16 bit.
|
||||
|
||||
BYTE bBlockID; // = 9
|
||||
BYTE nBlockLen[3]; // length 12 plus length of sound
|
||||
DWORD dwSamplesPerSec; // samples per second, not time const.
|
||||
BYTE bBitsPerSample; // e.g., 8 or 16
|
||||
BYTE bChannels; // 1 for mono, 2 for stereo
|
||||
WORD wFormat; // see below
|
||||
BYTE reserved[4]; // pad to make block w/o data
|
||||
// have a size of 16 bytes
|
||||
|
||||
Valid values of wFormat are:
|
||||
|
||||
0x0000 8-bit unsigned PCM
|
||||
0x0001 Creative 8-bit to 4-bit ADPCM
|
||||
0x0002 Creative 8-bit to 3-bit ADPCM
|
||||
0x0003 Creative 8-bit to 2-bit ADPCM
|
||||
0x0004 16-bit signed PCM
|
||||
0x0006 CCITT a-Law
|
||||
0x0007 CCITT u-Law
|
||||
0x02000 Creative 16-bit to 4-bit ADPCM
|
||||
|
||||
Data is stored left, right
|
BIN
source/A.OBJ
Normal file
BIN
source/A.OBJ
Normal file
Binary file not shown.
7155
source/ACTORS.cpp
Normal file
7155
source/ACTORS.cpp
Normal file
File diff suppressed because it is too large
Load diff
162
source/ANIMLIB.H
Normal file
162
source/ANIMLIB.H
Normal file
|
@ -0,0 +1,162 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
||||
|
||||
Duke Nukem 3D 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1996 - Todd Replogle
|
||||
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ANIMLIB.H
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _animlib_public_
|
||||
#define _animlib_public_
|
||||
|
||||
|
||||
// structure declarations for deluxe animate large page files */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32 id; // 4 character ID == "LPF " */
|
||||
uint16 maxLps; // max # largePages allowed. 256 FOR NOW. */
|
||||
uint16 nLps; // # largePages in this file. */
|
||||
uint32 nRecords; // # records in this file. 65534 is current limit plus */
|
||||
// one for last-to-first delta for looping the animation */
|
||||
uint16 maxRecsPerLp; // # records permitted in an lp. 256 FOR NOW. */
|
||||
uint16 lpfTableOffset; // Absolute Seek position of lpfTable. 1280 FOR NOW.
|
||||
// The lpf Table is an array of 256 large page structures
|
||||
// that is used to facilitate finding records in an anim
|
||||
// file without having to seek through all of the Large
|
||||
// Pages to find which one a specific record lives in. */
|
||||
uint32 contentType; // 4 character ID == "ANIM" */
|
||||
uint16 width; // Width of screen in pixels. */
|
||||
uint16 height; // Height of screen in pixels. */
|
||||
byte variant; // 0==ANIM. */
|
||||
byte version; // 0==frame rate is multiple of 18 cycles/sec.
|
||||
// 1==frame rate is multiple of 70 cycles/sec. */
|
||||
byte hasLastDelta; // 1==Last record is a delta from last-to-first frame. */
|
||||
byte lastDeltaValid; // 0==The last-to-first delta (if present) hasn't been
|
||||
// updated to match the current first&last frames, so it
|
||||
// should be ignored. */
|
||||
byte pixelType; // /* 0==256 color. */
|
||||
byte CompressionType;// /* 1==(RunSkipDump) Only one used FOR NOW. */
|
||||
byte otherRecsPerFrm;// /* 0 FOR NOW. */
|
||||
byte bitmaptype; // /* 1==320x200, 256-color. Only one implemented so far. */
|
||||
byte recordTypes[32];// /* Not yet implemented. */
|
||||
uint32 nFrames; // /* In case future version adds other records at end of
|
||||
// file, we still know how many actual frames.
|
||||
// NOTE: DOES include last-to-first delta when present. */
|
||||
uint16 framesPerSecond; // Number of frames to play per second. */
|
||||
uint16 pad2[29]; // 58 bytes of filler to round up to 128 bytes total. */
|
||||
} lpfileheader;
|
||||
|
||||
// this is the format of a large page structure
|
||||
typedef struct
|
||||
{
|
||||
uint16 baseRecord; // Number of first record in this large page.
|
||||
uint16 nRecords; // Number of records in lp.
|
||||
// bit 15 of "nRecords" == "has continuation from previous lp".
|
||||
// bit 14 of "nRecords" == "final record continues on next lp".
|
||||
uint16 nBytes; // Total number of bytes of contents, excluding header.
|
||||
} lp_descriptor;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 framecount; // current frame of anim
|
||||
lpfileheader lpheader; // file header will be loaded into this structure
|
||||
lp_descriptor LpArray[256]; // arrays of large page structs used to find frames
|
||||
uint16 curlpnum; // initialize to an invalid Large page number
|
||||
lp_descriptor curlp; // header of large page currently in memory
|
||||
uint16 thepage[0x8000]; // buffer where current large page is loaded
|
||||
byte imagebuffer[0x10000]; // buffer where anim frame is decoded
|
||||
byte * buffer;
|
||||
byte pal[768];
|
||||
int32 currentframe;
|
||||
} anim_t;
|
||||
|
||||
//****************************************************************************
|
||||
//
|
||||
// ANIM_LoadAnim ()
|
||||
//
|
||||
// Setup internal anim data structure
|
||||
//
|
||||
//****************************************************************************
|
||||
|
||||
void ANIM_LoadAnim (char * buffer);
|
||||
|
||||
//****************************************************************************
|
||||
//
|
||||
// ANIM_FreeAnim ()
|
||||
//
|
||||
// Free up internal anim data structure
|
||||
//
|
||||
//****************************************************************************
|
||||
|
||||
void ANIM_FreeAnim ( void );
|
||||
|
||||
//****************************************************************************
|
||||
//
|
||||
// ANIM_NumFrames ()
|
||||
//
|
||||
// returns the number of frames in the current anim
|
||||
//
|
||||
//****************************************************************************
|
||||
|
||||
int32 ANIM_NumFrames ( void );
|
||||
|
||||
//****************************************************************************
|
||||
//
|
||||
// ANIM_DrawFrame ()
|
||||
//
|
||||
// Draw the frame to a returned buffer
|
||||
//
|
||||
//****************************************************************************
|
||||
|
||||
byte * ANIM_DrawFrame (int32 framenumber);
|
||||
|
||||
//****************************************************************************
|
||||
//
|
||||
// ANIM_GetPalette ()
|
||||
//
|
||||
// return the palette of the anim
|
||||
//****************************************************************************
|
||||
|
||||
byte * ANIM_GetPalette ( void );
|
||||
|
||||
extern anim_t * anim;
|
||||
|
||||
//#line "animlib.c" 34
|
||||
extern void CheckAnimStarted(char *funcname);
|
||||
//#line "animlib.c" 46
|
||||
extern uint16 findpage(uint16 framenumber);
|
||||
//#line "animlib.c" 71
|
||||
extern void loadpage(uint16 pagenumber,uint16 *pagepointer);
|
||||
//#line "animlib.c" 97
|
||||
extern void CPlayRunSkipDump(byte *srcP,byte *dstP);
|
||||
//#line "animlib.c" 177
|
||||
extern void renderframe(uint16 framenumber,uint16 *pagepointer);
|
||||
//#line "animlib.c" 214
|
||||
extern void drawframe(uint16 framenumber);
|
||||
|
||||
#endif
|
BIN
source/AUDIO_WF.LIB
Normal file
BIN
source/AUDIO_WF.LIB
Normal file
Binary file not shown.
BIN
source/BUTWCD4.LIB
Normal file
BIN
source/BUTWCD4.LIB
Normal file
Binary file not shown.
BIN
source/CACHE1D.OBJ
Normal file
BIN
source/CACHE1D.OBJ
Normal file
Binary file not shown.
54
source/CONFIG.H
Normal file
54
source/CONFIG.H
Normal file
|
@ -0,0 +1,54 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
||||
|
||||
Duke Nukem 3D 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1996 - Todd Replogle
|
||||
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef _config_public
|
||||
#define _config_public
|
||||
|
||||
#define SETUPNAMEPARM "-SETUPFILE"
|
||||
|
||||
extern int32 FXDevice;
|
||||
extern int32 MusicDevice;
|
||||
extern int32 FXVolume;
|
||||
extern int32 MusicVolume;
|
||||
extern fx_blaster_config BlasterConfig;
|
||||
extern int32 NumVoices;
|
||||
extern int32 NumChannels;
|
||||
extern int32 NumBits;
|
||||
extern int32 MixRate;
|
||||
extern int32 MidiPort;
|
||||
extern int32 ReverseStereo;
|
||||
|
||||
extern int32 ControllerType;
|
||||
extern int32 MouseAiming;
|
||||
extern int32 ScreenMode;
|
||||
extern int32 ScreenWidth;
|
||||
extern int32 ScreenHeight;
|
||||
|
||||
void CONFIG_ReadSetup( void );
|
||||
void CONFIG_GetSetupFilename( void );
|
||||
void CONFIG_WriteSetup( void );
|
||||
|
||||
#endif
|
761
source/CONFIG.cpp
Normal file
761
source/CONFIG.cpp
Normal file
|
@ -0,0 +1,761 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
||||
|
||||
Duke Nukem 3D 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1996 - Todd Replogle
|
||||
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#include <conio.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <dos.h>
|
||||
#include "duke3d.h"
|
||||
#include "scriplib.h"
|
||||
#include "m_argv.h"
|
||||
#include "c_bind.h"
|
||||
|
||||
// we load this in to get default button and key assignments
|
||||
// as well as setting up function mappings
|
||||
|
||||
#include "_functio.h"
|
||||
|
||||
//
|
||||
// Sound variables
|
||||
//
|
||||
int32 FXDevice;
|
||||
int32 MusicDevice;
|
||||
int32 FXVolume;
|
||||
int32 MusicVolume;
|
||||
int32 SoundToggle;
|
||||
int32 MusicToggle;
|
||||
int32 VoiceToggle;
|
||||
int32 AmbienceToggle;
|
||||
fx_blaster_config BlasterConfig;
|
||||
int32 NumVoices;
|
||||
int32 NumChannels;
|
||||
int32 NumBits;
|
||||
int32 MixRate;
|
||||
int32 MidiPort;
|
||||
int32 ReverseStereo;
|
||||
|
||||
int32 ControllerType = controltype_keyboardandmouse;
|
||||
int32 MouseAiming;
|
||||
|
||||
//
|
||||
// Screen variables
|
||||
//
|
||||
|
||||
int32 ScreenMode;
|
||||
int32 ScreenWidth;
|
||||
int32 ScreenHeight;
|
||||
|
||||
static char setupfilename[128]={SETUPFILENAME};
|
||||
static int32 scripthandle;
|
||||
static int32 setupread=0;
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_GetSetupFilename
|
||||
=
|
||||
===================
|
||||
*/
|
||||
#define MAXSETUPFILES 20
|
||||
void CONFIG_GetSetupFilename( void )
|
||||
{
|
||||
struct find_t fblock;
|
||||
char extension[10];
|
||||
char * src;
|
||||
char * filenames[MAXSETUPFILES];
|
||||
char * parm;
|
||||
int32 numfiles;
|
||||
int32 i;
|
||||
|
||||
strcpy(setupfilename,SETUPFILENAME);
|
||||
|
||||
// determine extension
|
||||
|
||||
src = setupfilename + strlen(setupfilename) - 1;
|
||||
|
||||
while (*src != '.')
|
||||
{
|
||||
src--;
|
||||
}
|
||||
strcpy (&extension[1],src);
|
||||
extension[0] = '*';
|
||||
|
||||
numfiles=0;
|
||||
if (_dos_findfirst(extension,0,&fblock)==0)
|
||||
{
|
||||
do
|
||||
{
|
||||
filenames[numfiles]=(char*)SafeMalloc(128);
|
||||
strcpy(filenames[numfiles],fblock.name);
|
||||
numfiles++;
|
||||
if (numfiles == MAXSETUPFILES)
|
||||
break;
|
||||
}
|
||||
while(!_dos_findnext(&fblock));
|
||||
}
|
||||
parm = Args.CheckValue (SETUPNAMEPARM);
|
||||
if (parm!=0)
|
||||
{
|
||||
numfiles = 0;
|
||||
strcpy(setupfilename,parm);
|
||||
}
|
||||
if (numfiles>1)
|
||||
{
|
||||
int32 time;
|
||||
int32 oldtime;
|
||||
int32 count;
|
||||
|
||||
Printf("\nMultiple Configuration Files Encountered\n");
|
||||
Printf("========================================\n");
|
||||
Printf("Please choose a configuration file from the following list by pressing its\n");
|
||||
Printf("corresponding letter:\n");
|
||||
for (i=0;i<numfiles;i++)
|
||||
{
|
||||
if (strcmpi(filenames[i],SETUPFILENAME))
|
||||
{
|
||||
Printf("%c. %s\n",'a'+(char)i,filenames[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf("%c. %s <DEFAULT>\n",'a'+(char)i,filenames[i]);
|
||||
}
|
||||
}
|
||||
Printf("\n");
|
||||
Printf("(%s will be used if no selection is made within 10 seconds.)\n\n",SETUPFILENAME);
|
||||
//KB_FlushKeyboardQueue();
|
||||
//KB_ClearKeysDown();
|
||||
count = 9;
|
||||
oldtime = clock();
|
||||
time=clock()+(10*CLOCKS_PER_SEC);
|
||||
while (clock()<time)
|
||||
{
|
||||
if (clock()>oldtime)
|
||||
{
|
||||
Printf("%ld seconds left. \r",count);
|
||||
fflush(stdout);
|
||||
oldtime = clock()+CLOCKS_PER_SEC;
|
||||
count--;
|
||||
}
|
||||
if (0/*KB_KeyWaiting()*/)
|
||||
{
|
||||
int32 ch = 0;//KB_Getch();
|
||||
ch -='a';
|
||||
if (ch>=0 && ch<numfiles)
|
||||
{
|
||||
strcpy (setupfilename, filenames[ch]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Printf("\n\n");
|
||||
}
|
||||
if (numfiles==1)
|
||||
strcpy (setupfilename, filenames[0]);
|
||||
Printf("Using Setup file: '%s'\n",setupfilename);
|
||||
#if 0
|
||||
i=clock()+(3*CLOCKS_PER_SEC/4);
|
||||
while (clock()<i)
|
||||
{
|
||||
;
|
||||
}
|
||||
#endif
|
||||
for (i=0;i<numfiles;i++)
|
||||
{
|
||||
SafeFree(filenames[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_FunctionNameToNum
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
int32 CONFIG_FunctionNameToNum( char * func )
|
||||
{
|
||||
int32 i;
|
||||
|
||||
for (i=0;i<NUMGAMEFUNCTIONS;i++)
|
||||
{
|
||||
if (!stricmp(func,gamefunctions[i]))
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_FunctionNumToName
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
char * CONFIG_FunctionNumToName( int32 func )
|
||||
{
|
||||
if (func < NUMGAMEFUNCTIONS)
|
||||
{
|
||||
return gamefunctions[func];
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_AnalogNameToNum
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
|
||||
int32 CONFIG_AnalogNameToNum( char * func )
|
||||
{
|
||||
|
||||
if (!stricmp(func,"analog_turning"))
|
||||
{
|
||||
return analog_turning;
|
||||
}
|
||||
if (!stricmp(func,"analog_strafing"))
|
||||
{
|
||||
return analog_strafing;
|
||||
}
|
||||
if (!stricmp(func,"analog_moving"))
|
||||
{
|
||||
return analog_moving;
|
||||
}
|
||||
if (!stricmp(func,"analog_lookingupanddown"))
|
||||
{
|
||||
return analog_lookingupanddown;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_SetDefaults
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
void CONFIG_SetDefaults( void )
|
||||
{
|
||||
SoundToggle = 1;
|
||||
MusicToggle = 1;
|
||||
VoiceToggle = 1;
|
||||
AmbienceToggle = 1;
|
||||
FXVolume = 192;
|
||||
MusicVolume = 128;
|
||||
ReverseStereo = 0;
|
||||
ps[0].aim_mode = 0;
|
||||
ud.screen_size = 8;
|
||||
ud.screen_tilting = 1;
|
||||
ud.shadows = 1;
|
||||
ud.detail = 1;
|
||||
ud.lockout = 0;
|
||||
ud.pwlockout[0] = '\0';
|
||||
ud.crosshair = 0;
|
||||
ud.m_marker = 1;
|
||||
ud.m_ffire = 1;
|
||||
|
||||
C_SetDefaultBindings ();
|
||||
|
||||
strcpy (ud.ridecule[0], "An inspiration for birth control.");
|
||||
strcpy (ud.ridecule[1], "You're gonna die for that!");
|
||||
strcpy (ud.ridecule[2], "It hurts to be you.");
|
||||
strcpy (ud.ridecule[3], "Lucky Son of a Bitch.");
|
||||
strcpy (ud.ridecule[4], "Hmmm....Payback time.");
|
||||
strcpy (ud.ridecule[5], "You bottom dwelling scum sucker.");
|
||||
strcpy (ud.ridecule[6], "Damn, you're ugly.");
|
||||
strcpy (ud.ridecule[7], "Ha ha ha...Wasted!");
|
||||
strcpy (ud.ridecule[8], "You suck!");
|
||||
strcpy (ud.ridecule[9], "AARRRGHHHHH!!!");
|
||||
|
||||
strcpy (ud.rtsname, "DUKE.RTS");
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_ReadKeys
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
void CONFIG_ReadKeys( void )
|
||||
{
|
||||
int32 i;
|
||||
int32 numkeyentries;
|
||||
int32 function;
|
||||
char keyname1[80];
|
||||
char keyname2[80];
|
||||
kb_scancode key1,key2;
|
||||
|
||||
numkeyentries = SCRIPT_NumberEntries( scripthandle, "KeyDefinitions" );
|
||||
|
||||
for (i=0;i<numkeyentries;i++)
|
||||
{
|
||||
function = CONFIG_FunctionNameToNum(SCRIPT_Entry( scripthandle, "KeyDefinitions", i ));
|
||||
if (function != -1)
|
||||
{
|
||||
memset(keyname1,0,sizeof(keyname1));
|
||||
memset(keyname2,0,sizeof(keyname2));
|
||||
SCRIPT_GetDoubleString
|
||||
(
|
||||
scripthandle,
|
||||
"KeyDefinitions",
|
||||
SCRIPT_Entry( scripthandle,"KeyDefinitions", i ),
|
||||
keyname1,
|
||||
keyname2
|
||||
);
|
||||
key1 = 0;
|
||||
key2 = 0;
|
||||
if (keyname1[0])
|
||||
{
|
||||
key1 = (byte) 0;//KB_StringToScanCode( keyname1 );
|
||||
}
|
||||
if (keyname2[0])
|
||||
{
|
||||
key2 = (byte) 0;//KB_StringToScanCode( keyname2 );
|
||||
}
|
||||
CONTROL_MapKey( function, key1, key2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_SetupMouse
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
void CONFIG_SetupMouse( int32 scripthandle )
|
||||
{
|
||||
int32 i;
|
||||
char str[80];
|
||||
char temp[80];
|
||||
int32 function, scale;
|
||||
|
||||
for (i=0;i<MAXMOUSEBUTTONS;i++)
|
||||
{
|
||||
sprintf(str,"MouseButton%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString( scripthandle,"Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapButton( function, i, false );
|
||||
sprintf(str,"MouseButtonClicked%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString( scripthandle,"Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapButton( function, i, true );
|
||||
}
|
||||
// map over the axes
|
||||
for (i=0;i<MAXMOUSEAXES;i++)
|
||||
{
|
||||
sprintf(str,"MouseAnalogAxes%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_AnalogNameToNum(temp);
|
||||
if (function != -1)
|
||||
{
|
||||
CONTROL_MapAnalogAxis(i,function);
|
||||
}
|
||||
sprintf(str,"MouseDigitalAxes%ld_0",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapDigitalAxis( i, function, 0 );
|
||||
sprintf(str,"MouseDigitalAxes%ld_1",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapDigitalAxis( i, function, 1 );
|
||||
sprintf(str,"MouseAnalogScale%ld",i);
|
||||
SCRIPT_GetNumber(scripthandle, "Controls", str,&scale);
|
||||
CONTROL_SetAnalogAxisScale( i, scale );
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","MouseSensitivity",&function);
|
||||
CONTROL_SetMouseSensitivity(function);
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_SetupGamePad
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
void CONFIG_SetupGamePad( int32 scripthandle )
|
||||
{
|
||||
int32 i;
|
||||
char str[80];
|
||||
char temp[80];
|
||||
int32 function;
|
||||
|
||||
|
||||
for (i=0;i<MAXJOYBUTTONS;i++)
|
||||
{
|
||||
sprintf(str,"JoystickButton%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString( scripthandle,"Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapButton( function, i, false );
|
||||
sprintf(str,"JoystickButtonClicked%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString( scripthandle,"Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapButton( function, i, true );
|
||||
}
|
||||
// map over the axes
|
||||
for (i=0;i<MAXGAMEPADAXES;i++)
|
||||
{
|
||||
sprintf(str,"GamePadDigitalAxes%ld_0",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapDigitalAxis( i, function, 0 );
|
||||
sprintf(str,"GamePadDigitalAxes%ld_1",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapDigitalAxis( i, function, 1 );
|
||||
}
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","JoystickPort",&function);
|
||||
CONTROL_JoystickPort = function;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_SetupJoystick
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
void CONFIG_SetupJoystick( int32 scripthandle )
|
||||
{
|
||||
int32 i;
|
||||
char str[80];
|
||||
char temp[80];
|
||||
int32 function, scale;
|
||||
|
||||
for (i=0;i<MAXJOYBUTTONS;i++)
|
||||
{
|
||||
sprintf(str,"JoystickButton%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString( scripthandle,"Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapButton( function, i, false );
|
||||
sprintf(str,"JoystickButtonClicked%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString( scripthandle,"Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapButton( function, i, true );
|
||||
}
|
||||
// map over the axes
|
||||
for (i=0;i<MAXJOYAXES;i++)
|
||||
{
|
||||
sprintf(str,"JoystickAnalogAxes%ld",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_AnalogNameToNum(temp);
|
||||
if (function != -1)
|
||||
{
|
||||
CONTROL_MapAnalogAxis(i,function);
|
||||
}
|
||||
sprintf(str,"JoystickDigitalAxes%ld_0",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapDigitalAxis( i, function, 0 );
|
||||
sprintf(str,"JoystickDigitalAxes%ld_1",i);
|
||||
memset(temp,0,sizeof(temp));
|
||||
SCRIPT_GetString(scripthandle, "Controls", str,temp);
|
||||
function = CONFIG_FunctionNameToNum(temp);
|
||||
if (function != -1)
|
||||
CONTROL_MapDigitalAxis( i, function, 1 );
|
||||
sprintf(str,"JoystickAnalogScale%ld",i);
|
||||
SCRIPT_GetNumber(scripthandle, "Controls", str,&scale);
|
||||
CONTROL_SetAnalogAxisScale( i, scale );
|
||||
}
|
||||
// read in JoystickPort
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","JoystickPort",&function);
|
||||
CONTROL_JoystickPort = function;
|
||||
// read in rudder state
|
||||
SCRIPT_GetBoolean( scripthandle, "Controls","EnableRudder",&CONTROL_RudderEnabled);
|
||||
}
|
||||
|
||||
void readsavenames(void)
|
||||
{
|
||||
long dummy;
|
||||
short i;
|
||||
char fn[] = "game_.sav";
|
||||
FILE *fil;
|
||||
|
||||
for (i=0;i<10;i++)
|
||||
{
|
||||
fn[4] = i+'0';
|
||||
if ((fil = fopen(fn,"rb")) == NULL ) continue;
|
||||
dfread(&dummy,4,1,fil);
|
||||
|
||||
if(dummy != BYTEVERSION) return;
|
||||
dfread(&dummy,4,1,fil);
|
||||
dfread(&ud.savegame[i][0],19,1,fil);
|
||||
fclose(fil);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_ReadSetup
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
void CONFIG_ReadSetup( void )
|
||||
{
|
||||
char *dummy;
|
||||
int32 i;
|
||||
char commmacro[] = "CommbatMacro# ";
|
||||
|
||||
CONFIG_SetDefaults();
|
||||
return;
|
||||
|
||||
if (!SafeFileExists(setupfilename))
|
||||
{
|
||||
I_FatalError("ReadSetup: %s does not exist\n"
|
||||
" Please run SETUP.EXE\n",setupfilename);
|
||||
}
|
||||
scripthandle = SCRIPT_Load( setupfilename );
|
||||
|
||||
for(i = 0;i < 10;i++)
|
||||
{
|
||||
commmacro[13] = i+'0';
|
||||
SCRIPT_GetString( scripthandle, "Comm Setup",commmacro,&ud.ridecule[i][0]);
|
||||
}
|
||||
|
||||
SCRIPT_GetString( scripthandle, "Comm Setup","PlayerName",&myname[0]);
|
||||
|
||||
dummy = Args.CheckValue("-NAME");
|
||||
if( dummy ) strcpy(myname,dummy);
|
||||
dummy = Args.CheckValue("-MAP");
|
||||
if( dummy )
|
||||
{
|
||||
if (!VOLUMEONE)
|
||||
{
|
||||
strcpy(boardfilename,dummy);
|
||||
if( strchr(boardfilename,'.') == 0)
|
||||
strcat(boardfilename,".map");
|
||||
Printf("Using level: '%s'.\n",boardfilename);
|
||||
}
|
||||
else
|
||||
{
|
||||
Printf("The -map option is available in the registered version only!\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
boardfilename[0] = 0;
|
||||
}
|
||||
|
||||
SCRIPT_GetString( scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
|
||||
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "Shadows",&ud.shadows);
|
||||
SCRIPT_GetString( scripthandle, "Screen Setup","Password",&ud.pwlockout[0]);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "Detail",&ud.detail);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "Tilt",&ud.screen_tilting);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "Messages",&ud.fta_on);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenWidth",&ScreenWidth);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenHeight",&ScreenHeight);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenMode",&ScreenMode);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenGamma",&ud.brightness);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size);
|
||||
SCRIPT_GetNumber( scripthandle, "Screen Setup", "Out",&ud.lockout);
|
||||
|
||||
SCRIPT_GetNumber( scripthandle, "Misc", "Executions",&ud.executions);
|
||||
ud.executions++;
|
||||
SCRIPT_GetNumber( scripthandle, "Misc", "RunMode",&ud.auto_run);
|
||||
SCRIPT_GetNumber( scripthandle, "Misc", "Crosshairs",&ud.crosshair);
|
||||
if(ud.wchoice[0][0] == 0 && ud.wchoice[0][1] == 0)
|
||||
{
|
||||
ud.wchoice[0][0] = 3;
|
||||
ud.wchoice[0][1] = 4;
|
||||
ud.wchoice[0][2] = 5;
|
||||
ud.wchoice[0][3] = 7;
|
||||
ud.wchoice[0][4] = 8;
|
||||
ud.wchoice[0][5] = 6;
|
||||
ud.wchoice[0][6] = 0;
|
||||
ud.wchoice[0][7] = 2;
|
||||
ud.wchoice[0][8] = 9;
|
||||
ud.wchoice[0][9] = 1;
|
||||
|
||||
for(i=0;i<10;i++)
|
||||
{
|
||||
sprintf(buf,"WeaponChoice%ld",i);
|
||||
SCRIPT_GetNumber( scripthandle, "Misc", buf, &ud.wchoice[0][i]);
|
||||
}
|
||||
}
|
||||
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "FXDevice",&FXDevice);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "MusicDevice",&MusicDevice);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "FXVolume",&FXVolume);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "MusicVolume",&MusicVolume);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "SoundToggle",&SoundToggle);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "MusicToggle",&MusicToggle);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "VoiceToggle",&VoiceToggle);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "AmbienceToggle",&AmbienceToggle);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "NumVoices",&NumVoices);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "NumChannels",&NumChannels);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "NumBits",&NumBits);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "MixRate",&MixRate);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "MidiPort",&MidiPort);
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "BlasterAddress",&i);
|
||||
BlasterConfig.Address = i;
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "BlasterType",&i);
|
||||
BlasterConfig.Type = i;
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "BlasterInterrupt",&i);
|
||||
BlasterConfig.Interrupt = i;
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "BlasterDma8",&i);
|
||||
BlasterConfig.Dma8 = i;
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "BlasterDma16",&i);
|
||||
BlasterConfig.Dma16 = i;
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "BlasterEmu",&i);
|
||||
BlasterConfig.Emu = i;
|
||||
SCRIPT_GetNumber( scripthandle, "Sound Setup", "ReverseStereo",&i);
|
||||
ReverseStereo = i;
|
||||
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","ControllerType",&ControllerType);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","MouseAimingFlipped",&ud.mouseflip);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","MouseAiming",&MouseAiming);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","GameMouseAiming",(int32 *)&ps[0].aim_mode);
|
||||
SCRIPT_GetNumber( scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode);
|
||||
|
||||
CONTROL_ClearAssignments();
|
||||
|
||||
CONFIG_ReadKeys();
|
||||
|
||||
switch (ControllerType)
|
||||
{
|
||||
case controltype_keyboardandmouse:
|
||||
CONFIG_SetupMouse(scripthandle);
|
||||
break;
|
||||
default:
|
||||
CONFIG_SetupMouse(scripthandle);
|
||||
case controltype_keyboardandjoystick:
|
||||
case controltype_keyboardandflightstick:
|
||||
case controltype_keyboardandthrustmaster:
|
||||
CONFIG_SetupJoystick(scripthandle);
|
||||
break;
|
||||
case controltype_keyboardandgamepad:
|
||||
CONFIG_SetupGamePad(scripthandle);
|
||||
break;
|
||||
|
||||
}
|
||||
setupread = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
=
|
||||
= CONFIG_WriteSetup
|
||||
=
|
||||
===================
|
||||
*/
|
||||
|
||||
void CONFIG_WriteSetup( void )
|
||||
{
|
||||
int32 dummy;
|
||||
|
||||
if (!setupread) return;
|
||||
|
||||
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Shadows",ud.shadows,false,false);
|
||||
SCRIPT_PutString( scripthandle, "Screen Setup", "Password",ud.pwlockout);
|
||||
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Detail",ud.detail,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Tilt",ud.screen_tilting,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Messages",ud.fta_on,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Screen Setup", "Out",ud.lockout,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Sound Setup", "FXVolume",FXVolume,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicVolume",MusicVolume,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Sound Setup", "SoundToggle",SoundToggle,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Sound Setup", "VoiceToggle",VoiceToggle,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Sound Setup", "AmbienceToggle",AmbienceToggle,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Sound Setup", "MusicToggle",MusicToggle,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Sound Setup", "ReverseStereo",ReverseStereo,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenSize",ud.screen_size,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Screen Setup", "ScreenGamma",ud.brightness,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Misc", "Executions",ud.executions,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Misc", "RunMode",ud.auto_run,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Misc", "Crosshairs",ud.crosshair,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls", "MouseAimingFlipped",ud.mouseflip,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","MouseAiming",MouseAiming,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","GameMouseAiming",(int32) ps[myconnectindex].aim_mode,false,false);
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","AimingFlag",(long) myaimmode,false,false);
|
||||
|
||||
for(dummy=0;dummy<10;dummy++)
|
||||
{
|
||||
sprintf(buf,"WeaponChoice%ld",dummy);
|
||||
SCRIPT_PutNumber( scripthandle, "Misc",buf,ud.wchoice[myconnectindex][dummy],false,false);
|
||||
}
|
||||
|
||||
switch (ControllerType)
|
||||
{
|
||||
case controltype_keyboardandmouse:
|
||||
dummy = CONTROL_GetMouseSensitivity();
|
||||
SCRIPT_PutNumber( scripthandle, "Controls","MouseSensitivity",dummy,false,false);
|
||||
break;
|
||||
}
|
||||
SCRIPT_Save (scripthandle, setupfilename);
|
||||
SCRIPT_Free (scripthandle);
|
||||
}
|
||||
|
194
source/CONTROL.H
Normal file
194
source/CONTROL.H
Normal file
|
@ -0,0 +1,194 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
||||
|
||||
Duke Nukem 3D 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1996 - Todd Replogle
|
||||
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
//***************************************************************************
|
||||
//
|
||||
// Public header for CONTROL.C.
|
||||
//
|
||||
//***************************************************************************
|
||||
|
||||
#ifndef _control_public
|
||||
#define _control_public
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
//
|
||||
// DEFINES
|
||||
//
|
||||
//***************************************************************************
|
||||
|
||||
#define MaxJoys 2
|
||||
#define MAXGAMEBUTTONS 64
|
||||
|
||||
//***************************************************************************
|
||||
//
|
||||
// TYPEDEFS
|
||||
//
|
||||
//***************************************************************************
|
||||
typedef enum
|
||||
{
|
||||
axis_up,
|
||||
axis_down,
|
||||
axis_left,
|
||||
axis_right
|
||||
} axisdirection;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
analog_turning=0,
|
||||
analog_strafing=1,
|
||||
analog_lookingupanddown=2,
|
||||
analog_elevation=3,
|
||||
analog_rolling=4,
|
||||
analog_moving=5,
|
||||
analog_maxtype
|
||||
} analogcontrol;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
dir_North,
|
||||
dir_NorthEast,
|
||||
dir_East,
|
||||
dir_SouthEast,
|
||||
dir_South,
|
||||
dir_SouthWest,
|
||||
dir_West,
|
||||
dir_NorthWest,
|
||||
dir_None
|
||||
} direction;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool button0;
|
||||
bool button1;
|
||||
direction dir;
|
||||
} UserInput;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
fixed dx;
|
||||
fixed dy;
|
||||
fixed dz;
|
||||
fixed dyaw;
|
||||
fixed dpitch;
|
||||
fixed droll;
|
||||
} ControlInfo;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
controltype_keyboard,
|
||||
controltype_keyboardandmouse,
|
||||
controltype_keyboardandjoystick,
|
||||
controltype_keyboardandexternal,
|
||||
controltype_keyboardandgamepad,
|
||||
controltype_keyboardandflightstick,
|
||||
controltype_keyboardandthrustmaster
|
||||
} controltype;
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
//
|
||||
// GLOBALS
|
||||
//
|
||||
//***************************************************************************
|
||||
|
||||
extern bool CONTROL_RudderEnabled;
|
||||
extern bool CONTROL_MousePresent;
|
||||
extern bool CONTROL_JoysPresent[ MaxJoys ];
|
||||
extern bool CONTROL_MouseEnabled;
|
||||
extern bool CONTROL_JoystickEnabled;
|
||||
extern byte CONTROL_JoystickPort;
|
||||
extern uint32 CONTROL_ButtonState1;
|
||||
extern uint32 CONTROL_ButtonHeldState1;
|
||||
extern uint32 CONTROL_ButtonState2;
|
||||
extern uint32 CONTROL_ButtonHeldState2;
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
//
|
||||
// PROTOTYPES
|
||||
//
|
||||
//***************************************************************************
|
||||
|
||||
void CONTROL_MapKey( int32 which, kb_scancode key1, kb_scancode key2 );
|
||||
void CONTROL_MapButton
|
||||
(
|
||||
int32 whichfunction,
|
||||
int32 whichbutton,
|
||||
bool doubleclicked
|
||||
);
|
||||
void CONTROL_DefineFlag( int32 which, bool toggle );
|
||||
bool CONTROL_FlagActive( int32 which );
|
||||
void CONTROL_ClearAssignments( void );
|
||||
void CONTROL_GetUserInput( UserInput *info );
|
||||
void CONTROL_GetInput( ControlInfo *info );
|
||||
void CONTROL_ClearUserInput( UserInput *info );
|
||||
void CONTROL_WaitRelease( void );
|
||||
void CONTROL_Ack( void );
|
||||
void CONTROL_CenterJoystick
|
||||
(
|
||||
void ( *CenterCenter )( void ),
|
||||
void ( *UpperLeft )( void ),
|
||||
void ( *LowerRight )( void ),
|
||||
void ( *CenterThrottle )( void ),
|
||||
void ( *CenterRudder )( void )
|
||||
);
|
||||
int32 CONTROL_GetMouseSensitivity( void );
|
||||
void CONTROL_SetMouseSensitivity( int32 newsensitivity );
|
||||
void CONTROL_Startup
|
||||
(
|
||||
controltype which,
|
||||
int32 ( *TimeFunction )( void ),
|
||||
int32 ticspersecond
|
||||
);
|
||||
void CONTROL_Shutdown( void );
|
||||
|
||||
void CONTROL_MapAnalogAxis
|
||||
(
|
||||
int32 whichaxis,
|
||||
int32 whichanalog
|
||||
);
|
||||
|
||||
void CONTROL_MapDigitalAxis
|
||||
(
|
||||
int32 whichaxis,
|
||||
int32 whichfunction,
|
||||
int32 direction
|
||||
);
|
||||
void CONTROL_SetAnalogAxisScale
|
||||
(
|
||||
int32 whichaxis,
|
||||
int32 axisscale
|
||||
);
|
||||
void CONTROL_PrintAxes( void );
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif
|
65
source/DEVELOP.H
Normal file
65
source/DEVELOP.H
Normal file
|
@ -0,0 +1,65 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
||||
|
||||
Duke Nukem 3D 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1996 - Todd Replogle
|
||||
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef _develop_public
|
||||
#define _develop_public
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DEVELOPMENT 0
|
||||
#define SHAREWARE 0
|
||||
#define LOCATIONINFO 1
|
||||
#define SOFTWAREERROR 1
|
||||
#define MEMORYCORRUPTIONTEST 1
|
||||
#define PRECACHETEST 0
|
||||
#define DATACORRUPTIONTEST 0
|
||||
#define RANDOMNUMBERTEST 0
|
||||
|
||||
|
||||
#if ( LOCATIONINFO == 1 )
|
||||
|
||||
#define funcstart() \
|
||||
{ \
|
||||
SoftError( "funcstart : module '%s' at line %d.\n", __FILE__, __LINE__ );\
|
||||
}
|
||||
|
||||
#define funcend() \
|
||||
{ \
|
||||
SoftError( " funcend : module '%s' at line %d.\n", __FILE__, __LINE__ );\
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define funcstart()
|
||||
#define funcend()
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif
|
242
source/DUKE3D.CFG
Normal file
242
source/DUKE3D.CFG
Normal file
|
@ -0,0 +1,242 @@
|
|||
[Setup]
|
||||
;Setup File for Duke Nukem 3D
|
||||
SetupVersion = "1.4"
|
||||
;
|
||||
;
|
||||
[Screen Setup]
|
||||
;
|
||||
;
|
||||
;ScreenMode
|
||||
; - Chained - 0
|
||||
; - Vesa 2.0 - 1
|
||||
; - Screen Buffered - 2
|
||||
; - Tseng optimized - 3
|
||||
; - Paradise optimized - 4
|
||||
; - S3 optimized - 5
|
||||
; - RedBlue Stereo - 7
|
||||
; - Crystal Eyes - 6
|
||||
;
|
||||
;ScreenWidth passed to engine
|
||||
;
|
||||
;ScreenHeight passed to engine
|
||||
;
|
||||
;
|
||||
ScreenMode = 2
|
||||
ScreenWidth = 320
|
||||
ScreenHeight = 200
|
||||
;
|
||||
;
|
||||
[Sound Setup]
|
||||
;
|
||||
;
|
||||
FXDevice = 13
|
||||
MusicDevice = 13
|
||||
FXVolume = 220
|
||||
MusicVolume = 200
|
||||
NumVoices = 8
|
||||
NumChannels = 2
|
||||
NumBits = 1
|
||||
MixRate = 11000
|
||||
MidiPort = 0x330
|
||||
BlasterAddress = 0x220
|
||||
BlasterType = 3
|
||||
BlasterInterrupt = 5
|
||||
BlasterDma8 = 1
|
||||
BlasterDma16 = 5
|
||||
BlasterEmu = 0x620
|
||||
ReverseStereo = 0
|
||||
;
|
||||
;
|
||||
[KeyDefinitions]
|
||||
;
|
||||
;
|
||||
Move_Forward = "Up" "Kpad8"
|
||||
Move_Backward = "Down" "Kpad2"
|
||||
Turn_Left = "Left" "Kpad4"
|
||||
Turn_Right = "Right" "KPad6"
|
||||
Strafe = "LAlt" "RAlt"
|
||||
Fire = "LCtrl" "RCtrl"
|
||||
Open = "Space" ""
|
||||
Run = "LShift" "RShift"
|
||||
AutoRun = "CapLck" ""
|
||||
Jump = "A" "/"
|
||||
Crouch = "Z" ""
|
||||
Look_Up = "PgUp" "Kpad9"
|
||||
Look_Down = "PgDn" "Kpad3"
|
||||
Look_Left = "Insert" "Kpad0"
|
||||
Look_Right = "Delete" "Kpad."
|
||||
Strafe_Left = "," ""
|
||||
Strafe_Right = "." ""
|
||||
Aim_Up = "Home" "KPad7"
|
||||
Aim_Down = "End" "Kpad1"
|
||||
Weapon_1 = "1" ""
|
||||
Weapon_2 = "2" ""
|
||||
Weapon_3 = "3" ""
|
||||
Weapon_4 = "4" ""
|
||||
Weapon_5 = "5" ""
|
||||
Weapon_6 = "6" ""
|
||||
Weapon_7 = "7" ""
|
||||
Weapon_8 = "8" ""
|
||||
Weapon_9 = "9" ""
|
||||
Weapon_10 = "0" ""
|
||||
Inventory = "Enter" "KpdEnt"
|
||||
Inventory_Left = "[" ""
|
||||
Inventory_Right = "]" ""
|
||||
Holo_Duke = "H" ""
|
||||
Jetpack = "J" ""
|
||||
NightVision = "N" ""
|
||||
MedKit = "M" ""
|
||||
TurnAround = "BakSpc" ""
|
||||
SendMessage = "T" ""
|
||||
Map = "Tab" ""
|
||||
Shrink_Screen = "-" "Kpad-"
|
||||
Enlarge_Screen = "=" "Kpad+"
|
||||
Center_View = "KPad5" ""
|
||||
Holster_Weapon = "ScrLck" ""
|
||||
Show_Opponents_Weapon = "W" ""
|
||||
Map_Follow_Mode = "F" ""
|
||||
See_Coop_View = "K" ""
|
||||
Mouse_Aiming = "U" ""
|
||||
Toggle_Crosshair = "I" ""
|
||||
Steroids = "R" ""
|
||||
Quick_Kick = "`" ""
|
||||
Next_Weapon = "'" ""
|
||||
Previous_Weapon = ";" ""
|
||||
;
|
||||
;
|
||||
[Controls]
|
||||
;
|
||||
;
|
||||
;Controls
|
||||
;
|
||||
;ControllerType
|
||||
; - Keyboard - 0
|
||||
; - Keyboard and Mouse - 1
|
||||
; - Keyboard and Joystick - 2
|
||||
; - Keyboard and Gamepad - 4
|
||||
; - Keyboard and External - 3
|
||||
; - Keyboard and FlightStick - 5
|
||||
; - Keyboard and ThrustMaster - 6
|
||||
;
|
||||
;
|
||||
ControllerType = 1
|
||||
JoystickPort = 0
|
||||
MouseSensitivity = 32768
|
||||
ExternalFilename = "EXTERNAL.EXE"
|
||||
EnableRudder = 0
|
||||
MouseAiming = 0
|
||||
MouseAimingFlipped = 0
|
||||
MouseButton0 = "Fire"
|
||||
MouseButtonClicked0 = ""
|
||||
MouseButton1 = "Strafe"
|
||||
MouseButtonClicked1 = "Open"
|
||||
MouseButton2 = "Move_Forward"
|
||||
MouseButtonClicked2 = ""
|
||||
JoystickButton0 = "Fire"
|
||||
JoystickButtonClicked0 = ""
|
||||
JoystickButton1 = "Strafe"
|
||||
JoystickButtonClicked1 = "Inventory"
|
||||
JoystickButton2 = "Run"
|
||||
JoystickButtonClicked2 = "Jump"
|
||||
JoystickButton3 = "Open"
|
||||
JoystickButtonClicked3 = "Crouch"
|
||||
JoystickButton4 = "Aim_Down"
|
||||
JoystickButtonClicked4 = ""
|
||||
JoystickButton5 = "Look_Right"
|
||||
JoystickButtonClicked5 = ""
|
||||
JoystickButton6 = "Aim_Up"
|
||||
JoystickButtonClicked6 = ""
|
||||
JoystickButton7 = "Look_Left"
|
||||
JoystickButtonClicked7 = ""
|
||||
MouseAnalogAxes0 = "analog_turning"
|
||||
MouseDigitalAxes0_0 = ""
|
||||
MouseDigitalAxes0_1 = ""
|
||||
MouseAnalogScale0 = 65536
|
||||
MouseAnalogAxes1 = "analog_moving"
|
||||
MouseDigitalAxes1_0 = ""
|
||||
MouseDigitalAxes1_1 = ""
|
||||
MouseAnalogScale1 = 65536
|
||||
JoystickAnalogAxes0 = "analog_turning"
|
||||
JoystickDigitalAxes0_0 = ""
|
||||
JoystickDigitalAxes0_1 = ""
|
||||
JoystickAnalogScale0 = 65536
|
||||
JoystickAnalogAxes1 = "analog_moving"
|
||||
JoystickDigitalAxes1_0 = ""
|
||||
JoystickDigitalAxes1_1 = ""
|
||||
JoystickAnalogScale1 = 65536
|
||||
JoystickAnalogAxes2 = "analog_strafing"
|
||||
JoystickDigitalAxes2_0 = ""
|
||||
JoystickDigitalAxes2_1 = ""
|
||||
JoystickAnalogScale2 = 65536
|
||||
JoystickAnalogAxes3 = ""
|
||||
JoystickDigitalAxes3_0 = "Run"
|
||||
JoystickDigitalAxes3_1 = ""
|
||||
JoystickAnalogScale3 = 65536
|
||||
GamePadDigitalAxes0_0 = "Turn_Left"
|
||||
GamePadDigitalAxes0_1 = "Turn_Right"
|
||||
GamePadDigitalAxes1_0 = "Move_Forward"
|
||||
GamePadDigitalAxes1_1 = "Move_Backward"
|
||||
;
|
||||
;
|
||||
[Comm Setup]
|
||||
;
|
||||
;
|
||||
ComPort = 2
|
||||
IrqNumber = ~
|
||||
UartAddress = ~
|
||||
PortSpeed = 9600
|
||||
ToneDial = 1
|
||||
SocketNumber = ~
|
||||
NumberPlayers = 2
|
||||
ModemName = ""
|
||||
InitString = "ATZ"
|
||||
HangupString = "ATH0=0"
|
||||
DialoutString = ""
|
||||
PlayerName = "DUKE"
|
||||
RTSName = "DUKE.RTS"
|
||||
RTSPath = ".\"
|
||||
UserPath = ".\"
|
||||
PhoneNumber = ""
|
||||
ConnectType = 0
|
||||
CommbatMacro#0 = "An inspiration for birth control."
|
||||
CommbatMacro#1 = "You're gonna die for that!"
|
||||
CommbatMacro#2 = "It hurts to be you."
|
||||
CommbatMacro#3 = "Lucky Son of a Bitch."
|
||||
CommbatMacro#4 = "Hmmm....Payback time."
|
||||
CommbatMacro#5 = "You bottom dwelling scum sucker."
|
||||
CommbatMacro#6 = "Damn, you're ugly."
|
||||
CommbatMacro#7 = "Ha ha ha...Wasted!"
|
||||
CommbatMacro#8 = "You suck!"
|
||||
CommbatMacro#9 = "AARRRGHHHHH!!!"
|
||||
PhoneName#0 = ""
|
||||
PhoneNumber#0 = ""
|
||||
PhoneName#1 = ""
|
||||
PhoneNumber#1 = ""
|
||||
PhoneName#2 = ""
|
||||
PhoneNumber#2 = ""
|
||||
PhoneName#3 = ""
|
||||
PhoneNumber#3 = ""
|
||||
PhoneName#4 = ""
|
||||
PhoneNumber#4 = ""
|
||||
PhoneName#5 = ""
|
||||
PhoneNumber#5 = ""
|
||||
PhoneName#6 = ""
|
||||
PhoneNumber#6 = ""
|
||||
PhoneName#7 = ""
|
||||
PhoneNumber#7 = ""
|
||||
PhoneName#8 = ""
|
||||
PhoneNumber#8 = ""
|
||||
PhoneName#9 = ""
|
||||
PhoneNumber#9 = ""
|
||||
PhoneName#10 = ""
|
||||
PhoneNumber#10 = ""
|
||||
PhoneName#11 = ""
|
||||
PhoneNumber#11 = ""
|
||||
PhoneName#12 = ""
|
||||
PhoneNumber#12 = ""
|
||||
PhoneName#13 = ""
|
||||
PhoneNumber#13 = ""
|
||||
PhoneName#14 = ""
|
||||
PhoneNumber#14 = ""
|
||||
PhoneName#15 = ""
|
||||
PhoneNumber#15 = ""
|
568
source/DUKE3D.H
Normal file
568
source/DUKE3D.H
Normal file
|
@ -0,0 +1,568 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
||||
|
||||
Duke Nukem 3D 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1996 - Todd Replogle
|
||||
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <dos.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.H>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include "pragmas.h"
|
||||
#include "function.h"
|
||||
#include "build.h"
|
||||
#include "multi.h"
|
||||
#include "win32.h"
|
||||
|
||||
#if _MSC_VER
|
||||
#pragma warning(disable:4244) // conversion from 'biggertype' to 'smallertype', possible loss of data
|
||||
#endif
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) ((a)<(b)?(a):(b))
|
||||
#define max(a,b) ((a)>(b)?(a):(b))
|
||||
#endif
|
||||
|
||||
//#define VOLUMEALL
|
||||
//#define PLUTOPAK
|
||||
// #define VOLUMEONE
|
||||
// #define ONELEVELDEMO
|
||||
|
||||
// #define TEN
|
||||
// #define BETA
|
||||
|
||||
// #define AUSTRALIA
|
||||
|
||||
extern bool VOLUMEONE;
|
||||
extern bool PLUTOPAK;
|
||||
extern bool VOLUMEALL;
|
||||
extern bool ONELEVELDEMO;
|
||||
|
||||
#define MAXSLEEPDIST 16384
|
||||
#define SLEEPTIME 24*64
|
||||
|
||||
#define VERSION "1.5"
|
||||
|
||||
|
||||
//#ifndef VOLUMEONE
|
||||
#define BYTEVERSION 117
|
||||
//#else
|
||||
// #define BYTEVERSION 27
|
||||
//#endif
|
||||
|
||||
#define NUMPAGES 1
|
||||
|
||||
#define AUTO_AIM_ANGLE 48
|
||||
#define RECSYNCBUFSIZ 2520 //2520 is the (LCM of 1-8)*3
|
||||
#define MOVEFIFOSIZ 256
|
||||
|
||||
#define FOURSLEIGHT (1<<8)
|
||||
|
||||
#include "types.h"
|
||||
#include "file_lib.h"
|
||||
#include "develop.h"
|
||||
#include "gamedefs.h"
|
||||
#include "keyboard.h"
|
||||
#include "util_lib.h"
|
||||
#include "function.h"
|
||||
#include "fx_man.h"
|
||||
#include "config.h"
|
||||
#include "sounds.h"
|
||||
#include "control.h"
|
||||
#include "_rts.h"
|
||||
#include "rts.h"
|
||||
#include "soundefs.h"
|
||||
|
||||
|
||||
#include "task_man.h"
|
||||
#include "music.h"
|
||||
#include "sndcards.h"
|
||||
|
||||
#include "names.h"
|
||||
#include "funct.h"
|
||||
|
||||
|
||||
#define TICRATE (120)
|
||||
#define TICSPERFRAME (TICRATE/26)
|
||||
|
||||
// #define GC (TICSPERFRAME*44)
|
||||
|
||||
#define NUM_SOUNDS 450
|
||||
|
||||
#ifdef _MSC_VER
|
||||
__inline int sgn (int v)
|
||||
{
|
||||
return v < 0 ? -1 : v > 0 ? 1 : 0;
|
||||
}
|
||||
#else
|
||||
#pragma aux sgn =\
|
||||
"add ebx, ebx",\
|
||||
"sbb eax, eax",\
|
||||
"cmp eax, ebx",\
|
||||
"adc eax, 0",\
|
||||
parm [ebx]\
|
||||
|
||||
#endif
|
||||
|
||||
#define ALT_IS_PRESSED ( 0 )
|
||||
#define SHIFTS_IS_PRESSED ( 0 )
|
||||
#define RANDOMSCRAP EGS(s->sectnum,s->x+(TRAND&255)-128,s->y+(TRAND&255)-128,s->z-(8<<8)-(TRAND&8191),SCRAP6+(TRAND&15),-8,48,48,TRAND&2047,(TRAND&63)+64,-512-(TRAND&2047),i,5)
|
||||
|
||||
#define BLACK 0
|
||||
#define DARKBLUE 1
|
||||
#define DARKGREEN 2
|
||||
#define DARKCYAN 3
|
||||
#define DARKRED 4
|
||||
#define DARKPURPLE 5
|
||||
#define BROWN 6
|
||||
#define LIGHTGRAY 7
|
||||
|
||||
#define DARKGRAY 8
|
||||
#define BLUE 9
|
||||
#define GREEN 10
|
||||
#define CYAN 11
|
||||
#define RED 12
|
||||
#define PURPLE 13
|
||||
#define YELLOW 14
|
||||
#define WHITE 15
|
||||
|
||||
#define PHEIGHT (38<<8)
|
||||
|
||||
// #define P(X) Printf("%ld\n",X);
|
||||
|
||||
#define WAIT(X) ototalclock=totalclock+(X);while(totalclock<ototalclock)
|
||||
|
||||
|
||||
#define MODE_MENU 1
|
||||
#define MODE_DEMO 2
|
||||
#define MODE_GAME 4
|
||||
#define MODE_EOL 8
|
||||
#define MODE_TYPE 16
|
||||
#define MODE_RESTART 32
|
||||
#define MODE_SENDTOWHOM 64
|
||||
#define MODE_END 128
|
||||
|
||||
|
||||
#define MAXANIMWALLS 512
|
||||
#define MAXINTERPOLATIONS 2048
|
||||
#define NUMOFFIRSTTIMEACTIVE 192
|
||||
|
||||
#define MAXCYCLERS 256
|
||||
#define MAXSCRIPTSIZE 20460
|
||||
#define MAXANIMATES 64
|
||||
|
||||
/*
|
||||
#define SP sprite[i].yvel
|
||||
#define SX sprite[i].x
|
||||
#define SY sprite[i].y
|
||||
#define SZ sprite[i].z
|
||||
#define SS sprite[i].shade
|
||||
#define PN sprite[i].picnum
|
||||
#define SA sprite[i].ang
|
||||
#define SV sprite[i].xvel
|
||||
#define ZV sprite[i].zvel
|
||||
#define RX sprite[i].xrepeat
|
||||
#define RY sprite[i].yrepeat
|
||||
#define OW sprite[i].owner
|
||||
#define CS sprite[i].cstat
|
||||
#define SH sprite[i].extra
|
||||
#define CX sprite[i].xoffset
|
||||
#define CY sprite[i].yoffset
|
||||
#define CD sprite[i].clipdist
|
||||
#define PL sprite[i].pal
|
||||
#define SLT sprite[i].lotag
|
||||
#define SHT sprite[i].hitag
|
||||
#define SECT sprite[i].sectnum
|
||||
*/
|
||||
|
||||
#define face_player 1
|
||||
#define geth 2
|
||||
#define getv 4
|
||||
#define random_angle 8
|
||||
#define face_player_slow 16
|
||||
#define spin 32
|
||||
#define face_player_smart 64
|
||||
#define fleeenemy 128
|
||||
#define jumptoplayer 257
|
||||
#define seekplayer 512
|
||||
#define furthestdir 1024
|
||||
#define dodgebullet 4096
|
||||
|
||||
#define TRAND krand()
|
||||
|
||||
|
||||
#define MAX_WEAPONS 12
|
||||
|
||||
#define KNEE_WEAPON 0
|
||||
#define PISTOL_WEAPON 1
|
||||
#define SHOTGUN_WEAPON 2
|
||||
#define CHAINGUN_WEAPON 3
|
||||
#define RPG_WEAPON 4
|
||||
#define HANDBOMB_WEAPON 5
|
||||
#define SHRINKER_WEAPON 6
|
||||
#define DEVISTATOR_WEAPON 7
|
||||
#define TRIPBOMB_WEAPON 8
|
||||
#define FREEZE_WEAPON 9
|
||||
#define HANDREMOTE_WEAPON 10
|
||||
#define GROW_WEAPON 11
|
||||
|
||||
/*
|
||||
#define T1 hittype[i].temp_data[0]
|
||||
#define T2 hittype[i].temp_data[1]
|
||||
#define T3 hittype[i].temp_data[2]
|
||||
#define T4 hittype[i].temp_data[3]
|
||||
#define T5 hittype[i].temp_data[4]
|
||||
#define T6 hittype[i].temp_data[5]
|
||||
*/
|
||||
|
||||
#define IFWITHIN(B,E) if((sprite[i].picnum)>=(B) && (sprite[i].picnum)<=(E))
|
||||
#define KILLIT(KX) {deletesprite(KX);goto BOLT;}
|
||||
|
||||
|
||||
#define IFMOVING if(ssp(i,CLIPMASK0))
|
||||
#define IFHIT j=ifhitbyweapon(i);if(j >= 0)
|
||||
#define IFHITSECT j=ifhitsectors(s->sectnum);if(j >= 0)
|
||||
|
||||
#define AFLAMABLE(X) (X==BOX||X==TREE1||X==TREE2||X==TIRE||X==CONE)
|
||||
|
||||
|
||||
#define IFSKILL1 if(player_skill<1)
|
||||
#define IFSKILL2 if(player_skill<2)
|
||||
#define IFSKILL3 if(player_skill<3)
|
||||
#define IFSKILL4 if(player_skill<4)
|
||||
|
||||
#define rnd(X) ((TRAND>>8)>=(255-(X)))
|
||||
|
||||
#define __USRHOOKS_H
|
||||
|
||||
enum USRHOOKS_Errors
|
||||
{
|
||||
USRHOOKS_Warning = -2,
|
||||
USRHOOKS_Error = -1,
|
||||
USRHOOKS_Ok = 0
|
||||
};
|
||||
|
||||
#pragma pack(push,1)
|
||||
typedef struct
|
||||
{
|
||||
signed char avel, horz;
|
||||
short fvel, svel;
|
||||
unsigned long bits;
|
||||
} input;
|
||||
#pragma pack(pop)
|
||||
|
||||
extern bool dukever13;
|
||||
|
||||
extern input inputfifo[MOVEFIFOSIZ][MAXPLAYERS], sync[MAXPLAYERS];
|
||||
extern input recsync[RECSYNCBUFSIZ];
|
||||
|
||||
extern long movefifosendplc;
|
||||
|
||||
struct animwalltype
|
||||
{
|
||||
short wallnum;
|
||||
long tag;
|
||||
};
|
||||
extern struct animwalltype animwall[MAXANIMWALLS];
|
||||
extern short numanimwalls,probey,lastprobey;
|
||||
|
||||
extern char *mymembuf;
|
||||
extern char typebuflen,typebuf[41];
|
||||
extern long msx[2048],msy[2048];
|
||||
extern short cyclers[MAXCYCLERS][6],numcyclers;
|
||||
extern char myname[32];
|
||||
|
||||
struct user_defs
|
||||
{
|
||||
char god,warp_on,cashman,eog,showallmap;
|
||||
char show_help,scrollmode,clipping;
|
||||
char user_name[MAXPLAYERS][32];
|
||||
char ridecule[10][40];
|
||||
char savegame[10][22];
|
||||
char pwlockout[128],rtsname[128];
|
||||
char overhead_on,last_overhead,showweapons;
|
||||
|
||||
short pause_on,from_bonus;
|
||||
short camerasprite,last_camsprite;
|
||||
short last_level,secretlevel;
|
||||
|
||||
long const_visibility,uw_framerate;
|
||||
long camera_time,folfvel,folavel,folx,foly,fola;
|
||||
long reccnt;
|
||||
|
||||
int32 entered_name,screen_tilting,shadows,fta_on,executions,auto_run;
|
||||
int32 coords,tickrate,m_coop,coop,screen_size,lockout,crosshair;
|
||||
int32 wchoice[MAXPLAYERS][MAX_WEAPONS],playerai;
|
||||
|
||||
int32 respawn_monsters,respawn_items,respawn_inventory,recstat,monsters_off,brightness;
|
||||
int32 m_respawn_items,m_respawn_monsters,m_respawn_inventory,m_recstat,m_monsters_off,detail;
|
||||
int32 m_ffire,ffire,m_player_skill,m_level_number,m_volume_number,multimode;
|
||||
int32 player_skill,level_number,volume_number,m_marker,marker,mouseflip;
|
||||
|
||||
};
|
||||
|
||||
struct player_orig
|
||||
{
|
||||
long ox,oy,oz;
|
||||
short oa,os;
|
||||
};
|
||||
|
||||
|
||||
extern char numplayersprites;
|
||||
extern char picsiz[MAXTILES];
|
||||
|
||||
void add_ammo( short, short, short, short );
|
||||
|
||||
|
||||
extern long fricxv,fricyv;
|
||||
|
||||
struct player_struct
|
||||
{
|
||||
long zoom,exitx,exity,loogiex[64],loogiey[64],numloogs,loogcnt;
|
||||
long posx, posy, posz, horiz, ohoriz, ohorizoff, invdisptime;
|
||||
long bobposx,bobposy,oposx,oposy,oposz,pyoff,opyoff;
|
||||
long posxv,posyv,poszv,last_pissed_time,truefz,truecz;
|
||||
long player_par,visibility;
|
||||
long bobcounter,weapon_sway;
|
||||
long pals_time,randomflamex,crack_time;
|
||||
|
||||
int32 aim_mode;
|
||||
|
||||
short ang,oang,angvel,cursectnum,look_ang,last_extra,subweapon;
|
||||
short ammo_amount[MAX_WEAPONS],wackedbyactor,frag,fraggedself;
|
||||
|
||||
short curr_weapon, last_weapon, tipincs, horizoff, wantweaponfire;
|
||||
short holoduke_amount,newowner,hurt_delay,hbomb_hold_delay;
|
||||
short jumping_counter,airleft,knee_incs,access_incs;
|
||||
short fta,ftq,access_wallnum,access_spritenum;
|
||||
short kickback_pic,got_access,weapon_ang,firstaid_amount;
|
||||
short somethingonplayer,on_crane,i,one_parallax_sectnum;
|
||||
short over_shoulder_on,random_club_frame,fist_incs;
|
||||
short one_eighty_count,cheat_phase;
|
||||
short dummyplayersprite,extra_extra8,quick_kick;
|
||||
short heat_amount,actorsqu,timebeforeexit,customexitsound;
|
||||
|
||||
short weaprecs[16],weapreccnt,interface_toggle_flag;
|
||||
|
||||
short rotscrnang,dead_flag,show_empty_weapon;
|
||||
short scuba_amount,jetpack_amount,steroids_amount,shield_amount;
|
||||
short holoduke_on,pycount,weapon_pos,frag_ps;
|
||||
short transporter_hold,last_full_weapon,footprintshade,boot_amount;
|
||||
|
||||
int scream_voice;
|
||||
|
||||
char gm,on_warping_sector,footprintcount;
|
||||
char hbomb_on,jumping_toggle,rapid_fire_hold,on_ground;
|
||||
char name[32],inven_icon,buttonpalette;
|
||||
|
||||
char jetpack_on,spritebridge,lastrandomspot;
|
||||
char scuba_on,footprintpal,heat_on;
|
||||
|
||||
char holster_weapon,falling_counter;
|
||||
char gotweapon[MAX_WEAPONS],refresh_inventory,*palette;
|
||||
|
||||
char toggle_key_flag,knuckle_incs; // ,select_dir;
|
||||
char walking_snd_toggle, palookup, hard_landing;
|
||||
char max_secret_rooms,secret_rooms,/*fire_flag,*/pals[3];
|
||||
char max_actors_killed,actors_killed,return_to_center;
|
||||
};
|
||||
|
||||
extern unsigned char tempbuf[2048], packbuf[576];
|
||||
|
||||
extern long gc,max_player_health,max_armour_amount,max_ammo_amount[MAX_WEAPONS];
|
||||
|
||||
extern long impact_damage,respawnactortime,respawnitemtime;
|
||||
|
||||
#define MOVFIFOSIZ 256
|
||||
|
||||
extern short spriteq[1024],spriteqloc,spriteqamount;
|
||||
extern struct player_struct ps[MAXPLAYERS];
|
||||
extern struct player_orig po[MAXPLAYERS];
|
||||
extern struct user_defs ud;
|
||||
extern short int moustat;
|
||||
extern short int global_random;
|
||||
extern long scaredfallz;
|
||||
extern char buf[80]; //My own generic input buffer
|
||||
|
||||
extern char fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
|
||||
extern char scantoasc[128],ready2send;
|
||||
extern char scantoascwithshift[128];
|
||||
|
||||
extern fx_device device;
|
||||
extern int32 VoiceToggle,AmbienceToggle;
|
||||
|
||||
extern char playerreadyflag[MAXPLAYERS],playerquitflag[MAXPLAYERS];
|
||||
|
||||
extern long script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt;
|
||||
extern char *label,*textptr,error,warning,killit_flag;
|
||||
extern long *actorscrptr[MAXTILES],*parsing_actor;
|
||||
extern char actortype[MAXTILES];
|
||||
extern char *music_pointer;
|
||||
|
||||
extern char ipath[80],opath[80];
|
||||
|
||||
extern char music_fn[4][11][13],music_select;
|
||||
extern char env_music_fn[4][13];
|
||||
extern short camsprite;
|
||||
|
||||
// extern char gotz;
|
||||
extern char inspace(short sectnum);
|
||||
|
||||
|
||||
// 72 bytes
|
||||
struct weaponhit
|
||||
{
|
||||
char cgg, pad;
|
||||
short picnum,ang,extra,owner,movflag;
|
||||
short tempang,actorstayput,dispicnum;
|
||||
short timetosleep;
|
||||
long floorz,ceilingz,lastvx,lastvy,bposx,bposy,bposz;
|
||||
long temp_data[6];
|
||||
};
|
||||
|
||||
extern struct weaponhit hittype[MAXSPRITES];
|
||||
|
||||
extern input loc;
|
||||
extern input recsync[RECSYNCBUFSIZ];
|
||||
extern long avgfvel, avgsvel, avgavel, avghorz, avgbits;
|
||||
|
||||
extern short numplayers, myconnectindex;
|
||||
extern short connecthead, connectpoint2[MAXPLAYERS]; //Player linked list variables (indeces, not connection numbers)
|
||||
extern short screenpeek;
|
||||
|
||||
extern int current_menu;
|
||||
extern long tempwallptr,animatecnt;
|
||||
extern long lockclock,frameplace;
|
||||
extern char display_mirror,loadfromgrouponly,rtsplaying;
|
||||
|
||||
extern long movefifoend[MAXPLAYERS], groupfile;
|
||||
extern long ototalclock;
|
||||
|
||||
extern long *animateptr[MAXANIMATES], animategoal[MAXANIMATES];
|
||||
extern long animatevel[MAXANIMATES];
|
||||
// extern long oanimateval[MAXANIMATES];
|
||||
extern short neartagsector, neartagwall, neartagsprite;
|
||||
extern long neartaghitdist;
|
||||
extern short animatesect[MAXANIMATES];
|
||||
extern long movefifoplc, vel,svel,angvel,horiz;
|
||||
|
||||
extern short mirrorwall[64], mirrorsector[64], mirrorcnt;
|
||||
|
||||
#define NUMKEYS 19
|
||||
|
||||
extern long frameplace, chainplace, chainnumpages;
|
||||
extern volatile long checksume;
|
||||
|
||||
#include "funct.h"
|
||||
|
||||
extern char screencapt;
|
||||
extern char level_names[44][33];
|
||||
extern long partime[44],designertime[44];
|
||||
extern char volume_names[4][33];
|
||||
extern char skill_names[5][33];
|
||||
extern char level_file_names[44][128];
|
||||
|
||||
extern int32 SoundToggle,MusicToggle;
|
||||
extern short last_threehundred,lastsavedpos;
|
||||
extern char restorepalette;
|
||||
|
||||
extern short buttonstat;
|
||||
extern long cachecount;
|
||||
extern char boardfilename[128],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768];
|
||||
extern char betaname[80];
|
||||
extern char cachedebug,earthquaketime;
|
||||
extern char networkmode;
|
||||
|
||||
//DUKE3D.H - replace the end "my's" with this
|
||||
extern long myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
|
||||
extern short myhoriz, omyhoriz, myhorizoff, omyhorizoff, globalskillsound;
|
||||
extern int globalskillvoice;
|
||||
extern short myang, omyang, mycursectnum, myjumpingcounter;
|
||||
extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
|
||||
extern long fakemovefifoplc;
|
||||
extern long myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
|
||||
extern long myhorizbak[MOVEFIFOSIZ];
|
||||
extern short myangbak[MOVEFIFOSIZ];
|
||||
|
||||
extern short weaponsandammosprites[15];
|
||||
|
||||
|
||||
|
||||
|
||||
//DUKE3D.H:
|
||||
typedef struct
|
||||
{
|
||||
short frag[MAXPLAYERS], got_access, last_extra, shield_amount, curr_weapon;
|
||||
short ammo_amount[MAX_WEAPONS], holoduke_on;
|
||||
char gotweapon[MAX_WEAPONS], inven_icon, jetpack_on, heat_on;
|
||||
short firstaid_amount, steroids_amount, holoduke_amount, jetpack_amount;
|
||||
short heat_amount, scuba_amount, boot_amount;
|
||||
short last_weapon, weapon_pos, kickback_pic;
|
||||
|
||||
} STATUSBARTYPE;
|
||||
|
||||
extern STATUSBARTYPE sbar;
|
||||
extern short frags[MAXPLAYERS][MAXPLAYERS];
|
||||
extern long cameradist, cameraclock, dukefriction,show_shareware;
|
||||
extern char networkmode, movesperpacket;
|
||||
extern char gamequit;
|
||||
|
||||
extern char pus,pub,camerashitable,freezerhurtowner,lasermode;
|
||||
extern char syncstat, syncval[MAXPLAYERS][MOVEFIFOSIZ];
|
||||
extern signed char multiwho, multipos, multiwhat, multiflag;
|
||||
extern long syncvalhead[MAXPLAYERS], syncvaltail, syncvaltottail;
|
||||
extern long numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
|
||||
// CTW - MODIFICATION
|
||||
// extern char stereo,eightytwofifty,playerswhenstarted,playonten,everyothertime;
|
||||
extern char stereo,playerswhenstarted,everyothertime;
|
||||
// CTW END - MODIFICATION
|
||||
extern long myminlag[MAXPLAYERS], mymaxlag, otherminlag, bufferjitter;
|
||||
|
||||
extern long numinterpolations, startofdynamicinterpolations;
|
||||
extern long oldipos[MAXINTERPOLATIONS];
|
||||
extern long bakipos[MAXINTERPOLATIONS];
|
||||
extern long *curipos[MAXINTERPOLATIONS];
|
||||
|
||||
extern short numclouds,clouds[128],cloudx[128],cloudy[128];
|
||||
extern long cloudtotalclock,totalmemory;
|
||||
|
||||
extern long stereomode, stereowidth, stereopixelwidth;
|
||||
|
||||
extern long myaimmode;
|
||||
|
||||
extern int FindDistance2D (int, int);
|
||||
extern int FindDistance3D (int, int, int);
|
||||
|
||||
|
||||
// player.c
|
||||
void computergetinput (long snum, input *syn);
|
||||
|
||||
// game.c
|
||||
extern bool SkipLogoTime;
|
||||
extern bool CheckSkipLogoTime();
|
||||
extern void ClearSkipLogoTime();
|
BIN
source/ENGINE.OBJ
Normal file
BIN
source/ENGINE.OBJ
Normal file
Binary file not shown.
254
source/FILE_LIB.H
Normal file
254
source/FILE_LIB.H
Normal file
|
@ -0,0 +1,254 @@
|
|||
//-------------------------------------------------------------------------
|
||||
/*
|
||||
Copyright (C) 1996, 2003 - 3D Realms Entertainment
|
||||
|
||||
This file is part of Duke Nukem 3D version 1.5 - Atomic Edition
|
||||
|
||||
Duke Nukem 3D 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Original Source: 1996 - Todd Replogle
|
||||
Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||
*/
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
#ifndef _file_lib_public
|
||||
#define _file_lib_public
|
||||
|
||||
enum
|
||||
{
|
||||
filetype_binary,
|
||||
filetype_text
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
access_read,
|
||||
access_write,
|
||||
access_append
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeOpenWrite - Opens a file for writing, returns handle
|
||||
//
|
||||
//==========================================================================
|
||||
int32 SafeOpenWrite ( const char * filename, int32 filetype );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeOpenRead - Opens a file for reading, returns handle
|
||||
//
|
||||
//==========================================================================
|
||||
int32 SafeOpenRead ( const char * filename, int32 filetype );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeOpenAppend - Opens a file for appending, returns handle
|
||||
//
|
||||
//==========================================================================
|
||||
int32 SafeOpenAppend ( const char * filename, int32 filetype );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeClose - Close a file denoted by the file handle
|
||||
//
|
||||
//==========================================================================
|
||||
void SafeClose ( int32 handle );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeFileExists - Checks for existence of file
|
||||
//
|
||||
//==========================================================================
|
||||
bool SafeFileExists ( const char * filename );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeFileLength - Get length of a file pointed to by handle
|
||||
//
|
||||
//==========================================================================
|
||||
int32 SafeFileLength ( int32 handle );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeRead - reads from a handle
|
||||
//
|
||||
// handle - handle of file to read from
|
||||
//
|
||||
// buffer - pointer of buffer to read into
|
||||
//
|
||||
// count - number of bytes to read
|
||||
//
|
||||
//==========================================================================
|
||||
void SafeRead (int32 handle, void *buffer, int32 count);
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SafeWrite - writes to a handle
|
||||
//
|
||||
// handle - handle of file to write to
|
||||
//
|
||||
// buffer - pointer of buffer to write from
|
||||
//
|
||||
// count - number of bytes to write
|
||||
//
|
||||
//==========================================================================
|
||||
void SafeWrite (int32 handle, void *buffer, int32 count);
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// LoadFile - Load a file
|
||||
//
|
||||
// filename - name of file
|
||||
//
|
||||
// bufferptr - pointer to pointer of buffer to read into
|
||||
//
|
||||
// returns number of bytes read
|
||||
//
|
||||
//==========================================================================
|
||||
int32 LoadFile ( const char * filename, void ** bufferptr );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SaveFile - Save a file
|
||||
//
|
||||
// filename - name of file
|
||||
//
|
||||
// bufferptr - pointer to buffer to write from
|
||||
//
|
||||
// count - number of bytes to write
|
||||
//
|
||||
//==========================================================================
|
||||
void SaveFile ( const char * filename, void * bufferptr, int32 count );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// GetPathFromEnvironment - Add a pathname described in an environment
|
||||
// variable to a standard filename.
|
||||
//
|
||||
// fullname - final string containing entire path
|
||||
//
|
||||
// envname - string naming enivronment variable
|
||||
//
|
||||
// filename - standard filename
|
||||
//
|
||||
//==========================================================================
|
||||
void GetPathFromEnvironment( char *fullname, const char *envname, const char *filename );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// DefaultExtension - Add a default extension to a path
|
||||
//
|
||||
// path - a path
|
||||
//
|
||||
// extension - default extension should include '.'
|
||||
//
|
||||
//==========================================================================
|
||||
void DefaultExtension (char *path, const char *extension);
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// DefaultPath - Add the default path to a filename if it doesn't have one
|
||||
//
|
||||
// path - filename
|
||||
//
|
||||
// extension - default path
|
||||
//
|
||||
//==========================================================================
|
||||
void DefaultPath (char *path, const char *basepath);
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// ExtractFileBase - Extract the base filename from a path
|
||||
//
|
||||
// path - the path
|
||||
//
|
||||
// dest - where the file base name will be placed
|
||||
//
|
||||
//==========================================================================
|
||||
void ExtractFileBase (char *path, char *dest);
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// GetExtension - Extract the extension from a name
|
||||
// returns true if an extension is found
|
||||
// returns false otherwise
|
||||
//
|
||||
//==========================================================================
|
||||
bool GetExtension( char *filename, char *extension );
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// SetExtension - Sets the extension from a name. Assumes that enough
|
||||
// space is left at the end of the string to hold an extension.
|
||||
//
|
||||
//==========================================================================
|
||||
void SetExtension( char *filename, const char *extension );
|
||||
|
||||
#ifdef __MSDOS__
|
||||
//******************************************************************************
|
||||
//
|
||||
// GetPath
|
||||
//
|
||||
// Purpose
|
||||
// To parse the directory entered by the user to make the directory.
|
||||
//
|
||||
// Parms
|
||||
// Path - the path to be parsed.
|
||||
//
|
||||
// Returns
|
||||
// Pointer to next path
|
||||
//
|
||||
//******************************************************************************
|
||||
char * GetPath (char * path, char *dir);
|
||||
|
||||
//******************************************************************************
|
||||
//
|
||||
// ChangeDirectory ()
|
||||
//
|
||||
// Purpose
|
||||
// To change to a directory. Checks for drive changes.
|
||||
//
|
||||
// Parms
|
||||
// path - The path to change to.
|
||||
//
|
||||
// Returns
|
||||
// TRUE - If successful.
|
||||
// FALSE - If unsuccessful.
|
||||
//
|
||||
//******************************************************************************
|
||||
bool ChangeDirectory (char * path);
|
||||
|
||||
//******************************************************************************
|
||||
//
|
||||
// ChangeDrive ()
|
||||
//
|
||||
// Purpose
|
||||
// To change drives.
|
||||
//
|
||||
// Parms
|
||||
// drive - The drive to change to.
|
||||
//
|
||||
// Returns
|
||||
// TRUE - If drive change successful.
|
||||
// FALSE - If drive change unsuccessful.
|
||||
//
|
||||
//******************************************************************************
|
||||
bool ChangeDrive (char *drive);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
57
source/FLAC/Debug/BuildLog.htm
Normal file
57
source/FLAC/Debug/BuildLog.htm
Normal file
|
@ -0,0 +1,57 @@
|
|||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" content="text/html; charset=Windows-1252">
|
||||
</head>
|
||||
<body>
|
||||
<pre>
|
||||
<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
|
||||
Build Log
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
|
||||
<h3>------- Build started: Project: FLAC, Configuration: Debug|Win32 -------
|
||||
</h3>
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Environment Space
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre> ALLUSERSPROFILE=H:\Documents and Settings\All Users
|
||||
APPDATA=H:\Documents and Settings\Randy\Application Data
|
||||
BLASTER=A220 I5 D1 H5 P330
|
||||
CLIENTNAME=Console
|
||||
CommonProgramFiles=H:\Program Files\Common Files
|
||||
COMPUTERNAME=MUDMUFFIN
|
||||
ComSpec=H:\WINDOWS\system32\cmd.exe
|
||||
CTSYN=D:\WIN98
|
||||
DJGPP=D:\DJGPP\DJGPP.ENV
|
||||
HOMEDRIVE=H:
|
||||
HOMEPATH=\Documents and Settings\Randy
|
||||
INCLUDE=D:\gnu\oggvorbis-win32sdk-1.0\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;d:\sdk\include;H:\Program Files\SDL-1.2.4\include;F:\fmodapi362win32\api\inc;
|
||||
LIB=D:\gnu\oggvorbis-win32sdk-1.0\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\lib;H:\Program Files\SDL-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_mixer-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_net-1.2.4\lib;f:\fmodapi362win32/api/lib/;
|
||||
LIBPATH=
|
||||
LOGONSERVER=\\MUDMUFFIN
|
||||
NUMBER_OF_PROCESSORS=1
|
||||
OS=Windows_NT
|
||||
Path=H:\Program Files\Microsoft Visual Studio .NET\Vc7\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\tools;H:\Program Files\Microsoft Visual Studio .NET\Common7\ide;H:\Program Files\HTML Help Workshop\;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\bin;H:\WINDOWS\Microsoft.NET\Framework\v1.0.3705;H:\WINDOWS\system32;H:\WINDOWS;H:\WINDOWS\System32\Wbem;d:\nasm;
|
||||
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
|
||||
PROCESSOR_ARCHITECTURE=x86
|
||||
PROCESSOR_IDENTIFIER=x86 Family 6 Model 6 Stepping 2, AuthenticAMD
|
||||
PROCESSOR_LEVEL=6
|
||||
PROCESSOR_REVISION=0602
|
||||
ProgramFiles=H:\Program Files
|
||||
SESSIONNAME=Console
|
||||
SystemDrive=H:
|
||||
SystemRoot=H:\WINDOWS
|
||||
TEMP=H:\DOCUME~1\Randy\LOCALS~1\Temp
|
||||
TMP=H:\DOCUME~1\Randy\LOCALS~1\Temp
|
||||
USERDOMAIN=MUDMUFFIN
|
||||
USERNAME=Randy
|
||||
USERPROFILE=H:\Documents and Settings\Randy
|
||||
VDMSPath=H:\Program Files\VDMSound\
|
||||
VJSHARPTOOLS=H:\Program Files\Microsoft Visual J# .NET\Framework\Bin;H:\WINDOWS\Microsoft Visual JSharp .NET\Framework\v1.0.4205;
|
||||
VSCOMNTOOLS="H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\"
|
||||
windir=H:\WINDOWS
|
||||
_ACP_ATLPROV=H:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\ATLPROV.DLL
|
||||
_ACP_INCLUDE=source\engine;source\doomlayer;source\win32;source\sound;source;source\FLAC;D:\gnu\oggvorbis-win32sdk-1.0\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;d:\sdk\include;H:\Program Files\SDL-1.2.4\include;F:\fmodapi362win32\api\inc;
|
||||
_ACP_LIB=D:\gnu\oggvorbis-win32sdk-1.0\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\lib;H:\Program Files\SDL-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_mixer-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_net-1.2.4\lib;f:\fmodapi362win32/api/lib/;;source\engine;source\doomlayer;source\win32;source\sound;source;source\FLAC;D:\gnu\oggvorbis-win32sdk-1.0\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;d:\sdk\include;H:\Program Files\SDL-1.2.4\include;F:\fmodapi362win32\api\inc;
|
||||
_ACP_PATH=H:\Program Files\Microsoft Visual Studio .NET\Vc7\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\tools;H:\Program Files\Microsoft Visual Studio .NET\Common7\ide;H:\Program Files\HTML Help Workshop\;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\bin;H:\WINDOWS\Microsoft.NET\Framework\v1.0.3705;H:\WINDOWS\system32;H:\WINDOWS;H:\WINDOWS\System32\Wbem;d:\nasm;
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Command Lines
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>FLAC - up-to-date.</pre></table><table width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
|
||||
</font></table></body></html>
|
BIN
source/FLAC/Debug/FLAC.lib
Normal file
BIN
source/FLAC/Debug/FLAC.lib
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/bitbuffer.obj
Normal file
BIN
source/FLAC/Debug/bitbuffer.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/bitmath.obj
Normal file
BIN
source/FLAC/Debug/bitmath.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/cpu.obj
Normal file
BIN
source/FLAC/Debug/cpu.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/cpu_asm.obj
Normal file
BIN
source/FLAC/Debug/cpu_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/crc.obj
Normal file
BIN
source/FLAC/Debug/crc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/fixed.obj
Normal file
BIN
source/FLAC/Debug/fixed.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/fixed_asm.obj
Normal file
BIN
source/FLAC/Debug/fixed_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/format.obj
Normal file
BIN
source/FLAC/Debug/format.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/lpc.obj
Normal file
BIN
source/FLAC/Debug/lpc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/lpc_asm.obj
Normal file
BIN
source/FLAC/Debug/lpc_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/stream_decoder.obj
Normal file
BIN
source/FLAC/Debug/stream_decoder.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/stream_decoder_pp.obj
Normal file
BIN
source/FLAC/Debug/stream_decoder_pp.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/vc70.idb
Normal file
BIN
source/FLAC/Debug/vc70.idb
Normal file
Binary file not shown.
BIN
source/FLAC/Debug/vc70.pdb
Normal file
BIN
source/FLAC/Debug/vc70.pdb
Normal file
Binary file not shown.
340
source/FLAC/FLAC++/decoder.h
Normal file
340
source/FLAC/FLAC++/decoder.h
Normal file
|
@ -0,0 +1,340 @@
|
|||
/* libFLAC++ - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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 FLACPP__DECODER_H
|
||||
#define FLACPP__DECODER_H
|
||||
|
||||
#include "export.h"
|
||||
|
||||
//#include "FLAC/file_decoder.h"
|
||||
//#include "FLAC/seekable_stream_decoder.h"
|
||||
#include "FLAC/stream_decoder.h"
|
||||
|
||||
|
||||
/** \file include/FLAC++/decoder.h
|
||||
*
|
||||
* \brief
|
||||
* This module contains the classes which implement the various
|
||||
* decoders.
|
||||
*
|
||||
* See the detailed documentation in the
|
||||
* \link flacpp_decoder decoder \endlink module.
|
||||
*/
|
||||
|
||||
/** \defgroup flacpp_decoder FLAC++/decoder.h: decoder classes
|
||||
* \ingroup flacpp
|
||||
*
|
||||
* \brief
|
||||
* This module describes the three decoder layers provided by libFLAC++.
|
||||
*
|
||||
* The libFLAC++ decoder classes are object wrappers around their
|
||||
* counterparts in libFLAC. All three decoding layers available in
|
||||
* libFLAC are also provided here. The interface is very similar;
|
||||
* make sure to read the \link flac_decoder libFLAC decoder module \endlink.
|
||||
*
|
||||
* The only real difference here is that instead of passing in C function
|
||||
* pointers for callbacks, you inherit from the decoder class and provide
|
||||
* implementations for the callbacks in the derived class; because of this
|
||||
* there is no need for a 'client_data' property.
|
||||
*/
|
||||
|
||||
namespace FLAC {
|
||||
namespace Decoder {
|
||||
|
||||
// ============================================================
|
||||
//
|
||||
// Equivalent: FLAC__StreamDecoder
|
||||
//
|
||||
// ============================================================
|
||||
|
||||
/** \defgroup flacpp_stream_decoder FLAC++/decoder.h: stream decoder class
|
||||
* \ingroup flacpp_decoder
|
||||
*
|
||||
* \brief
|
||||
* This class wraps the ::FLAC__StreamDecoder.
|
||||
*
|
||||
* See the \link flac_stream_decoder libFLAC stream decoder module \endlink.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
/** This class wraps the ::FLAC__StreamDecoder.
|
||||
*/
|
||||
class FLACPP_API Stream {
|
||||
public:
|
||||
class FLACPP_API State {
|
||||
public:
|
||||
inline State(::FLAC__StreamDecoderState state): state_(state) { }
|
||||
inline operator ::FLAC__StreamDecoderState() const { return state_; }
|
||||
inline const char *as_cstring() const { return ::FLAC__StreamDecoderStateString[state_]; }
|
||||
const char *resolved_as_cstring(const Stream &) const;
|
||||
protected:
|
||||
::FLAC__StreamDecoderState state_;
|
||||
};
|
||||
|
||||
Stream();
|
||||
virtual ~Stream();
|
||||
|
||||
bool is_valid() const;
|
||||
inline operator bool() const { return is_valid(); }
|
||||
|
||||
bool set_metadata_respond(::FLAC__MetadataType type);
|
||||
bool set_metadata_respond_application(const FLAC__byte id[4]);
|
||||
bool set_metadata_respond_all();
|
||||
bool set_metadata_ignore(::FLAC__MetadataType type);
|
||||
bool set_metadata_ignore_application(const FLAC__byte id[4]);
|
||||
bool set_metadata_ignore_all();
|
||||
|
||||
State get_state() const;
|
||||
unsigned get_channels() const;
|
||||
::FLAC__ChannelAssignment get_channel_assignment() const;
|
||||
unsigned get_bits_per_sample() const;
|
||||
unsigned get_sample_rate() const;
|
||||
unsigned get_blocksize() const;
|
||||
|
||||
/** Initialize the instance; as with the C interface,
|
||||
* init() should be called after construction and 'set'
|
||||
* calls but before any of the 'process' calls.
|
||||
*/
|
||||
State init();
|
||||
|
||||
void finish();
|
||||
|
||||
bool flush();
|
||||
bool reset();
|
||||
|
||||
bool process_single();
|
||||
bool process_until_end_of_metadata();
|
||||
bool process_until_end_of_stream();
|
||||
protected:
|
||||
virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], unsigned *bytes) = 0;
|
||||
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) = 0;
|
||||
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0;
|
||||
virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
|
||||
|
||||
::FLAC__StreamDecoder *decoder_;
|
||||
private:
|
||||
static ::FLAC__StreamDecoderReadStatus read_callback_(const ::FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
|
||||
static ::FLAC__StreamDecoderWriteStatus write_callback_(const ::FLAC__StreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
|
||||
static void metadata_callback_(const ::FLAC__StreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
|
||||
static void error_callback_(const ::FLAC__StreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data);
|
||||
|
||||
// Private and undefined so you can't use them:
|
||||
Stream(const Stream &);
|
||||
void operator=(const Stream &);
|
||||
};
|
||||
|
||||
/* \} */
|
||||
|
||||
#if 0 // [RH] Don't need these for ZDoom
|
||||
|
||||
// ============================================================
|
||||
//
|
||||
// Equivalent: FLAC__SeekableStreamDecoder
|
||||
//
|
||||
// ============================================================
|
||||
|
||||
/** \defgroup flacpp_seekable_stream_decoder FLAC++/decoder.h: seekable stream decoder class
|
||||
* \ingroup flacpp_decoder
|
||||
*
|
||||
* \brief
|
||||
* This class wraps the ::FLAC__SeekableStreamDecoder.
|
||||
*
|
||||
* See the \link flac_seekable_stream_decoder libFLAC seekable stream decoder module \endlink.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
/** This class wraps the ::FLAC__SeekableStreamDecoder.
|
||||
*/
|
||||
class FLACPP_API SeekableStream {
|
||||
public:
|
||||
class FLACPP_API State {
|
||||
public:
|
||||
inline State(::FLAC__SeekableStreamDecoderState state): state_(state) { }
|
||||
inline operator ::FLAC__SeekableStreamDecoderState() const { return state_; }
|
||||
inline const char *as_cstring() const { return ::FLAC__SeekableStreamDecoderStateString[state_]; }
|
||||
const char *resolved_as_cstring(const SeekableStream &) const;
|
||||
protected:
|
||||
::FLAC__SeekableStreamDecoderState state_;
|
||||
};
|
||||
|
||||
SeekableStream();
|
||||
virtual ~SeekableStream();
|
||||
|
||||
bool is_valid() const;
|
||||
inline operator bool() const { return is_valid(); }
|
||||
|
||||
bool set_md5_checking(bool value);
|
||||
bool set_metadata_respond(::FLAC__MetadataType type);
|
||||
bool set_metadata_respond_application(const FLAC__byte id[4]);
|
||||
bool set_metadata_respond_all();
|
||||
bool set_metadata_ignore(::FLAC__MetadataType type);
|
||||
bool set_metadata_ignore_application(const FLAC__byte id[4]);
|
||||
bool set_metadata_ignore_all();
|
||||
|
||||
State get_state() const;
|
||||
Stream::State get_stream_decoder_state() const;
|
||||
bool get_md5_checking() const;
|
||||
unsigned get_channels() const;
|
||||
::FLAC__ChannelAssignment get_channel_assignment() const;
|
||||
unsigned get_bits_per_sample() const;
|
||||
unsigned get_sample_rate() const;
|
||||
unsigned get_blocksize() const;
|
||||
|
||||
State init();
|
||||
|
||||
bool finish();
|
||||
|
||||
bool flush();
|
||||
bool reset();
|
||||
|
||||
bool process_single();
|
||||
bool process_until_end_of_metadata();
|
||||
bool process_until_end_of_stream();
|
||||
|
||||
bool seek_absolute(FLAC__uint64 sample);
|
||||
protected:
|
||||
virtual ::FLAC__SeekableStreamDecoderReadStatus read_callback(FLAC__byte buffer[], unsigned *bytes) = 0;
|
||||
virtual ::FLAC__SeekableStreamDecoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset) = 0;
|
||||
virtual ::FLAC__SeekableStreamDecoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset) = 0;
|
||||
virtual ::FLAC__SeekableStreamDecoderLengthStatus length_callback(FLAC__uint64 *stream_length) = 0;
|
||||
virtual bool eof_callback() = 0;
|
||||
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) = 0;
|
||||
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0;
|
||||
virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
|
||||
|
||||
::FLAC__SeekableStreamDecoder *decoder_;
|
||||
private:
|
||||
static ::FLAC__SeekableStreamDecoderReadStatus read_callback_(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
|
||||
static ::FLAC__SeekableStreamDecoderSeekStatus seek_callback_(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
|
||||
static ::FLAC__SeekableStreamDecoderTellStatus tell_callback_(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
|
||||
static ::FLAC__SeekableStreamDecoderLengthStatus length_callback_(const ::FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
|
||||
static FLAC__bool eof_callback_(const ::FLAC__SeekableStreamDecoder *decoder, void *client_data);
|
||||
static ::FLAC__StreamDecoderWriteStatus write_callback_(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
|
||||
static void metadata_callback_(const ::FLAC__SeekableStreamDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
|
||||
static void error_callback_(const ::FLAC__SeekableStreamDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data);
|
||||
|
||||
// Private and undefined so you can't use them:
|
||||
SeekableStream(const SeekableStream &);
|
||||
void operator=(const SeekableStream &);
|
||||
};
|
||||
|
||||
/* \} */
|
||||
|
||||
|
||||
// ============================================================
|
||||
//
|
||||
// Equivalent: FLAC__FileDecoder
|
||||
//
|
||||
// ============================================================
|
||||
|
||||
/** \defgroup flacpp_file_decoder FLAC++/decoder.h: file decoder class
|
||||
* \ingroup flacpp_decoder
|
||||
*
|
||||
* \brief
|
||||
* This class wraps the ::FLAC__FileDecoder.
|
||||
*
|
||||
* See the \link flac_file_decoder libFLAC file decoder module \endlink.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
/** This class wraps the ::FLAC__FileDecoder.
|
||||
*/
|
||||
class FLACPP_API File {
|
||||
public:
|
||||
class FLACPP_API State {
|
||||
public:
|
||||
inline State(::FLAC__FileDecoderState state): state_(state) { }
|
||||
inline operator ::FLAC__FileDecoderState() const { return state_; }
|
||||
inline const char *as_cstring() const { return ::FLAC__FileDecoderStateString[state_]; }
|
||||
const char *resolved_as_cstring(const File &) const;
|
||||
protected:
|
||||
::FLAC__FileDecoderState state_;
|
||||
};
|
||||
|
||||
File();
|
||||
virtual ~File();
|
||||
|
||||
bool is_valid() const;
|
||||
inline operator bool() const { return is_valid(); }
|
||||
|
||||
bool set_md5_checking(bool value);
|
||||
bool set_filename(const char *value); //!< 'value' may not be \c NULL; use "-" for stdin
|
||||
bool set_metadata_respond(::FLAC__MetadataType type);
|
||||
bool set_metadata_respond_application(const FLAC__byte id[4]);
|
||||
bool set_metadata_respond_all();
|
||||
bool set_metadata_ignore(::FLAC__MetadataType type);
|
||||
bool set_metadata_ignore_application(const FLAC__byte id[4]);
|
||||
bool set_metadata_ignore_all();
|
||||
|
||||
State get_state() const;
|
||||
SeekableStream::State get_seekable_stream_decoder_state() const;
|
||||
Stream::State get_stream_decoder_state() const;
|
||||
bool get_md5_checking() const;
|
||||
unsigned get_channels() const;
|
||||
::FLAC__ChannelAssignment get_channel_assignment() const;
|
||||
unsigned get_bits_per_sample() const;
|
||||
unsigned get_sample_rate() const;
|
||||
unsigned get_blocksize() const;
|
||||
|
||||
State init();
|
||||
|
||||
bool finish();
|
||||
|
||||
bool process_single();
|
||||
bool process_until_end_of_metadata();
|
||||
bool process_until_end_of_file();
|
||||
|
||||
bool seek_absolute(FLAC__uint64 sample);
|
||||
protected:
|
||||
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]) = 0;
|
||||
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata) = 0;
|
||||
virtual void error_callback(::FLAC__StreamDecoderErrorStatus status) = 0;
|
||||
|
||||
::FLAC__FileDecoder *decoder_;
|
||||
private:
|
||||
static ::FLAC__StreamDecoderWriteStatus write_callback_(const ::FLAC__FileDecoder *decoder, const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
|
||||
static void metadata_callback_(const ::FLAC__FileDecoder *decoder, const ::FLAC__StreamMetadata *metadata, void *client_data);
|
||||
static void error_callback_(const ::FLAC__FileDecoder *decoder, ::FLAC__StreamDecoderErrorStatus status, void *client_data);
|
||||
|
||||
// Private and undefined so you can't use them:
|
||||
File(const File &);
|
||||
void operator=(const File &);
|
||||
};
|
||||
|
||||
/* \} */
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
51
source/FLAC/FLAC++/export.h
Normal file
51
source/FLAC/FLAC++/export.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* libFLAC++ - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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 FLACPP__EXPORT_H
|
||||
#define FLACPP__EXPORT_H
|
||||
|
||||
#if defined(FLAC__NO_DLL) || !defined(_MSC_VER) || 1
|
||||
#define FLACPP_API
|
||||
|
||||
#else
|
||||
|
||||
#ifdef FLACPP_API_EXPORTS
|
||||
#define FLACPP_API _declspec(dllexport)
|
||||
#else
|
||||
#define FLACPP_API _declspec(dllimport)
|
||||
#define __LIBNAME__ "libFLAC++.lib"
|
||||
#pragma comment(lib, __LIBNAME__)
|
||||
#undef __LIBNAME__
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
309
source/FLAC/FLAC.dsp
Normal file
309
source/FLAC/FLAC.dsp
Normal file
|
@ -0,0 +1,309 @@
|
|||
# Microsoft Developer Studio Project File - Name="FLAC" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=FLAC - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "FLAC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "FLAC.mak" CFG="FLAC - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "FLAC - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "FLAC - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "FLAC - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "FLAC___Win32_Release"
|
||||
# PROP BASE Intermediate_Dir "FLAC___Win32_Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "FLAC___Win32_Release"
|
||||
# PROP Intermediate_Dir "FLAC___Win32_Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__SSE_OS" /D "FLAC__USE_3DNOW" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "FLAC - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "FLAC___Win32_Debug"
|
||||
# PROP BASE Intermediate_Dir "FLAC___Win32_Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "FLAC___Win32_Debug"
|
||||
# PROP Intermediate_Dir "FLAC___Win32_Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__SSE_OS" /D "FLAC__USE_3DNOW" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "FLAC - Win32 Release"
|
||||
# Name "FLAC - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\bitbuffer.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\bitmath.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\cpu.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\crc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\fixed.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\format.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\lpc.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stream_decoder.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\stream_decoder_pp.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Group "Protected"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\protected\stream_decoder.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Private"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\private\bitbuffer.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\private\bitmath.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\private\cpu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\private\crc.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\private\fixed.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\private\format.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\private\lpc.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "FLAC"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FLAC\assert.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FLAC\export.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FLAC\format.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FLAC\ordinals.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FLAC\stream_decoder.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "FLAC++"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\FLAC++\decoder.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\FLAC++\export.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Group
|
||||
# Begin Group "IA32 Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ia32\cpu_asm.nasm
|
||||
|
||||
!IF "$(CFG)" == "FLAC - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
IntDir=.\FLAC___Win32_Release
|
||||
InputPath=.\ia32\cpu_asm.nasm
|
||||
InputName=cpu_asm
|
||||
|
||||
"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "FLAC - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
IntDir=.\FLAC___Win32_Debug
|
||||
InputPath=.\ia32\cpu_asm.nasm
|
||||
InputName=cpu_asm
|
||||
|
||||
"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ia32\fixed_asm.nasm
|
||||
|
||||
!IF "$(CFG)" == "FLAC - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
IntDir=.\FLAC___Win32_Release
|
||||
InputPath=.\ia32\fixed_asm.nasm
|
||||
InputName=fixed_asm
|
||||
|
||||
"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "FLAC - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
IntDir=.\FLAC___Win32_Debug
|
||||
InputPath=.\ia32\fixed_asm.nasm
|
||||
InputName=fixed_asm
|
||||
|
||||
"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ia32\lpc_asm.nasm
|
||||
|
||||
!IF "$(CFG)" == "FLAC - Win32 Release"
|
||||
|
||||
# Begin Custom Build
|
||||
IntDir=.\FLAC___Win32_Release
|
||||
InputPath=.\ia32\lpc_asm.nasm
|
||||
InputName=lpc_asm
|
||||
|
||||
"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ELSEIF "$(CFG)" == "FLAC - Win32 Debug"
|
||||
|
||||
# Begin Custom Build
|
||||
IntDir=.\FLAC___Win32_Debug
|
||||
InputPath=.\ia32\lpc_asm.nasm
|
||||
InputName=lpc_asm
|
||||
|
||||
"$(IntDir)\$(InputName).obj" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
|
||||
nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
|
||||
# End Custom Build
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ia32\nasm.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ReadMe.txt
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
59
source/FLAC/FLAC.plg
Normal file
59
source/FLAC/FLAC.plg
Normal file
|
@ -0,0 +1,59 @@
|
|||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: FLAC - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "H:\DOCUME~1\Randy\LOCALS~1\Temp\RSPEC.tmp" with contents
|
||||
[
|
||||
/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "FLAC__CPU_IA32" /D "FLAC__HAS_NASM" /D "FLAC__SSE_OS" /D "FLAC__USE_3DNOW" /Fp"FLAC___Win32_Debug/FLAC.pch" /YX /Fo"FLAC___Win32_Debug/" /Fd"FLAC___Win32_Debug/" /FD /GZ /c
|
||||
"F:\zdoom\zdoom-2.0\src\flac\bitbuffer.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\bitmath.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\cpu.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\crc.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\fixed.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\format.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\lpc.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\stream_decoder.c"
|
||||
"F:\zdoom\zdoom-2.0\src\flac\stream_decoder_pp.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @H:\DOCUME~1\Randy\LOCALS~1\Temp\RSPEC.tmp"
|
||||
Creating temporary file "H:\DOCUME~1\Randy\LOCALS~1\Temp\RSPED.tmp" with contents
|
||||
[
|
||||
/nologo /out:"FLAC___Win32_Debug\FLAC.lib"
|
||||
".\FLAC___Win32_Debug\bitbuffer.obj"
|
||||
".\FLAC___Win32_Debug\bitmath.obj"
|
||||
".\FLAC___Win32_Debug\cpu.obj"
|
||||
".\FLAC___Win32_Debug\crc.obj"
|
||||
".\FLAC___Win32_Debug\fixed.obj"
|
||||
".\FLAC___Win32_Debug\format.obj"
|
||||
".\FLAC___Win32_Debug\lpc.obj"
|
||||
".\FLAC___Win32_Debug\stream_decoder.obj"
|
||||
".\FLAC___Win32_Debug\stream_decoder_pp.obj"
|
||||
".\FLAC___Win32_Debug\cpu_asm.obj"
|
||||
".\FLAC___Win32_Debug\fixed_asm.obj"
|
||||
".\FLAC___Win32_Debug\lpc_asm.obj"
|
||||
]
|
||||
Creating command line "link.exe -lib @H:\DOCUME~1\Randy\LOCALS~1\Temp\RSPED.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
bitbuffer.c
|
||||
bitmath.c
|
||||
cpu.c
|
||||
crc.c
|
||||
fixed.c
|
||||
format.c
|
||||
lpc.c
|
||||
stream_decoder.c
|
||||
stream_decoder_pp.cpp
|
||||
Creating library...
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
FLAC.lib - 0 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
273
source/FLAC/FLAC.vcproj
Normal file
273
source/FLAC/FLAC.vcproj
Normal file
|
@ -0,0 +1,273 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="FLAC"
|
||||
ProjectGUID="{873F2EEA-24DF-454C-B245-CB9738BA993E}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__SSE_OS;FLAC__USE_3DNOW"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/FLAC.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OmitFramePointers="TRUE"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__SSE_OS;FLAC__USE_3DNOW"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/FLAC.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||
<File
|
||||
RelativePath="bitbuffer.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="bitmath.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="cpu.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="crc.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="fixed.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="format.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="lpc.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stream_decoder.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stream_decoder_pp.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc">
|
||||
<Filter
|
||||
Name="Protected"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="protected\stream_decoder.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Private"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="private\bitbuffer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\bitmath.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\cpu.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\crc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\fixed.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\format.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\lpc.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="FLAC"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="FLAC\assert.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\export.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\format.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\ordinals.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\stream_decoder.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="FLAC++"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="FLAC++\decoder.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC++\export.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="IA32 Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="ia32\cpu_asm.nasm">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ia32\fixed_asm.nasm">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ia32\lpc_asm.nasm">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ia32\nasm.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
259
source/FLAC/FLAC.vcproj.old
Normal file
259
source/FLAC/FLAC.vcproj.old
Normal file
|
@ -0,0 +1,259 @@
|
|||
<?xml version="1.0" encoding = "Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.00"
|
||||
Name="FLAC"
|
||||
ProjectGUID="{873F2EEA-24DF-454C-B245-CB9738BA993E}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__SSE_OS;FLAC__USE_3DNOW"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/FLAC.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
OmitFramePointers="TRUE"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FLAC__CPU_IA32;FLAC__HAS_NASM;FLAC__SSE_OS;FLAC__USE_3DNOW"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)/FLAC.lib"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
|
||||
<File
|
||||
RelativePath="bitbuffer.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="bitmath.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="cpu.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="crc.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="fixed.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="format.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="lpc.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stream_decoder.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="stream_decoder_pp.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc">
|
||||
<Filter
|
||||
Name="Protected"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="protected\stream_decoder.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Private"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="private\bitbuffer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\bitmath.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\cpu.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\crc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\fixed.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\format.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="private\lpc.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="FLAC"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="FLAC\assert.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\export.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\format.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\ordinals.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC\stream_decoder.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="FLAC++"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="FLAC++\decoder.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="FLAC++\export.h">
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="IA32 Files"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath="ia32\cpu_asm.nasm">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ia32\fixed_asm.nasm">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ia32\lpc_asm.nasm">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description="Assembling $(InputPath)..."
|
||||
CommandLine="nasmw -o $(IntDir)\$(InputName).obj -d OBJ_FORMAT_win32 -f win32 $(InputPath)
|
||||
"
|
||||
Outputs="$(IntDir)\$(InputName).obj"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="ia32\nasm.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
45
source/FLAC/FLAC/assert.h
Normal file
45
source/FLAC/FLAC/assert.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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 FLAC__ASSERT_H
|
||||
#define FLAC__ASSERT_H
|
||||
|
||||
/* we need this since some compilers (like MSVC) leave assert()s on release code (and we don't want to use their ASSERT) */
|
||||
#ifdef DEBUG
|
||||
#include <assert.h>
|
||||
#define FLAC__ASSERT(x) assert(x)
|
||||
#define FLAC__ASSERT_DECLARATION(x) x
|
||||
#else
|
||||
#define FLAC__ASSERT(x)
|
||||
#define FLAC__ASSERT_DECLARATION(x)
|
||||
#endif
|
||||
|
||||
#endif
|
50
source/FLAC/FLAC/export.h
Normal file
50
source/FLAC/FLAC/export.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000,2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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 FLAC__EXPORT_H
|
||||
#define FLAC__EXPORT_H
|
||||
|
||||
#if defined(FLAC__NO_DLL) || !defined(_MSC_VER) || 1
|
||||
#define FLAC_API
|
||||
|
||||
#else
|
||||
|
||||
#ifdef FLAC_API_EXPORTS
|
||||
#define FLAC_API _declspec(dllexport)
|
||||
#else
|
||||
#define FLAC_API _declspec(dllimport)
|
||||
#define __LIBNAME__ "libFLAC.lib"
|
||||
#pragma comment(lib, __LIBNAME__)
|
||||
#undef __LIBNAME__
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
809
source/FLAC/FLAC/format.h
Normal file
809
source/FLAC/FLAC/format.h
Normal file
|
@ -0,0 +1,809 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000,2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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 FLAC__FORMAT_H
|
||||
#define FLAC__FORMAT_H
|
||||
|
||||
#include "export.h"
|
||||
#include "ordinals.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** \file include/FLAC/format.h
|
||||
*
|
||||
* \brief
|
||||
* This module contains structure definitions for the representation
|
||||
* of FLAC format components in memory. These are the basic
|
||||
* structures used by the rest of the interfaces.
|
||||
*
|
||||
* See the detailed documentation in the
|
||||
* \link flac_format format \endlink module.
|
||||
*/
|
||||
|
||||
/** \defgroup flac_format FLAC/format.h: format components
|
||||
* \ingroup flac
|
||||
*
|
||||
* \brief
|
||||
* This module contains structure definitions for the representation
|
||||
* of FLAC format components in memory. These are the basic
|
||||
* structures used by the rest of the interfaces.
|
||||
*
|
||||
* First, you should be familiar with the
|
||||
* <A HREF="../format.html">FLAC format</A>. Many of the values here
|
||||
* follow directly from the specification. As a user of libFLAC, the
|
||||
* interesting parts really are the structures that describe the frame
|
||||
* header and metadata blocks.
|
||||
*
|
||||
* The format structures here are very primitive, designed to store
|
||||
* information in an efficient way. Reading information from the
|
||||
* structures is easy but creating or modifying them directly is
|
||||
* more complex. For the most part, as a user of a library, editing
|
||||
* is not necessary; however, for metadata blocks it is, so there are
|
||||
* convenience functions provided in the \link flac_metadata metadata
|
||||
* module \endlink to simplify the manipulation of metadata blocks.
|
||||
*
|
||||
* \note
|
||||
* It's not the best convention, but symbols ending in _LEN are in bits
|
||||
* and _LENGTH are in bytes. _LENGTH symbols are \#defines instead of
|
||||
* global variables because they are usually used when declaring byte
|
||||
* arrays and some compilers require compile-time knowledge of array
|
||||
* sizes when declared on the stack.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
Most of the values described in this file are defined by the FLAC
|
||||
format specification. There is nothing to tune here.
|
||||
*/
|
||||
|
||||
/** The minimum block size, in samples, permitted by the format. */
|
||||
#define FLAC__MIN_BLOCK_SIZE (16u)
|
||||
|
||||
/** The maximum block size, in samples, permitted by the format. */
|
||||
#define FLAC__MAX_BLOCK_SIZE (65535u)
|
||||
|
||||
/** The maximum number of channels permitted by the format. */
|
||||
#define FLAC__MAX_CHANNELS (8u)
|
||||
|
||||
/** The minimum sample resolution permitted by the format. */
|
||||
#define FLAC__MIN_BITS_PER_SAMPLE (4u)
|
||||
|
||||
/** The maximum sample resolution permitted by the format. */
|
||||
#define FLAC__MAX_BITS_PER_SAMPLE (32u)
|
||||
|
||||
/** The maximum sample resolution permitted by libFLAC.
|
||||
*
|
||||
* \warning
|
||||
* FLAC__MAX_BITS_PER_SAMPLE is the limit of the FLAC format. However,
|
||||
* the reference encoder/decoder is currently limited to 24 bits because
|
||||
* of prevalent 32-bit math, so make sure and use this value when
|
||||
* appropriate.
|
||||
*/
|
||||
#define FLAC__REFERENCE_CODEC_MAX_BITS_PER_SAMPLE (24u)
|
||||
|
||||
/** The maximum sample rate permitted by the format. The value is
|
||||
* ((2 ^ 16) - 1) * 10; see <A HREF="../format.html">FLAC format</A>
|
||||
* as to why.
|
||||
*/
|
||||
#define FLAC__MAX_SAMPLE_RATE (655350u)
|
||||
|
||||
/** The maximum LPC order permitted by the format. */
|
||||
#define FLAC__MAX_LPC_ORDER (32u)
|
||||
|
||||
/** The minimum quantized linear predictor coefficient precision
|
||||
* permitted by the format.
|
||||
*/
|
||||
#define FLAC__MIN_QLP_COEFF_PRECISION (5u)
|
||||
|
||||
/** The maximum quantized linear predictor coefficient precision
|
||||
* permitted by the format.
|
||||
*/
|
||||
#define FLAC__MAX_QLP_COEFF_PRECISION (15u)
|
||||
|
||||
/** The maximum order of the fixed predictors permitted by the format. */
|
||||
#define FLAC__MAX_FIXED_ORDER (4u)
|
||||
|
||||
/** The maximum Rice partition order permitted by the format. */
|
||||
#define FLAC__MAX_RICE_PARTITION_ORDER (15u)
|
||||
|
||||
/** The maximum Rice partition order permitted by the FLAC Subset. */
|
||||
#define FLAC__SUBSET_MAX_RICE_PARTITION_ORDER (8u)
|
||||
|
||||
/** The version string of the release, stamped onto the libraries and binaries.
|
||||
*
|
||||
* \note
|
||||
* This does not correspond to the shared library version number, which
|
||||
* is used to determine binary compatibility.
|
||||
*/
|
||||
extern FLAC_API const char *FLAC__VERSION_STRING;
|
||||
|
||||
/** The vendor string inserted by the encoder into the VORBIS_COMMENT block.
|
||||
* This is a nulL-terminated ASCII string; when inserted into the
|
||||
* VORBIS_COMMENT the trailing null is stripped.
|
||||
*/
|
||||
extern FLAC_API const char *FLAC__VENDOR_STRING;
|
||||
|
||||
/** The byte string representation of the beginning of a FLAC stream. */
|
||||
extern FLAC_API const FLAC__byte FLAC__STREAM_SYNC_STRING[4]; /* = "fLaC" */
|
||||
|
||||
/** The 32-bit integer big-endian representation of the beginning of
|
||||
* a FLAC stream.
|
||||
*/
|
||||
extern FLAC_API const unsigned FLAC__STREAM_SYNC; /* = 0x664C6143 */
|
||||
|
||||
/** The length of the FLAC signature in bits. */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_SYNC_LEN; /* = 32 bits */
|
||||
|
||||
/** The length of the FLAC signature in bytes. */
|
||||
#define FLAC__STREAM_SYNC_LENGTH (4u)
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Subframe structures
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/** An enumeration of the available entropy coding methods. */
|
||||
typedef enum {
|
||||
FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE = 0
|
||||
/**< Residual is coded by partitioning into contexts, each with it's own
|
||||
* Rice parameter. */
|
||||
} FLAC__EntropyCodingMethodType;
|
||||
|
||||
/** Maps a FLAC__EntropyCodingMethodType to a C string.
|
||||
*
|
||||
* Using a FLAC__EntropyCodingMethodType as the index to this array will
|
||||
* give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__EntropyCodingMethodTypeString[];
|
||||
|
||||
|
||||
/** Contents of a Rice partitioned residual
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
unsigned *parameters;
|
||||
/**< The Rice parameters for each context. */
|
||||
|
||||
unsigned *raw_bits;
|
||||
/**< Widths for escape-coded partitions. */
|
||||
|
||||
unsigned capacity_by_order;
|
||||
/**< The capacity of the \a parameters and \a raw_bits arrays
|
||||
* specified as an order, i.e. the number of array elements
|
||||
* allocated is 2 ^ \a capacity_by_order.
|
||||
*/
|
||||
} FLAC__EntropyCodingMethod_PartitionedRiceContents;
|
||||
|
||||
/** Header for a Rice partitioned residual. (c.f. <A HREF="../format.html#partitioned_rice">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
|
||||
unsigned order;
|
||||
/**< The partition order, i.e. # of contexts = 2 ^ \a order. */
|
||||
|
||||
const FLAC__EntropyCodingMethod_PartitionedRiceContents *contents;
|
||||
/**< The context's Rice parameters and/or raw bits. */
|
||||
|
||||
} FLAC__EntropyCodingMethod_PartitionedRice;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ORDER_LEN; /**< == 4 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN; /**< == 4 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_RAW_LEN; /**< == 5 (bits) */
|
||||
|
||||
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_ESCAPE_PARAMETER;
|
||||
/**< == (1<<FLAC__ENTROPY_CODING_METHOD_PARTITIONED_RICE_PARAMETER_LEN)-1 */
|
||||
|
||||
/** Header for the entropy coding method. (c.f. <A HREF="../format.html#residual">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__EntropyCodingMethodType type;
|
||||
union {
|
||||
FLAC__EntropyCodingMethod_PartitionedRice partitioned_rice;
|
||||
} data;
|
||||
} FLAC__EntropyCodingMethod;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__ENTROPY_CODING_METHOD_TYPE_LEN; /**< == 2 (bits) */
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/** An enumeration of the available subframe types. */
|
||||
typedef enum {
|
||||
FLAC__SUBFRAME_TYPE_CONSTANT = 0, /**< constant signal */
|
||||
FLAC__SUBFRAME_TYPE_VERBATIM = 1, /**< uncompressed signal */
|
||||
FLAC__SUBFRAME_TYPE_FIXED = 2, /**< fixed polynomial prediction */
|
||||
FLAC__SUBFRAME_TYPE_LPC = 3 /**< linear prediction */
|
||||
} FLAC__SubframeType;
|
||||
|
||||
/** Maps a FLAC__SubframeType to a C string.
|
||||
*
|
||||
* Using a FLAC__SubframeType as the index to this array will
|
||||
* give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__SubframeTypeString[];
|
||||
|
||||
|
||||
/** CONSTANT subframe. (c.f. <A HREF="../format.html#subframe_constant">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__int32 value; /**< The constant signal value. */
|
||||
} FLAC__Subframe_Constant;
|
||||
|
||||
|
||||
/** VERBATIM subframe. (c.f. <A HREF="../format.html#subframe_verbatim">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
const FLAC__int32 *data; /**< A pointer to verbatim signal. */
|
||||
} FLAC__Subframe_Verbatim;
|
||||
|
||||
|
||||
/** FIXED subframe. (c.f. <A HREF="../format.html#subframe_fixed">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__EntropyCodingMethod entropy_coding_method;
|
||||
/**< The residual coding method. */
|
||||
|
||||
unsigned order;
|
||||
/**< The polynomial order. */
|
||||
|
||||
FLAC__int32 warmup[FLAC__MAX_FIXED_ORDER];
|
||||
/**< Warmup samples to prime the predictor, length == order. */
|
||||
|
||||
const FLAC__int32 *residual;
|
||||
/**< The residual signal, length == (blocksize minus order) samples. */
|
||||
} FLAC__Subframe_Fixed;
|
||||
|
||||
|
||||
/** LPC subframe. (c.f. <A HREF="../format.html#subframe_lpc">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__EntropyCodingMethod entropy_coding_method;
|
||||
/**< The residual coding method. */
|
||||
|
||||
unsigned order;
|
||||
/**< The FIR order. */
|
||||
|
||||
unsigned qlp_coeff_precision;
|
||||
/**< Quantized FIR filter coefficient precision in bits. */
|
||||
|
||||
int quantization_level;
|
||||
/**< The qlp coeff shift needed. */
|
||||
|
||||
FLAC__int32 qlp_coeff[FLAC__MAX_LPC_ORDER];
|
||||
/**< FIR filter coefficients. */
|
||||
|
||||
FLAC__int32 warmup[FLAC__MAX_LPC_ORDER];
|
||||
/**< Warmup samples to prime the predictor, length == order. */
|
||||
|
||||
const FLAC__int32 *residual;
|
||||
/**< The residual signal, length == (blocksize minus order) samples. */
|
||||
} FLAC__Subframe_LPC;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_COEFF_PRECISION_LEN; /**< == 4 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_LPC_QLP_SHIFT_LEN; /**< == 5 (bits) */
|
||||
|
||||
|
||||
/** FLAC subframe structure. (c.f. <A HREF="../format.html#subframe">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__SubframeType type;
|
||||
union {
|
||||
FLAC__Subframe_Constant constant;
|
||||
FLAC__Subframe_Fixed fixed;
|
||||
FLAC__Subframe_LPC lpc;
|
||||
FLAC__Subframe_Verbatim verbatim;
|
||||
} data;
|
||||
unsigned wasted_bits;
|
||||
} FLAC__Subframe;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_ZERO_PAD_LEN; /**< == 1 (bit) */
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LEN; /**< == 6 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_WASTED_BITS_FLAG_LEN; /**< == 1 (bit) */
|
||||
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_CONSTANT_BYTE_ALIGNED_MASK; /* = 0x00 */
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_VERBATIM_BYTE_ALIGNED_MASK; /* = 0x02 */
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_FIXED_BYTE_ALIGNED_MASK; /* = 0x10 */
|
||||
extern FLAC_API const unsigned FLAC__SUBFRAME_TYPE_LPC_BYTE_ALIGNED_MASK; /* = 0x40 */
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Frame structures
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/** An enumeration of the available channel assignments. */
|
||||
typedef enum {
|
||||
FLAC__CHANNEL_ASSIGNMENT_INDEPENDENT = 0, /**< independent channels */
|
||||
FLAC__CHANNEL_ASSIGNMENT_LEFT_SIDE = 1, /**< left+side stereo */
|
||||
FLAC__CHANNEL_ASSIGNMENT_RIGHT_SIDE = 2, /**< right+side stereo */
|
||||
FLAC__CHANNEL_ASSIGNMENT_MID_SIDE = 3 /**< mid+side stereo */
|
||||
} FLAC__ChannelAssignment;
|
||||
|
||||
/** Maps a FLAC__ChannelAssignment to a C string.
|
||||
*
|
||||
* Using a FLAC__ChannelAssignment as the index to this array will
|
||||
* give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__ChannelAssignmentString[];
|
||||
|
||||
/** An enumeration of the possible frame numbering methods. */
|
||||
typedef enum {
|
||||
FLAC__FRAME_NUMBER_TYPE_FRAME_NUMBER, /**< number contains the frame number */
|
||||
FLAC__FRAME_NUMBER_TYPE_SAMPLE_NUMBER /**< number contains the sample number of first sample in frame */
|
||||
} FLAC__FrameNumberType;
|
||||
|
||||
/** Maps a FLAC__FrameNumberType to a C string.
|
||||
*
|
||||
* Using a FLAC__FrameNumberType as the index to this array will
|
||||
* give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__FrameNumberTypeString[];
|
||||
|
||||
|
||||
/** FLAC frame header structure. (c.f. <A HREF="../format.html#frame_header">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned blocksize;
|
||||
/**< The number of samples per subframe. */
|
||||
|
||||
unsigned sample_rate;
|
||||
/**< The sample rate in Hz. */
|
||||
|
||||
unsigned channels;
|
||||
/**< The number of channels (== number of subframes). */
|
||||
|
||||
FLAC__ChannelAssignment channel_assignment;
|
||||
/**< The channel assignment for the frame. */
|
||||
|
||||
unsigned bits_per_sample;
|
||||
/**< The sample resolution. */
|
||||
|
||||
FLAC__FrameNumberType number_type;
|
||||
/**< The numbering scheme used for the frame. */
|
||||
|
||||
union {
|
||||
FLAC__uint32 frame_number;
|
||||
FLAC__uint64 sample_number;
|
||||
} number;
|
||||
/**< The frame number or sample number of first sample in frame;
|
||||
* use the \a number_type value to determine which to use. */
|
||||
|
||||
FLAC__uint8 crc;
|
||||
/**< CRC-8 (polynomial = x^8 + x^2 + x^1 + x^0, initialized with 0)
|
||||
* of the raw frame header bytes, meaning everything before the CRC byte
|
||||
* including the sync code.
|
||||
*/
|
||||
} FLAC__FrameHeader;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC; /**< == 0x3ffe; the frame header sync code */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SYNC_LEN; /**< == 14 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_RESERVED_LEN; /**< == 2 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_BLOCK_SIZE_LEN; /**< == 4 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_SAMPLE_RATE_LEN; /**< == 4 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_CHANNEL_ASSIGNMENT_LEN; /**< == 4 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_BITS_PER_SAMPLE_LEN; /**< == 3 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_ZERO_PAD_LEN; /**< == 1 (bit) */
|
||||
extern FLAC_API const unsigned FLAC__FRAME_HEADER_CRC_LEN; /**< == 8 (bits) */
|
||||
|
||||
|
||||
/** FLAC frame footer structure. (c.f. <A HREF="../format.html#frame_footer">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__uint16 crc;
|
||||
/**< CRC-16 (polynomial = x^16 + x^15 + x^2 + x^0, initialized with
|
||||
* 0) of the bytes before the crc, back to and including the frame header
|
||||
* sync code.
|
||||
*/
|
||||
} FLAC__FrameFooter;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__FRAME_FOOTER_CRC_LEN; /**< == 16 (bits) */
|
||||
|
||||
|
||||
/** FLAC frame structure. (c.f. <A HREF="../format.html#frame">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__FrameHeader header;
|
||||
FLAC__Subframe subframes[FLAC__MAX_CHANNELS];
|
||||
FLAC__FrameFooter footer;
|
||||
} FLAC__Frame;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Meta-data structures
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/** An enumeration of the available metadata block types. */
|
||||
typedef enum {
|
||||
|
||||
FLAC__METADATA_TYPE_STREAMINFO = 0,
|
||||
/**< <A HREF="../format.html#metadata_block_streaminfo">STREAMINFO</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_PADDING = 1,
|
||||
/**< <A HREF="../format.html#metadata_block_padding">PADDING</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_APPLICATION = 2,
|
||||
/**< <A HREF="../format.html#metadata_block_application">APPLICATION</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_SEEKTABLE = 3,
|
||||
/**< <A HREF="../format.html#metadata_block_seektable">SEEKTABLE</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_VORBIS_COMMENT = 4,
|
||||
/**< <A HREF="../format.html#metadata_block_vorbis_comment">VORBISCOMMENT</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_CUESHEET = 5,
|
||||
/**< <A HREF="../format.html#metadata_block_cuesheet">CUESHEET</A> block */
|
||||
|
||||
FLAC__METADATA_TYPE_UNDEFINED = 6
|
||||
/**< marker to denote beginning of undefined type range; this number will increase as new metadata types are added */
|
||||
|
||||
} FLAC__MetadataType;
|
||||
|
||||
/** Maps a FLAC__MetadataType to a C string.
|
||||
*
|
||||
* Using a FLAC__MetadataType as the index to this array will
|
||||
* give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__MetadataTypeString[];
|
||||
|
||||
|
||||
/** FLAC STREAMINFO structure. (c.f. <A HREF="../format.html#metadata_block_streaminfo">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned min_blocksize, max_blocksize;
|
||||
unsigned min_framesize, max_framesize;
|
||||
unsigned sample_rate;
|
||||
unsigned channels;
|
||||
unsigned bits_per_sample;
|
||||
FLAC__uint64 total_samples;
|
||||
FLAC__byte md5sum[16];
|
||||
} FLAC__StreamMetadata_StreamInfo;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_BLOCK_SIZE_LEN; /**< == 16 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_BLOCK_SIZE_LEN; /**< == 16 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MIN_FRAME_SIZE_LEN; /**< == 24 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MAX_FRAME_SIZE_LEN; /**< == 24 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_SAMPLE_RATE_LEN; /**< == 20 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_CHANNELS_LEN; /**< == 3 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_BITS_PER_SAMPLE_LEN; /**< == 5 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_TOTAL_SAMPLES_LEN; /**< == 36 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_STREAMINFO_MD5SUM_LEN; /**< == 128 (bits) */
|
||||
|
||||
/** The total stream length of the STREAMINFO block in bytes. */
|
||||
#define FLAC__STREAM_METADATA_STREAMINFO_LENGTH (34u)
|
||||
|
||||
/** FLAC PADDING structure. (c.f. <A HREF="../format.html#metadata_block_padding">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
int dummy;
|
||||
/**< Conceptually this is an empty struct since we don't store the
|
||||
* padding bytes. Empty structs are not allowed by some C compilers,
|
||||
* hence the dummy.
|
||||
*/
|
||||
} FLAC__StreamMetadata_Padding;
|
||||
|
||||
|
||||
/** FLAC APPLICATION structure. (c.f. <A HREF="../format.html#metadata_block_application">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__byte id[4];
|
||||
FLAC__byte *data;
|
||||
} FLAC__StreamMetadata_Application;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_APPLICATION_ID_LEN; /**< == 32 (bits) */
|
||||
|
||||
/** SeekPoint structure used in SEEKTABLE blocks. (c.f. <A HREF="../format.html#seekpoint">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__uint64 sample_number;
|
||||
/**< The sample number of the target frame. */
|
||||
|
||||
FLAC__uint64 stream_offset;
|
||||
/**< The offset, in bytes, of the target frame with respect to
|
||||
* beginning of the first frame. */
|
||||
|
||||
unsigned frame_samples;
|
||||
/**< The number of samples in the target frame. */
|
||||
} FLAC__StreamMetadata_SeekPoint;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_SAMPLE_NUMBER_LEN; /**< == 64 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_STREAM_OFFSET_LEN; /**< == 64 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_SEEKPOINT_FRAME_SAMPLES_LEN; /**< == 16 (bits) */
|
||||
|
||||
/** The total stream length of a seek point in bytes. */
|
||||
#define FLAC__STREAM_METADATA_SEEKPOINT_LENGTH (18u)
|
||||
|
||||
/** The value used in the \a sample_number field of
|
||||
* FLAC__StreamMetadataSeekPoint used to indicate a placeholder
|
||||
* point (== 0xffffffffffffffff).
|
||||
*/
|
||||
extern FLAC_API const FLAC__uint64 FLAC__STREAM_METADATA_SEEKPOINT_PLACEHOLDER;
|
||||
|
||||
|
||||
/** FLAC SEEKTABLE structure. (c.f. <A HREF="../format.html#metadata_block_seektable">format specification</A>)
|
||||
*
|
||||
* \note From the format specification:
|
||||
* - The seek points must be sorted by ascending sample number.
|
||||
* - Each seek point's sample number must be the first sample of the
|
||||
* target frame.
|
||||
* - Each seek point's sample number must be unique within the table.
|
||||
* - Existence of a SEEKTABLE block implies a correct setting of
|
||||
* total_samples in the stream_info block.
|
||||
* - Behavior is undefined when more than one SEEKTABLE block is
|
||||
* present in a stream.
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned num_points;
|
||||
FLAC__StreamMetadata_SeekPoint *points;
|
||||
} FLAC__StreamMetadata_SeekTable;
|
||||
|
||||
|
||||
/** Vorbis comment entry structure used in VORBIS_COMMENT blocks. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__uint32 length;
|
||||
FLAC__byte *entry;
|
||||
} FLAC__StreamMetadata_VorbisComment_Entry;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_ENTRY_LENGTH_LEN; /**< == 32 (bits) */
|
||||
|
||||
|
||||
/** FLAC VORBIS_COMMENT structure. (c.f. <A HREF="../format.html#metadata_block_vorbis_comment">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__StreamMetadata_VorbisComment_Entry vendor_string;
|
||||
FLAC__uint32 num_comments;
|
||||
FLAC__StreamMetadata_VorbisComment_Entry *comments;
|
||||
} FLAC__StreamMetadata_VorbisComment;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_VORBIS_COMMENT_NUM_COMMENTS_LEN; /**< == 32 (bits) */
|
||||
|
||||
|
||||
/** FLAC CUESHEET track index structure. (See the
|
||||
* <A HREF="../format.html#cuesheet_track_index">format specification</A> for
|
||||
* the full description of each field.)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__uint64 offset;
|
||||
/**< Offset in samples, relative to the track offset, of the index
|
||||
* point.
|
||||
*/
|
||||
|
||||
FLAC__byte number;
|
||||
/**< The index point number. */
|
||||
} FLAC__StreamMetadata_CueSheet_Index;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_OFFSET_LEN; /**< == 64 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_NUMBER_LEN; /**< == 8 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_INDEX_RESERVED_LEN; /**< == 3*8 (bits) */
|
||||
|
||||
|
||||
/** FLAC CUESHEET track structure. (See the
|
||||
* <A HREF="../format.html#cuesheet_track">format specification</A> for
|
||||
* the full description of each field.)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__uint64 offset;
|
||||
/**< Track offset in samples, relative to the beginning of the FLAC audio stream. */
|
||||
|
||||
FLAC__byte number;
|
||||
/**< The track number. */
|
||||
|
||||
char isrc[13];
|
||||
/**< Track ISRC. This is a 12-digit alphanumeric code plus a trailing '\0' */
|
||||
|
||||
unsigned type:1;
|
||||
/**< The track type: 0 for audio, 1 for non-audio. */
|
||||
|
||||
unsigned pre_emphasis:1;
|
||||
/**< The pre-emphasis flag: 0 for no pre-emphasis, 1 for pre-emphasis. */
|
||||
|
||||
FLAC__byte num_indices;
|
||||
/**< The number of track index points. */
|
||||
|
||||
FLAC__StreamMetadata_CueSheet_Index *indices;
|
||||
/**< NULL if num_indices == 0, else pointer to array of index points. */
|
||||
|
||||
} FLAC__StreamMetadata_CueSheet_Track;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_OFFSET_LEN; /**< == 64 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUMBER_LEN; /**< == 8 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_ISRC_LEN; /**< == 12*8 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_TYPE_LEN; /**< == 1 (bit) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_PRE_EMPHASIS_LEN; /**< == 1 (bit) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_RESERVED_LEN; /**< == 6+13*8 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_TRACK_NUM_INDICES_LEN; /**< == 8 (bits) */
|
||||
|
||||
|
||||
/** FLAC CUESHEET structure. (See the
|
||||
* <A HREF="../format.html#metadata_block_cuesheet">format specification</A>
|
||||
* for the full description of each field.)
|
||||
*/
|
||||
typedef struct {
|
||||
char media_catalog_number[129];
|
||||
/**< Media catalog number, in ASCII printable characters 0x20-0x7e. In
|
||||
* general, the media catalog number may be 0 to 128 bytes long; any
|
||||
* unused characters should be right-padded with NUL characters.
|
||||
*/
|
||||
|
||||
FLAC__uint64 lead_in;
|
||||
/**< The number of lead-in samples. */
|
||||
|
||||
FLAC__bool is_cd;
|
||||
/**< \c true if CUESHEET corresponds to a Compact Disc, else \c false */
|
||||
|
||||
unsigned num_tracks;
|
||||
/**< The number of tracks. */
|
||||
|
||||
FLAC__StreamMetadata_CueSheet_Track *tracks;
|
||||
/**< NULL if num_tracks == 0, else pointer to array of tracks. */
|
||||
|
||||
} FLAC__StreamMetadata_CueSheet;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_MEDIA_CATALOG_NUMBER_LEN; /**< == 128*8 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_LEAD_IN_LEN; /**< == 64 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_IS_CD_LEN; /**< == 1 (bit) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_RESERVED_LEN; /**< == 7+258*8 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_CUESHEET_NUM_TRACKS_LEN; /**< == 8 (bits) */
|
||||
|
||||
|
||||
/** Structure that is used when a metadata block of unknown type is loaded.
|
||||
* The contents are opaque. The structure is used only internally to
|
||||
* correctly handle unknown metadata.
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__byte *data;
|
||||
} FLAC__StreamMetadata_Unknown;
|
||||
|
||||
|
||||
/** FLAC metadata block structure. (c.f. <A HREF="../format.html#metadata_block">format specification</A>)
|
||||
*/
|
||||
typedef struct {
|
||||
FLAC__MetadataType type;
|
||||
/**< The type of the metadata block; used determine which member of the
|
||||
* \a data union to dereference. If type >= FLAC__METADATA_TYPE_UNDEFINED
|
||||
* then \a data.unknown must be used. */
|
||||
|
||||
FLAC__bool is_last;
|
||||
/**< \c true if this metadata block is the last, else \a false */
|
||||
|
||||
unsigned length;
|
||||
/**< Length, in bytes, of the block data as it appears in the stream. */
|
||||
|
||||
union {
|
||||
FLAC__StreamMetadata_StreamInfo stream_info;
|
||||
FLAC__StreamMetadata_Padding padding;
|
||||
FLAC__StreamMetadata_Application application;
|
||||
FLAC__StreamMetadata_SeekTable seek_table;
|
||||
FLAC__StreamMetadata_VorbisComment vorbis_comment;
|
||||
FLAC__StreamMetadata_CueSheet cue_sheet;
|
||||
FLAC__StreamMetadata_Unknown unknown;
|
||||
} data;
|
||||
/**< Polymorphic block data; use the \a type value to determine which
|
||||
* to use. */
|
||||
} FLAC__StreamMetadata;
|
||||
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_IS_LAST_LEN; /**< == 1 (bit) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_TYPE_LEN; /**< == 7 (bits) */
|
||||
extern FLAC_API const unsigned FLAC__STREAM_METADATA_LENGTH_LEN; /**< == 24 (bits) */
|
||||
|
||||
/** The total stream length of a metadata block header in bytes. */
|
||||
#define FLAC__STREAM_METADATA_HEADER_LENGTH (4u)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Utility functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
/** Tests that a sample rate is valid for FLAC. Since the rules for valid
|
||||
* sample rates are slightly complex, they are encapsulated in this function.
|
||||
*
|
||||
* \param sample_rate The sample rate to test for compliance.
|
||||
* \retval FLAC__bool
|
||||
* \c true if the given sample rate conforms to the specification, else
|
||||
* \c false.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__format_sample_rate_is_valid(unsigned sample_rate);
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
/** Check a seek table to see if it conforms to the FLAC specification.
|
||||
* See the format specification for limits on the contents of the
|
||||
* seek table.
|
||||
*
|
||||
* \param seek_table A pointer to a seek table to be checked.
|
||||
* \assert
|
||||
* \code seek_table != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if seek table is illegal, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__format_seektable_is_legal(const FLAC__StreamMetadata_SeekTable *seek_table);
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
/** Sort a seek table's seek points according to the format specification.
|
||||
* This includes a "unique-ification" step to remove duplicates, i.e.
|
||||
* seek points with identical \a sample_number values. Duplicate seek
|
||||
* points are converted into placeholder points and sorted to the end of
|
||||
* the table.
|
||||
*
|
||||
* \param seek_table A pointer to a seek table to be sorted.
|
||||
* \assert
|
||||
* \code seek_table != NULL \endcode
|
||||
* \retval unsigned
|
||||
* The number of duplicate seek points converted into placeholders.
|
||||
*/
|
||||
FLAC_API unsigned FLAC__format_seektable_sort(FLAC__StreamMetadata_SeekTable *seek_table);
|
||||
|
||||
/* @@@@ add to unit tests; it is already indirectly tested by the metadata_object tests */
|
||||
/** Check a cue sheet to see if it conforms to the FLAC specification.
|
||||
* See the format specification for limits on the contents of the
|
||||
* cue sheet.
|
||||
*
|
||||
* \param cue_sheet A pointer to an existing cue sheet to be checked.
|
||||
* \param check_cd_da_subset If \c true, check CUESHEET against more
|
||||
* stringent requirements for a CD-DA (audio) disc.
|
||||
* \param violation Address of a pointer to a string. If there is a
|
||||
* violation, a pointer to a string explanation of the
|
||||
* violation will be returned here. \a violation may be
|
||||
* \c NULL if you don't need the returned string. Do not
|
||||
* free the returned string; it will always point to static
|
||||
* data.
|
||||
* \assert
|
||||
* \code cue_sheet != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if cue sheet is illegal, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__format_cuesheet_is_legal(const FLAC__StreamMetadata_CueSheet *cue_sheet, FLAC__bool check_cd_da_subset, const char **violation);
|
||||
|
||||
/* \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
70
source/FLAC/FLAC/ordinals.h
Normal file
70
source/FLAC/FLAC/ordinals.h
Normal file
|
@ -0,0 +1,70 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000,2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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 FLAC__ORDINALS_H
|
||||
#define FLAC__ORDINALS_H
|
||||
|
||||
#ifdef true
|
||||
#undef true
|
||||
#endif
|
||||
#ifdef false
|
||||
#undef false
|
||||
#endif
|
||||
#ifndef __cplusplus
|
||||
#define true 1
|
||||
#define false 0
|
||||
#endif
|
||||
|
||||
typedef int FLAC__bool;
|
||||
|
||||
typedef signed char FLAC__int8;
|
||||
typedef unsigned char FLAC__uint8;
|
||||
|
||||
#if defined _MSC_VER
|
||||
typedef __int16 FLAC__int16;
|
||||
typedef __int32 FLAC__int32;
|
||||
typedef __int64 FLAC__int64;
|
||||
typedef unsigned __int16 FLAC__uint16;
|
||||
typedef unsigned __int32 FLAC__uint32;
|
||||
typedef unsigned __int64 FLAC__uint64;
|
||||
#else
|
||||
typedef short FLAC__int16;
|
||||
typedef int FLAC__int32;
|
||||
typedef long long FLAC__int64;
|
||||
typedef unsigned short FLAC__uint16;
|
||||
typedef unsigned int FLAC__uint32;
|
||||
typedef unsigned long long FLAC__uint64;
|
||||
#endif
|
||||
|
||||
typedef FLAC__uint8 FLAC__byte;
|
||||
typedef float FLAC__real;
|
||||
|
||||
#endif
|
813
source/FLAC/FLAC/stream_decoder.h
Normal file
813
source/FLAC/FLAC/stream_decoder.h
Normal file
|
@ -0,0 +1,813 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000,2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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 FLAC__STREAM_DECODER_H
|
||||
#define FLAC__STREAM_DECODER_H
|
||||
|
||||
#include "export.h"
|
||||
#include "format.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/** \file include/FLAC/stream_decoder.h
|
||||
*
|
||||
* \brief
|
||||
* This module contains the functions which implement the stream
|
||||
* decoder.
|
||||
*
|
||||
* See the detailed documentation in the
|
||||
* \link flac_stream_decoder stream decoder \endlink module.
|
||||
*/
|
||||
|
||||
/** \defgroup flac_decoder FLAC/ *_decoder.h: decoder interfaces
|
||||
* \ingroup flac
|
||||
*
|
||||
* \brief
|
||||
* This module describes the three decoder layers provided by libFLAC.
|
||||
*
|
||||
* For decoding FLAC streams, libFLAC provides three layers of access. The
|
||||
* lowest layer is non-seekable stream-level decoding, the next is seekable
|
||||
* stream-level decoding, and the highest layer is file-level decoding. The
|
||||
* interfaces are described in the \link flac_stream_decoder stream decoder
|
||||
* \endlink, \link flac_seekable_stream_decoder seekable stream decoder
|
||||
* \endlink, and \link flac_file_decoder file decoder \endlink modules
|
||||
* respectively. Typically you will choose the highest layer that your input
|
||||
* source will support.
|
||||
*
|
||||
* The stream decoder relies on callbacks for all input and output and has no
|
||||
* provisions for seeking. The seekable stream decoder wraps the stream
|
||||
* decoder and exposes functions for seeking. However, you must provide
|
||||
* extra callbacks for seek-related operations on your stream, like seek and
|
||||
* tell. The file decoder wraps the seekable stream decoder and supplies
|
||||
* most of the callbacks internally, simplifying the processing of standard
|
||||
* files.
|
||||
*/
|
||||
|
||||
/** \defgroup flac_stream_decoder FLAC/stream_decoder.h: stream decoder interface
|
||||
* \ingroup flac_decoder
|
||||
*
|
||||
* \brief
|
||||
* This module contains the functions which implement the stream
|
||||
* decoder.
|
||||
*
|
||||
* The basic usage of this decoder is as follows:
|
||||
* - The program creates an instance of a decoder using
|
||||
* FLAC__stream_decoder_new().
|
||||
* - The program overrides the default settings and sets callbacks for
|
||||
* reading, writing, error reporting, and metadata reporting using
|
||||
* FLAC__stream_decoder_set_*() functions.
|
||||
* - The program initializes the instance to validate the settings and
|
||||
* prepare for decoding using FLAC__stream_decoder_init().
|
||||
* - The program calls the FLAC__stream_decoder_process_*() functions
|
||||
* to decode data, which subsequently calls the callbacks.
|
||||
* - The program finishes the decoding with FLAC__stream_decoder_finish(),
|
||||
* which flushes the input and output and resets the decoder to the
|
||||
* uninitialized state.
|
||||
* - The instance may be used again or deleted with
|
||||
* FLAC__stream_decoder_delete().
|
||||
*
|
||||
* In more detail, the program will create a new instance by calling
|
||||
* FLAC__stream_decoder_new(), then call FLAC__stream_decoder_set_*()
|
||||
* functions to set the callbacks and client data, and call
|
||||
* FLAC__stream_decoder_init(). The required callbacks are:
|
||||
*
|
||||
* - Read callback - This function will be called when the decoder needs
|
||||
* more input data. The address of the buffer to be filled is supplied,
|
||||
* along with the number of bytes the buffer can hold. The callback may
|
||||
* choose to supply less data and modify the byte count but must be careful
|
||||
* not to overflow the buffer. The callback then returns a status code
|
||||
* chosen from FLAC__StreamDecoderReadStatus.
|
||||
* - Write callback - This function will be called when the decoder has
|
||||
* decoded a single frame of data. The decoder will pass the frame
|
||||
* metadata as well as an array of pointers (one for each channel)
|
||||
* pointing to the decoded audio.
|
||||
* - Metadata callback - This function will be called when the decoder has
|
||||
* decoded a metadata block. In a valid FLAC file there will always be
|
||||
* one STREAMINFO block, followed by zero or more other metadata
|
||||
* blocks. These will be supplied by the decoder in the same order as
|
||||
* they appear in the stream and always before the first audio frame
|
||||
* (i.e. write callback). The metadata block that is passed in must not
|
||||
* be modified, and it doesn't live beyond the callback, so you should
|
||||
* make a copy of it with FLAC__metadata_object_clone() if you will need
|
||||
* it elsewhere. Since metadata blocks can potentially be large, by
|
||||
* default the decoder only calls the metadata callback for the STREAMINFO
|
||||
* block; you can instruct the decoder to pass or filter other blocks with
|
||||
* FLAC__stream_decoder_set_metadata_*() calls.
|
||||
* - Error callback - This function will be called whenever an error occurs
|
||||
* during decoding.
|
||||
*
|
||||
* Once the decoder is initialized, your program will call one of several
|
||||
* functions to start the decoding process:
|
||||
*
|
||||
* - FLAC__stream_decoder_process_single() - Tells the decoder to process at
|
||||
* most one metadata block or audio frame and return, calling either the
|
||||
* metadata callback or write callback, respectively, once. If the decoder
|
||||
* loses sync it will return with only the error callback being called.
|
||||
* - FLAC__stream_decoder_process_until_end_of_metadata() - Tells the decoder
|
||||
* to process the stream from the current location and stop upon reaching
|
||||
* the first audio frame. The user will get one metadata, write, or error
|
||||
* callback per metadata block, audio frame, or sync error, respectively.
|
||||
* - FLAC__stream_decoder_process_until_end_of_stream() - Tells the decoder
|
||||
* to process the stream from the current location until the read callback
|
||||
* returns FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM or
|
||||
* FLAC__STREAM_DECODER_READ_STATUS_ABORT. The user will get one metadata,
|
||||
* write, or error callback per metadata block, audio frame, or sync error,
|
||||
* respectively.
|
||||
*
|
||||
* When the decoder has finished decoding (normally or through an abort),
|
||||
* the instance is finished by calling FLAC__stream_decoder_finish(), which
|
||||
* ensures the decoder is in the correct state and frees memory. Then the
|
||||
* instance may be deleted with FLAC__stream_decoder_delete() or initialized
|
||||
* again to decode another stream.
|
||||
*
|
||||
* Note that the stream decoder has no real concept of stream position, it
|
||||
* just converts data. To seek within a stream the callbacks have only to
|
||||
* flush the decoder using FLAC__stream_decoder_flush() and start feeding
|
||||
* data from the new position through the read callback. The seekable
|
||||
* stream decoder does just this.
|
||||
*
|
||||
* The FLAC__stream_decoder_set_metadata_*() functions deserve special
|
||||
* attention. By default, the decoder only calls the metadata_callback for
|
||||
* the STREAMINFO block. These functions allow you to tell the decoder
|
||||
* explicitly which blocks to parse and return via the metadata_callback
|
||||
* and/or which to skip. Use a FLAC__stream_decoder_set_metadata_respond_all(),
|
||||
* FLAC__stream_decoder_set_metadata_ignore() ... or FLAC__stream_decoder_set_metadata_ignore_all(),
|
||||
* FLAC__stream_decoder_set_metadata_respond() ... sequence to exactly specify which
|
||||
* blocks to return. Remember that some metadata blocks can be big so
|
||||
* filtering out the ones you don't use can reduce the memory requirements
|
||||
* of the decoder. Also note the special forms
|
||||
* FLAC__stream_decoder_set_metadata_respond_application(id) and
|
||||
* FLAC__stream_decoder_set_metadata_ignore_application(id) for filtering APPLICATION
|
||||
* blocks based on the application ID.
|
||||
*
|
||||
* STREAMINFO and SEEKTABLE blocks are always parsed and used internally, but
|
||||
* they still can legally be filtered from the metadata_callback.
|
||||
*
|
||||
* \note
|
||||
* The "set" functions may only be called when the decoder is in the
|
||||
* state FLAC__STREAM_DECODER_UNINITIALIZED, i.e. after
|
||||
* FLAC__stream_decoder_new() or FLAC__stream_decoder_finish(), but
|
||||
* before FLAC__stream_decoder_init(). If this is the case they will
|
||||
* return \c true, otherwise \c false.
|
||||
*
|
||||
* \note
|
||||
* FLAC__stream_decoder_finish() resets all settings to the constructor
|
||||
* defaults, including the callbacks.
|
||||
*
|
||||
* \{
|
||||
*/
|
||||
|
||||
|
||||
/** State values for a FLAC__StreamDecoder
|
||||
*
|
||||
* The decoder's state can be obtained by calling FLAC__stream_decoder_get_state().
|
||||
*/
|
||||
typedef enum {
|
||||
|
||||
FLAC__STREAM_DECODER_SEARCH_FOR_METADATA = 0,
|
||||
/**< The decoder is ready to search for metadata. */
|
||||
|
||||
FLAC__STREAM_DECODER_READ_METADATA,
|
||||
/**< The decoder is ready to or is in the process of reading metadata. */
|
||||
|
||||
FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC,
|
||||
/**< The decoder is ready to or is in the process of searching for the frame sync code. */
|
||||
|
||||
FLAC__STREAM_DECODER_READ_FRAME,
|
||||
/**< The decoder is ready to or is in the process of reading a frame. */
|
||||
|
||||
FLAC__STREAM_DECODER_END_OF_STREAM,
|
||||
/**< The decoder has reached the end of the stream. */
|
||||
|
||||
FLAC__STREAM_DECODER_ABORTED,
|
||||
/**< The decoder was aborted by the read callback. */
|
||||
|
||||
FLAC__STREAM_DECODER_UNPARSEABLE_STREAM,
|
||||
/**< The decoder encountered reserved fields in use in the stream. */
|
||||
|
||||
FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
|
||||
/**< An error occurred allocating memory. */
|
||||
|
||||
FLAC__STREAM_DECODER_ALREADY_INITIALIZED,
|
||||
/**< FLAC__stream_decoder_init() was called when the decoder was
|
||||
* already initialized, usually because
|
||||
* FLAC__stream_decoder_finish() was not called.
|
||||
*/
|
||||
|
||||
FLAC__STREAM_DECODER_INVALID_CALLBACK,
|
||||
/**< FLAC__stream_decoder_init() was called without all callbacks being set. */
|
||||
|
||||
FLAC__STREAM_DECODER_UNINITIALIZED
|
||||
/**< The decoder is in the uninitialized state. */
|
||||
|
||||
} FLAC__StreamDecoderState;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderState to a C string.
|
||||
*
|
||||
* Using a FLAC__StreamDecoderState as the index to this array
|
||||
* will give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__StreamDecoderStateString[];
|
||||
|
||||
|
||||
/** Return values for the FLAC__StreamDecoder read callback.
|
||||
*/
|
||||
typedef enum {
|
||||
|
||||
FLAC__STREAM_DECODER_READ_STATUS_CONTINUE,
|
||||
/**< The read was OK and decoding can continue. */
|
||||
|
||||
FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM,
|
||||
/**< The read was attempted at the end of the stream. */
|
||||
|
||||
FLAC__STREAM_DECODER_READ_STATUS_ABORT
|
||||
/**< An unrecoverable error occurred. The decoder will return from the process call. */
|
||||
|
||||
} FLAC__StreamDecoderReadStatus;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderReadStatus to a C string.
|
||||
*
|
||||
* Using a FLAC__StreamDecoderReadStatus as the index to this array
|
||||
* will give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__StreamDecoderReadStatusString[];
|
||||
|
||||
|
||||
/** Return values for the FLAC__StreamDecoder write callback.
|
||||
*/
|
||||
typedef enum {
|
||||
|
||||
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE,
|
||||
/**< The write was OK and decoding can continue. */
|
||||
|
||||
FLAC__STREAM_DECODER_WRITE_STATUS_ABORT
|
||||
/**< An unrecoverable error occurred. The decoder will return from the process call. */
|
||||
|
||||
} FLAC__StreamDecoderWriteStatus;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderWriteStatus to a C string.
|
||||
*
|
||||
* Using a FLAC__StreamDecoderWriteStatus as the index to this array
|
||||
* will give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[];
|
||||
|
||||
|
||||
/** Possible values passed in to the FLAC__StreamDecoder error callback.
|
||||
*/
|
||||
typedef enum {
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC,
|
||||
/**< An error in the stream caused the decoder to lose synchronization. */
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER,
|
||||
/**< The decoder encountered a corrupted frame header. */
|
||||
|
||||
FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH
|
||||
/**< The frame's data did not match the CRC in the footer. */
|
||||
|
||||
} FLAC__StreamDecoderErrorStatus;
|
||||
|
||||
/** Maps a FLAC__StreamDecoderErrorStatus to a C string.
|
||||
*
|
||||
* Using a FLAC__StreamDecoderErrorStatus as the index to this array
|
||||
* will give the string equivalent. The contents should not be modified.
|
||||
*/
|
||||
extern FLAC_API const char * const FLAC__StreamDecoderErrorStatusString[];
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* class FLAC__StreamDecoder
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
struct FLAC__StreamDecoderProtected;
|
||||
struct FLAC__StreamDecoderPrivate;
|
||||
/** The opaque structure definition for the stream decoder type.
|
||||
* See the \link flac_stream_decoder stream decoder module \endlink
|
||||
* for a detailed description.
|
||||
*/
|
||||
typedef struct {
|
||||
struct FLAC__StreamDecoderProtected *protected_; /* avoid the C++ keyword 'protected' */
|
||||
struct FLAC__StreamDecoderPrivate *private_; /* avoid the C++ keyword 'private' */
|
||||
} FLAC__StreamDecoder;
|
||||
|
||||
/** Signature for the read callback.
|
||||
* See FLAC__stream_decoder_set_read_callback() for more info.
|
||||
*
|
||||
* \param decoder The decoder instance calling the callback.
|
||||
* \param buffer A pointer to a location for the callee to store
|
||||
* data to be decoded.
|
||||
* \param bytes A pointer to the size of the buffer. On entry
|
||||
* to the callback, it contains the maximum number
|
||||
* of bytes that may be stored in \a buffer. The
|
||||
* callee must set it to the actual number of bytes
|
||||
* stored before returning.
|
||||
* \param client_data The callee's client data set through
|
||||
* FLAC__stream_decoder_set_client_data().
|
||||
* \retval FLAC__StreamDecoderReadStatus
|
||||
* The callee's return status.
|
||||
*/
|
||||
typedef FLAC__StreamDecoderReadStatus (*FLAC__StreamDecoderReadCallback)(const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
|
||||
|
||||
/** Signature for the write callback.
|
||||
* See FLAC__stream_decoder_set_write_callback() for more info.
|
||||
*
|
||||
* \param decoder The decoder instance calling the callback.
|
||||
* \param frame The description of the decoded frame. See
|
||||
* FLAC__Frame.
|
||||
* \param buffer An array of pointers to decoded channels of data.
|
||||
* Each pointer will point to an array of signed
|
||||
* samples of length \a frame->header.blocksize.
|
||||
* Currently, the channel order has no meaning
|
||||
* except for stereo streams; in this case channel
|
||||
* 0 is left and 1 is right.
|
||||
* \param client_data The callee's client data set through
|
||||
* FLAC__stream_decoder_set_client_data().
|
||||
* \retval FLAC__StreamDecoderWriteStatus
|
||||
* The callee's return status.
|
||||
*/
|
||||
typedef FLAC__StreamDecoderWriteStatus (*FLAC__StreamDecoderWriteCallback)(const FLAC__StreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
|
||||
|
||||
/** Signature for the metadata callback.
|
||||
* See FLAC__stream_decoder_set_metadata_callback() for more info.
|
||||
*
|
||||
* \param decoder The decoder instance calling the callback.
|
||||
* \param metadata The decoded metadata block.
|
||||
* \param client_data The callee's client data set through
|
||||
* FLAC__stream_decoder_set_client_data().
|
||||
*/
|
||||
typedef void (*FLAC__StreamDecoderMetadataCallback)(const FLAC__StreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
|
||||
|
||||
/** Signature for the error callback.
|
||||
* See FLAC__stream_decoder_set_error_callback() for more info.
|
||||
*
|
||||
* \param decoder The decoder instance calling the callback.
|
||||
* \param status The error encountered by the decoder.
|
||||
* \param client_data The callee's client data set through
|
||||
* FLAC__stream_decoder_set_client_data().
|
||||
*/
|
||||
typedef void (*FLAC__StreamDecoderErrorCallback)(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Class constructor/destructor
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
/** Create a new stream decoder instance. The instance is created with
|
||||
* default settings; see the individual FLAC__stream_decoder_set_*()
|
||||
* functions for each setting's default.
|
||||
*
|
||||
* \retval FLAC__StreamDecoder*
|
||||
* \c NULL if there was an error allocating memory, else the new instance.
|
||||
*/
|
||||
FLAC_API FLAC__StreamDecoder *FLAC__stream_decoder_new();
|
||||
|
||||
/** Free a decoder instance. Deletes the object pointed to by \a decoder.
|
||||
*
|
||||
* \param decoder A pointer to an existing decoder.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
*/
|
||||
FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Public class method prototypes
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
/** Set the read callback.
|
||||
* The supplied function will be called when the decoder needs more input
|
||||
* data. The address of the buffer to be filled is supplied, along with
|
||||
* the number of bytes the buffer can hold. The callback may choose to
|
||||
* supply less data and modify the byte count but must be careful not to
|
||||
* overflow the buffer. The callback then returns a status code chosen
|
||||
* from FLAC__StreamDecoderReadStatus.
|
||||
*
|
||||
* \note
|
||||
* The callback is mandatory and must be set before initialization.
|
||||
*
|
||||
* \default \c NULL
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param value See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code value != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_read_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderReadCallback value);
|
||||
|
||||
/** Set the write callback.
|
||||
* The supplied function will be called when the decoder has decoded a
|
||||
* single frame of data. The decoder will pass the frame metadata as
|
||||
* well as an array of pointers (one for each channel) pointing to the
|
||||
* decoded audio.
|
||||
*
|
||||
* \note
|
||||
* The callback is mandatory and must be set before initialization.
|
||||
*
|
||||
* \default \c NULL
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param value See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code value != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_write_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderWriteCallback value);
|
||||
|
||||
/** Set the metadata callback.
|
||||
* The supplied function will be called when the decoder has decoded a metadata
|
||||
* block. In a valid FLAC file there will always be one STREAMINFO block,
|
||||
* followed by zero or more other metadata blocks. These will be supplied
|
||||
* by the decoder in the same order as they appear in the stream and always
|
||||
* before the first audio frame (i.e. write callback). The metadata block
|
||||
* that is passed in must not be modified, and it doesn't live beyond the
|
||||
* callback, so you should make a copy of it with
|
||||
* FLAC__metadata_object_clone() if you will need it elsewhere. Since
|
||||
* metadata blocks can potentially be large, by default the decoder only
|
||||
* calls the metadata callback for the STREAMINFO block; you can instruct
|
||||
* the decoder to pass or filter other blocks with
|
||||
* FLAC__stream_decoder_set_metadata_*() calls.
|
||||
*
|
||||
* \note
|
||||
* The callback is mandatory and must be set before initialization.
|
||||
*
|
||||
* \default \c NULL
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param value See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code value != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderMetadataCallback value);
|
||||
|
||||
/** Set the error callback.
|
||||
* The supplied function will be called whenever an error occurs during
|
||||
* decoding.
|
||||
*
|
||||
* \note
|
||||
* The callback is mandatory and must be set before initialization.
|
||||
*
|
||||
* \default \c NULL
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param value See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code value != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_error_callback(FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorCallback value);
|
||||
|
||||
/** Set the client data to be passed back to callbacks.
|
||||
* This value will be supplied to callbacks in their \a client_data
|
||||
* argument.
|
||||
*
|
||||
* \default \c NULL
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param value See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_client_data(FLAC__StreamDecoder *decoder, void *value);
|
||||
|
||||
/** Direct the decoder to pass on all metadata blocks of type \a type.
|
||||
*
|
||||
* \default By default, only the \c STREAMINFO block is returned via the
|
||||
* metadata callback.
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param type See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \a type is valid
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
|
||||
|
||||
/** Direct the decoder to pass on all APPLICATION metadata blocks of the
|
||||
* given \a id.
|
||||
*
|
||||
* \default By default, only the \c STREAMINFO block is returned via the
|
||||
* metadata callback.
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param id See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code id != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
|
||||
|
||||
/** Direct the decoder to pass on all metadata blocks of any type.
|
||||
*
|
||||
* \default By default, only the \c STREAMINFO block is returned via the
|
||||
* metadata callback.
|
||||
* \param decoder A decoder instance to set.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_respond_all(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Direct the decoder to filter out all metadata blocks of type \a type.
|
||||
*
|
||||
* \default By default, only the \c STREAMINFO block is returned via the
|
||||
* metadata callback.
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param type See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \a type is valid
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore(FLAC__StreamDecoder *decoder, FLAC__MetadataType type);
|
||||
|
||||
/** Direct the decoder to filter out all APPLICATION metadata blocks of
|
||||
* the given \a id.
|
||||
*
|
||||
* \default By default, only the \c STREAMINFO block is returned via the
|
||||
* metadata callback.
|
||||
* \param decoder A decoder instance to set.
|
||||
* \param id See above.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code id != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_application(FLAC__StreamDecoder *decoder, const FLAC__byte id[4]);
|
||||
|
||||
/** Direct the decoder to filter out all metadata blocks of any type.
|
||||
*
|
||||
* \default By default, only the \c STREAMINFO block is returned via the
|
||||
* metadata callback.
|
||||
* \param decoder A decoder instance to set.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if the decoder is already initialized, else \c true.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_set_metadata_ignore_all(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the current decoder state.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__StreamDecoderState
|
||||
* The current decoder state.
|
||||
*/
|
||||
FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_get_state(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the current number of channels in the stream being decoded.
|
||||
* Will only be valid after decoding has started and will contain the
|
||||
* value from the most recently decoded frame header.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval unsigned
|
||||
* See above.
|
||||
*/
|
||||
FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the current channel assignment in the stream being decoded.
|
||||
* Will only be valid after decoding has started and will contain the
|
||||
* value from the most recently decoded frame header.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__ChannelAssignment
|
||||
* See above.
|
||||
*/
|
||||
FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the current sample resolution in the stream being decoded.
|
||||
* Will only be valid after decoding has started and will contain the
|
||||
* value from the most recently decoded frame header.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval unsigned
|
||||
* See above.
|
||||
*/
|
||||
FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the current sample rate in Hz of the stream being decoded.
|
||||
* Will only be valid after decoding has started and will contain the
|
||||
* value from the most recently decoded frame header.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval unsigned
|
||||
* See above.
|
||||
*/
|
||||
FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Get the current blocksize of the stream being decoded.
|
||||
* Will only be valid after decoding has started and will contain the
|
||||
* value from the most recently decoded frame header.
|
||||
*
|
||||
* \param decoder A decoder instance to query.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval unsigned
|
||||
* See above.
|
||||
*/
|
||||
FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Initialize the decoder instance.
|
||||
* Should be called after FLAC__stream_decoder_new() and
|
||||
* FLAC__stream_decoder_set_*() but before any of the
|
||||
* FLAC__stream_decoder_process_*() functions. Will set and return the
|
||||
* decoder state, which will be FLAC__STREAM_DECODER_SEARCH_FOR_METADATA
|
||||
* if initialization succeeded.
|
||||
*
|
||||
* \param decoder An uninitialized decoder instance.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__StreamDecoderState
|
||||
* \c FLAC__STREAM_DECODER_SEARCH_FOR_MEATADATA if initialization was
|
||||
* successful; see FLAC__StreamDecoderState for the meanings of other
|
||||
* return values.
|
||||
*/
|
||||
FLAC_API FLAC__StreamDecoderState FLAC__stream_decoder_init(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Finish the decoding process.
|
||||
* Flushes the decoding buffer, releases resources, resets the decoder
|
||||
* settings to their defaults, and returns the decoder state to
|
||||
* FLAC__STREAM_DECODER_UNINITIALIZED.
|
||||
*
|
||||
* In the event of a prematurely-terminated decode, it is not strictly
|
||||
* necessary to call this immediately before FLAC__stream_decoder_delete()
|
||||
* but it is good practice to match every FLAC__stream_decoder_init()
|
||||
* with a FLAC__stream_decoder_finish().
|
||||
*
|
||||
* \param decoder An uninitialized decoder instance.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
*/
|
||||
FLAC_API void FLAC__stream_decoder_finish(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Flush the stream input.
|
||||
* The decoder's input buffer will be cleared and the state set to
|
||||
* \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC.
|
||||
*
|
||||
* \param decoder A decoder instance.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c true if successful, else \c false if a memory allocation
|
||||
* error occurs.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Reset the decoding process.
|
||||
* The decoder's input buffer will be cleared and the state set to
|
||||
* \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA. This is similar to
|
||||
* FLAC__stream_decoder_finish() except that the settings are
|
||||
* preserved; there is no need to call FLAC__stream_decoder_init()
|
||||
* before decoding again.
|
||||
*
|
||||
* \param decoder A decoder instance.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c true if successful, else \c false if a memory allocation
|
||||
* error occurs.
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_reset(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Decode one metadata block or audio frame.
|
||||
* This version instructs the decoder to decode a either a single metadata
|
||||
* block or a single frame and stop, unless the callbacks return a fatal
|
||||
* error or the read callback returns
|
||||
* \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM.
|
||||
*
|
||||
* As the decoder needs more input it will call the read callback.
|
||||
* Depending on what was decoded, the metadata or write callback will be
|
||||
* called with the decoded metadata block or audio frame, unless an error
|
||||
* occurred. If the decoder loses sync it will call the error callback
|
||||
* instead.
|
||||
*
|
||||
* \param decoder An initialized decoder instance in the state
|
||||
* \c FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if any read or write error occurred (except
|
||||
* \c FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC), else \c true;
|
||||
* in any case, check the decoder state with
|
||||
* FLAC__stream_decoder_get_state() to see what went wrong or to
|
||||
* check for lost synchronization (a sign of stream corruption).
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_process_single(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Decode until the end of the metadata.
|
||||
* This version instructs the decoder to decode from the current position
|
||||
* and continue until all the metadata has been read, or until the
|
||||
* callbacks return a fatal error or the read callback returns
|
||||
* \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM.
|
||||
*
|
||||
* As the decoder needs more input it will call the read callback.
|
||||
* As each metadata block is decoded, the metadata callback will be called
|
||||
* with the decoded metadata. If the decoder loses sync it will call the
|
||||
* error callback.
|
||||
*
|
||||
* \param decoder An initialized decoder instance in the state
|
||||
* \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if any read or write error occurred (except
|
||||
* \c FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC), else \c true;
|
||||
* in any case, check the decoder state with
|
||||
* FLAC__stream_decoder_get_state() to see what went wrong or to
|
||||
* check for lost synchronization (a sign of stream corruption).
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_metadata(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/** Decode until the end of the stream.
|
||||
* This version instructs the decoder to decode from the current position
|
||||
* and continue until the end of stream (the read callback returns
|
||||
* \c FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM), or until the
|
||||
* callbacks return a fatal error.
|
||||
*
|
||||
* As the decoder needs more input it will call the read callback.
|
||||
* As each metadata block and frame is decoded, the metadata or write
|
||||
* callback will be called with the decoded metadata or frame. If the
|
||||
* decoder loses sync it will call the error callback.
|
||||
*
|
||||
* \param decoder An initialized decoder instance in the state
|
||||
* \c FLAC__STREAM_DECODER_SEARCH_FOR_METADATA.
|
||||
* \assert
|
||||
* \code decoder != NULL \endcode
|
||||
* \code FLAC__stream_decoder_get_state(decoder) == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA \endcode
|
||||
* \retval FLAC__bool
|
||||
* \c false if any read or write error occurred (except
|
||||
* \c FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC), else \c true;
|
||||
* in any case, check the decoder state with
|
||||
* FLAC__stream_decoder_get_state() to see what went wrong or to
|
||||
* check for lost synchronization (a sign of stream corruption).
|
||||
*/
|
||||
FLAC_API FLAC__bool FLAC__stream_decoder_process_until_end_of_stream(FLAC__StreamDecoder *decoder);
|
||||
|
||||
/* \} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
BIN
source/FLAC/FLAC___Win32_Debug/FLAC.lib
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/FLAC.lib
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/FLAC.pch
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/FLAC.pch
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/bitbuffer.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/bitbuffer.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/bitmath.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/bitmath.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/cpu.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/cpu.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/cpu_asm.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/cpu_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/crc.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/crc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/fixed.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/fixed.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/fixed_asm.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/fixed_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/format.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/format.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/lpc.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/lpc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/lpc_asm.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/lpc_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/stream_decoder.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/stream_decoder.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/stream_decoder_pp.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/stream_decoder_pp.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/vc60.idb
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/vc60.idb
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Debug/vc60.pdb
Normal file
BIN
source/FLAC/FLAC___Win32_Debug/vc60.pdb
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/FLAC.lib
Normal file
BIN
source/FLAC/FLAC___Win32_Release/FLAC.lib
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/FLAC.pch
Normal file
BIN
source/FLAC/FLAC___Win32_Release/FLAC.pch
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/bitbuffer.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/bitbuffer.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/bitmath.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/bitmath.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/cpu.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/cpu.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/cpu_asm.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/cpu_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/crc.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/crc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/fixed.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/fixed.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/fixed_asm.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/fixed_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/format.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/format.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/lpc.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/lpc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/lpc_asm.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/lpc_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/stream_decoder.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/stream_decoder.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/stream_decoder_pp.obj
Normal file
BIN
source/FLAC/FLAC___Win32_Release/stream_decoder_pp.obj
Normal file
Binary file not shown.
BIN
source/FLAC/FLAC___Win32_Release/vc60.idb
Normal file
BIN
source/FLAC/FLAC___Win32_Release/vc60.idb
Normal file
Binary file not shown.
6
source/FLAC/ReadMe.txt
Normal file
6
source/FLAC/ReadMe.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
This is not the complete FLAC distribution. It contains only what
|
||||
ZDoom needs to decode compressed FLAC streams. For the complete
|
||||
distribution, please visit <http://flac.sourceforge.net/>.
|
||||
|
||||
Of course, under Linux, you are encouraged to ignore this source
|
||||
here and dynamically link to the full libraries.
|
57
source/FLAC/Release/BuildLog.htm
Normal file
57
source/FLAC/Release/BuildLog.htm
Normal file
|
@ -0,0 +1,57 @@
|
|||
<html>
|
||||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" content="text/html; charset=Windows-1252">
|
||||
</head>
|
||||
<body>
|
||||
<pre>
|
||||
<table width=100% bgcolor=#CFCFE5><tr> <td> <font face=arial size=+3>
|
||||
Build Log
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>
|
||||
<h3>------- Build started: Project: FLAC, Configuration: Release|Win32 -------
|
||||
</h3>
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Environment Space
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre> ALLUSERSPROFILE=H:\Documents and Settings\All Users
|
||||
APPDATA=H:\Documents and Settings\Randy\Application Data
|
||||
BLASTER=A220 I5 D1 H5 P330
|
||||
CLIENTNAME=Console
|
||||
CommonProgramFiles=H:\Program Files\Common Files
|
||||
COMPUTERNAME=MUDMUFFIN
|
||||
ComSpec=H:\WINDOWS\system32\cmd.exe
|
||||
CTSYN=D:\WIN98
|
||||
DJGPP=D:\DJGPP\DJGPP.ENV
|
||||
HOMEDRIVE=H:
|
||||
HOMEPATH=\Documents and Settings\Randy
|
||||
INCLUDE=D:\gnu\oggvorbis-win32sdk-1.0\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;d:\sdk\include;H:\Program Files\SDL-1.2.4\include;F:\fmodapi362win32\api\inc;
|
||||
LIB=D:\gnu\oggvorbis-win32sdk-1.0\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\lib;H:\Program Files\SDL-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_mixer-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_net-1.2.4\lib;f:\fmodapi362win32/api/lib/;
|
||||
LIBPATH=
|
||||
LOGONSERVER=\\MUDMUFFIN
|
||||
NUMBER_OF_PROCESSORS=1
|
||||
OS=Windows_NT
|
||||
Path=H:\Program Files\Microsoft Visual Studio .NET\Vc7\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\tools;H:\Program Files\Microsoft Visual Studio .NET\Common7\ide;H:\Program Files\HTML Help Workshop\;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\bin;H:\WINDOWS\Microsoft.NET\Framework\v1.0.3705;H:\WINDOWS\system32;H:\WINDOWS;H:\WINDOWS\System32\Wbem;d:\nasm;
|
||||
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
|
||||
PROCESSOR_ARCHITECTURE=x86
|
||||
PROCESSOR_IDENTIFIER=x86 Family 6 Model 6 Stepping 2, AuthenticAMD
|
||||
PROCESSOR_LEVEL=6
|
||||
PROCESSOR_REVISION=0602
|
||||
ProgramFiles=H:\Program Files
|
||||
SESSIONNAME=Console
|
||||
SystemDrive=H:
|
||||
SystemRoot=H:\WINDOWS
|
||||
TEMP=H:\DOCUME~1\Randy\LOCALS~1\Temp
|
||||
TMP=H:\DOCUME~1\Randy\LOCALS~1\Temp
|
||||
USERDOMAIN=MUDMUFFIN
|
||||
USERNAME=Randy
|
||||
USERPROFILE=H:\Documents and Settings\Randy
|
||||
VDMSPath=H:\Program Files\VDMSound\
|
||||
VJSHARPTOOLS=H:\Program Files\Microsoft Visual J# .NET\Framework\Bin;H:\WINDOWS\Microsoft Visual JSharp .NET\Framework\v1.0.4205;
|
||||
VSCOMNTOOLS="H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\"
|
||||
windir=H:\WINDOWS
|
||||
_ACP_ATLPROV=H:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\ATLPROV.DLL
|
||||
_ACP_INCLUDE=source\engine;source\doomlayer;source\win32;source\sound;source;source\FLAC;D:\gnu\oggvorbis-win32sdk-1.0\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;d:\sdk\include;H:\Program Files\SDL-1.2.4\include;F:\fmodapi362win32\api\inc;
|
||||
_ACP_LIB=D:\gnu\oggvorbis-win32sdk-1.0\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\lib;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\lib;H:\Program Files\SDL-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_mixer-1.2.4\lib;H:\Program Files\SDL-1.2.4\SDL_net-1.2.4\lib;f:\fmodapi362win32/api/lib/;;source\engine;source\doomlayer;source\win32;source\sound;source;source\FLAC;D:\gnu\oggvorbis-win32sdk-1.0\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\include;H:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\include;d:\sdk\include;H:\Program Files\SDL-1.2.4\include;F:\fmodapi362win32\api\inc;
|
||||
_ACP_PATH=H:\Program Files\Microsoft Visual Studio .NET\Vc7\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin\prerelease;H:\Program Files\Microsoft Visual Studio .NET\Common7\Tools\bin;H:\Program Files\Microsoft Visual Studio .NET\Common7\tools;H:\Program Files\Microsoft Visual Studio .NET\Common7\ide;H:\Program Files\HTML Help Workshop\;H:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\bin;H:\WINDOWS\Microsoft.NET\Framework\v1.0.3705;H:\WINDOWS\system32;H:\WINDOWS;H:\WINDOWS\System32\Wbem;d:\nasm;
|
||||
</pre></table><table width=100% bgcolor=#DFDFE5><tr><td><font face=arial size=+2>
|
||||
Command Lines
|
||||
</font></table><table width=* cellspacing=0 cellpadding=0><tr><td width=0 bgcolor=#EDEDF5> </td><td width=0 bgcolor=#FFFFFF> </td><td width=*><pre>FLAC - up-to-date.</pre></table><table width=100% height=20 bgcolor=#CFCFE5><tr><td><font face=arial size=+2>
|
||||
</font></table></body></html>
|
BIN
source/FLAC/Release/FLAC.lib
Normal file
BIN
source/FLAC/Release/FLAC.lib
Normal file
Binary file not shown.
BIN
source/FLAC/Release/bitbuffer.obj
Normal file
BIN
source/FLAC/Release/bitbuffer.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/bitmath.obj
Normal file
BIN
source/FLAC/Release/bitmath.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/cpu.obj
Normal file
BIN
source/FLAC/Release/cpu.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/cpu_asm.obj
Normal file
BIN
source/FLAC/Release/cpu_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/crc.obj
Normal file
BIN
source/FLAC/Release/crc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/fixed.obj
Normal file
BIN
source/FLAC/Release/fixed.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/fixed_asm.obj
Normal file
BIN
source/FLAC/Release/fixed_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/format.obj
Normal file
BIN
source/FLAC/Release/format.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/lpc.obj
Normal file
BIN
source/FLAC/Release/lpc.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/lpc_asm.obj
Normal file
BIN
source/FLAC/Release/lpc_asm.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/stream_decoder.obj
Normal file
BIN
source/FLAC/Release/stream_decoder.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/stream_decoder_pp.obj
Normal file
BIN
source/FLAC/Release/stream_decoder_pp.obj
Normal file
Binary file not shown.
BIN
source/FLAC/Release/vc70.idb
Normal file
BIN
source/FLAC/Release/vc70.idb
Normal file
Binary file not shown.
BIN
source/FLAC/Release/vc70.pdb
Normal file
BIN
source/FLAC/Release/vc70.pdb
Normal file
Binary file not shown.
2523
source/FLAC/bitbuffer.c
Normal file
2523
source/FLAC/bitbuffer.c
Normal file
File diff suppressed because it is too large
Load diff
136
source/FLAC/bitmath.c
Normal file
136
source/FLAC/bitmath.c
Normal file
|
@ -0,0 +1,136 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "private/bitmath.h"
|
||||
#include "FLAC/assert.h"
|
||||
|
||||
/* An example of what FLAC__bitmath_ilog2() computes:
|
||||
*
|
||||
* ilog2( 0) = assertion failure
|
||||
* ilog2( 1) = 0
|
||||
* ilog2( 2) = 1
|
||||
* ilog2( 3) = 1
|
||||
* ilog2( 4) = 2
|
||||
* ilog2( 5) = 2
|
||||
* ilog2( 6) = 2
|
||||
* ilog2( 7) = 2
|
||||
* ilog2( 8) = 3
|
||||
* ilog2( 9) = 3
|
||||
* ilog2(10) = 3
|
||||
* ilog2(11) = 3
|
||||
* ilog2(12) = 3
|
||||
* ilog2(13) = 3
|
||||
* ilog2(14) = 3
|
||||
* ilog2(15) = 3
|
||||
* ilog2(16) = 4
|
||||
* ilog2(17) = 4
|
||||
* ilog2(18) = 4
|
||||
*/
|
||||
unsigned FLAC__bitmath_ilog2(unsigned v)
|
||||
{
|
||||
unsigned l = 0;
|
||||
FLAC__ASSERT(v > 0);
|
||||
while(v >>= 1)
|
||||
l++;
|
||||
return l;
|
||||
}
|
||||
|
||||
/* An example of what FLAC__bitmath_silog2() computes:
|
||||
*
|
||||
* silog2(-10) = 5
|
||||
* silog2(- 9) = 5
|
||||
* silog2(- 8) = 4
|
||||
* silog2(- 7) = 4
|
||||
* silog2(- 6) = 4
|
||||
* silog2(- 5) = 4
|
||||
* silog2(- 4) = 3
|
||||
* silog2(- 3) = 3
|
||||
* silog2(- 2) = 2
|
||||
* silog2(- 1) = 2
|
||||
* silog2( 0) = 0
|
||||
* silog2( 1) = 2
|
||||
* silog2( 2) = 3
|
||||
* silog2( 3) = 3
|
||||
* silog2( 4) = 4
|
||||
* silog2( 5) = 4
|
||||
* silog2( 6) = 4
|
||||
* silog2( 7) = 4
|
||||
* silog2( 8) = 5
|
||||
* silog2( 9) = 5
|
||||
* silog2( 10) = 5
|
||||
*/
|
||||
unsigned FLAC__bitmath_silog2(int v)
|
||||
{
|
||||
while(1) {
|
||||
if(v == 0) {
|
||||
return 0;
|
||||
}
|
||||
else if(v > 0) {
|
||||
unsigned l = 0;
|
||||
while(v) {
|
||||
l++;
|
||||
v >>= 1;
|
||||
}
|
||||
return l+1;
|
||||
}
|
||||
else if(v == -1) {
|
||||
return 2;
|
||||
}
|
||||
else {
|
||||
v++;
|
||||
v = -v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsigned FLAC__bitmath_silog2_wide(FLAC__int64 v)
|
||||
{
|
||||
while(1) {
|
||||
if(v == 0) {
|
||||
return 0;
|
||||
}
|
||||
else if(v > 0) {
|
||||
unsigned l = 0;
|
||||
while(v) {
|
||||
l++;
|
||||
v >>= 1;
|
||||
}
|
||||
return l+1;
|
||||
}
|
||||
else if(v == -1) {
|
||||
return 2;
|
||||
}
|
||||
else {
|
||||
v++;
|
||||
v = -v;
|
||||
}
|
||||
}
|
||||
}
|
85
source/FLAC/cpu.c
Normal file
85
source/FLAC/cpu.c
Normal file
|
@ -0,0 +1,85 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "private/cpu.h"
|
||||
#include<stdlib.h>
|
||||
#include<stdio.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_CMOV = 0x00008000;
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_MMX = 0x00800000;
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_FXSR = 0x01000000;
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_SSE = 0x02000000;
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_SSE2 = 0x04000000;
|
||||
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_3DNOW = 0x80000000;
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXT3DNOW = 0x40000000;
|
||||
const unsigned FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX = 0x00400000;
|
||||
|
||||
|
||||
void FLAC__cpu_info(FLAC__CPUInfo *info)
|
||||
{
|
||||
#ifdef FLAC__CPU_IA32
|
||||
info->type = FLAC__CPUINFO_TYPE_IA32;
|
||||
#if !defined FLAC__NO_ASM && defined FLAC__HAS_NASM
|
||||
info->use_asm = true;
|
||||
{
|
||||
unsigned cpuid = FLAC__cpu_info_asm_ia32();
|
||||
info->data.ia32.cmov = (cpuid & FLAC__CPUINFO_IA32_CPUID_CMOV)? true : false;
|
||||
info->data.ia32.mmx = (cpuid & FLAC__CPUINFO_IA32_CPUID_MMX)? true : false;
|
||||
info->data.ia32.fxsr = (cpuid & FLAC__CPUINFO_IA32_CPUID_FXSR)? true : false;
|
||||
info->data.ia32.sse = (cpuid & FLAC__CPUINFO_IA32_CPUID_SSE)? true : false;
|
||||
info->data.ia32.sse2 = (cpuid & FLAC__CPUINFO_IA32_CPUID_SSE2)? true : false;
|
||||
|
||||
#ifndef FLAC__SSE_OS
|
||||
info->data.ia32.fxsr = info->data.ia32.sse = info->data.ia32.sse2 = false;
|
||||
#endif
|
||||
|
||||
#ifdef FLAC__USE_3DNOW
|
||||
cpuid = FLAC__cpu_info_extended_amd_asm_ia32();
|
||||
info->data.ia32._3dnow = (cpuid & FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_3DNOW)? true : false;
|
||||
info->data.ia32.ext3dnow = (cpuid & FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXT3DNOW)? true : false;
|
||||
info->data.ia32.extmmx = (cpuid & FLAC__CPUINFO_IA32_CPUID_EXTENDED_AMD_EXTMMX)? true : false;
|
||||
#else
|
||||
info->data.ia32._3dnow = info->data.ia32.ext3dnow = info->data.ia32.extmmx = false;
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
info->use_asm = false;
|
||||
#endif
|
||||
#else
|
||||
info->type = FLAC__CPUINFO_TYPE_UNKNOWN;
|
||||
info->use_asm = false;
|
||||
#endif
|
||||
}
|
149
source/FLAC/crc.c
Normal file
149
source/FLAC/crc.c
Normal file
|
@ -0,0 +1,149 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000,2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "private/crc.h"
|
||||
|
||||
/* CRC-8, poly = x^8 + x^2 + x^1 + x^0, init = 0 */
|
||||
|
||||
FLAC__byte const FLAC__crc8_table[256] = {
|
||||
0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15,
|
||||
0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D,
|
||||
0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65,
|
||||
0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D,
|
||||
0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5,
|
||||
0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD,
|
||||
0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85,
|
||||
0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD,
|
||||
0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2,
|
||||
0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA,
|
||||
0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2,
|
||||
0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A,
|
||||
0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32,
|
||||
0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A,
|
||||
0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42,
|
||||
0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A,
|
||||
0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C,
|
||||
0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4,
|
||||
0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC,
|
||||
0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4,
|
||||
0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C,
|
||||
0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44,
|
||||
0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C,
|
||||
0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34,
|
||||
0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B,
|
||||
0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63,
|
||||
0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B,
|
||||
0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13,
|
||||
0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB,
|
||||
0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83,
|
||||
0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB,
|
||||
0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3
|
||||
};
|
||||
|
||||
/* CRC-16, poly = x^16 + x^15 + x^2 + x^0, init = 0 */
|
||||
|
||||
FLAC__uint16 FLAC__crc16_table[256] = {
|
||||
0x0000, 0x8005, 0x800f, 0x000a, 0x801b, 0x001e, 0x0014, 0x8011,
|
||||
0x8033, 0x0036, 0x003c, 0x8039, 0x0028, 0x802d, 0x8027, 0x0022,
|
||||
0x8063, 0x0066, 0x006c, 0x8069, 0x0078, 0x807d, 0x8077, 0x0072,
|
||||
0x0050, 0x8055, 0x805f, 0x005a, 0x804b, 0x004e, 0x0044, 0x8041,
|
||||
0x80c3, 0x00c6, 0x00cc, 0x80c9, 0x00d8, 0x80dd, 0x80d7, 0x00d2,
|
||||
0x00f0, 0x80f5, 0x80ff, 0x00fa, 0x80eb, 0x00ee, 0x00e4, 0x80e1,
|
||||
0x00a0, 0x80a5, 0x80af, 0x00aa, 0x80bb, 0x00be, 0x00b4, 0x80b1,
|
||||
0x8093, 0x0096, 0x009c, 0x8099, 0x0088, 0x808d, 0x8087, 0x0082,
|
||||
0x8183, 0x0186, 0x018c, 0x8189, 0x0198, 0x819d, 0x8197, 0x0192,
|
||||
0x01b0, 0x81b5, 0x81bf, 0x01ba, 0x81ab, 0x01ae, 0x01a4, 0x81a1,
|
||||
0x01e0, 0x81e5, 0x81ef, 0x01ea, 0x81fb, 0x01fe, 0x01f4, 0x81f1,
|
||||
0x81d3, 0x01d6, 0x01dc, 0x81d9, 0x01c8, 0x81cd, 0x81c7, 0x01c2,
|
||||
0x0140, 0x8145, 0x814f, 0x014a, 0x815b, 0x015e, 0x0154, 0x8151,
|
||||
0x8173, 0x0176, 0x017c, 0x8179, 0x0168, 0x816d, 0x8167, 0x0162,
|
||||
0x8123, 0x0126, 0x012c, 0x8129, 0x0138, 0x813d, 0x8137, 0x0132,
|
||||
0x0110, 0x8115, 0x811f, 0x011a, 0x810b, 0x010e, 0x0104, 0x8101,
|
||||
0x8303, 0x0306, 0x030c, 0x8309, 0x0318, 0x831d, 0x8317, 0x0312,
|
||||
0x0330, 0x8335, 0x833f, 0x033a, 0x832b, 0x032e, 0x0324, 0x8321,
|
||||
0x0360, 0x8365, 0x836f, 0x036a, 0x837b, 0x037e, 0x0374, 0x8371,
|
||||
0x8353, 0x0356, 0x035c, 0x8359, 0x0348, 0x834d, 0x8347, 0x0342,
|
||||
0x03c0, 0x83c5, 0x83cf, 0x03ca, 0x83db, 0x03de, 0x03d4, 0x83d1,
|
||||
0x83f3, 0x03f6, 0x03fc, 0x83f9, 0x03e8, 0x83ed, 0x83e7, 0x03e2,
|
||||
0x83a3, 0x03a6, 0x03ac, 0x83a9, 0x03b8, 0x83bd, 0x83b7, 0x03b2,
|
||||
0x0390, 0x8395, 0x839f, 0x039a, 0x838b, 0x038e, 0x0384, 0x8381,
|
||||
0x0280, 0x8285, 0x828f, 0x028a, 0x829b, 0x029e, 0x0294, 0x8291,
|
||||
0x82b3, 0x02b6, 0x02bc, 0x82b9, 0x02a8, 0x82ad, 0x82a7, 0x02a2,
|
||||
0x82e3, 0x02e6, 0x02ec, 0x82e9, 0x02f8, 0x82fd, 0x82f7, 0x02f2,
|
||||
0x02d0, 0x82d5, 0x82df, 0x02da, 0x82cb, 0x02ce, 0x02c4, 0x82c1,
|
||||
0x8243, 0x0246, 0x024c, 0x8249, 0x0258, 0x825d, 0x8257, 0x0252,
|
||||
0x0270, 0x8275, 0x827f, 0x027a, 0x826b, 0x026e, 0x0264, 0x8261,
|
||||
0x0220, 0x8225, 0x822f, 0x022a, 0x823b, 0x023e, 0x0234, 0x8231,
|
||||
0x8213, 0x0216, 0x021c, 0x8219, 0x0208, 0x820d, 0x8207, 0x0202
|
||||
};
|
||||
|
||||
|
||||
void FLAC__crc8_update(const FLAC__byte data, FLAC__uint8 *crc)
|
||||
{
|
||||
*crc = FLAC__crc8_table[*crc ^ data];
|
||||
}
|
||||
|
||||
void FLAC__crc8_update_block(const FLAC__byte *data, unsigned len, FLAC__uint8 *crc)
|
||||
{
|
||||
while(len--)
|
||||
*crc = FLAC__crc8_table[*crc ^ *data++];
|
||||
}
|
||||
|
||||
FLAC__uint8 FLAC__crc8(const FLAC__byte *data, unsigned len)
|
||||
{
|
||||
FLAC__uint8 crc = 0;
|
||||
|
||||
while(len--)
|
||||
crc = FLAC__crc8_table[crc ^ *data++];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void FLAC__crc16_update(const FLAC__byte data, FLAC__uint16 *crc)
|
||||
{
|
||||
*crc = (*crc<<8) ^ FLAC__crc16_table[(*crc>>8) ^ data];
|
||||
}
|
||||
|
||||
void FLAC__crc16_update_block(const FLAC__byte *data, unsigned len, FLAC__uint16 *crc)
|
||||
{
|
||||
while(len--)
|
||||
*crc = (*crc<<8) ^ FLAC__crc16_table[(*crc>>8) ^ *data++];
|
||||
}
|
||||
|
||||
FLAC__uint16 FLAC__crc16(const FLAC__byte *data, unsigned len)
|
||||
{
|
||||
FLAC__uint16 crc = 0;
|
||||
|
||||
while(len--)
|
||||
crc = (crc<<8) ^ FLAC__crc16_table[(crc>>8) ^ *data++];
|
||||
|
||||
return crc;
|
||||
}
|
231
source/FLAC/fixed.c
Normal file
231
source/FLAC/fixed.c
Normal file
|
@ -0,0 +1,231 @@
|
|||
/* libFLAC - Free Lossless Audio Codec library
|
||||
* Copyright (C) 2000,2001,2002,2003 Josh Coalson
|
||||
*
|
||||
* 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 Xiph.org Foundation 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 COPYRIGHT HOLDERS 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 FOUNDATION OR
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "private/fixed.h"
|
||||
#include "FLAC/assert.h"
|
||||
|
||||
#ifndef M_LN2
|
||||
/* math.h in VC++ doesn't seem to have this (how Microsoft is that?) */
|
||||
#define M_LN2 0.69314718055994530942
|
||||
#endif
|
||||
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
#define min(x,y) ((x) < (y)? (x) : (y))
|
||||
|
||||
#ifdef local_abs
|
||||
#undef local_abs
|
||||
#endif
|
||||
#define local_abs(x) ((unsigned)((x)<0? -(x) : (x)))
|
||||
|
||||
unsigned FLAC__fixed_compute_best_predictor(const FLAC__int32 data[], unsigned data_len, FLAC__real residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
{
|
||||
FLAC__int32 last_error_0 = data[-1];
|
||||
FLAC__int32 last_error_1 = data[-1] - data[-2];
|
||||
FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]);
|
||||
FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]);
|
||||
FLAC__int32 error, save;
|
||||
FLAC__uint32 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0;
|
||||
unsigned i, order;
|
||||
|
||||
for(i = 0; i < data_len; i++) {
|
||||
error = data[i] ; total_error_0 += local_abs(error); save = error;
|
||||
error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error;
|
||||
error -= last_error_1; total_error_2 += local_abs(error); last_error_1 = save; save = error;
|
||||
error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error;
|
||||
error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save;
|
||||
}
|
||||
|
||||
if(total_error_0 < min(min(min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
order = 0;
|
||||
else if(total_error_1 < min(min(total_error_2, total_error_3), total_error_4))
|
||||
order = 1;
|
||||
else if(total_error_2 < min(total_error_3, total_error_4))
|
||||
order = 2;
|
||||
else if(total_error_3 < total_error_4)
|
||||
order = 3;
|
||||
else
|
||||
order = 4;
|
||||
|
||||
/* Estimate the expected number of bits per residual signal sample. */
|
||||
/* 'total_error*' is linearly related to the variance of the residual */
|
||||
/* signal, so we use it directly to compute E(|x|) */
|
||||
FLAC__ASSERT(data_len > 0 || total_error_0 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_1 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_2 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_3 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_4 == 0);
|
||||
residual_bits_per_sample[0] = (FLAC__real)((total_error_0 > 0) ? log(M_LN2 * (double)total_error_0 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[1] = (FLAC__real)((total_error_1 > 0) ? log(M_LN2 * (double)total_error_1 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[2] = (FLAC__real)((total_error_2 > 0) ? log(M_LN2 * (double)total_error_2 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[3] = (FLAC__real)((total_error_3 > 0) ? log(M_LN2 * (double)total_error_3 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[4] = (FLAC__real)((total_error_4 > 0) ? log(M_LN2 * (double)total_error_4 / (double)data_len) / M_LN2 : 0.0);
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
unsigned FLAC__fixed_compute_best_predictor_wide(const FLAC__int32 data[], unsigned data_len, FLAC__real residual_bits_per_sample[FLAC__MAX_FIXED_ORDER+1])
|
||||
{
|
||||
FLAC__int32 last_error_0 = data[-1];
|
||||
FLAC__int32 last_error_1 = data[-1] - data[-2];
|
||||
FLAC__int32 last_error_2 = last_error_1 - (data[-2] - data[-3]);
|
||||
FLAC__int32 last_error_3 = last_error_2 - (data[-2] - 2*data[-3] + data[-4]);
|
||||
FLAC__int32 error, save;
|
||||
/* total_error_* are 64-bits to avoid overflow when encoding
|
||||
* erratic signals when the bits-per-sample and blocksize are
|
||||
* large.
|
||||
*/
|
||||
FLAC__uint64 total_error_0 = 0, total_error_1 = 0, total_error_2 = 0, total_error_3 = 0, total_error_4 = 0;
|
||||
unsigned i, order;
|
||||
|
||||
for(i = 0; i < data_len; i++) {
|
||||
error = data[i] ; total_error_0 += local_abs(error); save = error;
|
||||
error -= last_error_0; total_error_1 += local_abs(error); last_error_0 = save; save = error;
|
||||
error -= last_error_1; total_error_2 += local_abs(error); last_error_1 = save; save = error;
|
||||
error -= last_error_2; total_error_3 += local_abs(error); last_error_2 = save; save = error;
|
||||
error -= last_error_3; total_error_4 += local_abs(error); last_error_3 = save;
|
||||
}
|
||||
|
||||
if(total_error_0 < min(min(min(total_error_1, total_error_2), total_error_3), total_error_4))
|
||||
order = 0;
|
||||
else if(total_error_1 < min(min(total_error_2, total_error_3), total_error_4))
|
||||
order = 1;
|
||||
else if(total_error_2 < min(total_error_3, total_error_4))
|
||||
order = 2;
|
||||
else if(total_error_3 < total_error_4)
|
||||
order = 3;
|
||||
else
|
||||
order = 4;
|
||||
|
||||
/* Estimate the expected number of bits per residual signal sample. */
|
||||
/* 'total_error*' is linearly related to the variance of the residual */
|
||||
/* signal, so we use it directly to compute E(|x|) */
|
||||
FLAC__ASSERT(data_len > 0 || total_error_0 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_1 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_2 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_3 == 0);
|
||||
FLAC__ASSERT(data_len > 0 || total_error_4 == 0);
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
/* with VC++ you have to spoon feed it the casting */
|
||||
residual_bits_per_sample[0] = (FLAC__real)((total_error_0 > 0) ? log(M_LN2 * (double)(FLAC__int64)total_error_0 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[1] = (FLAC__real)((total_error_1 > 0) ? log(M_LN2 * (double)(FLAC__int64)total_error_1 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[2] = (FLAC__real)((total_error_2 > 0) ? log(M_LN2 * (double)(FLAC__int64)total_error_2 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[3] = (FLAC__real)((total_error_3 > 0) ? log(M_LN2 * (double)(FLAC__int64)total_error_3 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[4] = (FLAC__real)((total_error_4 > 0) ? log(M_LN2 * (double)(FLAC__int64)total_error_4 / (double)data_len) / M_LN2 : 0.0);
|
||||
#else
|
||||
residual_bits_per_sample[0] = (FLAC__real)((total_error_0 > 0) ? log(M_LN2 * (double)total_error_0 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[1] = (FLAC__real)((total_error_1 > 0) ? log(M_LN2 * (double)total_error_1 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[2] = (FLAC__real)((total_error_2 > 0) ? log(M_LN2 * (double)total_error_2 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[3] = (FLAC__real)((total_error_3 > 0) ? log(M_LN2 * (double)total_error_3 / (double)data_len) / M_LN2 : 0.0);
|
||||
residual_bits_per_sample[4] = (FLAC__real)((total_error_4 > 0) ? log(M_LN2 * (double)total_error_4 / (double)data_len) / M_LN2 : 0.0);
|
||||
#endif
|
||||
|
||||
return order;
|
||||
}
|
||||
|
||||
void FLAC__fixed_compute_residual(const FLAC__int32 data[], unsigned data_len, unsigned order, FLAC__int32 residual[])
|
||||
{
|
||||
const int idata_len = (int)data_len;
|
||||
int i;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
residual[i] = data[i];
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
residual[i] = data[i] - data[i-1];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
/* == data[i] - 2*data[i-1] + data[i-2] */
|
||||
residual[i] = data[i] - (data[i-1] << 1) + data[i-2];
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
/* == data[i] - 3*data[i-1] + 3*data[i-2] - data[i-3] */
|
||||
residual[i] = data[i] - (((data[i-1]-data[i-2])<<1) + (data[i-1]-data[i-2])) - data[i-3];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
/* == data[i] - 4*data[i-1] + 6*data[i-2] - 4*data[i-3] + data[i-4] */
|
||||
residual[i] = data[i] - ((data[i-1]+data[i-3])<<2) + ((data[i-2]<<2) + (data[i-2]<<1)) + data[i-4];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
||||
|
||||
void FLAC__fixed_restore_signal(const FLAC__int32 residual[], unsigned data_len, unsigned order, FLAC__int32 data[])
|
||||
{
|
||||
int i, idata_len = (int)data_len;
|
||||
|
||||
switch(order) {
|
||||
case 0:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
data[i] = residual[i];
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
data[i] = residual[i] + data[i-1];
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
/* == residual[i] + 2*data[i-1] - data[i-2] */
|
||||
data[i] = residual[i] + (data[i-1]<<1) - data[i-2];
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
/* residual[i] + 3*data[i-1] - 3*data[i-2]) + data[i-3] */
|
||||
data[i] = residual[i] + (((data[i-1]-data[i-2])<<1) + (data[i-1]-data[i-2])) + data[i-3];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
for(i = 0; i < idata_len; i++) {
|
||||
/* == residual[i] + 4*data[i-1] - 6*data[i-2] + 4*data[i-3] - data[i-4] */
|
||||
data[i] = residual[i] + ((data[i-1]+data[i-3])<<2) - ((data[i-2]<<2) + (data[i-2]<<1)) - data[i-4];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FLAC__ASSERT(0);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue