Initial community commit

This commit is contained in:
Jef
2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit 20d28e80a5
16810 changed files with 4640254 additions and 2 deletions

197
Src/alac/ALACMP4Decoder.cpp Normal file
View File

@ -0,0 +1,197 @@
/* copyright 2006 Ben Allison */
#include "ALACMP4Decoder.h"
#include "alac/ALACBitUtilities.h"
#include "api__alac.h"
#include "decomp.h"
#include <math.h>
#include <string.h>
#include "../external_dependencies/libmp4v2/mp4.h"
#include "../Plugins/Input/in_mp4/mpeg4audio.h"
// {B6CB4A7C-A8D0-4c55-8E60-9F7A7A23DA0F}
static const GUID playbackConfigGroupGUID =
{ 0xb6cb4a7c, 0xa8d0, 0x4c55, { 0x8e, 0x60, 0x9f, 0x7a, 0x7a, 0x23, 0xda, 0xf } };
int ALACMP4Decoder::OpenMP4(MP4FileHandle mp4_file, MP4TrackId mp4_track, size_t output_bits, size_t maxChannels, bool useFloat)
{
if (useFloat)
return MP4_FAILURE;
// get requested output bits
this->output_bits = (int)output_bits;
use_rg = false;
rg = 1.0f;
uint64_t val;
if (MP4GetTrackIntegerProperty(mp4_file, mp4_track, "mdia.minf.stbl.stsd.*[0].channels", &val))
channels = (int)val;
else
channels=2;
if (MP4GetTrackIntegerProperty(mp4_file, mp4_track, "mdia.minf.stbl.stsd.*[0].sampleSize", &val))
bps= (int)val;
else
bps=16;
return MP4_SUCCESS;
}
int ALACMP4Decoder::GetCurrentBitrate(unsigned int *bitrate)
{
if (mpAlacDecoder->mConfig.avgBitRate)
{
*bitrate = mpAlacDecoder->mConfig.avgBitRate;
return MP4_SUCCESS;
}
return MP4_GETCURRENTBITRATE_UNKNOWN; // TODO
}
/*
* 32 bits atom size
* 32 bits tag ("alac")
*
* Following data is passed to the function, ALACSpecificConfig structure (24 Bytes) does not contain
* "tag version", check and skip if data contains it
*
* 32 bits tag version (0)
* 32 bits samples per frame (used when not set explicitly in the frames) --> frameLength
* 8 bits compatible version (0)
* 8 bits sample size --> bitDepth
* 8 bits history mult (40)
* 8 bits initial history (10)
* 8 bits rice param limit (14)
* 8 bits channels --> numChannels
* 16 bits maxRun (255)
* 32 bits max coded frame size (0 means unknown) --> maxFrameBytes
* 32 bits average bitrate (0 means unknown)
* 32 bits samplerate
*/
int ALACMP4Decoder::AudioSpecificConfiguration(void *buffer, size_t buffer_size)
{
mpAlacDecoder = new ALACDecoder();
if (buffer_size > sizeof(ALACSpecificConfig))
{
// we have the "tag version" embedded;
// just skip
size_t skip = sizeof(uint32_t);
mpAlacDecoder->Init((void*)((char*)buffer + skip), sizeof(ALACSpecificConfig));
}
else
{
mpAlacDecoder->Init(buffer, buffer_size);
}
/*alac = create_alac(bps, channels);
alac_set_info(alac, reinterpret_cast<char *>(buffer));*/
return MP4_SUCCESS;
}
void ALACMP4Decoder::Flush()
{
// TODO
}
void ALACMP4Decoder::Close()
{
if (mpAlacDecoder)
{
delete mpAlacDecoder;
mpAlacDecoder = 0;
}
}
int ALACMP4Decoder::GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample)
{
*sampleRate = mpAlacDecoder->mConfig.sampleRate; // TODO: verify
*channels = mpAlacDecoder->mConfig.numChannels;
*bitsPerSample = mpAlacDecoder->mConfig.bitDepth;
return MP4_SUCCESS;
}
int ALACMP4Decoder::OutputFrameSize(size_t *frameSize)
{
*frameSize = mpAlacDecoder->mConfig.frameLength; // TODO: verify
return MP4_SUCCESS;
}
#define PA_CLIP_( val, min, max )\
{ val = ((val) < (min)) ? (min) : (((val) > (max)) ? (max) : (val)); }
inline static void clip(double &x, double a, double b)
{
double x1 = fabs (x - a);
double x2 = fabs (x - b);
x = x1 + (a + b);
x -= x2;
x *= 0.5;
}
int ALACMP4Decoder::DecodeSample(void *inputBuffer, size_t inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes)
{
struct BitBuffer inputChunk;
BitBufferInit(&inputChunk, (uint8_t*)(inputBuffer), inputBufferBytes);
uint32_t numFrames = 0;
mpAlacDecoder->Decode(&inputChunk, (uint8_t*)(outputBuffer), mpAlacDecoder->mConfig.frameLength , mpAlacDecoder->mConfig.numChannels, &numFrames);
size_t bytesPerSample = (mpAlacDecoder->mConfig.bitDepth / 8) * mpAlacDecoder->mConfig.numChannels;
*outputBufferBytes = mpAlacDecoder->mConfig.frameLength * bytesPerSample;
if (use_rg && mpAlacDecoder->mConfig.bitDepth == 16)
{
size_t numSamples = *outputBufferBytes / (mpAlacDecoder->mConfig.bitDepth / 8);
//if (bitsPerSample == 16)
{
// TODO: this algorithm assumes ALAC bps is 16!!
int16_t* audioBuffer = (int16_t*)outputBuffer;
for (size_t i = 0; i != numSamples; i++)
{
float sample = (float)audioBuffer[i];
int32_t temp = (int32_t)(sample * rg);
PA_CLIP_(temp, -0x8000, 0x7FFF);
audioBuffer[i] = (uint16_t)temp;
}
}
}
return MP4_SUCCESS;
}
const char *ALACMP4Decoder::GetCodecInfoString()
{
return "mdia.minf.stbl.stsd.alac.alac.decoderConfig";
}
int ALACMP4Decoder::CanHandleCodec(const char *codecName)
{
return !strcmp(codecName, "alac");
}
int ALACMP4Decoder::SetGain(float gain)
{
if (gain != 1.0f)
{
use_rg = true;
rg = gain;
}
return MP4_SUCCESS;
}
#ifdef CBCLASS
#undef CBCLASS
#endif
#define CBCLASS ALACMP4Decoder
START_DISPATCH;
CB(MPEG4_AUDIO_OPENMP4, OpenMP4)
CB(MPEG4_AUDIO_ASC, AudioSpecificConfiguration)
CB(MPEG4_AUDIO_BITRATE, GetCurrentBitrate)
CB(MPEG4_AUDIO_FRAMESIZE, OutputFrameSize)
CB(MPEG4_AUDIO_OUTPUTINFO, GetOutputProperties)
CB(MPEG4_AUDIO_DECODE, DecodeSample)
VCB(MPEG4_AUDIO_FLUSH, Flush)
VCB(MPEG4_AUDIO_CLOSE, Close)
CB(MPEG4_AUDIO_CODEC_INFO_STRING, GetCodecInfoString)
CB(MPEG4_AUDIO_HANDLES_CODEC, CanHandleCodec)
CB(MPEG4_AUDIO_SET_GAIN, SetGain)
END_DISPATCH;

