Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/alexmarsev/soundtouch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroparviai <oparviai@f3a24b6a-cf45-0410-b55a-8c22e2698227>2014-04-06 19:57:21 +0400
committeroparviai <oparviai@f3a24b6a-cf45-0410-b55a-8c22e2698227>2014-04-06 19:57:21 +0400
commit5519038229a9820577a96b26c4e395a870ae52e2 (patch)
tree952d080653eb8417d46f566d084c2b5cd237f58d
parent37f51ebdebba540c6c8c494cf6891f1fe04c9728 (diff)
Replaced custom 'BOOL' type with C++ 'bool'
-rw-r--r--include/STTypes.h14
-rw-r--r--include/SoundTouch.h6
-rw-r--r--source/SoundStretch/RunParameters.cpp8
-rw-r--r--source/SoundStretch/RunParameters.h4
-rw-r--r--source/SoundStretch/main.cpp2
-rw-r--r--source/SoundTouch/InterpolateShannon.cpp2
-rw-r--r--source/SoundTouch/RateTransposer.cpp8
-rw-r--r--source/SoundTouch/RateTransposer.h6
-rw-r--r--source/SoundTouch/SoundTouch.cpp26
-rw-r--r--source/SoundTouch/TDStretch.cpp18
-rw-r--r--source/SoundTouch/TDStretch.h10
11 files changed, 45 insertions, 59 deletions
diff --git a/include/STTypes.h b/include/STTypes.h
index 63950e1..c11a9d9 100644
--- a/include/STTypes.h
+++ b/include/STTypes.h
@@ -60,20 +60,6 @@ typedef unsigned long ulong;
#include "soundtouch_config.h"
#endif
-#ifndef _WINDEF_
- // if these aren't defined already by Windows headers, define now
-
-#if defined(__APPLE__)
- typedef signed char BOOL;
-#else
- typedef int BOOL;
-#endif
-
- #define FALSE 0
- #define TRUE 1
-
-#endif // _WINDEF_
-
namespace soundtouch
{
diff --git a/include/SoundTouch.h b/include/SoundTouch.h
index 8a5af72..db9100b 100644
--- a/include/SoundTouch.h
+++ b/include/SoundTouch.h
@@ -160,7 +160,7 @@ private:
float virtualPitch;
/// Flag: Has sample rate been set?
- BOOL bSrateSet;
+ bool bSrateSet;
/// Calculates effective rate & tempo valuescfrom 'virtualRate', 'virtualTempo' and
/// 'virtualPitch' parameters.
@@ -247,8 +247,8 @@ public:
/// 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
- BOOL setSetting(int settingId, ///< Setting ID number. see SETTING_... defines.
+ /// \return 'true' if the setting was succesfully changed
+ bool setSetting(int settingId, ///< Setting ID number. see SETTING_... defines.
int value ///< New setting value.
);
diff --git a/source/SoundStretch/RunParameters.cpp b/source/SoundStretch/RunParameters.cpp
index e5f569e..f68f0da 100644
--- a/source/SoundStretch/RunParameters.cpp
+++ b/source/SoundStretch/RunParameters.cpp
@@ -130,8 +130,8 @@ RunParameters::RunParameters(const int nParams, const char * const paramStr[])
quick = 0;
noAntiAlias = 0;
goalBPM = 0;
- speech = FALSE;
- detectBPM = FALSE;
+ speech = false;
+ detectBPM = false;
// Get input & output file names
inFileName = (char*)paramStr[1];
@@ -262,7 +262,7 @@ void RunParameters::parseSwitchParam(const string &str)
case 'b' :
// switch '-bpm=xx'
- detectBPM = TRUE;
+ detectBPM = true;
try
{
goalBPM = parseSwitchValue(str);
@@ -291,7 +291,7 @@ void RunParameters::parseSwitchParam(const string &str)
case 's' :
// switch '-speech'
- speech = TRUE;
+ speech = true;
break;
default:
diff --git a/source/SoundStretch/RunParameters.h b/source/SoundStretch/RunParameters.h
index ecdb5d6..6b91be4 100644
--- a/source/SoundStretch/RunParameters.h
+++ b/source/SoundStretch/RunParameters.h
@@ -63,8 +63,8 @@ public:
int quick;
int noAntiAlias;
float goalBPM;
- BOOL detectBPM;
- BOOL speech;
+ bool detectBPM;
+ bool speech;
RunParameters(const int nParams, const char * const paramStr[]);
};
diff --git a/source/SoundStretch/main.cpp b/source/SoundStretch/main.cpp
index 349576b..d100430 100644
--- a/source/SoundStretch/main.cpp
+++ b/source/SoundStretch/main.cpp
@@ -299,7 +299,7 @@ int main(const int nParams, const char * const paramStr[])
// Open input & output files
openFiles(&inFile, &outFile, params);
- if (params->detectBPM == TRUE)
+ if (params->detectBPM == true)
{
// detect sound BPM (and adjust processing parameters
// accordingly if necessary)
diff --git a/source/SoundTouch/InterpolateShannon.cpp b/source/SoundTouch/InterpolateShannon.cpp
index 3f17d85..495c254 100644
--- a/source/SoundTouch/InterpolateShannon.cpp
+++ b/source/SoundTouch/InterpolateShannon.cpp
@@ -180,6 +180,6 @@ int InterpolateShannon::transposeMulti(SAMPLETYPE *pdest,
int &srcSamples)
{
// not implemented
- assert(FALSE);
+ assert(false);
return 0;
}
diff --git a/source/SoundTouch/RateTransposer.cpp b/source/SoundTouch/RateTransposer.cpp
index 17a1617..80b5b6e 100644
--- a/source/SoundTouch/RateTransposer.cpp
+++ b/source/SoundTouch/RateTransposer.cpp
@@ -57,7 +57,7 @@ TransposerBase::ALGORITHM TransposerBase::algorithm = TransposerBase::CUBIC;
// Constructor
RateTransposer::RateTransposer() : FIFOProcessor(&outputBuffer)
{
- bUseAAFilter = TRUE;
+ bUseAAFilter = true;
// Instantiates the anti-alias filter
pAAFilter = new AAFilter(64);
@@ -75,14 +75,14 @@ RateTransposer::~RateTransposer()
/// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable
-void RateTransposer::enableAAFilter(BOOL newMode)
+void RateTransposer::enableAAFilter(bool newMode)
{
bUseAAFilter = newMode;
}
/// Returns nonzero if anti-alias filter is enabled.
-BOOL RateTransposer::isAAFilterEnabled() const
+bool RateTransposer::isAAFilterEnabled() const
{
return bUseAAFilter;
}
@@ -139,7 +139,7 @@ void RateTransposer::processSamples(const SAMPLETYPE *src, uint nSamples)
// If anti-alias filter is turned off, simply transpose without applying
// the filter
- if (bUseAAFilter == FALSE)
+ if (bUseAAFilter == false)
{
count = pTransposer->transpose(outputBuffer, inputBuffer);
return;
diff --git a/source/SoundTouch/RateTransposer.h b/source/SoundTouch/RateTransposer.h
index adf79dc..701a7c4 100644
--- a/source/SoundTouch/RateTransposer.h
+++ b/source/SoundTouch/RateTransposer.h
@@ -118,7 +118,7 @@ protected:
/// Output sample buffer
FIFOSampleBuffer outputBuffer;
- BOOL bUseAAFilter;
+ bool bUseAAFilter;
/// Transposes sample rate by applying anti-alias filter to prevent folding.
@@ -151,10 +151,10 @@ public:
AAFilter *getAAFilter();
/// Enables/disables the anti-alias filter. Zero to disable, nonzero to enable
- void enableAAFilter(BOOL newMode);
+ void enableAAFilter(bool newMode);
/// Returns nonzero if anti-alias filter is enabled.
- BOOL isAAFilterEnabled() const;
+ bool isAAFilterEnabled() const;
/// Sets new target rate. Normal rate = 1.0, smaller values represent slower
/// rate, larger faster rates.
diff --git a/source/SoundTouch/SoundTouch.cpp b/source/SoundTouch/SoundTouch.cpp
index 0de42de..ebca7ce 100644
--- a/source/SoundTouch/SoundTouch.cpp
+++ b/source/SoundTouch/SoundTouch.cpp
@@ -111,7 +111,7 @@ SoundTouch::SoundTouch()
calcEffectiveRateAndTempo();
channels = 0;
- bSrateSet = FALSE;
+ bSrateSet = false;
}
@@ -283,7 +283,7 @@ void SoundTouch::calcEffectiveRateAndTempo()
// Sets sample rate.
void SoundTouch::setSampleRate(uint srate)
{
- bSrateSet = TRUE;
+ bSrateSet = true;
// set sample rate, leave other tempo changer parameters as they are.
pTDStretch->setParameters((int)srate);
}
@@ -293,7 +293,7 @@ void SoundTouch::setSampleRate(uint srate)
// the input of the object.
void SoundTouch::putSamples(const SAMPLETYPE *samples, uint nSamples)
{
- if (bSrateSet == FALSE)
+ if (bSrateSet == false)
{
ST_THROW_RT_ERROR("SoundTouch : Sample rate not defined");
}
@@ -388,7 +388,7 @@ void SoundTouch::flush()
// Changes a setting controlling the processing system behaviour. See the
// 'SETTING_...' defines for available setting ID's.
-BOOL SoundTouch::setSetting(int settingId, int value)
+bool SoundTouch::setSetting(int settingId, int value)
{
int sampleRate, sequenceMs, seekWindowMs, overlapMs;
@@ -399,36 +399,36 @@ BOOL SoundTouch::setSetting(int settingId, int value)
{
case SETTING_USE_AA_FILTER :
// enables / disabless anti-alias filter
- pRateTransposer->enableAAFilter((value != 0) ? TRUE : FALSE);
- return TRUE;
+ pRateTransposer->enableAAFilter((value != 0) ? true : false);
+ return true;
case SETTING_AA_FILTER_LENGTH :
// sets anti-alias filter length
pRateTransposer->getAAFilter()->setLength(value);
- return TRUE;
+ return true;
case SETTING_USE_QUICKSEEK :
// enables / disables tempo routine quick seeking algorithm
- pTDStretch->enableQuickSeek((value != 0) ? TRUE : FALSE);
- return TRUE;
+ pTDStretch->enableQuickSeek((value != 0) ? true : false);
+ return true;
case SETTING_SEQUENCE_MS:
// change time-stretch sequence duration parameter
pTDStretch->setParameters(sampleRate, value, seekWindowMs, overlapMs);
- return TRUE;
+ return true;
case SETTING_SEEKWINDOW_MS:
// change time-stretch seek window length parameter
pTDStretch->setParameters(sampleRate, sequenceMs, value, overlapMs);
- return TRUE;
+ return true;
case SETTING_OVERLAP_MS:
// change time-stretch overlap length parameter
pTDStretch->setParameters(sampleRate, sequenceMs, seekWindowMs, value);
- return TRUE;
+ return true;
default :
- return FALSE;
+ return false;
}
}
diff --git a/source/SoundTouch/TDStretch.cpp b/source/SoundTouch/TDStretch.cpp
index b1fa670..c63f38d 100644
--- a/source/SoundTouch/TDStretch.cpp
+++ b/source/SoundTouch/TDStretch.cpp
@@ -84,15 +84,15 @@ static const short _scanOffsets[5][24]={
TDStretch::TDStretch() : FIFOProcessor(&outputBuffer)
{
- bQuickSeek = FALSE;
+ bQuickSeek = false;
channels = 2;
pMidBuffer = NULL;
pMidBufferUnaligned = NULL;
overlapLength = 0;
- bAutoSeqSetting = TRUE;
- bAutoSeekSetting = TRUE;
+ bAutoSeqSetting = true;
+ bAutoSeekSetting = true;
// outDebt = 0;
skipFract = 0;
@@ -132,23 +132,23 @@ void TDStretch::setParameters(int aSampleRate, int aSequenceMS,
if (aSequenceMS > 0)
{
this->sequenceMs = aSequenceMS;
- bAutoSeqSetting = FALSE;
+ bAutoSeqSetting = false;
}
else if (aSequenceMS == 0)
{
// if zero, use automatic setting
- bAutoSeqSetting = TRUE;
+ bAutoSeqSetting = true;
}
if (aSeekWindowMS > 0)
{
this->seekWindowMs = aSeekWindowMS;
- bAutoSeekSetting = FALSE;
+ bAutoSeekSetting = false;
}
else if (aSeekWindowMS == 0)
{
// if zero, use automatic setting
- bAutoSeekSetting = TRUE;
+ bAutoSeekSetting = true;
}
calcSeqParameters();
@@ -231,14 +231,14 @@ void TDStretch::clear()
// Enables/disables the quick position seeking algorithm. Zero to disable, nonzero
// to enable
-void TDStretch::enableQuickSeek(BOOL enable)
+void TDStretch::enableQuickSeek(bool enable)
{
bQuickSeek = enable;
}
// Returns nonzero if the quick seeking algorithm is enabled.
-BOOL TDStretch::isQuickSeekEnabled() const
+bool TDStretch::isQuickSeekEnabled() const
{
return bQuickSeek;
}
diff --git a/source/SoundTouch/TDStretch.h b/source/SoundTouch/TDStretch.h
index 4ce8726..18849b2 100644
--- a/source/SoundTouch/TDStretch.h
+++ b/source/SoundTouch/TDStretch.h
@@ -125,14 +125,14 @@ protected:
float skipFract;
FIFOSampleBuffer outputBuffer;
FIFOSampleBuffer inputBuffer;
- BOOL bQuickSeek;
+ bool bQuickSeek;
int sampleRate;
int sequenceMs;
int seekWindowMs;
int overlapMs;
- BOOL bAutoSeqSetting;
- BOOL bAutoSeekSetting;
+ bool bAutoSeqSetting;
+ bool bAutoSeekSetting;
void acceptNewOverlapLength(int newOverlapLength);
@@ -195,10 +195,10 @@ public:
/// Enables/disables the quick position seeking algorithm. Zero to disable,
/// nonzero to enable
- void enableQuickSeek(BOOL enable);
+ void enableQuickSeek(bool enable);
/// Returns nonzero if the quick seeking algorithm is enabled.
- BOOL isQuickSeekEnabled() const;
+ bool isQuickSeekEnabled() const;
/// Sets routine control parameters. These control are certain time constants
/// defining how the sound is stretched to the desired duration.