* Add warning if -c option and something conflicting with it are both given
* Fixes for mingw32 compile * Fix a couple of compiler warnings
This commit is contained in:
@@ -35,7 +35,7 @@ AudioCurve::process(const double *R__ mag, size_t increment)
|
|||||||
{
|
{
|
||||||
cerr << "WARNING: Using inefficient AudioCurve::process(double)" << endl;
|
cerr << "WARNING: Using inefficient AudioCurve::process(double)" << endl;
|
||||||
float *tmp = new float[m_windowSize];
|
float *tmp = new float[m_windowSize];
|
||||||
for (int i = 0; i < m_windowSize; ++i) tmp[i] = float(mag[i]);
|
for (int i = 0; i < int(m_windowSize); ++i) tmp[i] = float(mag[i]);
|
||||||
float df = process(tmp, increment);
|
float df = process(tmp, increment);
|
||||||
delete[] tmp;
|
delete[] tmp;
|
||||||
return df;
|
return df;
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ RubberBandStretcher::Impl::setPitchScale(double fs)
|
|||||||
m_pitchScale != 1.f) {
|
m_pitchScale != 1.f) {
|
||||||
|
|
||||||
// resampling mode has changed
|
// resampling mode has changed
|
||||||
for (int c = 0; c < m_channels; ++c) {
|
for (int c = 0; c < int(m_channels); ++c) {
|
||||||
if (m_channelData[c]->resampler) {
|
if (m_channelData[c]->resampler) {
|
||||||
m_channelData[c]->resampler->reset();
|
m_channelData[c]->resampler->reset();
|
||||||
}
|
}
|
||||||
@@ -932,7 +932,7 @@ RubberBandStretcher::Impl::calculateStretch()
|
|||||||
if (i >= m_silence.size()) break;
|
if (i >= m_silence.size()) break;
|
||||||
if (m_silence[i]) ++history;
|
if (m_silence[i]) ++history;
|
||||||
else history = 0;
|
else history = 0;
|
||||||
if (history >= (m_windowSize / m_increment) && increments[i] >= 0) {
|
if (history >= int(m_windowSize / m_increment) && increments[i] >= 0) {
|
||||||
increments[i] = -increments[i];
|
increments[i] = -increments[i];
|
||||||
if (m_debugLevel > 1) {
|
if (m_debugLevel > 1) {
|
||||||
std::cerr << "phase reset on silence (silent history == "
|
std::cerr << "phase reset on silence (silent history == "
|
||||||
|
|||||||
@@ -504,11 +504,11 @@ RubberBandStretcher::Impl::calculateIncrements(size_t &phaseIncrementRtn,
|
|||||||
if (silent) ++m_silentHistory;
|
if (silent) ++m_silentHistory;
|
||||||
else m_silentHistory = 0;
|
else m_silentHistory = 0;
|
||||||
|
|
||||||
if (m_silentHistory >= (m_windowSize / m_increment) && !phaseReset) {
|
if (m_silentHistory >= int(m_windowSize / m_increment) && !phaseReset) {
|
||||||
phaseReset = true;
|
phaseReset = true;
|
||||||
if (m_debugLevel > 1) {
|
if (m_debugLevel > 1) {
|
||||||
std::cerr << "calculateIncrements: phase reset on silence (silent history == "
|
cerr << "calculateIncrements: phase reset on silence (silent history == "
|
||||||
<< m_silentHistory << ")" << std::endl;
|
<< m_silentHistory << ")" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1067,7 +1067,7 @@ RubberBandStretcher::Impl::writeChunk(size_t channel, size_t shiftIncrement, boo
|
|||||||
windowAccumulator[i] = 0.0f;
|
windowAccumulator[i] = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cd.accumulatorFill > si) {
|
if (int(cd.accumulatorFill) > si) {
|
||||||
cd.accumulatorFill -= si;
|
cd.accumulatorFill -= si;
|
||||||
} else {
|
} else {
|
||||||
cd.accumulatorFill = 0;
|
cd.accumulatorFill = 0;
|
||||||
|
|||||||
10
src/bsd-3rdparty/getopt/getopt.c
vendored
10
src/bsd-3rdparty/getopt/getopt.c
vendored
@@ -31,19 +31,9 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*#if defined(LIBC_SCCS) && !defined(lint)
|
|
||||||
static char sccsid[] = "@(#)getopt.c 8.3 (Berkeley) 4/27/95";
|
|
||||||
#endif /* LIBC_SCCS and not lint
|
|
||||||
#include <sys/cdefs.h>
|
|
||||||
//__FBSDID("$FreeBSD: src/lib/libc/stdlib/getopt.c,v 1.6 2002/03/29 22:43:42 markm Exp $");
|
|
||||||
|
|
||||||
#include "namespace.h"*/
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
/*#include "un-namespace.h"*/
|
|
||||||
|
|
||||||
/*#include "libc_private.h"*/
|
|
||||||
|
|
||||||
int opterr = 1, /* if error message should be printed */
|
int opterr = 1, /* if error message should be printed */
|
||||||
optind = 1, /* index into parent argv vector */
|
optind = 1, /* index into parent argv vector */
|
||||||
|
|||||||
18
src/main.cpp
18
src/main.cpp
@@ -22,7 +22,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include "sysutils.h"
|
#include "sysutils.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __MSVC__
|
||||||
#include "bsd-3rdparty/getopt/getopt.h"
|
#include "bsd-3rdparty/getopt/getopt.h"
|
||||||
#else
|
#else
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
@@ -78,6 +78,7 @@ int main(int argc, char **argv)
|
|||||||
bool hqpitch = false;
|
bool hqpitch = false;
|
||||||
bool softening = true;
|
bool softening = true;
|
||||||
bool formant = false;
|
bool formant = false;
|
||||||
|
bool crispchanged = false;
|
||||||
int crispness = -1;
|
int crispness = -1;
|
||||||
bool help = false;
|
bool help = false;
|
||||||
bool version = false;
|
bool version = false;
|
||||||
@@ -138,11 +139,11 @@ int main(int argc, char **argv)
|
|||||||
case 'F': formant = true; break;
|
case 'F': formant = true; break;
|
||||||
case '0': threading = 1; break;
|
case '0': threading = 1; break;
|
||||||
case '@': threading = 2; break;
|
case '@': threading = 2; break;
|
||||||
case '1': transients = NoTransients; break;
|
case '1': transients = NoTransients; crispchanged = true; break;
|
||||||
case '2': peaklock = false; break;
|
case '2': peaklock = false; crispchanged = true; break;
|
||||||
case '3': longwin = true; break;
|
case '3': longwin = true; crispchanged = true; break;
|
||||||
case '4': shortwin = true; break;
|
case '4': shortwin = true; crispchanged = true; break;
|
||||||
case '8': transients = BandLimitedTransients; break;
|
case '8': transients = BandLimitedTransients; crispchanged = true; break;
|
||||||
case '9': softening = false; break;
|
case '9': softening = false; break;
|
||||||
case '%': hqpitch = true; break;
|
case '%': hqpitch = true; break;
|
||||||
case 'c': crispness = atoi(optarg); break;
|
case 'c': crispness = atoi(optarg); break;
|
||||||
@@ -215,6 +216,11 @@ int main(int argc, char **argv)
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (crispness >= 0 && crispchanged) {
|
||||||
|
cerr << "WARNING: Both crispness option and transients, peaklock or window options" << endl;
|
||||||
|
cerr << " provided -- crispness will override these other options" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
switch (crispness) {
|
switch (crispness) {
|
||||||
case -1: crispness = 4; break;
|
case -1: crispness = 4; break;
|
||||||
case 0: transients = NoTransients; peaklock = false; longwin = true; shortwin = false; break;
|
case 0: transients = NoTransients; peaklock = false; longwin = true; shortwin = false; break;
|
||||||
|
|||||||
@@ -15,8 +15,25 @@
|
|||||||
#ifndef _RUBBERBAND_SYSINFO_H_
|
#ifndef _RUBBERBAND_SYSINFO_H_
|
||||||
#define _RUBBERBAND_SYSINFO_H_
|
#define _RUBBERBAND_SYSINFO_H_
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef __MSVC__
|
||||||
#include "bsd-3rdparty/float_cast/float_cast.h"
|
#include "bsd-3rdparty/float_cast/float_cast.h"
|
||||||
|
#define R__ __restrict
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define R__ __restrict__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef R__
|
||||||
|
#define R__
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#include <malloc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MSVC__
|
||||||
|
#define alloca _alloca
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace RubberBand {
|
namespace RubberBand {
|
||||||
@@ -25,19 +42,11 @@ extern bool system_is_multiprocessor();
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
#define R__ __restrict
|
|
||||||
|
|
||||||
struct timeval { long tv_sec; long tv_usec; };
|
struct timeval { long tv_sec; long tv_usec; };
|
||||||
int gettimeofday(struct timeval *p, void *tz);
|
int gettimeofday(struct timeval *p, void *tz);
|
||||||
|
|
||||||
void usleep(unsigned long);
|
void usleep(unsigned long);
|
||||||
|
|
||||||
#define alloca _alloca
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#define R__ __restrict__
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,13 +15,10 @@
|
|||||||
#include "RubberBandVampPlugin.h"
|
#include "RubberBandVampPlugin.h"
|
||||||
|
|
||||||
#include "StretchCalculator.h"
|
#include "StretchCalculator.h"
|
||||||
|
#include "sysutils.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#include "bsd-3rdparty/float_cast/float_cast.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
|
|||||||
Reference in New Issue
Block a user