diff --git a/ChangeLog b/ChangeLog index 45fb2ef6a..6bf1d520e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-06-24 Tobias Doerffel + + * plugins/spectrum_analyzer/spectrumanalyzer_control_dialog.cpp: + * plugins/spectrum_analyzer/spectrum_analyzer.cpp: + * plugins/spectrum_analyzer/Makefile.am: + * plugins/spectrum_analyzer/spectrum_analyzer.h: + * configure.in: + use float-based FFTW-library + + * include/peak_controller.h: + * include/tempo_sync_knob.h: + fixes for win32-build + 2008-06-23 Tobias Doerffel * plugins/ladspa_effect/ladspa_effect.cpp: diff --git a/configure.in b/configure.in index 7f6f11ce3..3d972204d 100644 --- a/configure.in +++ b/configure.in @@ -2,8 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) -AC_INIT(lmms, 0.4.0-svn20080616, lmms-devel/at/lists/dot/sf/dot/net) -AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080616) +AC_INIT(lmms, 0.4.0-svn20080624, lmms-devel/at/lists/dot/sf/dot/net) +AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080624) AX_PREFIX_CONFIG_H([include/lmmsconfig.h]) AM_CONFIG_HEADER(config.h) @@ -488,7 +488,11 @@ AC_ARG_WITH(fftw3, AH_TEMPLATE(HAVE_FFTW3_H, [Define to 1 if you have the header file.]) if test "x$with_fftw3" = "xyes" ; then AC_CHECK_HEADER(fftw3.h, HAVE_FFTW3_H="true") - AC_CHECK_LIB([fftw3], [fftw_execute], HAVE_LIBFFTW3="true", HAVE_FFTW3_H="") + if [ "$build_win32" = "true" ] ; then + AC_CHECK_LIB([fftw3f-3], [fftwf_execute], HAVE_LIBFFTW3="true", HAVE_FFTW3_H="") + else + AC_CHECK_LIB([fftw3f], [fftwf_execute], HAVE_LIBFFTW3="true", HAVE_FFTW3_H="") + fi fi if test ! -z "$HAVE_FFTW3_H" ; then AC_DEFINE(HAVE_FFTW3_H) diff --git a/plugins/spectrum_analyzer/Makefile.am b/plugins/spectrum_analyzer/Makefile.am index a15cf5bbb..fa4251095 100644 --- a/plugins/spectrum_analyzer/Makefile.am +++ b/plugins/spectrum_analyzer/Makefile.am @@ -19,7 +19,7 @@ if BUILD_WIN32 DLL=$(PLUGIN_NAME).dll $(DLL): lib$(PLUGIN_NAME).la - $(CXX) *.o -L$(top_srcdir) -llmms-imp -shared -Wl,-no-undefined -o $@ $(QT_LDADD) && $(STRIP) $@ + $(CXX) *.o -L$(top_srcdir) -llmms-imp -shared -Wl,-no-undefined -o $@ $(QT_LDADD) -lfftw3f-3 && $(STRIP) $@ install-exec-hook: $(DLL) cp $< $(pkglibdir) @@ -49,6 +49,10 @@ libspectrumanalyzer_la_SOURCES = spectrum_analyzer.cpp \ spectrumanalyzer_controls.h \ spectrumanalyzer_control_dialog.cpp \ spectrumanalyzer_control_dialog.h -libspectrumanalyzer_la_LDFLAGS = -lfftw3 +if BUILD_WIN32 +libspectrumanalyzer_la_LDFLAGS = -lfftw3f-3 +else +libspectrumanalyzer_la_LDFLAGS = -lfftw3f +endif $(libspectrumanalyzer_la_SOURCES): ./embedded_resources.h diff --git a/plugins/spectrum_analyzer/spectrum_analyzer.cpp b/plugins/spectrum_analyzer/spectrum_analyzer.cpp index d02e98cd0..5b7c1405e 100644 --- a/plugins/spectrum_analyzer/spectrum_analyzer.cpp +++ b/plugins/spectrum_analyzer/spectrum_analyzer.cpp @@ -58,9 +58,9 @@ spectrumAnalyzer::spectrumAnalyzer( model * _parent, m_framesFilledUp( 0 ), m_energy( 0 ) { - m_specBuf = (fftw_complex *) fftw_malloc( ( BUFFER_SIZE + 1 ) * - sizeof( fftw_complex ) ); - m_fftPlan = fftw_plan_dft_r2c_1d( BUFFER_SIZE*2, m_buffer, + m_specBuf = (fftwf_complex *) fftwf_malloc( ( BUFFER_SIZE + 1 ) * + sizeof( fftwf_complex ) ); + m_fftPlan = fftwf_plan_dft_r2c_1d( BUFFER_SIZE*2, m_buffer, m_specBuf, FFTW_MEASURE ); } @@ -69,8 +69,8 @@ spectrumAnalyzer::spectrumAnalyzer( model * _parent, spectrumAnalyzer::~spectrumAnalyzer() { - fftw_destroy_plan( m_fftPlan ); - fftw_free( m_specBuf ); + fftwf_destroy_plan( m_fftPlan ); + fftwf_free( m_specBuf ); } @@ -88,9 +88,9 @@ enum WINDOWS returns -1 on error */ -double maximum(double *abs_spectrum, unsigned int spec_size) +float maximum(float *abs_spectrum, unsigned int spec_size) { - double maxi=0; + float maxi=0; unsigned int i; if ( abs_spectrum==NULL ) @@ -112,10 +112,10 @@ double maximum(double *abs_spectrum, unsigned int spec_size) /* apply hanning or hamming window to channel returns -1 on error */ -int hanming(double *timebuffer, int length, int type) +int hanming(float *timebuffer, int length, int type) { int i; - double alpha; + float alpha; if ( (timebuffer==NULL)||(length<=0) ) return -1; @@ -129,7 +129,7 @@ int hanming(double *timebuffer, int length, int type) for ( i=0; i num_new returns 0 on success, else -1 */ -int compressbands(double *absspec_buffer, double *compressedband, int num_old, int num_new, int bottom, int top) +int compressbands(float *absspec_buffer, float *compressedband, int num_old, int num_new, int bottom, int top) { - double ratio; + float ratio; int i, usefromold; - double j; - double j_min, j_max; + float j; + float j_min, j_max; if ( (absspec_buffer==NULL)||(compressedband==NULL) ) return -1; @@ -188,7 +188,7 @@ int compressbands(double *absspec_buffer, double *compressedband, int num_old, i usefromold=num_old-(num_old-top)-bottom; - ratio=(double)usefromold/(double)num_new; + ratio=(float)usefromold/(float)num_new; // foreach new subband for ( i=0; im_saControls.m_linearSpec.value() ? m_backgroundPlain : m_background; - const double e = m_sa->m_energy; + const float e = m_sa->m_energy; if( e <= 0 ) { darken( i, 0, 0, i.width(), i.height() ); @@ -84,7 +84,7 @@ public: } const bool lin_y = m_sa->m_saControls.m_linearYAxis.value(); - double * b = m_sa->m_bands; + float * b = m_sa->m_bands; const int LOWER_Y = -60; // dB int h; if( m_sa->m_saControls.m_linearSpec.value() )