#include <TDStretch.h>

Definition at line 97 of file TDStretch.h.
Public Member Functions | |
| TDStretch () | |
| virtual | ~TDStretch () |
| void * | operator new (size_t s) |
| Operator 'new' is overloaded so that it automatically creates a suitable instance depending on if we've a MMX/SSE/etc-capable CPU available or not. | |
| FIFOSamplePipe * | getOutput () |
| Returns the output buffer object. | |
| FIFOSamplePipe * | getInput () |
| Returns the input buffer object. | |
| void | setTempo (float newTempo) |
| Sets new target tempo. | |
| virtual void | clear () |
| Returns nonzero if there aren't any samples available for outputting. | |
| void | clearInput () |
| Clears the input buffer. | |
| void | setChannels (uint numChannels) |
| Sets the number of channels, 1 = mono, 2 = stereo. | |
| void | enableQuickSeek (BOOL enable) |
| Enables/disables the quick position seeking algorithm. | |
| BOOL | isQuickSeekEnabled () const |
| Returns nonzero if the quick seeking algorithm is enabled. | |
| void | setParameters (uint sampleRate, uint sequenceMS=DEFAULT_SEQUENCE_MS, uint seekwindowMS=DEFAULT_SEEKWINDOW_MS, uint overlapMS=DEFAULT_OVERLAP_MS) |
| Sets routine control parameters. | |
| void | getParameters (uint *pSampleRate, uint *pSequenceMs, uint *pSeekWindowMs, uint *pOverlapMs) |
| Get routine control parameters, see setParameters() function. | |
| virtual void | putSamples (const SAMPLETYPE *samples, uint numSamples) |
| Adds 'numsamples' pcs of samples from the 'samples' memory position into the input of the object. | |
Static Public Member Functions | |
| static TDStretch * | newInstance () |
| Use this function instead of "new" operator to create a new instance of this class. | |
Protected Member Functions | |
| void | acceptNewOverlapLength (uint newOverlapLength) |
| Set new overlap length parameter & reallocate RefMidBuffer if necessary. | |
| virtual void | clearCrossCorrState () |
| clear cross correlation routine state if necessary | |
| void | calculateOverlapLength (uint overlapMs) |
| Calculates overlap period length in samples. | |
| virtual LONG_SAMPLETYPE | calcCrossCorrMulti (const SAMPLETYPE *mixingPos, const SAMPLETYPE *compare) const |
| virtual LONG_SAMPLETYPE | calcCrossCorrStereo (const SAMPLETYPE *mixingPos, const SAMPLETYPE *compare) const |
| virtual LONG_SAMPLETYPE | calcCrossCorrMono (const SAMPLETYPE *mixingPos, const SAMPLETYPE *compare) const |
| virtual uint | seekBestOverlapPositionMulti (const SAMPLETYPE *refPos) |
| virtual uint | seekBestOverlapPositionMultiQuick (const SAMPLETYPE *refPos) |
| virtual uint | seekBestOverlapPositionStereo (const SAMPLETYPE *refPos) |
| virtual uint | seekBestOverlapPositionStereoQuick (const SAMPLETYPE *refPos) |
| virtual uint | seekBestOverlapPositionMono (const SAMPLETYPE *refPos) |
| virtual uint | seekBestOverlapPositionMonoQuick (const SAMPLETYPE *refPos) |
| uint | seekBestOverlapPosition (const SAMPLETYPE *refPos) |
| virtual void | overlapMulti (SAMPLETYPE *output, const SAMPLETYPE *input) const |
| virtual void | overlapStereo (SAMPLETYPE *output, const SAMPLETYPE *input) const |
| virtual void | overlapMono (SAMPLETYPE *output, const SAMPLETYPE *input) const |
| void | clearMidBuffer () |
| void | overlap (SAMPLETYPE *output, const SAMPLETYPE *input, uint ovlPos) const |
| void | precalcCorrReference () |
| void | precalcCorrReferenceMono () |
| void | precalcCorrReferenceStereo () |
| void | processNominalTempo () |
| void | processSamples () |
| Changes the tempo of the given sound samples. | |
Protected Attributes | |
| uint | channels |
| uint | sampleReq |
| float | tempo |
| SAMPLETYPE * | pMidBuffer |
| SAMPLETYPE * | pRefMidBuffer |
| SAMPLETYPE * | pRefMidBufferUnaligned |
| uint | midBufferLength |
| uint | overlapLength |
| uint | overlapDividerBits |
| uint | slopingDivider |
| uint | seekLength |
| uint | seekWindowLength |
| uint | maxOffset |
| float | nominalSkip |
| float | skipFract |
| FIFOSampleBuffer | outputBuffer |
| FIFOSampleBuffer | inputBuffer |
| BOOL | bQuickseek |
| BOOL | bMidBufferDirty |
| uint | sampleRate |
| uint | sequenceMs |
| uint | seekWindowMs |
| uint | overlapMs |
| TDStretch::TDStretch | ( | ) |
Definition at line 91 of file TDStretch.cpp.
| TDStretch::~TDStretch | ( | ) | [virtual] |
Definition at line 110 of file TDStretch.cpp.
| void TDStretch::acceptNewOverlapLength | ( | uint | newOverlapLength | ) | [protected] |
Set new overlap length parameter & reallocate RefMidBuffer if necessary.
Definition at line 764 of file TDStretch.cpp.
Referenced by calculateOverlapLength().
| void TDStretch::clearCrossCorrState | ( | ) | [protected, virtual] |
clear cross correlation routine state if necessary
Reimplemented in soundtouch::TDStretchMMX.
Definition at line 609 of file TDStretch.cpp.
Referenced by seekBestOverlapPositionMono(), seekBestOverlapPositionMonoQuick(), seekBestOverlapPositionMulti(), seekBestOverlapPositionMultiQuick(), seekBestOverlapPositionStereo(), and seekBestOverlapPositionStereoQuick().
| void TDStretch::calculateOverlapLength | ( | uint | overlapMs | ) | [protected] |
Calculates overlap period length in samples.
Integer version rounds overlap length to closest power of 2 for a divide scaling operation.
Definition at line 953 of file TDStretch.cpp.
Referenced by setParameters().
| long TDStretch::calcCrossCorrMulti | ( | const SAMPLETYPE * | mixingPos, | |
| const SAMPLETYPE * | compare | |||
| ) | const [protected, virtual] |
Reimplemented in soundtouch::TDStretchMMX.
Definition at line 1002 of file TDStretch.cpp.
Referenced by seekBestOverlapPositionMulti(), and seekBestOverlapPositionMultiQuick().
| long TDStretch::calcCrossCorrStereo | ( | const SAMPLETYPE * | mixingPos, | |
| const SAMPLETYPE * | compare | |||
| ) | const [protected, virtual] |
Reimplemented in soundtouch::TDStretchMMX.
Definition at line 986 of file TDStretch.cpp.
Referenced by seekBestOverlapPositionStereo(), and seekBestOverlapPositionStereoQuick().
| long TDStretch::calcCrossCorrMono | ( | const SAMPLETYPE * | mixingPos, | |
| const SAMPLETYPE * | compare | |||
| ) | const [protected, virtual] |
Definition at line 971 of file TDStretch.cpp.
Referenced by seekBestOverlapPositionMono(), and seekBestOverlapPositionMonoQuick().
| uint TDStretch::seekBestOverlapPositionMulti | ( | const SAMPLETYPE * | refPos | ) | [protected, virtual] |
| uint TDStretch::seekBestOverlapPositionMultiQuick | ( | const SAMPLETYPE * | refPos | ) | [protected, virtual] |
| uint TDStretch::seekBestOverlapPositionStereo | ( | const SAMPLETYPE * | refPos | ) | [protected, virtual] |
| uint TDStretch::seekBestOverlapPositionStereoQuick | ( | const SAMPLETYPE * | refPos | ) | [protected, virtual] |
| uint TDStretch::seekBestOverlapPositionMono | ( | const SAMPLETYPE * | refPos | ) | [protected, virtual] |
| uint TDStretch::seekBestOverlapPositionMonoQuick | ( | const SAMPLETYPE * | refPos | ) | [protected, virtual] |
| uint TDStretch::seekBestOverlapPosition | ( | const SAMPLETYPE * | refPos | ) | [protected] |
| void TDStretch::overlapMulti | ( | SAMPLETYPE * | output, | |
| const SAMPLETYPE * | input | |||
| ) | const [protected, virtual] |
| void TDStretch::overlapStereo | ( | SAMPLETYPE * | output, | |
| const SAMPLETYPE * | input | |||
| ) | const [protected, virtual] |
Reimplemented in soundtouch::TDStretchMMX.
Definition at line 913 of file TDStretch.cpp.
Referenced by overlap().
| void TDStretch::overlapMono | ( | SAMPLETYPE * | output, | |
| const SAMPLETYPE * | input | |||
| ) | const [protected, virtual] |
| void TDStretch::clearMidBuffer | ( | ) | [protected] |
Definition at line 202 of file TDStretch.cpp.
Referenced by acceptNewOverlapLength(), clear(), clearInput(), and processNominalTempo().
| void TDStretch::overlap | ( | SAMPLETYPE * | output, | |
| const SAMPLETYPE * | input, | |||
| uint | ovlPos | |||
| ) | const [inline, protected] |
Definition at line 293 of file TDStretch.cpp.
Referenced by processNominalTempo(), and processSamples().
| void TDStretch::precalcCorrReference | ( | ) | [protected] |
Definition at line 854 of file TDStretch.cpp.
Referenced by seekBestOverlapPositionMulti(), and seekBestOverlapPositionMultiQuick().
| void TDStretch::precalcCorrReferenceMono | ( | ) | [protected] |
Definition at line 896 of file TDStretch.cpp.
Referenced by seekBestOverlapPositionMono(), and seekBestOverlapPositionMonoQuick().
| void TDStretch::precalcCorrReferenceStereo | ( | ) | [protected] |
Definition at line 876 of file TDStretch.cpp.
Referenced by seekBestOverlapPositionStereo(), and seekBestOverlapPositionStereoQuick().
| void TDStretch::processNominalTempo | ( | ) | [protected] |
| void TDStretch::processSamples | ( | ) | [protected] |
Changes the tempo of the given sound samples.
Returns amount of samples returned in the "output" buffer. The maximum amount of samples that can be returned at a time is set by the 'set_returnBuffer_size' function.
Definition at line 684 of file TDStretch.cpp.
Referenced by putSamples().
| void * TDStretch::operator new | ( | size_t | s | ) |
Operator 'new' is overloaded so that it automatically creates a suitable instance depending on if we've a MMX/SSE/etc-capable CPU available or not.
Definition at line 791 of file TDStretch.cpp.
| TDStretch * TDStretch::newInstance | ( | ) | [static] |
Use this function instead of "new" operator to create a new instance of this class.
This function automatically chooses a correct feature set depending on if the CPU supports MMX/SSE/etc extensions.
Definition at line 799 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::SoundTouch().
| FIFOSamplePipe* soundtouch::TDStretch::getOutput | ( | ) | [inline] |
Returns the output buffer object.
Definition at line 184 of file TDStretch.h.
Referenced by soundtouch::SoundTouch::calcEffectiveRateAndTempo().
| FIFOSamplePipe* soundtouch::TDStretch::getInput | ( | ) | [inline] |
Returns the input buffer object.
Definition at line 187 of file TDStretch.h.
Referenced by soundtouch::SoundTouch::calcEffectiveRateAndTempo(), and soundtouch::SoundTouch::numUnprocessedSamples().
| void TDStretch::setTempo | ( | float | newTempo | ) |
Sets new target tempo.
Normal tempo = 'SCALE', smaller values represent slower tempo, larger faster tempo.
Definition at line 617 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::calcEffectiveRateAndTempo(), setParameters(), and TDStretch().
| void TDStretch::clear | ( | ) | [virtual] |
Returns nonzero if there aren't any samples available for outputting.
Implements FIFOSamplePipe.
Definition at line 220 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::clear().
| void TDStretch::clearInput | ( | ) |
Clears the input buffer.
Definition at line 212 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::flush().
| void TDStretch::setChannels | ( | uint | numChannels | ) |
Sets the number of channels, 1 = mono, 2 = stereo.
Definition at line 636 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::setChannels().
| void TDStretch::enableQuickSeek | ( | BOOL | enable | ) |
Enables/disables the quick position seeking algorithm.
Zero to disable, nonzero to enable
Definition at line 231 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::setSetting().
| BOOL TDStretch::isQuickSeekEnabled | ( | ) | const |
Returns nonzero if the quick seeking algorithm is enabled.
Definition at line 238 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::getSetting().
| void TDStretch::setParameters | ( | uint | sampleRate, | |
| uint | sequenceMS = DEFAULT_SEQUENCE_MS, |
|||
| uint | seekwindowMS = DEFAULT_SEEKWINDOW_MS, |
|||
| uint | overlapMS = DEFAULT_OVERLAP_MS | |||
| ) |
Sets routine control parameters.
These control are certain time constants defining how the sound is stretched to the desired duration. 'sampleRate' = sample rate of the sound 'sequenceMS' = one processing sequence length in milliseconds 'seekwindowMS' = seeking window length for scanning the best overlapping position 'overlapMS' = overlapping length
| sampleRate | Samplerate of sound being processed (Hz) |
| sequenceMS | Single processing sequence length (ms) |
| seekwindowMS | Offset seeking window length (ms) |
| overlapMS | Sequence overlapping length (ms) |
Definition at line 139 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::setSampleRate(), soundtouch::SoundTouch::setSetting(), and TDStretch().
| void TDStretch::getParameters | ( | uint * | pSampleRate, | |
| uint * | pSequenceMs, | |||
| uint * | pSeekWindowMs, | |||
| uint * | pOverlapMs | |||
| ) |
Get routine control parameters, see setParameters() function.
Any of the parameters to this function can be NULL, in such case corresponding parameter value isn't returned.
Any of the parameters to this function can be NULL, in such case corresponding parameter value isn't returned.
Definition at line 164 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::getSetting(), and soundtouch::SoundTouch::setSetting().
| void TDStretch::putSamples | ( | const SAMPLETYPE * | samples, | |
| uint | numSamples | |||
| ) | [virtual] |
Adds 'numsamples' pcs of samples from the 'samples' memory position into the input of the object.
| samples | Input sample data |
| numSamples | Number of samples in 'samples' so that one sample contains both channels if stereo |
Implements FIFOSamplePipe.
Definition at line 753 of file TDStretch.cpp.
Referenced by soundtouch::SoundTouch::putSamples().
uint soundtouch::TDStretch::channels [protected] |
Definition at line 100 of file TDStretch.h.
Referenced by acceptNewOverlapLength(), calcCrossCorrMulti(), soundtouch::TDStretchMMX::calcCrossCorrMulti(), clearMidBuffer(), overlap(), overlapMulti(), precalcCorrReference(), processSamples(), seekBestOverlapPosition(), seekBestOverlapPositionMulti(), seekBestOverlapPositionMultiQuick(), setChannels(), and TDStretch().
uint soundtouch::TDStretch::sampleReq [protected] |
float soundtouch::TDStretch::tempo [protected] |
Definition at line 102 of file TDStretch.h.
Referenced by processNominalTempo(), processSamples(), setParameters(), and setTempo().
SAMPLETYPE* soundtouch::TDStretch::pMidBuffer [protected] |
Definition at line 104 of file TDStretch.h.
Referenced by acceptNewOverlapLength(), clearMidBuffer(), overlapMono(), overlapMulti(), overlapStereo(), soundtouch::TDStretchMMX::overlapStereo(), precalcCorrReference(), precalcCorrReferenceMono(), precalcCorrReferenceStereo(), processSamples(), TDStretch(), and ~TDStretch().
SAMPLETYPE* soundtouch::TDStretch::pRefMidBuffer [protected] |
Definition at line 105 of file TDStretch.h.
Referenced by acceptNewOverlapLength(), precalcCorrReference(), precalcCorrReferenceMono(), precalcCorrReferenceStereo(), seekBestOverlapPositionMono(), seekBestOverlapPositionMonoQuick(), seekBestOverlapPositionMulti(), seekBestOverlapPositionMultiQuick(), seekBestOverlapPositionStereo(), and seekBestOverlapPositionStereoQuick().
SAMPLETYPE* soundtouch::TDStretch::pRefMidBufferUnaligned [protected] |
Definition at line 106 of file TDStretch.h.
Referenced by acceptNewOverlapLength(), TDStretch(), and ~TDStretch().
uint soundtouch::TDStretch::midBufferLength [protected] |
Definition at line 107 of file TDStretch.h.
Referenced by acceptNewOverlapLength(), clearMidBuffer(), TDStretch(), and ~TDStretch().
uint soundtouch::TDStretch::overlapLength [protected] |
Definition at line 108 of file TDStretch.h.
Referenced by acceptNewOverlapLength(), calcCrossCorrMono(), calcCrossCorrMulti(), soundtouch::TDStretchMMX::calcCrossCorrMulti(), calcCrossCorrStereo(), soundtouch::TDStretchMMX::calcCrossCorrStereo(), clearMidBuffer(), overlapMono(), overlapMulti(), overlapStereo(), soundtouch::TDStretchMMX::overlapStereo(), precalcCorrReference(), precalcCorrReferenceMono(), precalcCorrReferenceStereo(), processNominalTempo(), processSamples(), setTempo(), and TDStretch().
uint soundtouch::TDStretch::overlapDividerBits [protected] |
Definition at line 109 of file TDStretch.h.
Referenced by calcCrossCorrMono(), calcCrossCorrMulti(), soundtouch::TDStretchMMX::calcCrossCorrMulti(), calcCrossCorrStereo(), soundtouch::TDStretchMMX::calcCrossCorrStereo(), calculateOverlapLength(), and soundtouch::TDStretchMMX::overlapStereo().
uint soundtouch::TDStretch::slopingDivider [protected] |
Definition at line 110 of file TDStretch.h.
Referenced by calculateOverlapLength(), precalcCorrReference(), precalcCorrReferenceMono(), and precalcCorrReferenceStereo().
uint soundtouch::TDStretch::seekLength [protected] |
Definition at line 111 of file TDStretch.h.
Referenced by seekBestOverlapPositionMono(), seekBestOverlapPositionMonoQuick(), seekBestOverlapPositionMulti(), seekBestOverlapPositionMultiQuick(), seekBestOverlapPositionStereo(), seekBestOverlapPositionStereoQuick(), and setParameters().
uint soundtouch::TDStretch::seekWindowLength [protected] |
Definition at line 112 of file TDStretch.h.
Referenced by processSamples(), setParameters(), and setTempo().
uint soundtouch::TDStretch::maxOffset [protected] |
float soundtouch::TDStretch::nominalSkip [protected] |
float soundtouch::TDStretch::skipFract [protected] |
FIFOSampleBuffer soundtouch::TDStretch::outputBuffer [protected] |
Definition at line 116 of file TDStretch.h.
Referenced by clear(), getOutput(), processNominalTempo(), processSamples(), and setChannels().
FIFOSampleBuffer soundtouch::TDStretch::inputBuffer [protected] |
Definition at line 117 of file TDStretch.h.
Referenced by clear(), clearInput(), getInput(), processNominalTempo(), processSamples(), putSamples(), and setChannels().
BOOL soundtouch::TDStretch::bQuickseek [protected] |
Definition at line 118 of file TDStretch.h.
Referenced by enableQuickSeek(), isQuickSeekEnabled(), seekBestOverlapPosition(), and TDStretch().
BOOL soundtouch::TDStretch::bMidBufferDirty [protected] |
Definition at line 119 of file TDStretch.h.
Referenced by acceptNewOverlapLength(), clearMidBuffer(), processNominalTempo(), processSamples(), and TDStretch().
uint soundtouch::TDStretch::sampleRate [protected] |
Definition at line 121 of file TDStretch.h.
Referenced by calculateOverlapLength(), getParameters(), and setParameters().
uint soundtouch::TDStretch::sequenceMs [protected] |
uint soundtouch::TDStretch::seekWindowMs [protected] |
uint soundtouch::TDStretch::overlapMs [protected] |
1.5.5