43
Src/alac/ALACMP4Decoder.h Normal file
View File

@ -0,0 +1,43 @@
/* copyright 2006 Ben Allison */
#ifndef NULLSOFT_ALAC_DECODER_H
#define NULLSOFT_ALAC_DECODER_H
#include "alac/ALACDecoder.h"
#include "../Plugins/Input/in_mp4/mpeg4audio.h"
#include "decomp.h"
class ALACMP4Decoder : public MP4AudioDecoder
{
public:
ALACMP4Decoder()
: mpAlacDecoder(0),
channels(0),
bps(0),
output_bits(0),
use_rg(0),
rg(0.0)
{
}
int OpenMP4(MP4FileHandle mp4_file, MP4TrackId mp4_track, size_t output_bits, size_t maxChannels, bool useFloat);
int GetCurrentBitrate(unsigned int *bitrate);
int AudioSpecificConfiguration(void *buffer, size_t buffer_size); // reads ASC block from mp4 file
void Flush();
void Close();
int GetOutputProperties(unsigned int *sampleRate, unsigned int *channels, unsigned int *bitsPerSample);
int DecodeSample(void *inputBuffer, size_t inputBufferBytes, void *outputBuffer, size_t *outputBufferBytes);
int OutputFrameSize(size_t *frameSize);
const char *GetCodecInfoString();
int CanHandleCodec(const char *codecName);
int SetGain(float gain);
unsigned char setinfo_sample_size = 0x10;
private:
ALACDecoder *mpAlacDecoder;
int channels;
int bps;
int output_bits;
bool use_rg;
float rg;
protected:
RECVS_DISPATCH;
};
#endif

