1
0
mirror of https://github.com/RPCS3/soundtouch.git synced 2024-11-08 12:02:28 +01:00

Merge pull request 'Migrate configuration file, add building of dynamic-link version to the master makefile' (#9) from config-updates into master

Reviewed-on: https://codeberg.org/soundtouch/soundtouch/pulls/9
This commit is contained in:
Olli Parviainen 2022-10-30 17:19:16 +01:00
commit eaa9090f65
13 changed files with 534 additions and 58 deletions

View File

@ -1,33 +1,33 @@
dnl This file is part of SoundTouch, an audio processing library for pitch/time adjustments dnl This file is part of SoundTouch, an audio processing library for pitch/time adjustments
dnl dnl
dnl SoundTouch is free software; you can redistribute it and/or modify it under the dnl SoundTouch is free software; you can redistribute it and/or modify it under the
dnl terms of the GNU General Public License as published by the Free Software dnl terms of the GNU General Public License as published by the Free Software
dnl Foundation; either version 2 of the License, or (at your option) any later dnl Foundation; either version 2 of the License, or (at your option) any later
dnl version. dnl version.
dnl dnl
dnl SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY dnl SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
dnl FOR A PARTICULAR PURPOSE. See the GNU General Public License for more dnl FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
dnl details. dnl details.
dnl dnl
dnl You should have received a copy of the GNU General Public License along with dnl You should have received a copy of the GNU General Public License along with
dnl this program; if not, write to the Free Software Foundation, Inc., 59 Temple dnl this program; if not, write to the Free Software Foundation, Inc., 59 Temple
dnl Place - Suite 330, Boston, MA 02111-1307, USA dnl Place - Suite 330, Boston, MA 02111-1307, USA
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_INIT([SoundTouch], [2.3.1], [http://www.surina.net/soundtouch]) AC_INIT([SoundTouch],[2.3.1],[http://www.surina.net/soundtouch])
dnl Default to libSoundTouch.so.$LIB_SONAME.0.0 dnl Default to libSoundTouch.so.$LIB_SONAME.0.0
LIB_SONAME=1 LIB_SONAME=1
AC_SUBST(LIB_SONAME) AC_SUBST(LIB_SONAME)
AC_CONFIG_AUX_DIR(config) AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([config/m4]) AC_CONFIG_MACRO_DIR([config/m4])
AM_CONFIG_HEADER([config.h include/soundtouch_config.h]) AC_CONFIG_HEADERS([config.h include/soundtouch_config.h])
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
AM_SILENT_RULES([yes]) AM_SILENT_RULES([yes])
#AC_DISABLE_SHARED dnl This makes libtool only build static libs #AC_DISABLE_SHARED dnl This makes libtool only build static libs
AC_DISABLE_STATIC dnl This makes libtool only build shared libs AC_DISABLE_STATIC dnl This makes libtool only build shared libs
#AC_GNU_SOURCE dnl enable posix extensions in glibc #AC_USE_SYSTEM_EXTENSIONS dnl enable posix extensions in glibc
AC_LANG(C++) AC_LANG(C++)
@ -51,7 +51,7 @@ AC_PROG_INSTALL
#AC_PROG_LN_S #AC_PROG_LN_S
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AM_PROG_LIBTOOL dnl turn on using libtool LT_INIT dnl turn on using libtool
@ -59,7 +59,7 @@ AM_PROG_LIBTOOL dnl turn on using libtool
dnl ############################################################################ dnl ############################################################################
dnl # Checks for header files # dnl # Checks for header files #
dnl ############################################################################ dnl ############################################################################
AC_HEADER_STDC
#AC_HEADER_SYS_WAIT #AC_HEADER_SYS_WAIT
# add any others you want to check for here # add any others you want to check for here
AC_CHECK_HEADERS([cpuid.h]) AC_CHECK_HEADERS([cpuid.h])
@ -70,7 +70,7 @@ if test "x$ac_cv_header_cpuid_h" = "xno"; then
AC_MSG_WARN([If using a x86 architecture and optimizations are desired then please install gcc (>= 4.3).]) AC_MSG_WARN([If using a x86 architecture and optimizations are desired then please install gcc (>= 4.3).])
AC_MSG_WARN([If using a non-x86 architecture then this is expected and can be ignored.]) AC_MSG_WARN([If using a non-x86 architecture then this is expected and can be ignored.])
fi fi
dnl ############################################################################ dnl ############################################################################
dnl # Checks for typedefs, structures, and compiler characteristics $ dnl # Checks for typedefs, structures, and compiler characteristics $
@ -82,14 +82,12 @@ AC_C_INLINE
AC_ARG_ENABLE(integer-samples, AC_ARG_ENABLE(integer-samples,
[AC_HELP_STRING([--enable-integer-samples], [AS_HELP_STRING([--enable-integer-samples],[use integer samples instead of floats [default=no]])],,
[use integer samples instead of floats [default=no]])],,
[enable_integer_samples=no]) [enable_integer_samples=no])
AC_ARG_ENABLE(openmp, AC_ARG_ENABLE(openmp,
[AC_HELP_STRING([--enable-openmp], [AS_HELP_STRING([--enable-openmp],[use parallel multicore calculation through OpenMP [default=no]])],,
[use parallel multicore calculation through OpenMP [default=no]])],,
[enable_openmp=no]) [enable_openmp=no])
# Let the user enable/disable the x86 optimizations. # Let the user enable/disable the x86 optimizations.
@ -232,6 +230,26 @@ if test "x$enable_neon_optimizations" = "xyes" -a "x$ac_cv_header_arm_neon_h" =
fi fi
fi fi
AC_CANONICAL_HOST
HOST_OS=""
AS_CASE([$host_cpu],
[x86_64],
[
x86_64=true
x86=true
],
[i?86],
[
x86=true
])
AM_CONDITIONAL([X86], [test "$x86" = true])
AM_CONDITIONAL([X86_64], [test "$x86_64" = true])
AC_SUBST([HOST_OS])
# Set AM_CXXFLAGS # Set AM_CXXFLAGS
AC_SUBST([AM_CXXFLAGS], [$AM_CXXFLAGS]) AC_SUBST([AM_CXXFLAGS], [$AM_CXXFLAGS])
@ -254,11 +272,9 @@ AM_CONDITIONAL([HAVE_SSE], [test "x$have_sse_intrinsics" = "xyes"])
dnl ############################################################################ dnl ############################################################################
dnl # Checks for library functions/classes # dnl # Checks for library functions/classes #
dnl ############################################################################ dnl ############################################################################
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
dnl make -lm get added to the LIBS dnl make -lm get added to the LIBS
AC_CHECK_LIB(m, sqrt,,AC_MSG_ERROR([compatible libc math library not found])) AC_CHECK_LIB(m, sqrt,,AC_MSG_ERROR([compatible libc math library not found]))
dnl add whatever functions you might want to check for here dnl add whatever functions you might want to check for here
#AC_CHECK_FUNCS([floor ftruncate memmove memset mkdir modf pow realpath sqrt strchr strdup strerror strrchr strstr strtol]) #AC_CHECK_FUNCS([floor ftruncate memmove memset mkdir modf pow realpath sqrt strchr strdup strerror strrchr strstr strtol])
@ -288,11 +304,12 @@ AC_CONFIG_FILES([
source/Makefile source/Makefile
source/SoundTouch/Makefile source/SoundTouch/Makefile
source/SoundStretch/Makefile source/SoundStretch/Makefile
source/SoundTouchDLL/Makefile
include/Makefile include/Makefile
]) ])
AC_OUTPUT( AC_CONFIG_FILES([soundtouch.pc
soundtouch.pc ])
) AC_OUTPUT
dnl use 'echo' to put stuff here if you want a message to the builder dnl use 'echo' to put stuff here if you want a message to the builder

View File

@ -1,23 +1,23 @@
## Process this file with automake to create Makefile.in ## Process this file with automake to create Makefile.in
## ##
## This file is part of SoundTouch, an audio processing library for pitch/time adjustments ## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
## ##
## SoundTouch is free software; you can redistribute it and/or modify it under the ## SoundTouch is free software; you can redistribute it and/or modify it under the
## terms of the GNU General Public License as published by the Free Software ## terms of the GNU General Public License as published by the Free Software
## Foundation; either version 2 of the License, or (at your option) any later ## Foundation; either version 2 of the License, or (at your option) any later
## version. ## version.
## ##
## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY ## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR ## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
## A PARTICULAR PURPOSE. See the GNU General Public License for more details. ## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
## ##
## You should have received a copy of the GNU General Public License along with ## You should have received a copy of the GNU General Public License along with
## this program; if not, write to the Free Software Foundation, Inc., 59 Temple ## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
## Place - Suite 330, Boston, MA 02111-1307, USA ## Place - Suite 330, Boston, MA 02111-1307, USA
include $(top_srcdir)/config/am_include.mk include $(top_srcdir)/config/am_include.mk
SUBDIRS=SoundTouch SoundStretch SUBDIRS=SoundTouch SoundStretch SoundTouchDLL
# set to something if you want other stuff to be included in the distribution tarball # set to something if you want other stuff to be included in the distribution tarball
#EXTRA_DIST= #EXTRA_DIST=

View File

@ -0,0 +1,10 @@
This is Lazarus Pascal example that loads the SoundTouch dynamic-load library
and queries the library version as a simple example how to load SoundTouch from
Pascal / Lazarus.
Set the SoundTouch dynamic library file name in the 'InitDLL' procedure of
file 'SoundTouchDLL.pas' depending on if you're building for Windows or Linux.
The example expects the the 'libSoundTouchDll.so' (linux) or 'SoundTouch.dll' (Windows)
library binary files is found within this project directory, either via soft-link
(in Linux) or as a copied file.

View File

@ -2,11 +2,8 @@ unit SoundTouchDLL;
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// //
// SoundTouch.dll wrapper for accessing SoundTouch routines from Delphi/Pascal // SoundTouch.dll / libSoundTouchDll.so wrapper for accessing SoundTouch
// // routines from Delphi/Pascal/Lazarus
// Module Author : Christian Budde
//
// 2014-01-12 fixes by Sandro Cumerlato <sandro.cumerlato 'at' gmail.com>
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// //
@ -33,8 +30,8 @@ unit SoundTouchDLL;
interface interface
uses //uses
Windows; //Windows;
type type
TSoundTouchHandle = THandle; TSoundTouchHandle = THandle;
@ -50,7 +47,7 @@ type
// Get SoundTouch library version string 2 // Get SoundTouch library version string 2
TSoundTouchGetVersionString2 = procedure(VersionString : PAnsiChar; BufferSize : Integer); cdecl; TSoundTouchGetVersionString2 = procedure(VersionString : PAnsiChar; BufferSize : Integer); cdecl;
// Get SoundTouch library version Id // Get SoundTouch library version Id
TSoundTouchGetVersionId = function : Cardinal; cdecl; TSoundTouchGetVersionId = function : Cardinal; cdecl;
@ -107,6 +104,13 @@ type
//< contains data for both channels. //< contains data for both channels.
); cdecl; ); cdecl;
TSoundTouchPutSamplesI16 = procedure (Handle: TSoundTouchHandle;
const Samples: Pint16; //< Pointer to sample buffer.
NumSamples: Cardinal //< Number of samples in buffer. Notice
//< that in case of stereo-sound a single sample
//< contains data for both channels.
); cdecl;
// Clears all the samples in the object's output and internal processing // Clears all the samples in the object's output and internal processing
// buffers. // buffers.
TSoundTouchClear = procedure (Handle: TSoundTouchHandle); cdecl; TSoundTouchClear = procedure (Handle: TSoundTouchHandle); cdecl;
@ -131,16 +135,20 @@ type
// Returns number of samples currently unprocessed. // Returns number of samples currently unprocessed.
TSoundTouchNumUnprocessedSamples = function (Handle: TSoundTouchHandle): Cardinal; cdecl; TSoundTouchNumUnprocessedSamples = function (Handle: TSoundTouchHandle): Cardinal; cdecl;
// Adjusts book-keeping so that given number of samples are removed from beginning of the /// Receive ready samples from the processing pipeline.
// sample buffer without copying them anywhere. ///
// /// if called with outBuffer=NULL, just reduces amount of ready samples within the pipeline.
// Used to reduce the number of samples in the buffer when accessing the sample buffer directly
// with 'ptrBegin' function.
TSoundTouchReceiveSamples = function (Handle: TSoundTouchHandle; TSoundTouchReceiveSamples = function (Handle: TSoundTouchHandle;
OutBuffer: PSingle; //< Buffer where to copy output samples. OutBuffer: PSingle; //< Buffer where to copy output samples.
MaxSamples: Integer //< How many samples to receive at max. MaxSamples: Integer //< How many samples to receive at max.
): Cardinal; cdecl; ): Cardinal; cdecl;
/// int16 version of soundtouch_receiveSamples(): This converts internal float samples
/// into int16 (short) return data type
TSoundTouchReceiveSamplesI16 = function (Handle: TSoundTouchHandle;
OutBuffer: int16; //< Buffer where to copy output samples.
MaxSamples: Integer //< How many samples to receive at max.
): Cardinal; cdecl;
// Returns number of samples currently available. // Returns number of samples currently available.
TSoundTouchNumSamples = function (Handle: TSoundTouchHandle): Cardinal; cdecl; TSoundTouchNumSamples = function (Handle: TSoundTouchHandle): Cardinal; cdecl;
@ -170,6 +178,7 @@ var
SoundTouchGetSetting : TSoundTouchGetSetting; SoundTouchGetSetting : TSoundTouchGetSetting;
SoundTouchNumUnprocessedSamples : TSoundTouchNumUnprocessedSamples; SoundTouchNumUnprocessedSamples : TSoundTouchNumUnprocessedSamples;
SoundTouchReceiveSamples : TSoundTouchReceiveSamples; SoundTouchReceiveSamples : TSoundTouchReceiveSamples;
SoundTouchReceiveSamplesI16 : TSoundTouchReceiveSamplesI16;
SoundTouchNumSamples : TSoundTouchNumSamples; SoundTouchNumSamples : TSoundTouchNumSamples;
SoundTouchIsEmpty : TSoundTouchIsEmpty; SoundTouchIsEmpty : TSoundTouchIsEmpty;
@ -232,6 +241,9 @@ type
property IsEmpty: Integer read GetIsEmpty; property IsEmpty: Integer read GetIsEmpty;
end; end;
// list of exported functions and procedures
function IsSoundTouchLoaded: Boolean;
implementation implementation
{ TSoundTouch } { TSoundTouch }
@ -416,19 +428,20 @@ begin
end; end;
var var
SoundTouchLibHandle: HINST; SoundTouchLibHandle: THandle;
SoundTouchDLLFile: PAnsiChar = 'SoundTouch.dll'; SoundTouchDLLFile: AnsiString = 'libSoundTouchDll.so';
//SoundTouchDLLFile: AnsiString = 'SoundTouch.dll';
// bpm detect functions. untested -- if these don't work then remove: // bpm detect functions. untested -- if these don't work then remove:
bpm_createInstance: function(chan: CInt32; sampleRate : CInt32): THandle; cdecl; bpm_createInstance: function(chan: int32; sampleRate : int32): THandle; cdecl;
bpm_destroyInstance: procedure(h: THandle); cdecl; bpm_destroyInstance: procedure(h: THandle); cdecl;
bpm_getBpm: function(h: THandle): cfloat; cdecl; bpm_getBpm: function(h: THandle): Single; cdecl;
bpm_putSamples: procedure(h: THandle; const samples: pcfloat; bpm_putSamples: procedure(h: THandle; const samples: PSingle; numSamples: cardinal); cdecl;
numSamples: cardinal); cdecl;
procedure InitDLL; procedure InitDLL;
begin begin
SoundTouchLibHandle := LoadLibrary(SoundTouchDLLFile); // for Windows: use 'SoundTouch.dll` as filename
SoundTouchLibHandle := LoadLibrary('./libSoundTouchDll.so');
if SoundTouchLibHandle <> 0 then if SoundTouchLibHandle <> 0 then
try try
Pointer(SoundTouchCreateInstance) := GetProcAddress(SoundTouchLibHandle, 'soundtouch_createInstance'); Pointer(SoundTouchCreateInstance) := GetProcAddress(SoundTouchLibHandle, 'soundtouch_createInstance');
@ -461,7 +474,7 @@ begin
Pointer(bpm_destroyInstance) :=GetProcAddress(SoundTouchLibHandle, 'bpm_destroyInstance'); Pointer(bpm_destroyInstance) :=GetProcAddress(SoundTouchLibHandle, 'bpm_destroyInstance');
Pointer(bpm_getBpm) :=GetProcAddress(SoundTouchLibHandle, 'bpm_getBpm'); Pointer(bpm_getBpm) :=GetProcAddress(SoundTouchLibHandle, 'bpm_getBpm');
Pointer(bpm_putSamples) :=GetProcAddress(SoundTouchLibHandle, 'bpm_putSamples'); Pointer(bpm_putSamples) :=GetProcAddress(SoundTouchLibHandle, 'bpm_putSamples');
except except
FreeLibrary(SoundTouchLibHandle); FreeLibrary(SoundTouchLibHandle);
SoundTouchLibHandle := 0; SoundTouchLibHandle := 0;
@ -473,6 +486,12 @@ begin
if SoundTouchLibHandle <> 0 then FreeLibrary(SoundTouchLibHandle); if SoundTouchLibHandle <> 0 then FreeLibrary(SoundTouchLibHandle);
end; end;
// returns 'true' if SoundTouch dynamic library has been successfully loaded, otherwise 'false'
function IsSoundTouchLoaded: Boolean;
begin;
result := SoundTouchLibHandle <> 0
end;
initialization initialization
InitDLL; InitDLL;

