* Fix incorrect option parsing (-T not recognised, pitch shift mishandled)
* Fix incorrect #ifdef nesting in FFT.cpp * Ensure pkg-config directory is created on make install if necessary
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
CXX := @CXX@
|
||||
CXXFLAGS := -DUSE_PTHREADS -DHAVE_LIBSAMPLERATE -DHAVE_FFTW3 -DFFTW_DOUBLE_ONLY @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ -Irubberband -Isrc $(OPTFLAGS)
|
||||
CXXFLAGS := -DFFTW_DOUBLE_ONLY @CXXFLAGS@ @SRC_CFLAGS@ @SNDFILE_CFLAGS@ @FFTW_CFLAGS@ @Vamp_CFLAGS@ -Irubberband -Isrc $(OPTFLAGS)
|
||||
LDFLAGS := @LDFLAGS@ -lpthread $(LDFLAGS)
|
||||
|
||||
LIBRARY_LIBS := @SRC_LIBS@ @FFTW_LIBS@
|
||||
@@ -114,6 +114,7 @@ install: all
|
||||
$(MKDIR) -p $(INSTALL_LIBDIR)
|
||||
$(MKDIR) -p $(INSTALL_VAMPDIR)
|
||||
$(MKDIR) -p $(INSTALL_LADSPADIR)
|
||||
$(MKDIR) -p $(INSTALL_PKGDIR)
|
||||
cp $(PROGRAM_TARGET) $(INSTALL_BINDIR)
|
||||
cp $(PUBLIC_INCLUDES) $(INSTALL_INCDIR)
|
||||
cp $(STATIC_TARGET) $(INSTALL_LIBDIR)
|
||||
|
||||
10
src/FFT.cpp
10
src/FFT.cpp
@@ -72,12 +72,13 @@ public:
|
||||
//#define FFTW_DOUBLE_ONLY 1
|
||||
//#define FFTW_FLOAT_ONLY 1
|
||||
|
||||
#ifdef FFTW_DOUBLE_ONLY
|
||||
#ifdef FFTW_FLOAT_ONLY
|
||||
#if defined(FFTW_DOUBLE_ONLY) && defined(FFTW_FLOAT_ONLY)
|
||||
// Can't meaningfully define both
|
||||
#undef FFTW_DOUBLE_ONLY
|
||||
#undef FFTW_FLOAT_ONLY
|
||||
#else /* !FFTW_FLOAT_ONLY */
|
||||
#endif
|
||||
|
||||
#ifdef FFTW_DOUBLE_ONLY
|
||||
#define fftwf_complex fftw_complex
|
||||
#define fftwf_plan fftw_plan
|
||||
#define fftwf_plan_dft_r2c_1d fftw_plan_dft_r2c_1d
|
||||
@@ -90,7 +91,7 @@ public:
|
||||
#define sqrtf sqrt
|
||||
#define cosf cos
|
||||
#define sinf sin
|
||||
#endif /* !FFTW_FLOAT_ONLY */
|
||||
#endif /* FFTW_DOUBLE_ONLY */
|
||||
|
||||
#ifdef FFTW_FLOAT_ONLY
|
||||
#define fftw_complex fftwf_complex
|
||||
@@ -475,7 +476,6 @@ D_FFTW::m_extantd = 0;
|
||||
Mutex
|
||||
D_FFTW::m_extantMutex;
|
||||
|
||||
#endif
|
||||
|
||||
class D_Cross : public FFTImpl
|
||||
{
|
||||
|
||||
11
src/main.cpp
11
src/main.cpp
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
|
||||
int c;
|
||||
|
||||
double ratio = 1.0;
|
||||
double pitchshift = 1.0;
|
||||
double pitchshift = 0.0;
|
||||
double frequencyshift = 1.0;
|
||||
int debug = 0;
|
||||
bool realtime = false;
|
||||
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "t:p:d:RPc:f:qh", longOpts, &optionIndex);
|
||||
c = getopt_long(argc, argv, "t:p:d:RPc:f:T:qh", longOpts, &optionIndex);
|
||||
if (c == -1) break;
|
||||
|
||||
switch (c) {
|
||||
@@ -266,10 +266,15 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
}
|
||||
|
||||
if (pitchshift != 1.0) {
|
||||
if (pitchshift != 0.0) {
|
||||
frequencyshift *= pow(2.0, pitchshift / 12);
|
||||
}
|
||||
|
||||
if (debug > 0) {
|
||||
cerr << "Time ratio: " << ratio << endl;
|
||||
cerr << "Frequency ratio: " << frequencyshift << endl;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
RubberBand::
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user