76
Src/alac/alac.rc Normal file
View File

@ -0,0 +1,76 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.K.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#include ""version.rc2""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.K.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "version.rc2"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

40
Src/alac/alac.sln Normal file
View File

@ -0,0 +1,40 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29424.173
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "alac", "alac.vcxproj", "{408D49EC-5673-4056-AD1B-910F00F0645C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmp4v2", "..\libmp4v2\libmp4v2.vcxproj", "{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{408D49EC-5673-4056-AD1B-910F00F0645C}.Debug|Win32.ActiveCfg = Debug|Win32
{408D49EC-5673-4056-AD1B-910F00F0645C}.Debug|Win32.Build.0 = Debug|Win32
{408D49EC-5673-4056-AD1B-910F00F0645C}.Release|Win32.ActiveCfg = Release|Win32
{408D49EC-5673-4056-AD1B-910F00F0645C}.Release|Win32.Build.0 = Release|Win32
{408D49EC-5673-4056-AD1B-910F00F0645C}.Debug|x64.ActiveCfg = Debug|x64
{408D49EC-5673-4056-AD1B-910F00F0645C}.Debug|x64.Build.0 = Debug|x64
{408D49EC-5673-4056-AD1B-910F00F0645C}.Release|x64.ActiveCfg = Release|x64
{408D49EC-5673-4056-AD1B-910F00F0645C}.Release|x64.Build.0 = Release|x64
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Debug|Win32.ActiveCfg = Debug|Win32
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Debug|Win32.Build.0 = Debug|Win32
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Release|Win32.ActiveCfg = Release|Win32
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Release|Win32.Build.0 = Release|Win32
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Debug|x64.ActiveCfg = Debug|x64
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Debug|x64.Build.0 = Debug|x64
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Release|x64.ActiveCfg = Release|x64
{EFB9B882-6A8B-463D-A8E3-A2807AFC5D9F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D66B4741-BA01-4B2F-BE08-17AF8930A1AE}
EndGlobalSection
EndGlobal

279
Src/alac/alac.vcxproj Normal file
View File

