Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
BIN
Src/Plugins/Encoder/enc_vorbis/Libs/libogg_static.lib
Normal file
BIN
Src/Plugins/Encoder/enc_vorbis/Libs/libogg_static.lib
Normal file
Binary file not shown.
BIN
Src/Plugins/Encoder/enc_vorbis/Libs/vorbis_static.lib
Normal file
BIN
Src/Plugins/Encoder/enc_vorbis/Libs/vorbis_static.lib
Normal file
Binary file not shown.
BIN
Src/Plugins/Encoder/enc_vorbis/Libs/vorbisenc_static.lib
Normal file
BIN
Src/Plugins/Encoder/enc_vorbis/Libs/vorbisenc_static.lib
Normal file
Binary file not shown.
100
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.rc
Normal file
100
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.rc
Normal file
|
@ -0,0 +1,100 @@
|
|||
// 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
|
||||
|
||||
#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
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_CONFIG DIALOGEX 0, 0, 256, 167
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "Ogg Vorbis Encoder Options",IDC_STATIC,0,0,256,166
|
||||
LTEXT "Quality Factor: 0.0",IDC_VBRVAL,7,13,149,8
|
||||
CONTROL "",IDC_VBRQUALITY,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,5,23,243,17
|
||||
LTEXT "Low Quality\nSmall Files",IDC_VBR1,9,43,44,22
|
||||
LTEXT "High Quality\nLarge Files",IDC_VBR2,208,43,40,22
|
||||
LTEXT "Ogg Vorbis is an open, free audio format,\nThis encoder is based on aoTuV,",IDC_STATIC,5,143,242,19
|
||||
CONTROL "http://xiph.org/vorbis/",IDC_URL1,"Button",BS_OWNERDRAW | WS_TABSTOP,138,143,78,8
|
||||
CONTROL "https://ao-yumi.github.io/aotuv_web/index.html",IDC_URL2,"Button",BS_OWNERDRAW | WS_TABSTOP,109,151,138,8
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
65535 "{A23C2B70-C66B-475e-8A67-E0F33FD5BD12}"
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_ENC_VORBIS_DESC "Ogg Vorbis Encoder"
|
||||
IDS_QUALITY_FACTOR_F_KBPS "Quality Factor: %.1lf (%d kbps)"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#include "version.rc2"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
60
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.sln
Normal file
60
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.sln
Normal file
|
@ -0,0 +1,60 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29519.181
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "enc_vorbis", "enc_vorbis.vcxproj", "{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbis_static", "..\libvorbis\win32\vorbis_static.vcxproj", "{49238ED1-3146-49AB-9523-E9826EE4A0C8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libvorbisfile", "..\libvorbis\win32\vorbisfile_static.vcxproj", "{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libogg", "..\libogg\libogg.vcxproj", "{4FC28B55-2A14-43D5-86F7-201054F338A9}"
|
||||
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
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Debug|x64.Build.0 = Debug|x64
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Release|Win32.Build.0 = Release|Win32
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Release|x64.ActiveCfg = Release|x64
|
||||
{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}.Release|x64.Build.0 = Release|x64
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Debug|x64.Build.0 = Debug|x64
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Release|Win32.Build.0 = Release|Win32
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Release|x64.ActiveCfg = Release|x64
|
||||
{49238ED1-3146-49AB-9523-E9826EE4A0C8}.Release|x64.Build.0 = Release|x64
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Debug|x64.Build.0 = Debug|x64
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Release|Win32.Build.0 = Release|Win32
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Release|x64.ActiveCfg = Release|x64
|
||||
{EC9475D2-FEE2-4F8C-9BB9-A11D5EB597C4}.Release|x64.Build.0 = Release|x64
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Debug|x64.Build.0 = Debug|x64
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Release|Win32.Build.0 = Release|Win32
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Release|x64.ActiveCfg = Release|x64
|
||||
{4FC28B55-2A14-43D5-86F7-201054F338A9}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3845173A-0CB9-4C0E-86B0-284CCE7B043A}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
297
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.vcxproj
Normal file
297
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.vcxproj
Normal file
|
@ -0,0 +1,297 @@
|
|||
<?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>{3AC18E6A-7C92-4156-8117-CAFC6A781DAD}</ProjectGuid>
|
||||
<RootNamespace>enc_vorbis</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|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>
|
||||
</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>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
<IncludePath>$(IncludePath)</IncludePath>
|
||||
<LibraryPath>$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(PlatformShortName)_$(Configuration)\</OutDir>
|
||||
<IntDir>$(PlatformShortName)_$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="Vcpkg">
|
||||
<VcpkgEnableManifest>false</VcpkgEnableManifest>
|
||||
</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)'=='Release|x64'">
|
||||
<VcpkgInstalledDir>
|
||||
</VcpkgInstalledDir>
|
||||
<VcpkgUseStatic>false</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
</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)'=='Debug|x64'">
|
||||
<VcpkgInstalledDir>
|
||||
</VcpkgInstalledDir>
|
||||
<VcpkgUseStatic>false</VcpkgUseStatic>
|
||||
<VcpkgTriplet>x86-windows-static-md</VcpkgTriplet>
|
||||
<VcpkgConfiguration>Debug</VcpkgConfiguration>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NSV_CODER_MP3_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/ignore:4204 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\external_dependencies\openmpt-trunk\build\lib\$(PlatformShortName)_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<DelayLoadDLLs>uxtheme.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\
|
||||
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;NSV_CODER_MP3_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<CompileAs>Default</CompileAs>
|
||||
<DisableSpecificWarnings>4312;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/ignore:4204 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\external_dependencies\openmpt-trunk\build\lib\$(PlatformShortName)_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<DelayLoadDLLs>uxtheme.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\
|
||||
xcopy /Y /D $(IntDir)$(TargetName).pdb ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;NSV_CODER_MP3_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/ignore:4210 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\external_dependencies\openmpt-trunk\build\lib\$(PlatformShortName)_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<DelayLoadDLLs>uxtheme.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MinSpace</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||
<AdditionalIncludeDirectories>.;..\..\..\Wasabi;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;NSV_CODER_MP3_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<BufferSecurityCheck>true</BufferSecurityCheck>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)$(TargetName).pdb</ProgramDataBaseFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<DisableSpecificWarnings>4312;4701;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0409</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalOptions>/ignore:4210 %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalDependencies>uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
|
||||
<AdditionalLibraryDirectories>..\..\..\external_dependencies\openmpt-trunk\build\lib\$(PlatformShortName)_$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<DelayLoadDLLs>uxtheme.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(IntDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
|
||||
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Command>xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\ </Command>
|
||||
<Message>Post build event: 'xcopy /Y /D $(OutDir)$(TargetName)$(TargetExt) ..\..\..\..\Build\Winamp_$(PlatformShortName)_$(Configuration)\Plugins\'</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Wasabi\Wasabi.vcxproj">
|
||||
<Project>{3e0bfa8a-b86a-42e9-a33f-ec294f823f7f}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;NSV_CODER_MP3_EXPORTS</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">WIN64;_DEBUG;_WINDOWS;_MBCS;_USRDLL;NSV_CODER_MP3_EXPORTS</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="enc_vorbis.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
29
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.vcxproj.filters
Normal file
29
Src/Plugins/Encoder/enc_vorbis/enc_vorbis.vcxproj.filters
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{60891243-3702-45a9-8316-6dd4c4fe1657}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Ressource Files">
|
||||
<UniqueIdentifier>{0dcd9aec-855c-4009-8908-41d2d4c57e21}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{327bdd16-a664-4de5-9595-33490dffe0f7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="enc_vorbis.rc">
|
||||
<Filter>Ressource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
595
Src/Plugins/Encoder/enc_vorbis/main.cpp
Normal file
595
Src/Plugins/Encoder/enc_vorbis/main.cpp
Normal file
|
@ -0,0 +1,595 @@
|
|||
/*
|
||||
** enc_vorbis: main.cpp - Ogg Vorbis encoder plug-in
|
||||
**
|
||||
** Copyright (C) 2001-2012 Nullsoft, Inc.
|
||||
**
|
||||
** This software is provided 'as-is', without any express or implied warranty.
|
||||
** In no event will the authors be held liable for any damages arising from the use of this software.
|
||||
**
|
||||
** Permission is granted to anyone to use this software for any purpose, including commercial
|
||||
** applications, and to alter it and redistribute it freely, subject to the following restrictions:
|
||||
** 1. The origin of this software must not be misrepresented; you must not claim that you wrote the
|
||||
** original software. If you use this software in a product, an acknowledgment in the product
|
||||
** documentation would be appreciated but is not required.
|
||||
** 2. Altered source versions must be plainly marked as such, and must not be misrepresented as
|
||||
** being the original software.
|
||||
** 3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#define ENC_VERSION "v1.58"
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <uxtheme.h>
|
||||
#include <strsafe.h>
|
||||
#include "resource.h"
|
||||
#include "../nsv/enc_if.h"
|
||||
#include <vorbis/vorbisenc.h>
|
||||
|
||||
// wasabi based services for localisation support
|
||||
#include <api/service/waServiceFactory.h>
|
||||
#include "../Agave/Language/api_language.h"
|
||||
#include <api/application/api_application.h>
|
||||
#include "../winamp/wa_ipc.h"
|
||||
|
||||
HWND winampwnd = 0;
|
||||
int isthemethere = 0;
|
||||
api_service *WASABI_API_SVC = 0;
|
||||
api_application *WASABI_API_APP = 0;
|
||||
api_language *WASABI_API_LNG = 0;
|
||||
HINSTANCE WASABI_API_LNG_HINST = 0, WASABI_API_ORIG_HINST = 0;
|
||||
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool cfg_abr_use_max,cfg_abr_use_min;
|
||||
UINT cfg_mode;
|
||||
|
||||
float cfg_vbrquality;
|
||||
UINT cfg_abr_nominal;
|
||||
UINT cfg_abr_max;
|
||||
UINT cfg_abr_min;
|
||||
} configtype;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
configtype cfg;
|
||||
char *configfile;
|
||||
}
|
||||
configwndrec;
|
||||
|
||||
void readconfig(char *configfile, configtype *cfg)
|
||||
{
|
||||
cfg->cfg_abr_use_max=0;
|
||||
cfg->cfg_abr_use_min=0;
|
||||
cfg->cfg_mode=0; //VBR
|
||||
|
||||
cfg->cfg_vbrquality=0.4f;
|
||||
|
||||
cfg->cfg_abr_nominal=160;
|
||||
cfg->cfg_abr_max=352;
|
||||
cfg->cfg_abr_min=32;
|
||||
|
||||
if (configfile) GetPrivateProfileStructA("audio_ogg","conf",cfg,sizeof(configtype),configfile);
|
||||
cfg->cfg_mode=0; // VBR, fuckers.
|
||||
}
|
||||
|
||||
void writeconfig(char *configfile, configtype *cfg)
|
||||
{
|
||||
if (configfile) WritePrivateProfileStructA("audio_ogg","conf",cfg,sizeof(configtype),configfile);
|
||||
}
|
||||
|
||||
static HINSTANCE GetMyInstance()
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi = {0};
|
||||
if(VirtualQuery(GetMyInstance, &mbi, sizeof(mbi)))
|
||||
return (HINSTANCE)mbi.AllocationBase;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void GetLocalisationApiService(void)
|
||||
{
|
||||
if(!WASABI_API_LNG)
|
||||
{
|
||||
// loader so that we can get the localisation service api for use
|
||||
if(!WASABI_API_SVC)
|
||||
{
|
||||
WASABI_API_SVC = (api_service*)SendMessage(winampwnd, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
|
||||
if (WASABI_API_SVC == (api_service*)1)
|
||||
{
|
||||
WASABI_API_SVC = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(!WASABI_API_APP)
|
||||
{
|
||||
waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(applicationApiServiceGuid);
|
||||
if (sf) WASABI_API_APP = reinterpret_cast<api_application*>(sf->getInterface());
|
||||
}
|
||||
|
||||
if(!WASABI_API_LNG)
|
||||
{
|
||||
waServiceFactory *sf;
|
||||
sf = WASABI_API_SVC->service_getServiceByGuid(languageApiGUID);
|
||||
if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());
|
||||
}
|
||||
|
||||
// need to have this initialised before we try to do anything with localisation features
|
||||
WASABI_API_START_LANG(GetMyInstance(),EncVorbisLangGUID);
|
||||
}
|
||||
}
|
||||
|
||||
class AudioCoderOgg : public AudioCoder
|
||||
{
|
||||
public:
|
||||
AudioCoderOgg(int nch, int srate, int bps, configtype *cfg);
|
||||
int Encode(int framepos, void *in, int in_avail, int *in_used, void *out, int out_avail);
|
||||
~AudioCoderOgg()
|
||||
{
|
||||
ogg_stream_clear(&os);
|
||||
vorbis_block_clear(&vb);
|
||||
vorbis_dsp_clear(&vd);
|
||||
vorbis_comment_clear(&vc);
|
||||
vorbis_info_clear(&vi);
|
||||
}
|
||||
int GetLastError() { return m_err; };
|
||||
private:
|
||||
int m_err;
|
||||
int m_bps, m_nch;
|
||||
|
||||
ogg_stream_state os; /* take physical pages, weld into a logical stream of packets */
|
||||
ogg_page og; /* one Ogg bitstream page. Vorbis packets are inside */
|
||||
ogg_packet op; /* one raw packet of data for decode */
|
||||
|
||||
vorbis_info vi; /* struct that stores all the static vorbis bitstream settings */
|
||||
vorbis_comment vc; /* struct that stores all the user comments */
|
||||
|
||||
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
|
||||
vorbis_block vb; /* local working space for packet->PCM decode */
|
||||
|
||||
int m_inbuf;
|
||||
};
|
||||
|
||||
int AudioCoderOgg::Encode(int framepos, void *in, int in_avail, int *in_used, void *out, int out_avail)
|
||||
{
|
||||
if (m_err) return -1;
|
||||
*in_used = 0; //only necessary for flawed impl that dont reset this to zero each time (BAD rOn)
|
||||
|
||||
int wrote=0;
|
||||
char *dest = (char*)out;
|
||||
|
||||
if (!in_avail && !framepos)
|
||||
{
|
||||
vorbis_analysis_wrote(&vd,0);
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
/* vorbis does some data preanalysis, then divvies up blocks for
|
||||
more involved (potentially parallel) processing. Get a single
|
||||
block for encoding now */
|
||||
|
||||
while (m_inbuf || vorbis_analysis_blockout(&vd,&vb)==1)
|
||||
{
|
||||
/* analysis */
|
||||
if (!m_inbuf)
|
||||
{
|
||||
vorbis_analysis(&vb,&op);
|
||||
vorbis_bitrate_addblock(&vb);
|
||||
}
|
||||
|
||||
while (m_inbuf || vorbis_bitrate_flushpacket(&vd, &op))
|
||||
{
|
||||
/* weld the packet into the bitstream */
|
||||
if (!m_inbuf) ogg_stream_packetin(&os,&op);
|
||||
|
||||
/* write out pages (if any) */
|
||||
while (m_inbuf || ogg_stream_pageout(&os,&og))
|
||||
{
|
||||
int l=og.header_len+og.body_len;
|
||||
if(out_avail<l)
|
||||
{
|
||||
m_inbuf=1;
|
||||
return wrote;
|
||||
}
|
||||
memcpy(dest,og.header,og.header_len);
|
||||
memcpy(dest+og.header_len,og.body,og.body_len);
|
||||
dest+=l;
|
||||
wrote+=l;
|
||||
out_avail-=l;
|
||||
m_inbuf=0;
|
||||
|
||||
if (ogg_page_eos(&og)) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if we used all our samples, or had output, flush it
|
||||
if (*in_used >= in_avail || wrote) return wrote;
|
||||
|
||||
// bring in more pcm samples
|
||||
if (in_avail > *in_used)
|
||||
{
|
||||
UINT i;
|
||||
int c;
|
||||
int bytes=in_avail-*in_used;
|
||||
void *buf=(char*)in + *in_used;
|
||||
|
||||
if (bytes > 1024) bytes=1024;
|
||||
|
||||
*in_used+=bytes;
|
||||
|
||||
UINT nsam=bytes/((m_bps>>3)*m_nch);
|
||||
float **buffer=vorbis_analysis_buffer(&vd,nsam);
|
||||
switch(m_bps)
|
||||
{
|
||||
case 8:
|
||||
{
|
||||
BYTE* rbuf=(BYTE*)buf;
|
||||
for(i=0;i<nsam;i++)
|
||||
{
|
||||
for(c=0;c<m_nch;c++)
|
||||
{
|
||||
buffer[c][i]=((float)(UINT)*rbuf)/128.f-1.f;
|
||||
rbuf++;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
{
|
||||
short* rbuf=(short*)buf;
|
||||
for(i=0;i<nsam;i++)
|
||||
{
|
||||
for(c=0;c<m_nch;c++)
|
||||
{
|
||||
buffer[c][i]=(float)*rbuf/32768.f;
|
||||
rbuf++;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
{
|
||||
char* rbuf=(char*)buf;
|
||||
for(i=0;i<nsam;i++)
|
||||
{
|
||||
for(c=0;c<m_nch;c++)
|
||||
{
|
||||
BYTE* b=(BYTE*)rbuf;
|
||||
long val = b[0] | (b[1]<<8) | (b[2]<<16);
|
||||
if (val&0x800000) val|=0xFF000000;
|
||||
buffer[c][i]=(float)((double)val/(double)0x800000);
|
||||
rbuf+=3;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
{
|
||||
long* rbuf=(long*)buf;
|
||||
for(i=0;i<nsam;i++)
|
||||
{
|
||||
for(c=0;c<m_nch;c++)
|
||||
{
|
||||
buffer[c][i]=(float)((double)rbuf[i*m_nch+c]/(double)0x80000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* tell the library how much we actually submitted */
|
||||
vorbis_analysis_wrote(&vd,nsam);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AudioCoderOgg::AudioCoderOgg(int nch, int srate, int bps, configtype *cfg)
|
||||
{
|
||||
m_err=0;
|
||||
|
||||
m_bps=bps;
|
||||
m_nch=nch;
|
||||
m_inbuf=0;
|
||||
|
||||
int poo;
|
||||
|
||||
vorbis_info_init(&vi);
|
||||
if (cfg->cfg_mode==0) poo=vorbis_encode_init_vbr(&vi,nch,srate,cfg->cfg_vbrquality);
|
||||
else
|
||||
{
|
||||
UINT nominal,min,max;
|
||||
if (cfg->cfg_mode==1)
|
||||
{//abr
|
||||
nominal=cfg->cfg_abr_nominal * 1000;
|
||||
min=cfg->cfg_abr_use_min ? cfg->cfg_abr_min * 1000: -1;
|
||||
max=cfg->cfg_abr_use_max ? cfg->cfg_abr_max * 1000: -1;
|
||||
}
|
||||
else//cbr
|
||||
{
|
||||
nominal=min=max=cfg->cfg_abr_nominal*1000;
|
||||
}
|
||||
poo=vorbis_encode_init(&vi,nch,srate,max,nominal,min);
|
||||
}
|
||||
|
||||
if (poo)
|
||||
{
|
||||
vorbis_info_clear(&vi);
|
||||
m_err++;
|
||||
return;
|
||||
}
|
||||
|
||||
vorbis_comment_init(&vc);
|
||||
vorbis_comment_add(&vc, "ENCODEDBY=Winamp");
|
||||
|
||||
/* set up the analysis state and auxiliary encoding storage */
|
||||
vorbis_analysis_init(&vd,&vi);
|
||||
vorbis_block_init(&vd,&vb);
|
||||
|
||||
/* set up our packet->stream encoder */
|
||||
/* pick a random serial number; that way we can more likely build
|
||||
chained streams just by concatenation */
|
||||
|
||||
ogg_stream_init(&os,GetTickCount()^(GetTickCount()<<16));//fixme : rand
|
||||
|
||||
/* Vorbis streams begin with three headers; the initial header (with
|
||||
most of the codec setup parameters) which is mandated by the Ogg
|
||||
bitstream spec. The second header holds any comment fields. The
|
||||
third header holds the bitstream codebook. We merely need to
|
||||
make the headers, then pass them to libvorbis one at a time;
|
||||
libvorbis handles the additional Ogg bitstream constraints */
|
||||
|
||||
{
|
||||
ogg_packet header;
|
||||
ogg_packet header_comm;
|
||||
ogg_packet header_code;
|
||||
|
||||
vorbis_analysis_headerout(&vd,&vc,&header,&header_comm,&header_code);
|
||||
ogg_stream_packetin(&os,&header); /* automatically placed in its own page */
|
||||
ogg_stream_packetin(&os,&header_comm);
|
||||
ogg_stream_packetin(&os,&header_code);
|
||||
}
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
unsigned int __declspec(dllexport) GetAudioTypes3(int idx, char *desc)
|
||||
{
|
||||
if (idx==0)
|
||||
{
|
||||
GetLocalisationApiService();
|
||||
StringCchPrintfA(desc, 1024, "%s %s (aoTuV b6.03)", WASABI_API_LNGSTRING(IDS_ENC_VORBIS_DESC), ENC_VERSION);
|
||||
return mmioFOURCC('O','G','G',' ');
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
AudioCoder __declspec(dllexport) *CreateAudio3(int nch, int srate, int bps, unsigned int srct, unsigned int *outt, char *configfile)
|
||||
{
|
||||
if (srct == mmioFOURCC('P','C','M',' ') && *outt == mmioFOURCC('O','G','G',' '))
|
||||
{
|
||||
configtype cfg;
|
||||
readconfig(configfile,&cfg);
|
||||
AudioCoderOgg *t = new AudioCoderOgg(nch,srate,bps,&cfg);
|
||||
if (t->GetLastError())
|
||||
{
|
||||
delete t;
|
||||
return NULL;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void __declspec(dllexport) FinishAudio3(const char *filename, AudioCoder *coder)
|
||||
{
|
||||
}
|
||||
|
||||
#define doshow(x,y) ShowWindow(x,(y)?SW_SHOWNA:SW_HIDE)
|
||||
|
||||
static HCURSOR link_hand_cursor;
|
||||
LRESULT link_handlecursor(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
LRESULT ret = CallWindowProcW((WNDPROC)GetPropW(hwndDlg, L"link_proc"), hwndDlg, uMsg, wParam, lParam);
|
||||
// override the normal cursor behaviour so we have a hand to show it is a link
|
||||
if(uMsg == WM_SETCURSOR)
|
||||
{
|
||||
if((HWND)wParam == hwndDlg)
|
||||
{
|
||||
if(!link_hand_cursor)
|
||||
{
|
||||
link_hand_cursor = LoadCursor(NULL, IDC_HAND);
|
||||
}
|
||||
SetCursor(link_hand_cursor);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void link_handledraw(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (uMsg == WM_DRAWITEM)
|
||||
{
|
||||
DRAWITEMSTRUCT *di = (DRAWITEMSTRUCT *)lParam;
|
||||
if (di->CtlType == ODT_BUTTON)
|
||||
{
|
||||
wchar_t wt[123] = {0};
|
||||
int y;
|
||||
RECT r;
|
||||
HPEN hPen, hOldPen;
|
||||
GetDlgItemTextW(hwndDlg, (int)wParam, wt, sizeof(wt)/sizeof(wt[0]));
|
||||
|
||||
// due to the fun of theming and owner drawing we have to get the background colour
|
||||
if(isthemethere){
|
||||
HTHEME hTheme = OpenThemeData(hwndDlg, L"Tab");
|
||||
if (hTheme) {
|
||||
DrawThemeParentBackground(di->hwndItem, di->hDC, &di->rcItem);
|
||||
CloseThemeData(hTheme);
|
||||
}
|
||||
}
|
||||
|
||||
// draw text
|
||||
SetTextColor(di->hDC, (di->itemState & ODS_SELECTED) ? RGB(220, 0, 0) : RGB(0, 0, 220));
|
||||
r = di->rcItem;
|
||||
r.left += 2;
|
||||
DrawTextW(di->hDC, wt, -1, &r, DT_VCENTER | DT_SINGLELINE);
|
||||
|
||||
memset(&r, 0, sizeof(r));
|
||||
DrawTextW(di->hDC, wt, -1, &r, DT_SINGLELINE | DT_CALCRECT);
|
||||
|
||||
// draw underline
|
||||
y = di->rcItem.bottom - ((di->rcItem.bottom - di->rcItem.top) - (r.bottom - r.top)) / 2 - 1;
|
||||
hPen = CreatePen(PS_SOLID, 0, (di->itemState & ODS_SELECTED) ? RGB(220, 0, 0) : RGB(0, 0, 220));
|
||||
hOldPen = (HPEN) SelectObject(di->hDC, hPen);
|
||||
MoveToEx(di->hDC, di->rcItem.left + 2, y, NULL);
|
||||
LineTo(di->hDC, di->rcItem.right + 2 - ((di->rcItem.right - di->rcItem.left) - (r.right - r.left)), y);
|
||||
SelectObject(di->hDC, hOldPen);
|
||||
DeleteObject(hPen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void link_startsubclass(HWND hwndDlg, UINT id)
|
||||
{
|
||||
HWND ctrl = GetDlgItem(hwndDlg, id);
|
||||
if(!GetPropW(ctrl, L"link_proc"))
|
||||
{
|
||||
SetPropW(ctrl, L"link_proc",
|
||||
(HANDLE)SetWindowLongPtrW(ctrl, GWLP_WNDPROC, (LONG_PTR)link_handlecursor));
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
if (uMsg == WM_USER+667)
|
||||
{
|
||||
int p=(int)SendDlgItemMessage(hwndDlg,IDC_VBRQUALITY,TBM_GETPOS,0,0)-10;
|
||||
char tmp[512] = {0};
|
||||
double dispVal = ((double)p)/10;
|
||||
vorbis_info vi = {0};
|
||||
int br = 128;
|
||||
|
||||
vorbis_info_init(&vi);
|
||||
if(vorbis_encode_init_vbr(&vi, 2, 44100, (float) (p / 100.0)))
|
||||
br=128; // Mode setup failed: go with a default.
|
||||
else
|
||||
{
|
||||
br = vi.bitrate_nominal / 1000;
|
||||
vorbis_info_clear(&vi);
|
||||
}
|
||||
|
||||
StringCchPrintfA(tmp, 512, WASABI_API_LNGSTRING(IDS_QUALITY_FACTOR_F_KBPS), dispVal, br);
|
||||
|
||||
SetDlgItemTextA(hwndDlg,IDC_VBRVAL,tmp);
|
||||
|
||||
link_startsubclass(hwndDlg, IDC_URL1);
|
||||
link_startsubclass(hwndDlg, IDC_URL2);
|
||||
}
|
||||
|
||||
else if (uMsg == WM_INITDIALOG)
|
||||
{
|
||||
#if defined (_WIN64)
|
||||
SetWindowLong(hwndDlg,GWLP_USERDATA,(LONG)lParam);
|
||||
#else
|
||||
SetWindowLong(hwndDlg, GWL_USERDATA, lParam);
|
||||
#endif
|
||||
if (lParam)
|
||||
{
|
||||
configwndrec *wc=(configwndrec*)lParam;
|
||||
SendDlgItemMessage(hwndDlg,IDC_VBRQUALITY,TBM_SETRANGE,0,MAKELONG(0,110));
|
||||
SendDlgItemMessage(hwndDlg,IDC_VBRQUALITY,TBM_SETTICFREQ,5,0);
|
||||
SendDlgItemMessage(hwndDlg,IDC_VBRQUALITY,TBM_SETPAGESIZE,0,10);
|
||||
SendDlgItemMessage(hwndDlg,IDC_VBRQUALITY,TBM_SETPOS,TRUE,(int)(wc->cfg.cfg_vbrquality*100.0f + (wc->cfg.cfg_vbrquality < 0.0 ? - 0.5f : 0.5f)) + 10);
|
||||
SendMessage(hwndDlg,WM_USER+667,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
else if (uMsg == WM_HSCROLL)
|
||||
{
|
||||
HWND swnd = (HWND) lParam;
|
||||
if (swnd == GetDlgItem(hwndDlg, IDC_VBRQUALITY))
|
||||
{
|
||||
int p=(int)SendDlgItemMessage(hwndDlg,IDC_VBRQUALITY,TBM_GETPOS,0,0)-10;
|
||||
|
||||
#if defined (_WIN64)
|
||||
configwndrec* wc = (configwndrec*)GetWindowLong(hwndDlg, GWLP_USERDATA);
|
||||
#else
|
||||
configwndrec* wc = (configwndrec*)GetWindowLong(hwndDlg, GWL_USERDATA);
|
||||
#endif
|
||||
if (wc)
|
||||
{
|
||||
wc->cfg.cfg_vbrquality=(float)p/100.0f;
|
||||
}
|
||||
SendMessage(hwndDlg,WM_USER+667,0,0);
|
||||
}
|
||||
}
|
||||
|
||||
else if (uMsg == WM_COMMAND)
|
||||
{
|
||||
if(LOWORD(wParam) == IDC_URL1)
|
||||
{
|
||||
SendMessage(winampwnd, WM_WA_IPC, (WPARAM)"http://xiph.org/vorbis/", IPC_OPEN_URL);
|
||||
}
|
||||
else if(LOWORD(wParam) == IDC_URL2)
|
||||
{
|
||||
SendMessage(winampwnd, WM_WA_IPC, (WPARAM)"https://ao-yumi.github.io/aotuv_web/index.html", IPC_OPEN_URL);
|
||||
}
|
||||
}
|
||||
|
||||
else if (uMsg == WM_DESTROY)
|
||||
{
|
||||
#if defined (_WIN64)
|
||||
configwndrec* wc = (configwndrec*)SetWindowLong(hwndDlg, GWLP_USERDATA, 0);
|
||||
#else
|
||||
configwndrec* wc = (configwndrec*)SetWindowLong(hwndDlg, GWL_USERDATA, 0);
|
||||
#endif
|
||||
if (wc)
|
||||
{
|
||||
wc->cfg.cfg_mode=0;
|
||||
writeconfig(wc->configfile,&wc->cfg);
|
||||
free(wc->configfile);
|
||||
free(wc);
|
||||
}
|
||||
}
|
||||
|
||||
const int controls[] =
|
||||
{
|
||||
IDC_VBRQUALITY,
|
||||
};
|
||||
if (FALSE != WASABI_API_APP->DirectMouseWheel_ProcessDialogMessage(hwndDlg, uMsg, wParam, lParam, controls, ARRAYSIZE(controls)))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
link_handledraw(hwndDlg, uMsg, wParam, lParam);
|
||||
return 0;
|
||||
}
|
||||
|
||||
HWND __declspec(dllexport) ConfigAudio3(HWND hwndParent, HINSTANCE hinst, unsigned int outt, char *configfile)
|
||||
{
|
||||
if (outt == mmioFOURCC('O','G','G',' '))
|
||||
{
|
||||
configwndrec *wr=(configwndrec*)malloc(sizeof(configwndrec));
|
||||
if (configfile) wr->configfile=_strdup(configfile);
|
||||
else wr->configfile=0;
|
||||
|
||||
readconfig(configfile,&wr->cfg);
|
||||
GetLocalisationApiService();
|
||||
return WASABI_API_CREATEDIALOGPARAMW(IDD_CONFIG,hwndParent,DlgProc,(LPARAM)wr);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void __declspec(dllexport) SetWinampHWND(HWND hwnd)
|
||||
{
|
||||
winampwnd = hwnd;
|
||||
isthemethere = !SendMessage(hwnd,WM_WA_IPC,IPC_ISWINTHEMEPRESENT,IPC_USE_UXTHEME_FUNC);
|
||||
}
|
||||
};
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef __CONFIG_TYPES_H__
|
||||
#define __CONFIG_TYPES_H__
|
||||
|
||||
/* these are filled in by configure */
|
||||
#define INCLUDE_INTTYPES_H @INCLUDE_INTTYPES_H@
|
||||
#define INCLUDE_STDINT_H @INCLUDE_STDINT_H@
|
||||
#define INCLUDE_SYS_TYPES_H @INCLUDE_SYS_TYPES_H@
|
||||
|
||||
#if INCLUDE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
#if INCLUDE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#if INCLUDE_SYS_TYPES_H
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
typedef @SIZE16@ ogg_int16_t;
|
||||
typedef @USIZE16@ ogg_uint16_t;
|
||||
typedef @SIZE32@ ogg_int32_t;
|
||||
typedef @USIZE32@ ogg_uint32_t;
|
||||
typedef @SIZE64@ ogg_int64_t;
|
||||
|
||||
#endif
|
210
Src/Plugins/Encoder/enc_vorbis/ogg/include/ogg/ogg.h
Normal file
210
Src/Plugins/Encoder/enc_vorbis/ogg/include/ogg/ogg.h
Normal file
|
@ -0,0 +1,210 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: toplevel libogg include
|
||||
last mod: $Id$
|
||||
|
||||
********************************************************************/
|
||||
#ifndef _OGG_H
|
||||
#define _OGG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <ogg/os_types.h>
|
||||
|
||||
typedef struct {
|
||||
void *iov_base;
|
||||
size_t iov_len;
|
||||
} ogg_iovec_t;
|
||||
|
||||
typedef struct {
|
||||
long endbyte;
|
||||
int endbit;
|
||||
|
||||
unsigned char *buffer;
|
||||
unsigned char *ptr;
|
||||
long storage;
|
||||
} oggpack_buffer;
|
||||
|
||||
/* ogg_page is used to encapsulate the data in one Ogg bitstream page *****/
|
||||
|
||||
typedef struct {
|
||||
unsigned char *header;
|
||||
long header_len;
|
||||
unsigned char *body;
|
||||
long body_len;
|
||||
} ogg_page;
|
||||
|
||||
/* ogg_stream_state contains the current encode/decode state of a logical
|
||||
Ogg bitstream **********************************************************/
|
||||
|
||||
typedef struct {
|
||||
unsigned char *body_data; /* bytes from packet bodies */
|
||||
long body_storage; /* storage elements allocated */
|
||||
long body_fill; /* elements stored; fill mark */
|
||||
long body_returned; /* elements of fill returned */
|
||||
|
||||
|
||||
int *lacing_vals; /* The values that will go to the segment table */
|
||||
ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
|
||||
this way, but it is simple coupled to the
|
||||
lacing fifo */
|
||||
long lacing_storage;
|
||||
long lacing_fill;
|
||||
long lacing_packet;
|
||||
long lacing_returned;
|
||||
|
||||
unsigned char header[282]; /* working space for header encode */
|
||||
int header_fill;
|
||||
|
||||
int e_o_s; /* set when we have buffered the last packet in the
|
||||
logical bitstream */
|
||||
int b_o_s; /* set after we've written the initial page
|
||||
of a logical bitstream */
|
||||
long serialno;
|
||||
long pageno;
|
||||
ogg_int64_t packetno; /* sequence number for decode; the framing
|
||||
knows where there's a hole in the data,
|
||||
but we need coupling so that the codec
|
||||
(which is in a separate abstraction
|
||||
layer) also knows about the gap */
|
||||
ogg_int64_t granulepos;
|
||||
|
||||
} ogg_stream_state;
|
||||
|
||||
/* ogg_packet is used to encapsulate the data and metadata belonging
|
||||
to a single raw Ogg/Vorbis packet *************************************/
|
||||
|
||||
typedef struct {
|
||||
unsigned char *packet;
|
||||
long bytes;
|
||||
long b_o_s;
|
||||
long e_o_s;
|
||||
|
||||
ogg_int64_t granulepos;
|
||||
|
||||
ogg_int64_t packetno; /* sequence number for decode; the framing
|
||||
knows where there's a hole in the data,
|
||||
but we need coupling so that the codec
|
||||
(which is in a separate abstraction
|
||||
layer) also knows about the gap */
|
||||
} ogg_packet;
|
||||
|
||||
typedef struct {
|
||||
unsigned char *data;
|
||||
int storage;
|
||||
int fill;
|
||||
int returned;
|
||||
|
||||
int unsynced;
|
||||
int headerbytes;
|
||||
int bodybytes;
|
||||
} ogg_sync_state;
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: bitstream ************************/
|
||||
|
||||
extern void oggpack_writeinit(oggpack_buffer *b);
|
||||
extern int oggpack_writecheck(oggpack_buffer *b);
|
||||
extern void oggpack_writetrunc(oggpack_buffer *b,long bits);
|
||||
extern void oggpack_writealign(oggpack_buffer *b);
|
||||
extern void oggpack_writecopy(oggpack_buffer *b,void *source,long bits);
|
||||
extern void oggpack_reset(oggpack_buffer *b);
|
||||
extern void oggpack_writeclear(oggpack_buffer *b);
|
||||
extern void oggpack_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
|
||||
extern void oggpack_write(oggpack_buffer *b,unsigned long value,int bits);
|
||||
extern long oggpack_look(oggpack_buffer *b,int bits);
|
||||
extern long oggpack_look1(oggpack_buffer *b);
|
||||
extern void oggpack_adv(oggpack_buffer *b,int bits);
|
||||
extern void oggpack_adv1(oggpack_buffer *b);
|
||||
extern long oggpack_read(oggpack_buffer *b,int bits);
|
||||
extern long oggpack_read1(oggpack_buffer *b);
|
||||
extern long oggpack_bytes(oggpack_buffer *b);
|
||||
extern long oggpack_bits(oggpack_buffer *b);
|
||||
extern unsigned char *oggpack_get_buffer(oggpack_buffer *b);
|
||||
|
||||
extern void oggpackB_writeinit(oggpack_buffer *b);
|
||||
extern int oggpackB_writecheck(oggpack_buffer *b);
|
||||
extern void oggpackB_writetrunc(oggpack_buffer *b,long bits);
|
||||
extern void oggpackB_writealign(oggpack_buffer *b);
|
||||
extern void oggpackB_writecopy(oggpack_buffer *b,void *source,long bits);
|
||||
extern void oggpackB_reset(oggpack_buffer *b);
|
||||
extern void oggpackB_writeclear(oggpack_buffer *b);
|
||||
extern void oggpackB_readinit(oggpack_buffer *b,unsigned char *buf,int bytes);
|
||||
extern void oggpackB_write(oggpack_buffer *b,unsigned long value,int bits);
|
||||
extern long oggpackB_look(oggpack_buffer *b,int bits);
|
||||
extern long oggpackB_look1(oggpack_buffer *b);
|
||||
extern void oggpackB_adv(oggpack_buffer *b,int bits);
|
||||
extern void oggpackB_adv1(oggpack_buffer *b);
|
||||
extern long oggpackB_read(oggpack_buffer *b,int bits);
|
||||
extern long oggpackB_read1(oggpack_buffer *b);
|
||||
extern long oggpackB_bytes(oggpack_buffer *b);
|
||||
extern long oggpackB_bits(oggpack_buffer *b);
|
||||
extern unsigned char *oggpackB_get_buffer(oggpack_buffer *b);
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: encoding **************************/
|
||||
|
||||
extern int ogg_stream_packetin(ogg_stream_state *os, ogg_packet *op);
|
||||
extern int ogg_stream_iovecin(ogg_stream_state *os, ogg_iovec_t *iov,
|
||||
int count, long e_o_s, ogg_int64_t granulepos);
|
||||
extern int ogg_stream_pageout(ogg_stream_state *os, ogg_page *og);
|
||||
extern int ogg_stream_pageout_fill(ogg_stream_state *os, ogg_page *og, int nfill);
|
||||
extern int ogg_stream_flush(ogg_stream_state *os, ogg_page *og);
|
||||
extern int ogg_stream_flush_fill(ogg_stream_state *os, ogg_page *og, int nfill);
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: decoding **************************/
|
||||
|
||||
extern int ogg_sync_init(ogg_sync_state *oy);
|
||||
extern int ogg_sync_clear(ogg_sync_state *oy);
|
||||
extern int ogg_sync_reset(ogg_sync_state *oy);
|
||||
extern int ogg_sync_destroy(ogg_sync_state *oy);
|
||||
extern int ogg_sync_check(ogg_sync_state *oy);
|
||||
|
||||
extern char *ogg_sync_buffer(ogg_sync_state *oy, long size);
|
||||
extern int ogg_sync_wrote(ogg_sync_state *oy, long bytes);
|
||||
extern long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og);
|
||||
extern int ogg_sync_pageout(ogg_sync_state *oy, ogg_page *og);
|
||||
extern int ogg_stream_pagein(ogg_stream_state *os, ogg_page *og);
|
||||
extern int ogg_stream_packetout(ogg_stream_state *os,ogg_packet *op);
|
||||
extern int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
|
||||
|
||||
/* Ogg BITSTREAM PRIMITIVES: general ***************************/
|
||||
|
||||
extern int ogg_stream_init(ogg_stream_state *os,int serialno);
|
||||
extern int ogg_stream_clear(ogg_stream_state *os);
|
||||
extern int ogg_stream_reset(ogg_stream_state *os);
|
||||
extern int ogg_stream_reset_serialno(ogg_stream_state *os,int serialno);
|
||||
extern int ogg_stream_destroy(ogg_stream_state *os);
|
||||
extern int ogg_stream_check(ogg_stream_state *os);
|
||||
extern int ogg_stream_eos(ogg_stream_state *os);
|
||||
|
||||
extern void ogg_page_checksum_set(ogg_page *og);
|
||||
|
||||
extern int ogg_page_version(const ogg_page *og);
|
||||
extern int ogg_page_continued(const ogg_page *og);
|
||||
extern int ogg_page_bos(const ogg_page *og);
|
||||
extern int ogg_page_eos(const ogg_page *og);
|
||||
extern ogg_int64_t ogg_page_granulepos(const ogg_page *og);
|
||||
extern int ogg_page_serialno(const ogg_page *og);
|
||||
extern long ogg_page_pageno(const ogg_page *og);
|
||||
extern int ogg_page_packets(const ogg_page *og);
|
||||
|
||||
extern void ogg_packet_clear(ogg_packet *op);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OGG_H */
|
148
Src/Plugins/Encoder/enc_vorbis/ogg/include/ogg/os_types.h
Normal file
148
Src/Plugins/Encoder/enc_vorbis/ogg/include/ogg/os_types.h
Normal file
|
@ -0,0 +1,148 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2002 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: #ifdef jail to whip a few platforms into the UNIX ideal.
|
||||
last mod: $Id$
|
||||
|
||||
********************************************************************/
|
||||
#ifndef _OS_TYPES_H
|
||||
#define _OS_TYPES_H
|
||||
|
||||
/* make it easy on the folks that want to compile the libs with a
|
||||
different malloc than stdlib */
|
||||
#define _ogg_malloc malloc
|
||||
#define _ogg_calloc calloc
|
||||
#define _ogg_realloc realloc
|
||||
#define _ogg_free free
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
# if defined(__CYGWIN__)
|
||||
# include <stdint.h>
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef uint16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef uint32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
typedef uint64_t ogg_uint64_t;
|
||||
# elif defined(__MINGW32__)
|
||||
# include <sys/types.h>
|
||||
typedef short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long ogg_int64_t;
|
||||
typedef unsigned long long ogg_uint64_t;
|
||||
# elif defined(__MWERKS__)
|
||||
typedef long long ogg_int64_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
# else
|
||||
# if defined(_MSC_VER) && (_MSC_VER >= 1800) /* MSVC 2013 and newer */
|
||||
# include <stdint.h>
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef uint16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef uint32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
typedef uint64_t ogg_uint64_t;
|
||||
# else
|
||||
/* MSVC/Borland */
|
||||
typedef __int64 ogg_int64_t;
|
||||
typedef __int32 ogg_int32_t;
|
||||
typedef unsigned __int32 ogg_uint32_t;
|
||||
typedef __int16 ogg_int16_t;
|
||||
typedef unsigned __int16 ogg_uint16_t;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#elif (defined(__APPLE__) && defined(__MACH__)) /* MacOS X Framework build */
|
||||
|
||||
# include <inttypes.h>
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef uint16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef uint32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
|
||||
/* Haiku */
|
||||
# include <sys/types.h>
|
||||
typedef short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long ogg_int64_t;
|
||||
|
||||
#elif defined(__BEOS__)
|
||||
|
||||
/* Be */
|
||||
# include <inttypes.h>
|
||||
typedef int16_t ogg_int16_t;
|
||||
typedef uint16_t ogg_uint16_t;
|
||||
typedef int32_t ogg_int32_t;
|
||||
typedef uint32_t ogg_uint32_t;
|
||||
typedef int64_t ogg_int64_t;
|
||||
|
||||
#elif defined (__EMX__)
|
||||
|
||||
/* OS/2 GCC */
|
||||
typedef short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long ogg_int64_t;
|
||||
|
||||
#elif defined (DJGPP)
|
||||
|
||||
/* DJGPP */
|
||||
typedef short ogg_int16_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long ogg_int64_t;
|
||||
|
||||
#elif defined(R5900)
|
||||
|
||||
/* PS2 EE */
|
||||
typedef long ogg_int64_t;
|
||||
typedef int ogg_int32_t;
|
||||
typedef unsigned ogg_uint32_t;
|
||||
typedef short ogg_int16_t;
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
|
||||
/* Symbian GCC */
|
||||
typedef signed short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef signed int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long int ogg_int64_t;
|
||||
|
||||
#elif defined(__TMS320C6X__)
|
||||
|
||||
/* TI C64x compiler */
|
||||
typedef signed short ogg_int16_t;
|
||||
typedef unsigned short ogg_uint16_t;
|
||||
typedef signed int ogg_int32_t;
|
||||
typedef unsigned int ogg_uint32_t;
|
||||
typedef long long int ogg_int64_t;
|
||||
|
||||
#else
|
||||
|
||||
# include <ogg/config_types.h>
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* _OS_TYPES_H */
|
51
Src/Plugins/Encoder/enc_vorbis/resource.h
Normal file
51
Src/Plugins/Encoder/enc_vorbis/resource.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by enc_vorbis.rc
|
||||
//
|
||||
#define IDS_QUALITY_FACTOR_F 0
|
||||
#define IDS_ENC_VORBIS_DESC 1
|
||||
#define IDS_QUALITY_FACTOR_F_KBPS 2
|
||||
#define IDD_CONFIG 103
|
||||
#define IDC_BITRATE 1000
|
||||
#define IDC_VBR 1001
|
||||
#define IDC_QUALITY 1002
|
||||
#define IDC_JSTEREO1 1003
|
||||
#define IDC_JSTEREO2 1004
|
||||
#define IDC_BITRATE_TEXT1 1004
|
||||
#define IDC_MAXBITRATE 1005
|
||||
#define IDC_MINBITRATE 1005
|
||||
#define IDC_BITRATE_TEXT2 1006
|
||||
#define IDC_MAXBITRATE_TEXT1 1007
|
||||
#define IDC_MINBITRATE_TEXT1 1007
|
||||
#define IDC_MAXBITRATE_TEXT2 1008
|
||||
#define IDC_MINBITRATE_TEXT2 1008
|
||||
#define IDC_VBRMETHOD 1009
|
||||
#define IDC_AVGBITRATE_TEXT1 1010
|
||||
#define IDC_MAXBITRATE2_TEXT1 1010
|
||||
#define IDC_AVGBITRATE 1011
|
||||
#define IDC_MAXBITRATE2 1011
|
||||
#define IDC_AVGBITRATE_TEXT2 1012
|
||||
#define IDC_MAXBITRATE2_TEXT2 1012
|
||||
#define IDC_STEREOMODE 1013
|
||||
#define IDC_VBRQ_TEXT 1014
|
||||
#define IDC_VBRQ 1015
|
||||
#define IDC_VBRVAL 1016
|
||||
#define IDC_VBRTEXT 1017
|
||||
#define IDC_VBRQUALITY 1018
|
||||
#define IDC_MINBITRATE_CHECK 1019
|
||||
#define IDC_MAXBITRATE_CHECK 1020
|
||||
#define IDC_VBR1 1023
|
||||
#define IDC_VBR2 1024
|
||||
#define IDC_URL1 1026
|
||||
#define IDC_URL2 1027
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 106
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1028
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
39
Src/Plugins/Encoder/enc_vorbis/version.rc2
Normal file
39
Src/Plugins/Encoder/enc_vorbis/version.rc2
Normal file
|
@ -0,0 +1,39 @@
|
|||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
#include "../../../Winamp/buildType.h"
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,58,0,0
|
||||
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 Encoder Plug-in"
|
||||
VALUE "FileVersion", "1,58,0,0"
|
||||
VALUE "InternalName", "Nullsoft Ogg Vorbis Encoder"
|
||||
VALUE "LegalCopyright", "Copyright © 2006-2023 Winamp SA"
|
||||
VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
|
||||
VALUE "OriginalFilename", "enc_vorbis.dll"
|
||||
VALUE "ProductName", "Winamp"
|
||||
VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
END
|
||||
END
|
243
Src/Plugins/Encoder/enc_vorbis/vorbis/include/vorbis/codec.h
Normal file
243
Src/Plugins/Encoder/enc_vorbis/vorbis/include/vorbis/codec.h
Normal file
|
@ -0,0 +1,243 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
|
||||
********************************************************************
|
||||
|
||||
function: libvorbis codec headers
|
||||
last mod: $Id: codec.h,v 1.1 2010/11/09 22:53:50 dromagod Exp $
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#ifndef _vorbis_codec_h_
|
||||
#define _vorbis_codec_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <ogg/ogg.h>
|
||||
|
||||
typedef struct vorbis_info{
|
||||
int version;
|
||||
int channels;
|
||||
long rate;
|
||||
|
||||
/* The below bitrate declarations are *hints*.
|
||||
Combinations of the three values carry the following implications:
|
||||
|
||||
all three set to the same value:
|
||||
implies a fixed rate bitstream
|
||||
only nominal set:
|
||||
implies a VBR stream that averages the nominal bitrate. No hard
|
||||
upper/lower limit
|
||||
upper and or lower set:
|
||||
implies a VBR bitstream that obeys the bitrate limits. nominal
|
||||
may also be set to give a nominal rate.
|
||||
none set:
|
||||
the coder does not care to speculate.
|
||||
*/
|
||||
|
||||
long bitrate_upper;
|
||||
long bitrate_nominal;
|
||||
long bitrate_lower;
|
||||
long bitrate_window;
|
||||
|
||||
void *codec_setup;
|
||||
} vorbis_info;
|
||||
|
||||
/* vorbis_dsp_state buffers the current vorbis audio
|
||||
analysis/synthesis state. The DSP state belongs to a specific
|
||||
logical bitstream ****************************************************/
|
||||
typedef struct vorbis_dsp_state{
|
||||
int analysisp;
|
||||
vorbis_info *vi;
|
||||
|
||||
float **pcm;
|
||||
float **pcmret;
|
||||
int pcm_storage;
|
||||
int pcm_current;
|
||||
int pcm_returned;
|
||||
|
||||
int preextrapolate;
|
||||
int eofflag;
|
||||
|
||||
long lW;
|
||||
long W;
|
||||
long nW;
|
||||
long centerW;
|
||||
|
||||
ogg_int64_t granulepos;
|
||||
ogg_int64_t sequence;
|
||||
|
||||
ogg_int64_t glue_bits;
|
||||
ogg_int64_t time_bits;
|
||||
ogg_int64_t floor_bits;
|
||||
ogg_int64_t res_bits;
|
||||
|
||||
void *backend_state;
|
||||
} vorbis_dsp_state;
|
||||
|
||||
typedef struct vorbis_block{
|
||||
/* necessary stream state for linking to the framing abstraction */
|
||||
float **pcm; /* this is a pointer into local storage */
|
||||
oggpack_buffer opb;
|
||||
|
||||
long lW;
|
||||
long W;
|
||||
long nW;
|
||||
int pcmend;
|
||||
int mode;
|
||||
|
||||
int eofflag;
|
||||
ogg_int64_t granulepos;
|
||||
ogg_int64_t sequence;
|
||||
vorbis_dsp_state *vd; /* For read-only access of configuration */
|
||||
|
||||
/* local storage to avoid remallocing; it's up to the mapping to
|
||||
structure it */
|
||||
void *localstore;
|
||||
long localtop;
|
||||
long localalloc;
|
||||
long totaluse;
|
||||
struct alloc_chain *reap;
|
||||
|
||||
/* bitmetrics for the frame */
|
||||
long glue_bits;
|
||||
long time_bits;
|
||||
long floor_bits;
|
||||
long res_bits;
|
||||
|
||||
void *internal;
|
||||
|
||||
} vorbis_block;
|
||||
|
||||
/* vorbis_block is a single block of data to be processed as part of
|
||||
the analysis/synthesis stream; it belongs to a specific logical
|
||||
bitstream, but is independant from other vorbis_blocks belonging to
|
||||
that logical bitstream. *************************************************/
|
||||
|
||||
struct alloc_chain{
|
||||
void *ptr;
|
||||
struct alloc_chain *next;
|
||||
};
|
||||
|
||||
/* vorbis_info contains all the setup information specific to the
|
||||
specific compression/decompression mode in progress (eg,
|
||||
psychoacoustic settings, channel setup, options, codebook
|
||||
etc). vorbis_info and substructures are in backends.h.
|
||||
*********************************************************************/
|
||||
|
||||
/* the comments are not part of vorbis_info so that vorbis_info can be
|
||||
static storage */
|
||||
typedef struct vorbis_comment{
|
||||
/* unlimited user comment fields. libvorbis writes 'libvorbis'
|
||||
whatever vendor is set to in encode */
|
||||
char **user_comments;
|
||||
int *comment_lengths;
|
||||
int comments;
|
||||
char *vendor;
|
||||
|
||||
} vorbis_comment;
|
||||
|
||||
|
||||
/* libvorbis encodes in two abstraction layers; first we perform DSP
|
||||
and produce a packet (see docs/analysis.txt). The packet is then
|
||||
coded into a framed OggSquish bitstream by the second layer (see
|
||||
docs/framing.txt). Decode is the reverse process; we sync/frame
|
||||
the bitstream and extract individual packets, then decode the
|
||||
packet back into PCM audio.
|
||||
|
||||
The extra framing/packetizing is used in streaming formats, such as
|
||||
files. Over the net (such as with UDP), the framing and
|
||||
packetization aren't necessary as they're provided by the transport
|
||||
and the streaming layer is not used */
|
||||
|
||||
/* Vorbis PRIMITIVES: general ***************************************/
|
||||
|
||||
extern void vorbis_info_init(vorbis_info *vi);
|
||||
extern void vorbis_info_clear(vorbis_info *vi);
|
||||
extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
|
||||
extern void vorbis_comment_init(vorbis_comment *vc);
|
||||
extern void vorbis_comment_add(vorbis_comment *vc, const char *comment);
|
||||
extern void vorbis_comment_add_tag(vorbis_comment *vc,
|
||||
const char *tag, const char *contents);
|
||||
extern char *vorbis_comment_query(vorbis_comment *vc, const char *tag, int count);
|
||||
extern int vorbis_comment_query_count(vorbis_comment *vc, const char *tag);
|
||||
extern void vorbis_comment_clear(vorbis_comment *vc);
|
||||
|
||||
extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb);
|
||||
extern int vorbis_block_clear(vorbis_block *vb);
|
||||
extern void vorbis_dsp_clear(vorbis_dsp_state *v);
|
||||
extern double vorbis_granule_time(vorbis_dsp_state *v,
|
||||
ogg_int64_t granulepos);
|
||||
|
||||
extern const char *vorbis_version_string(void);
|
||||
|
||||
/* Vorbis PRIMITIVES: analysis/DSP layer ****************************/
|
||||
|
||||
extern int vorbis_analysis_init(vorbis_dsp_state *v,vorbis_info *vi);
|
||||
extern int vorbis_commentheader_out(vorbis_comment *vc, ogg_packet *op);
|
||||
extern int vorbis_analysis_headerout(vorbis_dsp_state *v,
|
||||
vorbis_comment *vc,
|
||||
ogg_packet *op,
|
||||
ogg_packet *op_comm,
|
||||
ogg_packet *op_code);
|
||||
extern float **vorbis_analysis_buffer(vorbis_dsp_state *v,int vals);
|
||||
extern int vorbis_analysis_wrote(vorbis_dsp_state *v,int vals);
|
||||
extern int vorbis_analysis_blockout(vorbis_dsp_state *v,vorbis_block *vb);
|
||||
extern int vorbis_analysis(vorbis_block *vb,ogg_packet *op);
|
||||
|
||||
extern int vorbis_bitrate_addblock(vorbis_block *vb);
|
||||
extern int vorbis_bitrate_flushpacket(vorbis_dsp_state *vd,
|
||||
ogg_packet *op);
|
||||
|
||||
/* Vorbis PRIMITIVES: synthesis layer *******************************/
|
||||
extern int vorbis_synthesis_idheader(ogg_packet *op);
|
||||
extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,
|
||||
ogg_packet *op);
|
||||
|
||||
extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi);
|
||||
extern int vorbis_synthesis_restart(vorbis_dsp_state *v);
|
||||
extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op);
|
||||
extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op);
|
||||
extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb);
|
||||
extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,float ***pcm);
|
||||
extern int vorbis_synthesis_lapout(vorbis_dsp_state *v,float ***pcm);
|
||||
extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples);
|
||||
extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op);
|
||||
|
||||
extern int vorbis_synthesis_halfrate(vorbis_info *v,int flag);
|
||||
extern int vorbis_synthesis_halfrate_p(vorbis_info *v);
|
||||
|
||||
/* Vorbis ERRORS and return codes ***********************************/
|
||||
|
||||
#define OV_FALSE -1
|
||||
#define OV_EOF -2
|
||||
#define OV_HOLE -3
|
||||
|
||||
#define OV_EREAD -128
|
||||
#define OV_EFAULT -129
|
||||
#define OV_EIMPL -130
|
||||
#define OV_EINVAL -131
|
||||
#define OV_ENOTVORBIS -132
|
||||
#define OV_EBADHEADER -133
|
||||
#define OV_EVERSION -134
|
||||
#define OV_ENOTAUDIO -135
|
||||
#define OV_EBADPACKET -136
|
||||
#define OV_EBADLINK -137
|
||||
#define OV_ENOSEEK -138
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
112
Src/Plugins/Encoder/enc_vorbis/vorbis/include/vorbis/vorbisenc.h
Normal file
112
Src/Plugins/Encoder/enc_vorbis/vorbis/include/vorbis/vorbisenc.h
Normal file
|
@ -0,0 +1,112 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: vorbis encode-engine setup
|
||||
last mod: $Id: vorbisenc.h,v 1.1 2010/11/09 22:53:50 dromagod Exp $
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#ifndef _OV_ENC_H_
|
||||
#define _OV_ENC_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include "codec.h"
|
||||
|
||||
extern int vorbis_encode_init(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
long max_bitrate,
|
||||
long nominal_bitrate,
|
||||
long min_bitrate);
|
||||
|
||||
extern int vorbis_encode_setup_managed(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
long max_bitrate,
|
||||
long nominal_bitrate,
|
||||
long min_bitrate);
|
||||
|
||||
extern int vorbis_encode_setup_vbr(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
float quality /* quality level from 0. (lo) to 1. (hi) */
|
||||
);
|
||||
|
||||
extern int vorbis_encode_init_vbr(vorbis_info *vi,
|
||||
long channels,
|
||||
long rate,
|
||||
|
||||
float base_quality /* quality level from 0. (lo) to 1. (hi) */
|
||||
);
|
||||
|
||||
extern int vorbis_encode_setup_init(vorbis_info *vi);
|
||||
|
||||
extern int vorbis_encode_ctl(vorbis_info *vi,int number,void *arg);
|
||||
|
||||
/* deprecated rate management supported only for compatability */
|
||||
#define OV_ECTL_RATEMANAGE_GET 0x10
|
||||
#define OV_ECTL_RATEMANAGE_SET 0x11
|
||||
#define OV_ECTL_RATEMANAGE_AVG 0x12
|
||||
#define OV_ECTL_RATEMANAGE_HARD 0x13
|
||||
|
||||
struct ovectl_ratemanage_arg {
|
||||
int management_active;
|
||||
|
||||
long bitrate_hard_min;
|
||||
long bitrate_hard_max;
|
||||
double bitrate_hard_window;
|
||||
|
||||
long bitrate_av_lo;
|
||||
long bitrate_av_hi;
|
||||
double bitrate_av_window;
|
||||
double bitrate_av_window_center;
|
||||
};
|
||||
|
||||
|
||||
/* new rate setup */
|
||||
#define OV_ECTL_RATEMANAGE2_GET 0x14
|
||||
#define OV_ECTL_RATEMANAGE2_SET 0x15
|
||||
|
||||
struct ovectl_ratemanage2_arg {
|
||||
int management_active;
|
||||
|
||||
long bitrate_limit_min_kbps;
|
||||
long bitrate_limit_max_kbps;
|
||||
long bitrate_limit_reservoir_bits;
|
||||
double bitrate_limit_reservoir_bias;
|
||||
|
||||
long bitrate_average_kbps;
|
||||
double bitrate_average_damping;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define OV_ECTL_LOWPASS_GET 0x20
|
||||
#define OV_ECTL_LOWPASS_SET 0x21
|
||||
|
||||
#define OV_ECTL_IBLOCK_GET 0x30
|
||||
#define OV_ECTL_IBLOCK_SET 0x31
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
/********************************************************************
|
||||
* *
|
||||
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
|
||||
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
|
||||
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
|
||||
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
|
||||
* *
|
||||
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
|
||||
* by the Xiph.Org Foundation http://www.xiph.org/ *
|
||||
* *
|
||||
********************************************************************
|
||||
|
||||
function: stdio-based convenience library for opening/seeking/decoding
|
||||
last mod: $Id: vorbisfile.h,v 1.1 2010/11/09 22:53:50 dromagod Exp $
|
||||
|
||||
********************************************************************/
|
||||
|
||||
#ifndef _OV_FILE_H_
|
||||
#define _OV_FILE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "codec.h"
|
||||
|
||||
/* The function prototypes for the callbacks are basically the same as for
|
||||
* the stdio functions fread, fseek, fclose, ftell.
|
||||
* The one difference is that the FILE * arguments have been replaced with
|
||||
* a void * - this is to be used as a pointer to whatever internal data these
|
||||
* functions might need. In the stdio case, it's just a FILE * cast to a void *
|
||||
*
|
||||
* If you use other functions, check the docs for these functions and return
|
||||
* the right values. For seek_func(), you *MUST* return -1 if the stream is
|
||||
* unseekable
|
||||
*/
|
||||
typedef struct {
|
||||
size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
|
||||
int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
|
||||
int (*close_func) (void *datasource);
|
||||
long (*tell_func) (void *datasource);
|
||||
} ov_callbacks;
|
||||
|
||||
/* a few sets of convenient callbacks, especially for use under
|
||||
* Windows where ov_open_callbacks() should always be used instead of
|
||||
* ov_open() to avoid problems with incompatable crt.o version linking
|
||||
* issues. */
|
||||
|
||||
static int _ov_header_fseek_wrap(FILE *f,ogg_int64_t off,int whence){
|
||||
if(f==NULL)return(-1);
|
||||
|
||||
#ifdef __MINGW32__
|
||||
return fseeko64(f,off,whence);
|
||||
#elif defined (_WIN32)
|
||||
return _fseeki64(f,off,whence);
|
||||
#else
|
||||
return fseek(f,off,whence);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* These structs below (OV_CALLBACKS_DEFAULT etc) are defined here as
|
||||
* static data. That means that every file which includes this header
|
||||
* will get its own copy of these structs whether it uses them or
|
||||
* not. This is essential on platforms such as Windows on which
|
||||
* several different versions of stdio support may be linked to by
|
||||
* different DLLs, and we need to be certain we know which one we're
|
||||
* using (the same one as the main application).
|
||||
*/
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_DEFAULT = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
|
||||
(int (*)(void *)) fclose,
|
||||
(long (*)(void *)) ftell
|
||||
};
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_NOCLOSE = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) _ov_header_fseek_wrap,
|
||||
(int (*)(void *)) NULL,
|
||||
(long (*)(void *)) ftell
|
||||
};
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_STREAMONLY = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) NULL,
|
||||
(int (*)(void *)) fclose,
|
||||
(long (*)(void *)) NULL
|
||||
};
|
||||
|
||||
static ov_callbacks OV_CALLBACKS_STREAMONLY_NOCLOSE = {
|
||||
(size_t (*)(void *, size_t, size_t, void *)) fread,
|
||||
(int (*)(void *, ogg_int64_t, int)) NULL,
|
||||
(int (*)(void *)) NULL,
|
||||
(long (*)(void *)) NULL
|
||||
};
|
||||
|
||||
#define NOTOPEN 0
|
||||
#define PARTOPEN 1
|
||||
#define OPENED 2
|
||||
#define STREAMSET 3
|
||||
#define INITSET 4
|
||||
|
||||
typedef struct OggVorbis_File {
|
||||
void *datasource; /* Pointer to a FILE *, etc. */
|
||||
int seekable;
|
||||
ogg_int64_t offset;
|
||||
ogg_int64_t end;
|
||||
ogg_sync_state oy;
|
||||
|
||||
/* If the FILE handle isn't seekable (eg, a pipe), only the current
|
||||
stream appears */
|
||||
int links;
|
||||
ogg_int64_t *offsets;
|
||||
ogg_int64_t *dataoffsets;
|
||||
long *serialnos;
|
||||
ogg_int64_t *pcmlengths; /* overloaded to maintain binary
|
||||
compatability; x2 size, stores both
|
||||
beginning and end values */
|
||||
vorbis_info *vi;
|
||||
vorbis_comment *vc;
|
||||
|
||||
/* Decoding working state local storage */
|
||||
ogg_int64_t pcm_offset;
|
||||
int ready_state;
|
||||
long current_serialno;
|
||||
int current_link;
|
||||
|
||||
double bittrack;
|
||||
double samptrack;
|
||||
|
||||
ogg_stream_state os; /* take physical pages, weld into a logical
|
||||
stream of packets */
|
||||
vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
|
||||
vorbis_block vb; /* local working space for packet->PCM decode */
|
||||
|
||||
ov_callbacks callbacks;
|
||||
|
||||
} OggVorbis_File;
|
||||
|
||||
|
||||
extern int ov_clear(OggVorbis_File *vf);
|
||||
extern int ov_fopen(char *path,OggVorbis_File *vf);
|
||||
extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
|
||||
extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
|
||||
char *initial, long ibytes, ov_callbacks callbacks);
|
||||
|
||||
extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
|
||||
extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
|
||||
char *initial, long ibytes, ov_callbacks callbacks);
|
||||
extern int ov_test_open(OggVorbis_File *vf);
|
||||
|
||||
extern long ov_bitrate(OggVorbis_File *vf,int i);
|
||||
extern long ov_bitrate_instant(OggVorbis_File *vf);
|
||||
extern long ov_streams(OggVorbis_File *vf);
|
||||
extern long ov_seekable(OggVorbis_File *vf);
|
||||
extern long ov_serialnumber(OggVorbis_File *vf,int i);
|
||||
|
||||
extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
|
||||
extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
|
||||
extern double ov_time_total(OggVorbis_File *vf,int i);
|
||||
|
||||
extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_time_seek(OggVorbis_File *vf,double pos);
|
||||
extern int ov_time_seek_page(OggVorbis_File *vf,double pos);
|
||||
|
||||
extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
|
||||
extern int ov_time_seek_lap(OggVorbis_File *vf,double pos);
|
||||
extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
|
||||
|
||||
extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
|
||||
extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
|
||||
extern double ov_time_tell(OggVorbis_File *vf);
|
||||
|
||||
extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
|
||||
extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
|
||||
|
||||
extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
|
||||
int *bitstream);
|
||||
extern long ov_read_filter(OggVorbis_File *vf,char *buffer,int length,
|
||||
int bigendianp,int word,int sgned,int *bitstream,
|
||||
void (*filter)(float **pcm,long channels,long samples,void *filter_param),void *filter_param);
|
||||
extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
|
||||
int bigendianp,int word,int sgned,int *bitstream);
|
||||
extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
|
||||
|
||||
extern int ov_halfrate(OggVorbis_File *vf,int flag);
|
||||
extern int ov_halfrate_p(OggVorbis_File *vf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue