mirror of
https://github.com/azahar-emu/soundtouch
synced 2025-11-07 07:30:02 +01:00
Added Dynamic-Link-Library (DLL) function wrapper for SoundTouch routines
This commit is contained in:
parent
c17eb6821a
commit
5a4a41cac6
327
source/SoundTouchDLL/SoundTouchDLL.cpp
Normal file
327
source/SoundTouchDLL/SoundTouchDLL.cpp
Normal file
@ -0,0 +1,327 @@
|
|||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
///
|
||||||
|
/// SoundTouch DLL wrapper - wraps SoundTouch routines into a Dynamic Load
|
||||||
|
/// Library interface.
|
||||||
|
///
|
||||||
|
/// Author : Copyright (c) Olli Parviainen
|
||||||
|
/// Author e-mail : oparviai 'at' iki.fi
|
||||||
|
/// SoundTouch WWW: http://www.surina.net/soundtouch
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// $Id: $
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// License :
|
||||||
|
//
|
||||||
|
// SoundTouch audio processing library
|
||||||
|
// Copyright (c) Olli Parviainen
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library 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
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include "SoundTouchDLL.h"
|
||||||
|
#include "soundtouch.h"
|
||||||
|
|
||||||
|
using namespace soundtouch;
|
||||||
|
|
||||||
|
BOOL APIENTRY DllMain( HANDLE hModule,
|
||||||
|
DWORD ul_reason_for_call,
|
||||||
|
LPVOID lpReserved
|
||||||
|
)
|
||||||
|
{
|
||||||
|
switch (ul_reason_for_call)
|
||||||
|
{
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
case DLL_THREAD_ATTACH:
|
||||||
|
case DLL_THREAD_DETACH:
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
DWORD dwMagic;
|
||||||
|
SoundTouch *pst;
|
||||||
|
} STHANDLE;
|
||||||
|
|
||||||
|
#define STMAGIC 0x1770C001
|
||||||
|
|
||||||
|
SOUNDTOUCHDLL_API HANDLE __stdcall soundtouch_createInstance()
|
||||||
|
{
|
||||||
|
STHANDLE *tmp = new STHANDLE;
|
||||||
|
|
||||||
|
if (tmp)
|
||||||
|
{
|
||||||
|
tmp->dwMagic = STMAGIC;
|
||||||
|
tmp->pst = new SoundTouch();
|
||||||
|
if (tmp->pst == NULL)
|
||||||
|
{
|
||||||
|
delete tmp;
|
||||||
|
tmp = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (HANDLE)tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_destroyInstance(HANDLE h)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
sth->dwMagic = 0;
|
||||||
|
delete sth->pst;
|
||||||
|
sth->pst = NULL;
|
||||||
|
delete sth;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Get SoundTouch library version string
|
||||||
|
SOUNDTOUCHDLL_API const char *__stdcall soundtouch_getVersionString()
|
||||||
|
{
|
||||||
|
return SoundTouch::getVersionString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get SoundTouch library version Id
|
||||||
|
SOUNDTOUCHDLL_API uint __stdcall soundtouch_getVersionId()
|
||||||
|
{
|
||||||
|
return SoundTouch::getVersionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets new rate control value. Normal rate = 1.0, smaller values
|
||||||
|
/// represent slower rate, larger faster rates.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setRate(HANDLE h, float newRate)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setRate(newRate);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Sets new tempo control value. Normal tempo = 1.0, smaller values
|
||||||
|
/// represent slower tempo, larger faster tempo.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setTempo(HANDLE h, float newTempo)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setTempo(newTempo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets new rate control value as a difference in percents compared
|
||||||
|
/// to the original rate (-50 .. +100 %)
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setRateChange(HANDLE h, float newRate)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setRateChange(newRate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets new tempo control value as a difference in percents compared
|
||||||
|
/// to the original tempo (-50 .. +100 %)
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setTempoChange(HANDLE h, float newTempo)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setTempoChange(newTempo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets new pitch control value. Original pitch = 1.0, smaller values
|
||||||
|
/// represent lower pitches, larger values higher pitch.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setPitch(HANDLE h, float newPitch)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setPitch(newPitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets pitch change in octaves compared to the original pitch
|
||||||
|
/// (-1.00 .. +1.00)
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setPitchOctaves(HANDLE h, float newPitch)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setPitchOctaves(newPitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets pitch change in semi-tones compared to the original pitch
|
||||||
|
/// (-12 .. +12)
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setPitchSemiTones(HANDLE h, float newPitch)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setPitchSemiTones(newPitch);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Sets the number of channels, 1 = mono, 2 = stereo
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setChannels(HANDLE h, uint numChannels)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setChannels(numChannels);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Sets sample rate.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setSampleRate(HANDLE h, uint srate)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->setSampleRate(srate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Flushes the last samples from the processing pipeline to the output.
|
||||||
|
/// Clears also the internal processing buffers.
|
||||||
|
//
|
||||||
|
/// Note: This function is meant for extracting the last samples of a sound
|
||||||
|
/// stream. This function may introduce additional blank samples in the end
|
||||||
|
/// of the sound stream, and thus it's not recommended to call this function
|
||||||
|
/// in the middle of a sound stream.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_flush(HANDLE h)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Adds 'numSamples' pcs of samples from the 'samples' memory position into
|
||||||
|
/// the input of the object. Notice that sample rate _has_to_ be set before
|
||||||
|
/// calling this function, otherwise throws a runtime_error exception.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_putSamples(HANDLE h,
|
||||||
|
const SAMPLETYPE *samples, ///< Pointer to sample buffer.
|
||||||
|
uint numSamples ///< Number of samples in buffer. Notice
|
||||||
|
///< that in case of stereo-sound a single sample
|
||||||
|
///< contains data for both channels.
|
||||||
|
)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->putSamples(samples, numSamples);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Clears all the samples in the object's output and internal processing
|
||||||
|
/// buffers.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_clear(HANDLE h)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return;
|
||||||
|
|
||||||
|
sth->pst->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Changes a setting controlling the processing system behaviour. See the
|
||||||
|
/// 'SETTING_...' defines for available setting ID's.
|
||||||
|
///
|
||||||
|
/// \return 'TRUE' if the setting was succesfully changed
|
||||||
|
SOUNDTOUCHDLL_API BOOL __stdcall soundtouch_setSetting(HANDLE h,
|
||||||
|
int settingId, ///< Setting ID number. see SETTING_... defines.
|
||||||
|
int value ///< New setting value.
|
||||||
|
)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return FALSE;
|
||||||
|
|
||||||
|
return sth->pst->setSetting(settingId, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Reads a setting controlling the processing system behaviour. See the
|
||||||
|
/// 'SETTING_...' defines for available setting ID's.
|
||||||
|
///
|
||||||
|
/// \return the setting value.
|
||||||
|
SOUNDTOUCHDLL_API int __stdcall soundtouch_getSetting(HANDLE h,
|
||||||
|
int settingId ///< Setting ID number, see SETTING_... defines.
|
||||||
|
)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return -1;
|
||||||
|
|
||||||
|
return sth->pst->getSetting(settingId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Returns number of samples currently unprocessed.
|
||||||
|
SOUNDTOUCHDLL_API uint __stdcall soundtouch_numUnprocessedSamples(HANDLE h)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return 0;
|
||||||
|
|
||||||
|
return sth->pst->numUnprocessedSamples();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// 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.
|
||||||
|
SOUNDTOUCHDLL_API uint __stdcall soundtouch_receiveSamples(HANDLE h,
|
||||||
|
SAMPLETYPE *outBuffer, ///< Buffer where to copy output samples.
|
||||||
|
uint maxSamples ///< How many samples to receive at max.
|
||||||
|
)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return 0;
|
||||||
|
|
||||||
|
if (outBuffer)
|
||||||
|
{
|
||||||
|
return sth->pst->receiveSamples(outBuffer, maxSamples);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return sth->pst->receiveSamples(maxSamples);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns number of samples currently available.
|
||||||
|
SOUNDTOUCHDLL_API uint __stdcall soundtouch_numSamples(HANDLE h)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return 0;
|
||||||
|
|
||||||
|
return sth->pst->numSamples();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// Returns nonzero if there aren't any samples available for outputting.
|
||||||
|
SOUNDTOUCHDLL_API int __stdcall soundtouch_isEmpty(HANDLE h)
|
||||||
|
{
|
||||||
|
STHANDLE *sth = (STHANDLE*)h;
|
||||||
|
if (sth->dwMagic != STMAGIC) return -1;
|
||||||
|
|
||||||
|
return sth->pst->isEmpty();
|
||||||
|
}
|
||||||
164
source/SoundTouchDLL/SoundTouchDLL.h
Normal file
164
source/SoundTouchDLL/SoundTouchDLL.h
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
///
|
||||||
|
/// SoundTouch DLL wrapper - wraps SoundTouch routines into a Dynamic Load
|
||||||
|
/// Library interface.
|
||||||
|
///
|
||||||
|
/// Author : Copyright (c) Olli Parviainen
|
||||||
|
/// Author e-mail : oparviai 'at' iki.fi
|
||||||
|
/// SoundTouch WWW: http://www.surina.net/soundtouch
|
||||||
|
///
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// $Id: $
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// License :
|
||||||
|
//
|
||||||
|
// SoundTouch audio processing library
|
||||||
|
// Copyright (c) Olli Parviainen
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library 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
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _SoundTouchDLL_h_
|
||||||
|
#define _SoundTouchDLL_h_
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DLL_EXPORTS
|
||||||
|
#define SOUNDTOUCHDLL_API __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define SOUNDTOUCHDLL_API __declspec(dllimport)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef void * HANDLE;
|
||||||
|
|
||||||
|
/// Create a new instance of SoundTouch processor.
|
||||||
|
SOUNDTOUCHDLL_API HANDLE __stdcall soundtouch_createInstance();
|
||||||
|
|
||||||
|
/// Destroys a SoundTouch processor instance.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_destroyInstance(HANDLE h);
|
||||||
|
|
||||||
|
/// Get SoundTouch library version string
|
||||||
|
SOUNDTOUCHDLL_API const char *__stdcall soundtouch_getVersionString();
|
||||||
|
|
||||||
|
/// Get SoundTouch library version Id
|
||||||
|
SOUNDTOUCHDLL_API unsigned int __stdcall soundtouch_getVersionId();
|
||||||
|
|
||||||
|
/// Sets new rate control value. Normal rate = 1.0, smaller values
|
||||||
|
/// represent slower rate, larger faster rates.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setRate(HANDLE h, float newRate);
|
||||||
|
|
||||||
|
/// Sets new tempo control value. Normal tempo = 1.0, smaller values
|
||||||
|
/// represent slower tempo, larger faster tempo.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setTempo(HANDLE h, float newTempo);
|
||||||
|
|
||||||
|
/// Sets new rate control value as a difference in percents compared
|
||||||
|
/// to the original rate (-50 .. +100 %);
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setRateChange(HANDLE h, float newRate);
|
||||||
|
|
||||||
|
/// Sets new tempo control value as a difference in percents compared
|
||||||
|
/// to the original tempo (-50 .. +100 %);
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setTempoChange(HANDLE h, float newTempo);
|
||||||
|
|
||||||
|
/// Sets new pitch control value. Original pitch = 1.0, smaller values
|
||||||
|
/// represent lower pitches, larger values higher pitch.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setPitch(HANDLE h, float newPitch);
|
||||||
|
|
||||||
|
/// Sets pitch change in octaves compared to the original pitch
|
||||||
|
/// (-1.00 .. +1.00);
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setPitchOctaves(HANDLE h, float newPitch);
|
||||||
|
|
||||||
|
/// Sets pitch change in semi-tones compared to the original pitch
|
||||||
|
/// (-12 .. +12);
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setPitchSemiTones(HANDLE h, float newPitch);
|
||||||
|
|
||||||
|
|
||||||
|
/// Sets the number of channels, 1 = mono, 2 = stereo
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setChannels(HANDLE h, unsigned int numChannels);
|
||||||
|
|
||||||
|
/// Sets sample rate.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_setSampleRate(HANDLE h, unsigned int srate);
|
||||||
|
|
||||||
|
/// Flushes the last samples from the processing pipeline to the output.
|
||||||
|
/// Clears also the internal processing buffers.
|
||||||
|
//
|
||||||
|
/// Note: This function is meant for extracting the last samples of a sound
|
||||||
|
/// stream. This function may introduce additional blank samples in the end
|
||||||
|
/// of the sound stream, and thus it's not recommended to call this function
|
||||||
|
/// in the middle of a sound stream.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_flush(HANDLE h);
|
||||||
|
|
||||||
|
/// Adds 'numSamples' pcs of samples from the 'samples' memory position into
|
||||||
|
/// the input of the object. Notice that sample rate _has_to_ be set before
|
||||||
|
/// calling this function, otherwise throws a runtime_error exception.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_putSamples(HANDLE h,
|
||||||
|
const float *samples, ///< Pointer to sample buffer.
|
||||||
|
unsigned int numSamples ///< Number of samples in buffer. Notice
|
||||||
|
///< that in case of stereo-sound a single sample
|
||||||
|
///< contains data for both channels.
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Clears all the samples in the object's output and internal processing
|
||||||
|
/// buffers.
|
||||||
|
SOUNDTOUCHDLL_API void __stdcall soundtouch_clear(HANDLE h);
|
||||||
|
|
||||||
|
/// Changes a setting controlling the processing system behaviour. See the
|
||||||
|
/// 'SETTING_...' defines for available setting ID's.
|
||||||
|
///
|
||||||
|
/// \return 'TRUE' if the setting was succesfully changed
|
||||||
|
SOUNDTOUCHDLL_API BOOL __stdcall soundtouch_setSetting(HANDLE h,
|
||||||
|
int settingId, ///< Setting ID number. see SETTING_... defines.
|
||||||
|
int value ///< New setting value.
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Reads a setting controlling the processing system behaviour. See the
|
||||||
|
/// 'SETTING_...' defines for available setting ID's.
|
||||||
|
///
|
||||||
|
/// \return the setting value.
|
||||||
|
SOUNDTOUCHDLL_API int __stdcall soundtouch_getSetting(HANDLE h,
|
||||||
|
int settingId ///< Setting ID number, see SETTING_... defines.
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/// Returns number of samples currently unprocessed.
|
||||||
|
SOUNDTOUCHDLL_API unsigned int __stdcall 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.
|
||||||
|
///
|
||||||
|
/// Used to reduce the number of samples in the buffer when accessing the sample buffer directly
|
||||||
|
/// with 'ptrBegin' function.
|
||||||
|
SOUNDTOUCHDLL_API unsigned int __stdcall soundtouch_receiveSamples(HANDLE h,
|
||||||
|
float *outBuffer, ///< Buffer where to copy output samples.
|
||||||
|
unsigned int maxSamples ///< How many samples to receive at max.
|
||||||
|
);
|
||||||
|
|
||||||
|
/// Returns number of samples currently available.
|
||||||
|
SOUNDTOUCHDLL_API unsigned int __stdcall soundtouch_numSamples(HANDLE h);
|
||||||
|
|
||||||
|
/// Returns nonzero if there aren't any samples available for outputting.
|
||||||
|
SOUNDTOUCHDLL_API int __stdcall soundtouch_isEmpty(HANDLE h);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // _SoundTouchDLL_h_
|
||||||
|
|
||||||
113
source/SoundTouchDLL/SoundTouchDLL.rc
Normal file
113
source/SoundTouchDLL/SoundTouchDLL.rc
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
// 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
|
||||||
|
"\r\n"
|
||||||
|
"\0"
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // APSTUDIO_INVOKED
|
||||||
|
|
||||||
|
#endif // English (U.S.) resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Finnish resources
|
||||||
|
|
||||||
|
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FIN)
|
||||||
|
#ifdef _WIN32
|
||||||
|
LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
|
||||||
|
#pragma code_page(1252)
|
||||||
|
#endif //_WIN32
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Version
|
||||||
|
//
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION 1,4,1,0
|
||||||
|
PRODUCTVERSION 1,4,1,0
|
||||||
|
FILEFLAGSMASK 0x17L
|
||||||
|
#ifdef _DEBUG
|
||||||
|
FILEFLAGS 0x1L
|
||||||
|
#else
|
||||||
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
|
FILEOS 0x4L
|
||||||
|
FILETYPE 0x2L
|
||||||
|
FILESUBTYPE 0x0L
|
||||||
|
BEGIN
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "000004b0"
|
||||||
|
BEGIN
|
||||||
|
VALUE "FileDescription", "SoundTouch Dynamic Link Library"
|
||||||
|
VALUE "FileVersion", "1, 4, 1, 0"
|
||||||
|
VALUE "InternalName", "SoundTouch"
|
||||||
|
VALUE "LegalCopyright", "Copyright (C) Olli Parviainen 2001-2009"
|
||||||
|
VALUE "OriginalFilename", "SoundTouch.dll"
|
||||||
|
VALUE "ProductName", " SoundTouch Dynamic Link Library"
|
||||||
|
VALUE "ProductVersion", "1, 4, 1, 0"
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x0, 1200
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
#endif // Finnish resources
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef APSTUDIO_INVOKED
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Generated from the TEXTINCLUDE 3 resource.
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
#endif // not APSTUDIO_INVOKED
|
||||||
|
|
||||||
32
source/SoundTouchDLL/SoundTouchDLL.sln
Normal file
32
source/SoundTouchDLL/SoundTouchDLL.sln
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouchDLL", "SoundTouchDLL.vcproj", "{164DE61D-6391-4265-8273-30740117D356}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{68A5DD20-7057-448B-8FE0-B6AC8D205509} = {68A5DD20-7057-448B-8FE0-B6AC8D205509}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SoundTouch", "..\SoundTouch\SoundTouch.vcproj", "{68A5DD20-7057-448B-8FE0-B6AC8D205509}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfiguration) = preSolution
|
||||||
|
Debug = Debug
|
||||||
|
Release = Release
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectDependencies) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfiguration) = postSolution
|
||||||
|
{164DE61D-6391-4265-8273-30740117D356}.Debug.ActiveCfg = Debug|Win32
|
||||||
|
{164DE61D-6391-4265-8273-30740117D356}.Debug.Build.0 = Debug|Win32
|
||||||
|
{164DE61D-6391-4265-8273-30740117D356}.Release.ActiveCfg = Release|Win32
|
||||||
|
{164DE61D-6391-4265-8273-30740117D356}.Release.Build.0 = Release|Win32
|
||||||
|
{68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug.ActiveCfg = Debug|Win32
|
||||||
|
{68A5DD20-7057-448B-8FE0-B6AC8D205509}.Debug.Build.0 = Debug|Win32
|
||||||
|
{68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release.ActiveCfg = Release|Win32
|
||||||
|
{68A5DD20-7057-448B-8FE0-B6AC8D205509}.Release.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
155
source/SoundTouchDLL/SoundTouchDLL.vcproj
Normal file
155
source/SoundTouchDLL/SoundTouchDLL.vcproj
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="7.10"
|
||||||
|
Name="SoundTouchDLL"
|
||||||
|
ProjectGUID="{164DE61D-6391-4265-8273-30740117D356}"
|
||||||
|
Keyword="Win32Proj">
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"/>
|
||||||
|
</Platforms>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Debug|Win32"
|
||||||
|
OutputDirectory="Debug"
|
||||||
|
IntermediateDirectory="Debug"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories="..\..\include"
|
||||||
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS"
|
||||||
|
MinimalRebuild="TRUE"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
|
DebugInformationFormat="4"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="$(OutDir)/SoundTouchD.dll"
|
||||||
|
LinkIncremental="2"
|
||||||
|
GenerateDebugInformation="TRUE"
|
||||||
|
ProgramDatabaseFile="$(OutDir)/SoundTouchD.pdb"
|
||||||
|
SubSystem="2"
|
||||||
|
ImportLibrary="$(OutDir)/SoundTouchDllD.lib"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
CommandLine="copy $(OutDir)\*.dll ..\..\lib
|
||||||
|
copy $(OutDir)\*.lib ..\..\lib
|
||||||
|
"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Release|Win32"
|
||||||
|
OutputDirectory="Release"
|
||||||
|
IntermediateDirectory="Release"
|
||||||
|
ConfigurationType="2"
|
||||||
|
CharacterSet="2">
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
GlobalOptimizations="FALSE"
|
||||||
|
AdditionalIncludeDirectories="..\..\include"
|
||||||
|
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;DLL_EXPORTS"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
WarningLevel="3"
|
||||||
|
Detect64BitPortabilityProblems="TRUE"
|
||||||
|
DebugInformationFormat="3"
|
||||||
|
CallingConvention="0"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLinkerTool"
|
||||||
|
OutputFile="$(OutDir)/SoundTouch.dll"
|
||||||
|
LinkIncremental="1"
|
||||||
|
GenerateDebugInformation="FALSE"
|
||||||
|
GenerateMapFile="TRUE"
|
||||||
|
SubSystem="2"
|
||||||
|
OptimizeReferences="2"
|
||||||
|
EnableCOMDATFolding="2"
|
||||||
|
ImportLibrary="$(OutDir)/SoundTouchDll.lib"
|
||||||
|
TargetMachine="1"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
CommandLine="copy $(OutDir)\*.dll ..\..\lib
|
||||||
|
copy $(OutDir)\*.lib ..\..\lib
|
||||||
|
"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebDeploymentTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedWrapperGeneratorTool"/>
|
||||||
|
<Tool
|
||||||
|
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||||
|
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||||
|
<File
|
||||||
|
RelativePath=".\SoundTouchDLL.cpp">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||||
|
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||||
|
<File
|
||||||
|
RelativePath=".\SoundTouchDLL.h">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Resource Files"
|
||||||
|
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||||
|
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||||
|
<File
|
||||||
|
RelativePath=".\SoundTouchDLL.rc">
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<File
|
||||||
|
RelativePath=".\ReadMe.txt">
|
||||||
|
</File>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
||||||
Loading…
x
Reference in New Issue
Block a user