@ -0,0 +1,279 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{408D49EC-5673-4056-AD1B-910F00F0645C}</ProjectGuid>
<RootNamespace>alac</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
<TargetExt>.w5s</TargetExt>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
<TargetExt>.w5s</TargetExt>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
<TargetExt>.w5s</TargetExt>
<IncludePath>$(IncludePath)</IncludePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
<TargetExt>.w5s</TargetExt>
</PropertyGroup>
<PropertyGroup Label="Vcpkg">
<VcpkgEnableManifest>false</VcpkgEnableManifest>
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgConfiguration>Debug</VcpkgConfiguration>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
<VcpkgConfiguration>Debug</VcpkgConfiguration>
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<VcpkgInstalledDir>
</VcpkgInstalledDir>
<VcpkgUseStatic>false</VcpkgUseStatic>
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;ALAC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ShowIncludes>false</ShowIncludes>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<DelayLoadDLLs>libmp4v2.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>../Wasabi;../libmp4v2/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;ALAC_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<ShowIncludes>false</ShowIncludes>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>..\wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;ALAC_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<ObjectFileName>$(IntDir)</ObjectFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<DelayLoadDLLs>libmp4v2.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>true</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
<AdditionalIncludeDirectories>../Wasabi;../libmp4v2/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;ALAC_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<BufferSecurityCheck>true</BufferSecurityCheck>
<ObjectFileName>$(IntDir)</ObjectFileName>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>None</DebugInformationFormat>
<DisableSpecificWarnings>4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<DelayLoadDLLs>libmp4v2.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<GenerateDebugInformation>false</GenerateDebugInformation>
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\ </Command>
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\System\'</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ProjectReference Include="..\external_dependencies\libmp4v2\libmp4v2.vcxproj">
<Project>{efb9b882-6a8b-463d-a8e3-a2807afc5d9f}</Project>
</ProjectReference>
<ProjectReference Include="..\Wasabi\Wasabi.vcxproj">
<Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ALACMP4Decoder.cpp" />
<ClCompile Include="factory_alac.cpp" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ALACMP4Decoder.h" />
<ClInclude Include="api__alac.h" />
<ClInclude Include="factory_alac.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="wa5_alac.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="alac.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="factory_alac.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ALACMP4Decoder.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="api__alac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="factory_alac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="wa5_alac.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ALACMP4Decoder.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="Header Files">
<UniqueIdentifier>{70e7d580-75b4-4d89-a793-7b55f71171c0}</UniqueIdentifier>
</Filter>
<Filter Include="Ressource Files">
<UniqueIdentifier>{2360ef73-0d80-4128-95a1-e979e802985b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files">
<UniqueIdentifier>{d2db34b9-2292-47d3-b820-36f0894fec1b}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="alac.rc">
<Filter>Ressource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,245 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
0C0A79AA0BC0A29300FC9A90 /* alac.c in Sources */ = {isa = PBXBuildFile; fileRef = 0C0A79A90BC0A29300FC9A90 /* alac.c */; };
0C0A79AD0BC0A2A100FC9A90 /* decomp.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C0A79AC0BC0A2A100FC9A90 /* decomp.h */; };
0C0A79C20BC0A2D500FC9A90 /* ALACDecoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C0A79C00BC0A2D500FC9A90 /* ALACDecoder.cpp */; };
0C0A79C30BC0A2D500FC9A90 /* ALACDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C0A79C10BC0A2D500FC9A90 /* ALACDecoder.h */; };
0C0A79F60BC0A35D00FC9A90 /* api.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C0A79F50BC0A35D00FC9A90 /* api.cpp */; };
0C0A7A000BC0A36F00FC9A90 /* factory_alac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C0A79FB0BC0A36F00FC9A90 /* factory_alac.cpp */; };
0C0A7A010BC0A36F00FC9A90 /* factory_alac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C0A79FC0BC0A36F00FC9A90 /* factory_alac.h */; };
0C0A7A020BC0A36F00FC9A90 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0C0A79FD0BC0A36F00FC9A90 /* main.cpp */; };
0C0A7A030BC0A36F00FC9A90 /* wa5_alac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C0A79FE0BC0A36F00FC9A90 /* wa5_alac.h */; };
0C0A7A040BC0A36F00FC9A90 /* api.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C0A79FF0BC0A36F00FC9A90 /* api.h */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
0C0A79A90BC0A29300FC9A90 /* alac.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = alac.c; sourceTree = "<group>"; };
0C0A79AC0BC0A2A100FC9A90 /* decomp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = decomp.h; sourceTree = "<group>"; };
0C0A79C00BC0A2D500FC9A90 /* ALACDecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ALACDecoder.cpp; sourceTree = "<group>"; };
0C0A79C10BC0A2D500FC9A90 /* ALACDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ALACDecoder.h; sourceTree = "<group>"; };
0C0A79F50BC0A35D00FC9A90 /* api.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = api.cpp; sourceTree = "<group>"; };
0C0A79FB0BC0A36F00FC9A90 /* factory_alac.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = factory_alac.cpp; sourceTree = "<group>"; };
0C0A79FC0BC0A36F00FC9A90 /* factory_alac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = factory_alac.h; sourceTree = "<group>"; };
0C0A79FD0BC0A36F00FC9A90 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
0C0A79FE0BC0A36F00FC9A90 /* wa5_alac.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = wa5_alac.h; sourceTree = "<group>"; };
0C0A79FF0BC0A36F00FC9A90 /* api.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = api.h; sourceTree = "<group>"; };
D2AAC0630554660B00DB518D /* libalac.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libalac.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
D289988505E68E00004EDB86 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
08FB7794FE84155DC02AAC07 /* alac */ = {
isa = PBXGroup;
children = (
08FB7795FE84155DC02AAC07 /* Source */,
1AB674ADFE9D54B511CA2CBB /* Products */,
);
name = alac;
sourceTree = "<group>";
};
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
0C0A7A070BC0A37B00FC9A90 /* Wasabi */,
0C0A7A060BC0A37500FC9A90 /* ALAC */,
);
name = Source;
sourceTree = "<group>";
};
0C0A7A060BC0A37500FC9A90 /* ALAC */ = {
isa = PBXGroup;
children = (
0C0A79A90BC0A29300FC9A90 /* alac.c */,
0C0A79AC0BC0A2A100FC9A90 /* decomp.h */,
);
name = ALAC;
sourceTree = "<group>";
};
0C0A7A070BC0A37B00FC9A90 /* Wasabi */ = {
isa = PBXGroup;
children = (
0C0A79C00BC0A2D500FC9A90 /* ALACDecoder.cpp */,
0C0A79C10BC0A2D500FC9A90 /* ALACDecoder.h */,
0C0A79F50BC0A35D00FC9A90 /* api.cpp */,
0C0A79FB0BC0A36F00FC9A90 /* factory_alac.cpp */,
0C0A79FC0BC0A36F00FC9A90 /* factory_alac.h */,
0C0A79FD0BC0A36F00FC9A90 /* main.cpp */,
0C0A79FE0BC0A36F00FC9A90 /* wa5_alac.h */,
0C0A79FF0BC0A36F00FC9A90 /* api.h */,
);
name = Wasabi;
sourceTree = "<group>";
};
1AB674ADFE9D54B511CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
D2AAC0630554660B00DB518D /* libalac.dylib */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
D2AAC0600554660B00DB518D /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
0C0A79AD0BC0A2A100FC9A90 /* decomp.h in Headers */,
0C0A79C30BC0A2D500FC9A90 /* ALACDecoder.h in Headers */,
0C0A7A010BC0A36F00FC9A90 /* factory_alac.h in Headers */,
0C0A7A030BC0A36F00FC9A90 /* wa5_alac.h in Headers */,
0C0A7A040BC0A36F00FC9A90 /* api.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
D2AAC0620554660B00DB518D /* alac */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "alac" */;
buildPhases = (
D2AAC0600554660B00DB518D /* Headers */,
D2AAC0610554660B00DB518D /* Sources */,
D289988505E68E00004EDB86 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = alac;
productName = alac;
productReference = D2AAC0630554660B00DB518D /* libalac.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "alac" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
mainGroup = 08FB7794FE84155DC02AAC07 /* alac */;
projectDirPath = "";
projectRoot = "";
targets = (
D2AAC0620554660B00DB518D /* alac */,
);
};
/* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */
D2AAC0610554660B00DB518D /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0C0A79AA0BC0A29300FC9A90 /* alac.c in Sources */,
0C0A79C20BC0A2D500FC9A90 /* ALACDecoder.cpp in Sources */,
0C0A79F60BC0A35D00FC9A90 /* api.cpp in Sources */,
0C0A7A000BC0A36F00FC9A90 /* factory_alac.cpp in Sources */,
0C0A7A020BC0A36F00FC9A90 /* main.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB914B08733D8E0010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
EXECUTABLE_EXTENSION = w5s;
EXECUTABLE_PREFIX = "";
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = alac;
ZERO_LINK = YES;
};
name = Debug;
};
1DEB914C08733D8E0010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
i386,
ppc,
ppc64,
x86_64,
);
EXECUTABLE_PREFIX = lib;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = /usr/local/lib;
PRODUCT_NAME = alac;
};
name = Release;
};
1DEB914F08733D8E0010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../Wasabi;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
};
name = Debug;
};
1DEB915008733D8E0010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../Wasabi;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.5.sdk;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB914A08733D8E0010E9CD /* Build configuration list for PBXNativeTarget "alac" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB914B08733D8E0010E9CD /* Debug */,
1DEB914C08733D8E0010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "alac" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB914F08733D8E0010E9CD /* Debug */,
1DEB915008733D8E0010E9CD /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
}