View File

@ -0,0 +1 @@
../.libs/libSoundTouchDll.so

View File

@ -0,0 +1,36 @@
object Form1: TForm1
Left = 2237
Height = 128
Top = 242
Width = 381
Caption = 'SoundTouch test'
ClientHeight = 128
ClientWidth = 381
LCLVersion = '2.2.0.4'
object Load: TButton
Left = 19
Height = 50
Top = 16
Width = 144
Caption = 'Load SoundTouch'
OnClick = LoadClick
TabOrder = 0
end
object EditVersion: TEdit
Left = 184
Height = 34
Top = 80
Width = 184
TabOrder = 1
Text = 'n/a'
TextHint = 'click to populate'
end
object Label1: TLabel
Left = 19
Height = 17
Top = 90
Width = 156
Caption = 'Soundtouch lib version:'
WordWrap = True
end
end

View File

@ -0,0 +1,49 @@
unit main;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, SoundTouchDLL;
type
{ TForm1 }
TForm1 = class(TForm)
EditVersion: TEdit;
Label1: TLabel;
Load: TButton;
procedure LoadClick(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.LoadClick(Sender: TObject);
var
version:string;
begin
if IsSoundTouchLoaded() then
version := SoundTouchGetVersionString()
else
version := '<library loading failed>';
EditVersion.Text:= version;
end;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<General>
<SessionStorage Value="InProjectDir"/>
<Title Value="soundtouchtest"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes>
<Item Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
</RunParams>
<RequiredPackages>
<Item>
<PackageName Value="LCL"/>
</Item>
</RequiredPackages>
<Units>
<Unit>
<Filename Value="soundtouchtest.lpr"/>
<IsPartOfProject Value="True"/>
</Unit>
<Unit>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<Target>
<Filename Value="soundtouchtest"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<DebugInfoType Value="dsDwarf3"/>
</Debugging>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions>
<Item>
<Name Value="EAbort"/>
</Item>
<Item>
<Name Value="ECodetoolError"/>
</Item>
<Item>
<Name Value="EFOpenError"/>
</Item>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,25 @@
program soundtouchtest;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
{$IFDEF HASAMIGA}
athreads,
{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, main
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,186 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectSession>
<Version Value="12"/>
<BuildModes Active="Default"/>
<Units>
<Unit>
<Filename Value="soundtouchtest.lpr"/>
<IsPartOfProject Value="True"/>
<EditorIndex Value="-1"/>
<WindowIndex Value="-1"/>
<TopLine Value="-1"/>
<CursorPos X="-1" Y="-1"/>
<UsageCount Value="21"/>
</Unit>
<Unit>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<IsVisibleTab Value="True"/>
<CursorPos X="26" Y="43"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
</Unit>
<Unit>
<Filename Value="../SoundTouchDLL.pas"/>
<EditorIndex Value="-1"/>
<TopLine Value="37"/>
<CursorPos X="19"/>
<UsageCount Value="10"/>
</Unit>
<Unit>
<Filename Value="/usr/lib/lazarus/2.2.0/lcl/interfaces/gtk2/gtk2proc.inc"/>
<EditorIndex Value="-1"/>
<TopLine Value="7149"/>
<CursorPos X="3" Y="7184"/>
<UsageCount Value="10"/>
</Unit>
<Unit>
<Filename Value="/usr/lib/lazarus/2.2.0/components/freetype/easylazfreetype.pas"/>
<UnitName Value="EasyLazFreeType"/>
<EditorIndex Value="-1"/>
<TopLine Value="539"/>
<CursorPos X="16" Y="574"/>
<UsageCount Value="10"/>
</Unit>
<Unit>
<Filename Value="SoundTouchDLL.pas"/>
<EditorIndex Value="1"/>
<TopLine Value="326"/>
<CursorPos X="127" Y="379"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit>
</Units>
<JumpHistory HistoryIndex="29">
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="439" TopLine="403"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="427" Column="37" TopLine="403"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="439" TopLine="403"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="427" Column="32" TopLine="403"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="444" Column="48" TopLine="403"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="439" TopLine="403"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="416" Column="116" TopLine="403"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="439" TopLine="403"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="45" Column="40"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="243" Column="38" TopLine="197"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="487" Column="38" TopLine="429"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="42" Column="8"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="41" Column="44"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="44" Column="6"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="43" Column="39"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="44" Column="7"/>
</Position>
<Position>
<Filename Value="main.pas"/>
<Caret Line="38" Column="7"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="467" TopLine="423"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="212" Column="32" TopLine="78"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="361" Column="37" TopLine="308"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="466" Column="37" TopLine="413"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="467" Column="37" TopLine="413"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="466" Column="13" TopLine="413"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="361" Column="13" TopLine="326"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="110" Column="3" TopLine="74"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="180" Column="37" TopLine="145"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="179" Column="55" TopLine="145"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="146" Column="3" TopLine="145"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="149" TopLine="111"/>
</Position>
<Position>
<Filename Value="SoundTouchDLL.pas"/>
<Caret Line="151" Column="31" TopLine="116"/>
</Position>
</JumpHistory>
<RunParams>
<FormatVersion Value="2"/>
<Modes ActiveMode=""/>
</RunParams>
</ProjectSession>
</CONFIG>

View File

@ -0,0 +1,57 @@
## Process this file with automake to create Makefile.in
##
## This file is part of SoundTouch, an audio processing library for pitch/time adjustments
##
## SoundTouch is free software; you can redistribute it and/or modify it under the
## terms of the GNU General Public License as published by the Free Software
## Foundation; either version 2 of the License, or (at your option) any later
## version.
##
## SoundTouch is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
## A PARTICULAR PURPOSE. See the GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along with
## this program; if not, write to the Free Software Foundation, Inc., 59 Temple
## Place - Suite 330, Boston, MA 02111-1307, USA
include $(top_srcdir)/config/am_include.mk
#AUTOMAKE_OPTIONS = subdir-objects
noinst_HEADERS=../SoundTouch/AAFilter.h ../SoundTouch/cpu_detect.h ../SoundTouch/cpu_detect_x86.cpp ../SoundTouch/FIRFilter.h \
../SoundTouch/RateTransposer.h ../SoundTouch/TDStretch.h ../SoundTouch/PeakFinder.h ../SoundTouch/InterpolateCubic.h \
../SoundTouch/InterpolateLinear.h ../SoundTouch/InterpolateShannon.h
include_HEADERS=SoundTouchDLL.h
lib_LTLIBRARIES=libSoundTouchDll.la
#
libSoundTouchDll_la_SOURCES=../SoundTouch/AAFilter.cpp ../SoundTouch/FIRFilter.cpp \
../SoundTouch/FIFOSampleBuffer.cpp ../SoundTouch/RateTransposer.cpp ../SoundTouch/SoundTouch.cpp \
../SoundTouch/TDStretch.cpp ../SoundTouch/sse_optimized.cpp ../SoundTouch/cpu_detect_x86.cpp \
../SoundTouch/BPMDetect.cpp ../SoundTouch/PeakFinder.cpp ../SoundTouch/InterpolateLinear.cpp \
../SoundTouch/InterpolateCubic.cpp ../SoundTouch/InterpolateShannon.cpp SoundTouchDLL.cpp
# Compiler flags
# Modify the default 0.0.0 to LIB_SONAME.0.0
#libSoundTouchDll_la_LDFLAGS=-version-info @LIB_SONAME@
LDFLAGS=-version-info @LIB_SONAME@
if X86
CXXFLAGS1=-mstackrealign -msse
endif
if X86_64
CXXFLAGS2=-fPIC
endif
#libSoundTouchDll_CXXFLAGS=$(AM_CXXFLAGS) $(CXXFLAGS1) $(CXXFLAGS2) -shared -DDLL_EXPORTS -fvisibility=hidden
CXXFLAGS=$(AM_CXXFLAGS) $(CXXFLAGS1) $(CXXFLAGS2) -shared -DDLL_EXPORTS -fvisibility=hidden
# TODO:
# - saatu kääntymään
# - tee testi, toimiiko dll?

View File

@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
/// ///
/// SoundTouch DLL wrapper - wraps SoundTouch routines into a Dynamic Load /// SoundTouch DLL wrapper - wraps SoundTouch routines into a Dynamic Load
/// Library interface. /// Library interface.
/// ///
/// Author : Copyright (c) Olli Parviainen /// Author : Copyright (c) Olli Parviainen
@ -119,7 +119,7 @@ SOUNDTOUCHDLL_API const char *__cdecl soundtouch_getVersionString()
} }
/// Get SoundTouch library version string - alternative function for /// Get SoundTouch library version string - alternative function for
/// environments that can't properly handle character string as return value /// environments that can't properly handle character string as return value
SOUNDTOUCHDLL_API void __cdecl soundtouch_getVersionString2(char* versionString, int bufferSize) SOUNDTOUCHDLL_API void __cdecl soundtouch_getVersionString2(char* versionString, int bufferSize)
{ {
@ -185,7 +185,7 @@ SOUNDTOUCHDLL_API void __cdecl soundtouch_setPitch(HANDLE h, float newPitch)
sth->pst->setPitch(newPitch); sth->pst->setPitch(newPitch);
} }
/// Sets pitch change in octaves compared to the original pitch /// Sets pitch change in octaves compared to the original pitch
/// (-1.00 .. +1.00) /// (-1.00 .. +1.00)
SOUNDTOUCHDLL_API void __cdecl soundtouch_setPitchOctaves(HANDLE h, float newPitch) SOUNDTOUCHDLL_API void __cdecl soundtouch_setPitchOctaves(HANDLE h, float newPitch)
{ {
@ -335,9 +335,9 @@ SOUNDTOUCHDLL_API void __cdecl soundtouch_clear(HANDLE h)
/// Changes a setting controlling the processing system behaviour. See the /// Changes a setting controlling the processing system behaviour. See the
/// 'SETTING_...' defines for available setting ID's. /// 'SETTING_...' defines for available setting ID's.
/// ///
/// \return 'nonzero' if the setting was successfully changed /// \return 'nonzero' if the setting was successfully changed
SOUNDTOUCHDLL_API int __cdecl soundtouch_setSetting(HANDLE h, SOUNDTOUCHDLL_API int __cdecl soundtouch_setSetting(HANDLE h,
int settingId, ///< Setting ID number. see SETTING_... defines. int settingId, ///< Setting ID number. see SETTING_... defines.
int value ///< New setting value. int value ///< New setting value.
) )
@ -352,7 +352,7 @@ SOUNDTOUCHDLL_API int __cdecl soundtouch_setSetting(HANDLE h,
/// 'SETTING_...' defines for available setting ID's. /// 'SETTING_...' defines for available setting ID's.
/// ///
/// \return the setting value. /// \return the setting value.
SOUNDTOUCHDLL_API int __cdecl soundtouch_getSetting(HANDLE h, SOUNDTOUCHDLL_API int __cdecl soundtouch_getSetting(HANDLE h,
int settingId ///< Setting ID number, see SETTING_... defines. int settingId ///< Setting ID number, see SETTING_... defines.
) )
{ {
@ -373,12 +373,10 @@ SOUNDTOUCHDLL_API uint __cdecl soundtouch_numUnprocessedSamples(HANDLE h)
} }
/// Adjusts book-keeping so that given number of samples are removed from beginning of the /// Receive ready samples from the processing pipeline.
/// sample buffer without copying them anywhere.
/// ///
/// Used to reduce the number of samples in the buffer when accessing the sample buffer directly /// if called with outBuffer=NULL, just reduces amount of ready samples within the pipeline.
/// with 'ptrBegin' function. SOUNDTOUCHDLL_API uint __cdecl soundtouch_receiveSamples(HANDLE h,
SOUNDTOUCHDLL_API uint __cdecl soundtouch_receiveSamples(HANDLE h,
SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples. SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples.
unsigned int maxSamples ///< How many samples to receive at max. unsigned int maxSamples ///< How many samples to receive at max.
) )
@ -507,7 +505,7 @@ SOUNDTOUCHDLL_API void __cdecl bpm_destroyInstance(HANDLE h)
/// Feed 'numSamples' sample frames from 'samples' into the BPM detection handler /// Feed 'numSamples' sample frames from 'samples' into the BPM detection handler
SOUNDTOUCHDLL_API void __cdecl bpm_putSamples(HANDLE h, SOUNDTOUCHDLL_API void __cdecl bpm_putSamples(HANDLE h,
const float *samples, const float *samples,
unsigned int numSamples) unsigned int numSamples)
{ {
@ -520,7 +518,7 @@ SOUNDTOUCHDLL_API void __cdecl bpm_putSamples(HANDLE h,
/// Feed 'numSamples' sample frames from 'samples' into the BPM detection handler. /// Feed 'numSamples' sample frames from 'samples' into the BPM detection handler.
/// 16bit int sample format version. /// 16bit int sample format version.
SOUNDTOUCHDLL_API void __cdecl bpm_putSamples_i16(HANDLE h, SOUNDTOUCHDLL_API void __cdecl bpm_putSamples_i16(HANDLE h,
const short *samples, const short *samples,
unsigned int numSamples) unsigned int numSamples)
{ {