diff --git a/configure.ac b/configure.ac index d557fb6..6db05e2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,33 +1,33 @@ 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 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 version. -dnl +dnl 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 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more dnl details. -dnl +dnl 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 Place - Suite 330, Boston, MA 02111-1307, USA # 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 LIB_SONAME=1 AC_SUBST(LIB_SONAME) AC_CONFIG_AUX_DIR(config) 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_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_GNU_SOURCE dnl enable posix extensions in glibc +#AC_USE_SYSTEM_EXTENSIONS dnl enable posix extensions in glibc AC_LANG(C++) @@ -51,7 +51,7 @@ AC_PROG_INSTALL #AC_PROG_LN_S 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 # Checks for header files # dnl ############################################################################ -AC_HEADER_STDC + #AC_HEADER_SYS_WAIT # add any others you want to check for here 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 non-x86 architecture then this is expected and can be ignored.]) fi - + dnl ############################################################################ dnl # Checks for typedefs, structures, and compiler characteristics $ @@ -82,14 +82,12 @@ AC_C_INLINE AC_ARG_ENABLE(integer-samples, - [AC_HELP_STRING([--enable-integer-samples], - [use integer samples instead of floats [default=no]])],, + [AS_HELP_STRING([--enable-integer-samples],[use integer samples instead of floats [default=no]])],, [enable_integer_samples=no]) AC_ARG_ENABLE(openmp, - [AC_HELP_STRING([--enable-openmp], - [use parallel multicore calculation through OpenMP [default=no]])],, + [AS_HELP_STRING([--enable-openmp],[use parallel multicore calculation through OpenMP [default=no]])],, [enable_openmp=no]) # 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 + +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 AC_SUBST([AM_CXXFLAGS], [$AM_CXXFLAGS]) @@ -254,11 +272,9 @@ AM_CONDITIONAL([HAVE_SSE], [test "x$have_sse_intrinsics" = "xyes"]) dnl ############################################################################ dnl # Checks for library functions/classes # dnl ############################################################################ -AC_FUNC_MALLOC -AC_TYPE_SIGNAL 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 #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/SoundTouch/Makefile source/SoundStretch/Makefile + source/SoundTouchDLL/Makefile include/Makefile ]) -AC_OUTPUT( - soundtouch.pc -) +AC_CONFIG_FILES([soundtouch.pc +]) +AC_OUTPUT dnl use 'echo' to put stuff here if you want a message to the builder diff --git a/source/Makefile.am b/source/Makefile.am index f5c3edb..8463069 100644 --- a/source/Makefile.am +++ b/source/Makefile.am @@ -1,23 +1,23 @@ ## 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 -SUBDIRS=SoundTouch SoundStretch +SUBDIRS=SoundTouch SoundStretch SoundTouchDLL # set to something if you want other stuff to be included in the distribution tarball #EXTRA_DIST= diff --git a/source/SoundTouchDLL/LazarusTest/README.txt b/source/SoundTouchDLL/LazarusTest/README.txt new file mode 100644 index 0000000..e1188c1 --- /dev/null +++ b/source/SoundTouchDLL/LazarusTest/README.txt @@ -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. diff --git a/source/SoundTouchDLL/SoundTouchDLL.pas b/source/SoundTouchDLL/LazarusTest/SoundTouchDLL.pas similarity index 87% rename from source/SoundTouchDLL/SoundTouchDLL.pas rename to source/SoundTouchDLL/LazarusTest/SoundTouchDLL.pas index 48e6251..3c6c362 100644 --- a/source/SoundTouchDLL/SoundTouchDLL.pas +++ b/source/SoundTouchDLL/LazarusTest/SoundTouchDLL.pas @@ -2,11 +2,8 @@ unit SoundTouchDLL; ////////////////////////////////////////////////////////////////////////////// // -// SoundTouch.dll wrapper for accessing SoundTouch routines from Delphi/Pascal -// -// Module Author : Christian Budde -// -// 2014-01-12 fixes by Sandro Cumerlato +// SoundTouch.dll / libSoundTouchDll.so wrapper for accessing SoundTouch +// routines from Delphi/Pascal/Lazarus // //////////////////////////////////////////////////////////////////////////////// // @@ -33,8 +30,8 @@ unit SoundTouchDLL; interface -uses - Windows; +//uses + //Windows; type TSoundTouchHandle = THandle; @@ -50,7 +47,7 @@ type // Get SoundTouch library version string 2 TSoundTouchGetVersionString2 = procedure(VersionString : PAnsiChar; BufferSize : Integer); cdecl; - + // Get SoundTouch library version Id TSoundTouchGetVersionId = function : Cardinal; cdecl; @@ -107,6 +104,13 @@ type //< contains data for both channels. ); 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 // buffers. TSoundTouchClear = procedure (Handle: TSoundTouchHandle); cdecl; @@ -131,16 +135,20 @@ type // Returns number of samples currently unprocessed. TSoundTouchNumUnprocessedSamples = function (Handle: TSoundTouchHandle): Cardinal; cdecl; - // Adjusts book-keeping so that given number of samples are removed from beginning of the - // sample buffer without copying them anywhere. - // - // Used to reduce the number of samples in the buffer when accessing the sample buffer directly - // with 'ptrBegin' function. + /// Receive ready samples from the processing pipeline. + /// + /// if called with outBuffer=NULL, just reduces amount of ready samples within the pipeline. TSoundTouchReceiveSamples = function (Handle: TSoundTouchHandle; OutBuffer: PSingle; //< Buffer where to copy output samples. MaxSamples: Integer //< How many samples to receive at max. ): 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. TSoundTouchNumSamples = function (Handle: TSoundTouchHandle): Cardinal; cdecl; @@ -170,6 +178,7 @@ var SoundTouchGetSetting : TSoundTouchGetSetting; SoundTouchNumUnprocessedSamples : TSoundTouchNumUnprocessedSamples; SoundTouchReceiveSamples : TSoundTouchReceiveSamples; + SoundTouchReceiveSamplesI16 : TSoundTouchReceiveSamplesI16; SoundTouchNumSamples : TSoundTouchNumSamples; SoundTouchIsEmpty : TSoundTouchIsEmpty; @@ -232,6 +241,9 @@ type property IsEmpty: Integer read GetIsEmpty; end; + // list of exported functions and procedures +function IsSoundTouchLoaded: Boolean; + implementation { TSoundTouch } @@ -416,19 +428,20 @@ begin end; var - SoundTouchLibHandle: HINST; - SoundTouchDLLFile: PAnsiChar = 'SoundTouch.dll'; + SoundTouchLibHandle: THandle; + SoundTouchDLLFile: AnsiString = 'libSoundTouchDll.so'; + //SoundTouchDLLFile: AnsiString = 'SoundTouch.dll'; // 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_getBpm: function(h: THandle): cfloat; cdecl; - bpm_putSamples: procedure(h: THandle; const samples: pcfloat; - numSamples: cardinal); cdecl; + bpm_getBpm: function(h: THandle): Single; cdecl; + bpm_putSamples: procedure(h: THandle; const samples: PSingle; numSamples: cardinal); cdecl; procedure InitDLL; begin - SoundTouchLibHandle := LoadLibrary(SoundTouchDLLFile); + // for Windows: use 'SoundTouch.dll` as filename + SoundTouchLibHandle := LoadLibrary('./libSoundTouchDll.so'); if SoundTouchLibHandle <> 0 then try Pointer(SoundTouchCreateInstance) := GetProcAddress(SoundTouchLibHandle, 'soundtouch_createInstance'); @@ -461,7 +474,7 @@ begin Pointer(bpm_destroyInstance) :=GetProcAddress(SoundTouchLibHandle, 'bpm_destroyInstance'); Pointer(bpm_getBpm) :=GetProcAddress(SoundTouchLibHandle, 'bpm_getBpm'); Pointer(bpm_putSamples) :=GetProcAddress(SoundTouchLibHandle, 'bpm_putSamples'); - + except FreeLibrary(SoundTouchLibHandle); SoundTouchLibHandle := 0; @@ -473,6 +486,12 @@ begin if SoundTouchLibHandle <> 0 then FreeLibrary(SoundTouchLibHandle); end; +// returns 'true' if SoundTouch dynamic library has been successfully loaded, otherwise 'false' +function IsSoundTouchLoaded: Boolean; +begin; + result := SoundTouchLibHandle <> 0 +end; + initialization InitDLL; diff --git a/source/SoundTouchDLL/LazarusTest/libSoundTouchDll.so b/source/SoundTouchDLL/LazarusTest/libSoundTouchDll.so new file mode 120000 index 0000000..6db5ce9 --- /dev/null +++ b/source/SoundTouchDLL/LazarusTest/libSoundTouchDll.so @@ -0,0 +1 @@ +../.libs/libSoundTouchDll.so \ No newline at end of file diff --git a/source/SoundTouchDLL/LazarusTest/main.lfm b/source/SoundTouchDLL/LazarusTest/main.lfm new file mode 100644 index 0000000..36ffb13 --- /dev/null +++ b/source/SoundTouchDLL/LazarusTest/main.lfm @@ -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 diff --git a/source/SoundTouchDLL/LazarusTest/main.pas b/source/SoundTouchDLL/LazarusTest/main.pas new file mode 100644 index 0000000..44ccce4 --- /dev/null +++ b/source/SoundTouchDLL/LazarusTest/main.pas @@ -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 := ''; + + EditVersion.Text:= version; +end; + +end. + diff --git a/source/SoundTouchDLL/LazarusTest/soundtouchtest.ico b/source/SoundTouchDLL/LazarusTest/soundtouchtest.ico new file mode 100644 index 0000000..25c186a Binary files /dev/null and b/source/SoundTouchDLL/LazarusTest/soundtouchtest.ico differ diff --git a/source/SoundTouchDLL/LazarusTest/soundtouchtest.lpi b/source/SoundTouchDLL/LazarusTest/soundtouchtest.lpi new file mode 100644 index 0000000..d2ce13e --- /dev/null +++ b/source/SoundTouchDLL/LazarusTest/soundtouchtest.lpi @@ -0,0 +1,78 @@ + + + + + + + + <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> diff --git a/source/SoundTouchDLL/LazarusTest/soundtouchtest.lpr b/source/SoundTouchDLL/LazarusTest/soundtouchtest.lpr new file mode 100644 index 0000000..e8fee83 --- /dev/null +++ b/source/SoundTouchDLL/LazarusTest/soundtouchtest.lpr @@ -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. + diff --git a/source/SoundTouchDLL/LazarusTest/soundtouchtest.lps b/source/SoundTouchDLL/LazarusTest/soundtouchtest.lps new file mode 100644 index 0000000..c80f75f --- /dev/null +++ b/source/SoundTouchDLL/LazarusTest/soundtouchtest.lps @@ -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> diff --git a/source/SoundTouchDLL/Makefile.am b/source/SoundTouchDLL/Makefile.am new file mode 100644 index 0000000..65b764e --- /dev/null +++ b/source/SoundTouchDLL/Makefile.am @@ -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? diff --git a/source/SoundTouchDLL/SoundTouchDLL.cpp b/source/SoundTouchDLL/SoundTouchDLL.cpp index 1b6b8f2..3f78cca 100644 --- a/source/SoundTouchDLL/SoundTouchDLL.cpp +++ b/source/SoundTouchDLL/SoundTouchDLL.cpp @@ -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. /// /// 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 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); } -/// Sets pitch change in octaves compared to the original pitch +/// Sets pitch change in octaves compared to the original pitch /// (-1.00 .. +1.00) 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 /// 'SETTING_...' defines for available setting ID's. -/// +/// /// \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 value ///< New setting value. ) @@ -352,7 +352,7 @@ SOUNDTOUCHDLL_API int __cdecl soundtouch_setSetting(HANDLE h, /// 'SETTING_...' defines for available setting ID's. /// /// \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. ) { @@ -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 -/// sample buffer without copying them anywhere. +/// Receive ready samples from the processing pipeline. /// -/// Used to reduce the number of samples in the buffer when accessing the sample buffer directly -/// with 'ptrBegin' function. -SOUNDTOUCHDLL_API uint __cdecl soundtouch_receiveSamples(HANDLE h, +/// if called with outBuffer=NULL, just reduces amount of ready samples within the pipeline. +SOUNDTOUCHDLL_API uint __cdecl soundtouch_receiveSamples(HANDLE h, SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples. 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 -SOUNDTOUCHDLL_API void __cdecl bpm_putSamples(HANDLE h, +SOUNDTOUCHDLL_API void __cdecl bpm_putSamples(HANDLE h, const float *samples, 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. /// 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, unsigned int numSamples) {