11
Src/alac/api__alac.h Normal file
View File

@ -0,0 +1,11 @@
/* copyright 2006 Ben Allison */
#ifndef NULLSOFT_ALAC_API_H
#define NULLSOFT_ALAC_API_H
#include "api/service/api_service.h"
extern api_service *serviceManager;
#define WASABI_API_SVC serviceManager
#include "../Agave/Config/api_config.h"
#endif // !NULLSOFT_ALAC_API_H

61
Src/alac/decomp.h Normal file
View File

@ -0,0 +1,61 @@
/* copyright 2006 David Hammerton, Ben Allison */
#ifndef __ALAC__DECOMP_H
#define __ALAC__DECOMP_H
#include <bfc/platform/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct alac_file
{
unsigned char *input_buffer;
int input_buffer_bitaccumulator; /* used so we can do arbitary
bit reads */
int samplesize;
int numchannels;
int bytespersample;
/* buffers */
int32_t *predicterror_buffer_a;
int32_t *predicterror_buffer_b;
int32_t *outputsamples_buffer_a;
int32_t *outputsamples_buffer_b;
int32_t *uncompressed_bytes_buffer_a;
int32_t *uncompressed_bytes_buffer_b;
/* stuff from setinfo */
uint32_t setinfo_max_samples_per_frame; /* 0x1000 = 4096 */ /* max samples per frame? */
uint8_t setinfo_7a; /* 0x00 */
uint8_t setinfo_sample_size; /* 0x10 */ /* bits per sample */
uint8_t setinfo_rice_historymult; /* 0x28 */
uint8_t setinfo_rice_initialhistory; /* 0x0a */
uint8_t setinfo_rice_kmodifier; /* 0x0e */
uint8_t setinfo_7f; /* 0x02 */ /* channels? */
uint16_t setinfo_80; /* 0x00ff, 255 */
uint32_t setinfo_82; /* 0x000020e7, 8423 */ /* max sample size?? */
uint32_t setinfo_86; /* 0x00069fe4, 434148 */ /* bit rate (avarge)?? */
uint32_t setinfo_sample_rate; /* 0x0000ac44, 44100 */ /* samplerate? */
/* end setinfo stuff */
int32_t last_bitrate;
} alac_file;
alac_file *create_alac(int samplesize, int numchannels);
void decode_frame(alac_file *alac,
unsigned char *inbuffer,
void *outbuffer, int *outputsize);
void alac_set_info(alac_file *alac, char *inputbuffer);
void destroy_alac(alac_file *alac);
#ifdef __cplusplus
}
#endif
#endif /* __ALAC__DECOMP_H */

