Mercurial > hg > easaier-soundaccess
changeset 241:2aea571dc9d4
remove AirWorm
remove mutex lock in destructor of Equalizer (bug)
author | lbajardsilogic |
---|---|
date | Tue, 25 Mar 2008 14:54:36 +0000 |
parents | e006f4a57f86 |
children | 60e84bb658bc |
files | sv/filter/EqualizerFilter.cpp sv/filter/EqualizerFilter.h sv/filter/MultiRealTimeFilter.cpp sv/sound_access.vcproj |
diffstat | 4 files changed, 91 insertions(+), 122 deletions(-) [+] |
line wrap: on
line diff
--- a/sv/filter/EqualizerFilter.cpp Tue Mar 11 13:53:59 2008 +0000 +++ b/sv/filter/EqualizerFilter.cpp Tue Mar 25 14:54:36 2008 +0000 @@ -57,8 +57,8 @@ } else { - for(int i = 0 ; i < m_resolution ; i++){ - m_eqcurve.push_back(0); + for(int i = 0 ; i < m_resolution ; i++){ + m_eqcurve.push_back(0); } } m_mutex->unlock(); @@ -68,14 +68,16 @@ EqualizerFilter::~EqualizerFilter() { - m_mutex->lock(); m_eqcurve.clear(); - m_mutex->unlock(); - + for(int i = 0 ; i < m_nbBand ; i++){ delete band[i]; } delete band; + band = 0; + + delete m_plotbandcurve; + m_plotbandcurve = 0; } EqualizerFilter::PropertyList EqualizerFilter::getProperties() const @@ -107,13 +109,13 @@ if (name.left(8) == "GainBand") return RangeProperty; return InvalidProperty; } - -QString EqualizerFilter::getPropertyGroupName(const PropertyName &name) const -{ - if (name.left(8) == "GainBand") return "GainBand"; + +QString EqualizerFilter::getPropertyGroupName(const PropertyName &name) const +{ + if (name.left(8) == "GainBand") return "GainBand"; if ((name == "Equalizer") || (name == "DrawCurve")) return "Draw Curve"; - return QString(); -} + return QString(); +} int EqualizerFilter::getPropertyRangeAndValue(const PropertyName &name, int *min, int *max, int *deflt) const
--- a/sv/filter/EqualizerFilter.h Tue Mar 11 13:53:59 2008 +0000 +++ b/sv/filter/EqualizerFilter.h Tue Mar 25 14:54:36 2008 +0000 @@ -15,81 +15,81 @@ License, or (at your option) any later version. See the file COPYING included with this distribution for more information. */ - -#ifndef _EQUALIZER_FILTER_H_ -#define _EQUALIZER_FILTER_H_ - -#include <QMutex> - -#include "base/PropertyContainer.h" - -class EqualizerFilter : public PropertyContainer -{ - Q_OBJECT - -public: - EqualizerFilter(size_t framesize, QMutex *mutex); - virtual ~EqualizerFilter(); - - virtual QString getPropertyContainerIconName() const {return "";} - - virtual QString getPropertyContainerName() const {return "Time and Pitch filter";} - - virtual QString getPropertyGroupName(const PropertyName &) const; - - virtual PropertyList getProperties() const; - virtual QString getPropertyLabel(const PropertyName &) const; - virtual PropertyType getPropertyType(const PropertyName &) const; - virtual int getPropertyRangeAndValue(const PropertyName &, - int *min, int *max, int *deflt) const; - virtual QString getPropertyValueLabel(const PropertyName &, - int value) const; - - virtual void setProperty(const PropertyName &, int value); - virtual void setProperty(const PropertyName &, QVector<float> value); - - inline bool isEnabled() {return m_enabled;} - - inline bool bypass() {return !m_enabled;} - inline bool simpleMode() {return m_simpleMode;} - inline int* gainband() {return m_gainband;} - - inline QVector<float>& curve() {return m_eqcurve;} - - void emitPlotFFTArray(float *signal, int framesize); - - void create_filterbands(); - -signals: - void filterEnabled(bool); - void signalChanged(float *); - void filterChanged(float *); - void enableDrawCurve(bool); - -public slots : - void setFilterEnabled(bool b); - void setFilterEnabled(int b); - -protected: - - QVector<float> m_eqcurve; - float* m_curve; - float* m_plotbandcurve; - - bool m_enabled; - - bool m_simpleMode; - - int m_gainband[5]; - int m_nbBand; - - int m_resolution; - - float **band; - - size_t m_framesize; - - QMutex * m_mutex; -}; - + +#ifndef _EQUALIZER_FILTER_H_ +#define _EQUALIZER_FILTER_H_ + +#include <QMutex> + +#include "base/PropertyContainer.h" + +class EqualizerFilter : public PropertyContainer +{ + Q_OBJECT + +public: + EqualizerFilter(size_t framesize, QMutex *mutex); + virtual ~EqualizerFilter(); + + virtual QString getPropertyContainerIconName() const {return "";} + + virtual QString getPropertyContainerName() const {return "Time and Pitch filter";} + + virtual QString getPropertyGroupName(const PropertyName &) const; + + virtual PropertyList getProperties() const; + virtual QString getPropertyLabel(const PropertyName &) const; + virtual PropertyType getPropertyType(const PropertyName &) const; + virtual int getPropertyRangeAndValue(const PropertyName &, + int *min, int *max, int *deflt) const; + virtual QString getPropertyValueLabel(const PropertyName &, + int value) const; + + virtual void setProperty(const PropertyName &, int value); + virtual void setProperty(const PropertyName &, QVector<float> value); + + inline bool isEnabled() {return m_enabled;} + + inline bool bypass() {return !m_enabled;} + inline bool simpleMode() {return m_simpleMode;} + inline int* gainband() {return m_gainband;} + + inline QVector<float>& curve() {return m_eqcurve;} + + void emitPlotFFTArray(float *signal, int framesize); + + void create_filterbands(); + +signals: + void filterEnabled(bool); + void signalChanged(float *); + void filterChanged(float *); + void enableDrawCurve(bool); + +public slots : + void setFilterEnabled(bool b); + void setFilterEnabled(int b); + +protected: + + QVector<float> m_eqcurve; + float* m_curve; + float* m_plotbandcurve; + + bool m_enabled; + + bool m_simpleMode; + + int m_gainband[5]; + int m_nbBand; + + int m_resolution; + + float **band; + + size_t m_framesize; + + QMutex * m_mutex; +}; + #endif \ No newline at end of file
--- a/sv/filter/MultiRealTimeFilter.cpp Tue Mar 11 13:53:59 2008 +0000 +++ b/sv/filter/MultiRealTimeFilter.cpp Tue Mar 25 14:54:36 2008 +0000 @@ -167,6 +167,7 @@ emit playSpeedChanged(1); delete m_mutex; + m_mutex = 0; /***************************/ }
--- a/sv/sound_access.vcproj Tue Mar 11 13:53:59 2008 +0000 +++ b/sv/sound_access.vcproj Tue Mar 25 14:54:36 2008 +0000 @@ -309,10 +309,6 @@ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx" > <File - RelativePath=".\AirWorm.cpp" - > - </File> - <File RelativePath="audioio\AudioCallbackPlaySource.cpp" > </File> @@ -509,32 +505,6 @@ Name="Moc" > <File - RelativePath=".\AirWorm.h" - > - <FileConfiguration - Name="Release|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="MOC $(InputFileName)" - CommandLine="$(QTDIR)\bin\moc.exe -DNDEBUG -DBUILD_RELEASE -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtNetwork" -I "$(QTDIR)\include\QtNetwork" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include" -I "..\..\vamp-plugin-sdk" -I "." -I ".." -I "audioio" -I "document" -I "transform" -I "osc" -I "main" -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp" - AdditionalDependencies="$(QTDIR)\bin\moc.exe" - Outputs="tmp_moc\moc_$(InputName).cpp" - /> - </FileConfiguration> - <FileConfiguration - Name="Debug|Win32" - > - <Tool - Name="VCCustomBuildTool" - Description="MOC $(InputFileName)" - CommandLine="$(QTDIR)\bin\moc.exe -DBUILD_DEBUG -DUSE_VC -D_WINDOWS -DUNICODE -DQT_LARGEFILE_SUPPORT -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DHAVE_BZ2 -DHAVE_PORTAUDIO -DHAVE_PORTAUDIO_V18 -DHAVE_OGGZ -DHAVE_FISHSOUND -DHAVE_FFTW3F -DHAVE_VAMP -DHAVE_VAMP_HOSTSDK -DHAVE_SNDFILE -DHAVE_SAMPLERATE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtCore" -I "$(QTDIR)\include\QtNetwork" -I "$(QTDIR)\include\QtNetwork" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtGui" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include\QtXml" -I "$(QTDIR)\include" -I "." -I ".." -I "audioio" -I "document" -I "transform" -I "osc" -I "main" -I "$(QTDIR)\include\ActiveQt" -I "tmp_moc" -I "." -I"$(QTDIR)\mkspecs\win32-msvc2005" $(InputPath) -o tmp_moc\moc_$(InputName).cpp
" - AdditionalDependencies="$(QTDIR)\bin\moc.exe" - Outputs="tmp_moc\moc_$(InputName).cpp" - /> - </FileConfiguration> - </File> - <File RelativePath="audioio\AudioCallbackPlaySource.h" > <FileConfiguration @@ -1207,10 +1177,6 @@ Filter="cpp;c;cxx;moc;h;qrc;def;odl;idl;res" > <File - RelativePath=".\tmp_moc\moc_AirWorm.cpp" - > - </File> - <File RelativePath="tmp_moc\moc_AudioCallbackPlaySource.cpp" > </File>