* 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:
Chris Cannam
2007-12-13 17:59:21 +00:00
parent fafcb36e97
commit 308e2ad632
3 changed files with 15 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
CXX := @CXX@ 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) LDFLAGS := @LDFLAGS@ -lpthread $(LDFLAGS)
LIBRARY_LIBS := @SRC_LIBS@ @FFTW_LIBS@ LIBRARY_LIBS := @SRC_LIBS@ @FFTW_LIBS@
@@ -114,6 +114,7 @@ install: all
$(MKDIR) -p $(INSTALL_LIBDIR) $(MKDIR) -p $(INSTALL_LIBDIR)
$(MKDIR) -p $(INSTALL_VAMPDIR) $(MKDIR) -p $(INSTALL_VAMPDIR)
$(MKDIR) -p $(INSTALL_LADSPADIR) $(MKDIR) -p $(INSTALL_LADSPADIR)
$(MKDIR) -p $(INSTALL_PKGDIR)
cp $(PROGRAM_TARGET) $(INSTALL_BINDIR) cp $(PROGRAM_TARGET) $(INSTALL_BINDIR)
cp $(PUBLIC_INCLUDES) $(INSTALL_INCDIR) cp $(PUBLIC_INCLUDES) $(INSTALL_INCDIR)
cp $(STATIC_TARGET) $(INSTALL_LIBDIR) cp $(STATIC_TARGET) $(INSTALL_LIBDIR)

View File

@@ -72,12 +72,13 @@ public:
//#define FFTW_DOUBLE_ONLY 1 //#define FFTW_DOUBLE_ONLY 1
//#define FFTW_FLOAT_ONLY 1 //#define FFTW_FLOAT_ONLY 1
#ifdef FFTW_DOUBLE_ONLY #if defined(FFTW_DOUBLE_ONLY) && defined(FFTW_FLOAT_ONLY)
#ifdef FFTW_FLOAT_ONLY
// Can't meaningfully define both // Can't meaningfully define both
#undef FFTW_DOUBLE_ONLY #undef FFTW_DOUBLE_ONLY
#undef FFTW_FLOAT_ONLY #undef FFTW_FLOAT_ONLY
#else /* !FFTW_FLOAT_ONLY */ #endif
#ifdef FFTW_DOUBLE_ONLY
#define fftwf_complex fftw_complex #define fftwf_complex fftw_complex
#define fftwf_plan fftw_plan #define fftwf_plan fftw_plan
#define fftwf_plan_dft_r2c_1d fftw_plan_dft_r2c_1d #define fftwf_plan_dft_r2c_1d fftw_plan_dft_r2c_1d
@@ -90,7 +91,7 @@ public:
#define sqrtf sqrt #define sqrtf sqrt
#define cosf cos #define cosf cos
#define sinf sin #define sinf sin
#endif /* !FFTW_FLOAT_ONLY */ #endif /* FFTW_DOUBLE_ONLY */
#ifdef FFTW_FLOAT_ONLY #ifdef FFTW_FLOAT_ONLY
#define fftw_complex fftwf_complex #define fftw_complex fftwf_complex
@@ -475,7 +476,6 @@ D_FFTW::m_extantd = 0;
Mutex Mutex
D_FFTW::m_extantMutex; D_FFTW::m_extantMutex;
#endif
class D_Cross : public FFTImpl class D_Cross : public FFTImpl
{ {

View File

@@ -39,7 +39,7 @@ int main(int argc, char **argv)
int c; int c;
double ratio = 1.0; double ratio = 1.0;
double pitchshift = 1.0; double pitchshift = 0.0;
double frequencyshift = 1.0; double frequencyshift = 1.0;
int debug = 0; int debug = 0;
bool realtime = false; bool realtime = false;
@@ -94,7 +94,7 @@ int main(int argc, char **argv)
{ 0, 0, 0 } { 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; if (c == -1) break;
switch (c) { switch (c) {
@@ -266,10 +266,15 @@ int main(int argc, char **argv)
break; break;
} }
if (pitchshift != 1.0) { if (pitchshift != 0.0) {
frequencyshift *= pow(2.0, pitchshift / 12); frequencyshift *= pow(2.0, pitchshift / 12);
} }
if (debug > 0) {
cerr << "Time ratio: " << ratio << endl;
cerr << "Frequency ratio: " << frequencyshift << endl;
}
#ifdef _WIN32 #ifdef _WIN32
RubberBand:: RubberBand::
#endif #endif