72
Src/alac/factory_alac.cpp Normal file
View File

@ -0,0 +1,72 @@
/* copyright 2006 Ben Allison */
#include "factory_alac.h"
#include "ALACMP4Decoder.h"
static const char serviceName[] = "ALAC Decoder";
static const char testString[] = "alac";
// {47ADFABA-BDB5-4e2e-A91F-BC184C123DE9}
static const GUID api_downloads_GUID= { 0x47adfaba, 0xbdb5, 0x4e2e, { 0xa9, 0x1f, 0xbc, 0x18, 0x4c, 0x12, 0x3d, 0xe9 } };
FOURCC ALACFactory::GetServiceType()
{
return WaSvc::MP4AUDIODECODER;
}
const char *ALACFactory::GetServiceName()
{
return serviceName;
}
GUID ALACFactory::GetGUID()
{
return api_downloads_GUID;
}
void *ALACFactory::GetInterface(int global_lock)
{
MP4AudioDecoder *ifc=new ALACMP4Decoder;
// if (global_lock)
// WASABI_API_SVC->service_lock(this, (void *)ifc);
return ifc;
}
int ALACFactory::SupportNonLockingInterface()
{
return 1;
}
int ALACFactory::ReleaseInterface(void *ifc)
{
//WASABI_API_SVC->service_unlock(ifc);
MP4AudioDecoder *decoder = static_cast<MP4AudioDecoder *>(ifc);
ALACMP4Decoder *aacPlusDecoder = static_cast<ALACMP4Decoder *>(decoder);
delete aacPlusDecoder;
return 1;
}
const char *ALACFactory::GetTestString()
{
return testString;
}
int ALACFactory::ServiceNotify(int msg, int param1, int param2)
{
return 1;
}
#ifdef CBCLASS
#undef CBCLASS
#endif
#define CBCLASS ALACFactory
START_DISPATCH;
CB( WASERVICEFACTORY_GETSERVICETYPE, GetServiceType )
CB( WASERVICEFACTORY_GETSERVICENAME, GetServiceName )
CB( WASERVICEFACTORY_GETGUID, GetGUID )
CB( WASERVICEFACTORY_GETINTERFACE, GetInterface )
CB( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface )
CB( WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface )
CB( WASERVICEFACTORY_GETTESTSTRING, GetTestString )
CB( WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify )
END_DISPATCH;

25
Src/alac/factory_alac.h Normal file
View File

@ -0,0 +1,25 @@
/* copyright 2006 Ben Allison */
#ifndef NULLSOFT_FACTORY_ALAC_H
#define NULLSOFT_FACTORY_ALAC_H
#include "api__alac.h"
#include <api/service/waservicefactory.h>
#include <api/service/services.h>
class ALACFactory : public waServiceFactory
{
public:
FOURCC GetServiceType();
const char *GetServiceName();
GUID GetGUID();
void *GetInterface( int global_lock );
int SupportNonLockingInterface();
int ReleaseInterface( void *ifc );
const char *GetTestString();
int ServiceNotify( int msg, int param1, int param2 );
protected:
RECVS_DISPATCH;
};
#endif // !NULLSOFT_FACTORY_ALAC_H

69
Src/alac/main.cpp Normal file
View File

@ -0,0 +1,69 @@
/* copyright 2006 Ben Allison */
#include "api__alac.h"
#include "wa5_alac.h"
#include "factory_alac.h"
#include <bfc/platform/export.h>
#include <api/service/waservicefactory.h>
api_service *WASABI_API_SVC = 0;
api_config *AGAVE_API_CONFIG = 0;
static ALACFactory alacFactory;
static WA5_ALAC wa5_alac;
template <class api_T>
void ServiceBuild(api_T *&api_t, GUID factoryGUID_t)
{
if (WASABI_API_SVC)
{
waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(factoryGUID_t);
if (factory)
api_t = reinterpret_cast<api_T *>( factory->getInterface() );
}
}
template <class api_T>
void ServiceRelease(api_T *api_t, GUID factoryGUID_t)
{
if (WASABI_API_SVC && api_t)
{
waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(factoryGUID_t);
if (factory)
factory->releaseInterface(api_t);
}
api_t = NULL;
}
void WA5_ALAC::RegisterServices(api_service *service)
{
WASABI_API_SVC = service;
ServiceBuild(AGAVE_API_CONFIG, AgaveConfigGUID);
WASABI_API_SVC->service_register(&alacFactory);
}
int WA5_ALAC::RegisterServicesSafeModeOk()
{
return 1;
}
void WA5_ALAC::DeregisterServices(api_service *service)
{
service->service_deregister(&alacFactory);
ServiceRelease(AGAVE_API_CONFIG, AgaveConfigGUID);
}
extern "C" DLLEXPORT ifc_wa5component *GetWinamp5SystemComponent()
{
return &wa5_alac;
}
#ifdef CBCLASS
#undef CBCLASS
#endif
#define CBCLASS WA5_ALAC
START_DISPATCH;
VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
CB(15, RegisterServicesSafeModeOk)
VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
END_DISPATCH;

14
Src/alac/resource.h Normal file
View File

@ -0,0 +1,14 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by alac.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

39
Src/alac/version.rc2 Normal file
View File

@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
#include "../Winamp/buildType.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION WINAMP_PRODUCTVER
PRODUCTVERSION WINAMP_PRODUCTVER
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Winamp SA"
VALUE "FileDescription", "Winamp 5.x System Component"
VALUE "FileVersion", STR_WINAMP_PRODUCTVER
VALUE "InternalName", "alac.w5s"
VALUE "LegalCopyright", "Copyright <20> 2007-2019 Winamp SA"
VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
VALUE "OriginalFilename", "alac.w5s"
VALUE "ProductName", "Winamp ALAC Decoder Service"
VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

18
Src/alac/wa5_alac.h Normal file
View File

@ -0,0 +1,18 @@
/* copyright 2006 Ben Allison */
#ifndef __WASABI_WA5_ALAC_H
#define __WASABI_WA5_ALAC_H
#include "../Agave/Component/ifc_wa5component.h"
class WA5_ALAC : public ifc_wa5component
{
public:
void RegisterServices( api_service *service );
int RegisterServicesSafeModeOk();
void DeregisterServices( api_service *service );
protected:
RECVS_DISPATCH;
};
#endif