Mercurial > hg > easaier-soundaccess
changeset 223:c413e82a4812
reorganise RealTimeFilter for Equalizer integration
author | lbajardsilogic |
---|---|
date | Mon, 11 Feb 2008 15:17:54 +0000 |
parents | c9042816f12d |
children | d2dff2170c7a |
files | base/PropertyContainer.h sv/document/Document.cpp sv/document/Document.h sv/filter/EqualizerFilter.cpp sv/filter/EqualizerFilter.h sv/filter/Filter.cpp sv/filter/Filter.h sv/filter/FilterStack.cpp sv/filter/FilterStack.h sv/filter/MultiRealTimeFilter.cpp sv/filter/MultiRealTimeFilter.h sv/filter/RealTimeFilterFactory.cpp sv/filter/RealTimeFilterFactory.h sv/filter/TimeStretchFilter.cpp sv/filter/TimeStretchFilter.h sv/main/MainWindow.cpp sv/sound_access.vcproj sv/sv.pro widgets/ItemAudioFilterList.cpp widgets/ItemAudioFilterList.h widgets/RealTimeFilterPropertyStack.cpp widgets/RealTimeFilterPropertyStack.h |
diffstat | 22 files changed, 771 insertions(+), 350 deletions(-) [+] |
line wrap: on
line diff
--- a/base/PropertyContainer.h Mon Feb 11 10:08:48 2008 +0000 +++ b/base/PropertyContainer.h Mon Feb 11 15:17:54 2008 +0000 @@ -102,6 +102,8 @@ virtual PlayParameters *getPlayParameters() { return 0; } + bool isEnabled() const {return m_enabled;} + signals: void propertyChanged(PropertyContainer::PropertyName); @@ -162,6 +164,8 @@ virtual bool convertPropertyStrings(QString nameString, QString valueString, PropertyName &name, int &value); + + bool m_enabled; }; #endif
--- a/sv/document/Document.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/document/Document.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -43,8 +43,8 @@ connect(m_filterStack, SIGNAL(filterRemoved(QString)), this, SIGNAL(filterRemoved(QString))); - connect(m_filterStack, SIGNAL(newFilterAdded(Filter *)), - this, SIGNAL(newFilterAdded(Filter *))); + connect(m_filterStack, SIGNAL(newFilterAdded(PropertyContainer *)), + this, SIGNAL(newFilterAdded(PropertyContainer *))); connect(this, SIGNAL(modelAboutToBeDeleted(Model *)), TransformFactory::getInstance(),
--- a/sv/document/Document.h Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/document/Document.h Mon Feb 11 15:17:54 2008 +0000 @@ -231,7 +231,7 @@ void audioSourceInfoAdded(AudioSourceInfoModel *); - void newFilterAdded(Filter *); + void newFilterAdded(PropertyContainer *); void filterRemoved(QString); protected:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sv/filter/EqualizerFilter.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -0,0 +1,103 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* Sound Access + EASAIER client application. + Silogic 2007. Laure Bajard. + + Integration of the filter provided by: + Dublin Institute of Technology - Audio Research Group 2007 + www.audioresearchgroup.com + Author: Dan Barry + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include <math.h> +#include <iostream> + +#include "EqualizerFilter.h" + +#include "FFTReal.h" +#include "DSP.h" + +#include "system/System.h" +#include "main/MainWindow.h" + +EqualizerFilter::EqualizerFilter() : PropertyContainer() +{ + setObjectName("Equalizer"); +} + +EqualizerFilter::~EqualizerFilter() +{} + +EqualizerFilter::PropertyList EqualizerFilter::getProperties() const +{ + PropertyList list; + list.push_back("Equalizer"); + return list; +} + +QString EqualizerFilter::getPropertyLabel(const PropertyName &name) const +{ + if (name == "Equalizer") return tr("Equalizer"); + return ""; +} + +EqualizerFilter::PropertyType EqualizerFilter::getPropertyType(const PropertyName &name) const +{ + if (name == "Equalizer") return PlotProperty; + return InvalidProperty; +} + +int EqualizerFilter::getPropertyRangeAndValue(const PropertyName &name, + int *min, int *max, int *deflt) const +{ + //!!! factor this colour handling stuff out into a colour manager class + int val = 0; + + if (name == "Equalizer") { + /*if (deflt) *deflt = 0; + val = (m_peakcheck ? 1 : 0);*/ + } +#ifdef DEBUG_FILTERS + std::cerr << "EqualizerFilter::getPropertyRangeAndValue = " << val << std::endl; +#endif + return val; +} + +QString EqualizerFilter::getPropertyValueLabel(const PropertyName &name, + int value) const +{ + return tr("<unknown>"); +} + +void EqualizerFilter::setProperty(const PropertyName &name, int value) +{ + if (name == "Equalizer"){ + + } +#ifdef DEBUG_FILTERS + std::cerr << "EqualizerFilter::hopfactor = " << hopfactor << std::endl; + std::cerr << "EqualizerFilter::m_interpfactor = " << m_interpfactor << std::endl; + std::cerr << "EqualizerFilter::m_hop = " << m_hop << std::endl; + std::cerr << "EqualizerFilter::skip = " << getRequiredSkipSamples() << std::endl; +#endif + +} + +void EqualizerFilter::setFilterEnabled(bool b){ + m_enabled=b; + emit filterEnabled(m_enabled); +} + +void EqualizerFilter::setFilterEnabled(int b){ + m_enabled=b; + emit filterEnabled(m_enabled); +} + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sv/filter/EqualizerFilter.h Mon Feb 11 15:17:54 2008 +0000 @@ -0,0 +1,57 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* Sound Access + EASAIER client application. + Silogic 2007. Laure Bajard. + + Integration of the filter provided by: + Dublin Institute of Technology - Audio Research Group 2007 + www.audioresearchgroup.com + Author: Dan Barry + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + 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 "base/PropertyContainer.h" + +class EqualizerFilter : public PropertyContainer +{ + Q_OBJECT + +public: + EqualizerFilter(); + virtual ~EqualizerFilter(); + + virtual QString getPropertyContainerIconName() const {return "";} + + virtual QString getPropertyContainerName() const {return "Time and Pitch filter";} + + 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); + +signals: + void filterEnabled(bool); + +public slots : + void setFilterEnabled(bool b); + void setFilterEnabled(int b); + +protected: + +}; + +#endif \ No newline at end of file
--- a/sv/filter/Filter.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/Filter.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -13,13 +13,25 @@ #include "Filter.h" -Filter::Filter() : PropertyContainer(), +Filter::Filter() : QObject(), m_sourceChannelCount(0), filterEnabled(false) {} Filter::~Filter() -{} +{ + while (!m_filterCollection.empty()) + { + std::vector<PropertyContainer*>::iterator iter = m_filterCollection.begin(); + PropertyContainer* filterElt = *(iter); + if (filterElt) + { + delete filterElt; + filterElt = 0; + } + m_filterCollection.erase(iter); + } +} bool Filter::isFilterEnabled() const { return filterEnabled; @@ -42,14 +54,14 @@ int enable = isFilterEnabled(); s += indent + QString("<filter name=\"%1\" enable=\"%2\" ").arg(objectName()).arg(enable); - PropertyContainer::PropertyList propertyList = getProperties(); +/* PropertyContainer::PropertyList propertyList = getProperties(); for(int i=0; i< ((int) propertyList.size());i++) { int min, max, deflt; int value = getPropertyRangeAndValue(propertyList[i], &min, &max, &deflt); s += propertyList[i] + QString("=\"%1\" ").arg(value); } - +*/ s += QString(" %1 />\n").arg(extraAttributes); return s; @@ -61,7 +73,7 @@ setFilterEnabled(enable); emit filterEnableChange(enable); - PropertyContainer::PropertyList propertyList = getProperties(); +/* PropertyContainer::PropertyList propertyList = getProperties(); int value; for(int i=0; i< ((int) propertyList.size());i++) { @@ -69,5 +81,5 @@ setProperty(propertyList[i], value); } - emit propertiesChanged(this); + emit propertiesChanged(this);*/ } \ No newline at end of file
--- a/sv/filter/Filter.h Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/Filter.h Mon Feb 11 15:17:54 2008 +0000 @@ -18,7 +18,7 @@ #include "base/PropertyContainer.h" -class Filter : public PropertyContainer +class Filter : public QObject //: public PropertyContainer { Q_OBJECT @@ -26,9 +26,9 @@ Filter(); virtual ~Filter(); - virtual QString getPropertyLabel(const PropertyName &) const {return "";} - virtual QString getPropertyContainerName() const {return "";} - virtual QString getPropertyContainerIconName() const {return "";} + //virtual QString getPropertyLabel(const PropertyName &) const {return "";} + //virtual QString getPropertyContainerName() const {return "";} + //virtual QString getPropertyContainerIconName() const {return "";} /** @@ -56,10 +56,12 @@ void setProperties(const QXmlAttributes &attributes); + std::vector<PropertyContainer*> getFilterCollection(){ return m_filterCollection;} + signals : void filterEnableChange(bool); - void propertiesChanged(PropertyContainer *); + //void propertiesChanged(PropertyContainer *); protected: @@ -70,6 +72,8 @@ void setFilterEnabled(bool b); void setFilterEnabled(int b); +protected: + std::vector<PropertyContainer*> m_filterCollection; }; #endif \ No newline at end of file
--- a/sv/filter/FilterStack.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/FilterStack.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -13,7 +13,7 @@ #include "FilterStack.h" -#include "TimeStretchFilter.h" +#include "MultiRealTimeFilter.h" FilterStack::FilterStack() : QObject(), m_count(0), @@ -45,7 +45,15 @@ m_filters[m_count] = filter; filter->setSourceChannelCount(m_sourceChannelCount); m_count++; - emit newFilterAdded(filter); + + std::vector<PropertyContainer*> filterCollection = filter->getFilterCollection(); + std::vector<PropertyContainer*>::iterator iter; + for (iter = filterCollection.begin(); iter != filterCollection.end(); iter++) + { + PropertyContainer* filterElt = *iter; + emit newFilterAdded(filterElt); + } + //emit newFilterAdded(filter); } void FilterStack::putInput(float **input, size_t samples) @@ -156,9 +164,9 @@ { // find the time filter Filter * filter = iter->second; - if (filter->objectName() == "Pitch-Time Stretching") + if (filter->objectName() == "DIT Filters") { - TimeStretchFilter * timefilter = (TimeStretchFilter *) filter; + MultiRealTimeFilter * timefilter = (MultiRealTimeFilter *) filter; if (filter->isFilterEnabled()) { skip = timefilter->getRequiredSkipSamples(); }
--- a/sv/filter/FilterStack.h Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/FilterStack.h Mon Feb 11 15:17:54 2008 +0000 @@ -49,7 +49,7 @@ QString toEasaierXmlString(QString indent, QString extraAttributes) const; signals: - void newFilterAdded(Filter *); + void newFilterAdded(PropertyContainer *); void filterRemoved(QString); protected:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sv/filter/MultiRealTimeFilter.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -0,0 +1,340 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* Sound Access + EASAIER client application. + Silogic 2007. Laure Bajard. + + Integration of the filter provided by: + Dublin Institute of Technology - Audio Research Group 2007 + www.audioresearchgroup.com + Author: Dan Barry + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include <math.h> +#include <iostream> + +#include "MultiRealTimeFilter.h" + +#include "FFTReal.h" +#include "DSP.h" + +#include "system/System.h" +#include "main/MainWindow.h" + +/*float *audioframe; +float *prev_audioframe; +float *window; +float *processedframe; +float *outbuffer; +float *holdbuffer3; +float *holdbuffer2; +float *holdbuffer1; + +float *c_phase; ///CURRENT FRAME phases +float *p_phase; ///PREVIOUS FRAME phases +float *c_synthphase; +float *p_synthphase; +float *synthframe;*/ + +float *c_mags; ///CURRENT FRAME MAGNITUDES +float *p_mags; ///PREVIOUS FRAME MAGNITUDES + +float *FFTframe; + +extern float hopfactor; + +//need in DSP.cpp +float lastfactor; + +int numpeaks; +float *peak_locations; +int currentposition; +// + +MultiRealTimeFilter::MultiRealTimeFilter() : Filter(), + m_framesize(4096), + m_transhold(0) +{ + m_hop = m_framesize/4; + + currentposition = m_hop; + + m_timeStretchFilter = new TimeStretchFilter(); + m_equalizerFilter = new EqualizerFilter(); + + m_filterCollection.push_back(m_timeStretchFilter); + m_filterCollection.push_back(m_equalizerFilter); + + connect(m_timeStretchFilter, SIGNAL(filterEnabled(bool)), this, SLOT(setFilterEnabled(bool))); + connect(m_equalizerFilter, SIGNAL(filterEnabled(bool)), this, SLOT(setFilterEnabled(bool))); + + m_inputBuffer = (float *)calloc(m_framesize*(m_timeStretchFilter->getMaxPitchFactor()+1), sizeof(float)); + + /**********malloc***********/ + FFTframe=(float *)calloc((m_framesize), sizeof(float)); + + //This block specifically sets up the buffers required to do a 75% overlap scheme + audioframe=(float *)calloc((m_framesize), sizeof(float)); //The current frame + prev_audioframe=(float *)calloc((m_framesize), sizeof(float)); + window=(float *)calloc((m_framesize), sizeof(float)); //Window + processedframe=(float *)calloc((m_framesize), sizeof(float)); //The current frame + synthframe=(float *)calloc((m_framesize), sizeof(float)); + outbuffer=(float *)calloc((m_framesize/4), sizeof(float)); //The current output segment which is 1/4 framesize for 75% overlap + + holdbuffer3=(float *)calloc((m_framesize*0.75), sizeof(float)); //The hold buffer for the previous frame segment + holdbuffer2=(float *)calloc((m_framesize/2), sizeof(float)); //The fold buffer for the frame segment 2 frames ago + holdbuffer1=(float *)calloc((m_framesize/4), sizeof(float)); + + c_mags=(float *)calloc((m_framesize/2), sizeof(float)); //The magnitude and phase arrays + p_mags=(float *)calloc((m_framesize/2), sizeof(float)); + c_phase=(float *)calloc((m_framesize/2), sizeof(float)); + p_phase=(float *)calloc((m_framesize/2), sizeof(float)); + c_synthphase=(float *)calloc((m_framesize/2), sizeof(float)); + p_synthphase=(float *)calloc((m_framesize/2), sizeof(float)); + + peak_locations=(float *)calloc((m_framesize/2), sizeof(float)); + + hanning(window, m_framesize); + + connect(this, SIGNAL(playSpeedChanged(float)), + MainWindow::instance(), SLOT(playSpeedChanged(float))); + + hopfactor = 1; + /***************************/ +} + +MultiRealTimeFilter::~MultiRealTimeFilter() +{ + /**********de-alloc***********/ + delete m_inputBuffer; + delete FFTframe; + + delete audioframe; + delete prev_audioframe; + delete window; + delete processedframe; + delete synthframe; + + delete holdbuffer3; + delete holdbuffer2; + delete holdbuffer1; + + delete c_mags; + delete p_mags; + delete c_phase; + delete p_phase; + delete c_synthphase; + delete p_synthphase; + + delete peak_locations; + + delete outbuffer; + + hopfactor = 1; + + emit playSpeedChanged(1); + + /***************************/ +} + +void MultiRealTimeFilter::putInput(float **input, size_t samples) +{ + int dd; + float sampdiff; + float difratio; + float interpsample; + + bool drum = 0; + float drumthresh = 65; + + int delta = m_hop; //the "current position" is shifted of m_hop + + if ( samples < ( (size_t) floor(m_framesize*(m_timeStretchFilter->getPitchFactor() + 1)) ) ) + return; + + int channel = getSourceChannelCount(); + + for (int i=0; i< ((int) samples); i++){ + if (channel > 1) + m_inputBuffer[i] = input[0][i];// + input[1][i]) /2; + else + m_inputBuffer[i] = input[0][i]; + } + + for (int i = 0; i< ((int) m_framesize); i++) + { + + //This block was specifically written to do resampling interpolation for crude pitch shifting + //if it's not being used the audioframe line after the else should be used which is also used in bypass mode + //At + + if (m_timeStretchFilter->bypass() == false) { + dd = floor(double(i*m_timeStretchFilter->getPitchFactor())); + difratio = (double(i*m_timeStretchFilter->getPitchFactor())) - floor(double(i*m_timeStretchFilter->getPitchFactor())); + + // this block loads a frame as normal + sampdiff=m_inputBuffer[dd+delta+1]-m_inputBuffer[dd+delta]; + interpsample = (difratio*sampdiff)+m_inputBuffer[dd+delta]; + audioframe[i] = interpsample*window[i]; + + sampdiff=m_inputBuffer[dd+delta+1-m_hop]-m_inputBuffer[dd+delta-m_hop]; + interpsample = (difratio*sampdiff)+m_inputBuffer[dd+delta-m_hop]; + prev_audioframe[i] = interpsample*window[i]; + } + else { + audioframe[i] = m_inputBuffer[i+delta+1]*window[i]; + processedframe[i] = audioframe[i]*window[i]; + } + } + + FFTReal fft_object(m_framesize); + + if (m_timeStretchFilter->bypass() == false) + { + fft_object.do_fft(FFTframe,audioframe); + + cart2pol(FFTframe, c_mags, c_phase, m_framesize); + + //-------------------------------------------- + + fft_object.do_fft(FFTframe,prev_audioframe); + + cart2pol(FFTframe, p_mags, p_phase, m_framesize); + + drum = transient_detect(c_mags, c_mags, p_mags, p_mags, drumthresh, m_framesize); + + + if (m_timeStretchFilter->transcheck()) + { + + if (drum && m_transhold==0){ + cur2last(c_phase, c_synthphase, p_synthphase, m_framesize); + m_transhold=4; + } + else{ + if(m_timeStretchFilter->peakcheck()){ + rotatephases_peaklocked(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_timeStretchFilter->getPitchFactor()); + } + else{ + rotatephases(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_timeStretchFilter->getPitchFactor()); + } + } + } + else + { + if(m_timeStretchFilter->peakcheck()){ + rotatephases_peaklocked(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_timeStretchFilter->getPitchFactor()); + } + else{ + rotatephases(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_timeStretchFilter->getPitchFactor()); + } + } + + if(m_transhold != 0){ + m_transhold = m_transhold - 1; + } + + drum = 0; + + pol2cart(FFTframe, c_mags, c_synthphase, m_framesize); + + fft_object.do_ifft(FFTframe, processedframe); + fft_object.rescale(processedframe); //VIP######## I have edited this function to do rewindowing also###### + } + + for (int p = 0; p < ((int) m_framesize); p++){ + processedframe[p]=processedframe[p]*window[p]; + } + + for (int j = 0; j< ((int) m_framesize); j++) + { + //This block deals with the buffers for a 75% overlap scheme + + if (j < ((int) m_framesize)/4){ + outbuffer[j]=(processedframe[j]+holdbuffer1[j]+holdbuffer2[j]+holdbuffer3[j])*0.5; + holdbuffer1[j]=holdbuffer2[j+(m_framesize/4)]; + } + + if (j < ((int) m_framesize)/2){ + holdbuffer2[j]=holdbuffer3[j+(m_framesize/4)]; + } + + if (j < ((int) m_framesize)*0.75){ + holdbuffer3[j]=processedframe[j+(m_framesize/4)]; + } + } +} + +void MultiRealTimeFilter::getOutput(float **output, size_t samples) +{ + if (samples > m_framesize/4) + return; + + int channel = getSourceChannelCount(); + + for (int ch = 0; ch < channel; ++ch) + { + for (size_t i = 0; i < samples; ++i) { + output[ch][i] = outbuffer[i]; + } + } +} + +size_t MultiRealTimeFilter::getRequiredInputSamples(size_t outputSamplesNeeded) +{ + size_t need = (size_t) (floor(m_framesize*(m_timeStretchFilter->getPitchFactor() + 1))); + return need; +} + +size_t MultiRealTimeFilter::getRequiredSkipSamples() +{ + size_t skip = 1024; + + if (m_timeStretchFilter->bypass() == false && m_transhold==0) + { + skip = floor(m_hop*hopfactor); + currentposition += floor(m_hop*hopfactor); + } + else + { + skip = m_hop; + currentposition += m_hop; + } + return skip; +} + +void MultiRealTimeFilter::setFilterEnabled(bool b) +{ + filterEnabled = (m_timeStretchFilter->isEnabled() || m_equalizerFilter->isEnabled()); + /*filterEnabled=b; + + if (filterEnabled) + { + if (!m_timeStretchFilter->bypass()) + emit playSpeedChanged(hopfactor); + } + else + emit playSpeedChanged(1);*/ +} + +void MultiRealTimeFilter::setFilterEnabled(int b) +{ + filterEnabled = (m_timeStretchFilter->isEnabled() || m_equalizerFilter->isEnabled()); + /*filterEnabled=b; + + if (filterEnabled) + { + if (!m_timeStretchFilter->bypass()) + emit playSpeedChanged(hopfactor); + } + else + emit playSpeedChanged(1);*/ +} + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sv/filter/MultiRealTimeFilter.h Mon Feb 11 15:17:54 2008 +0000 @@ -0,0 +1,78 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* Sound Access + EASAIER client application. + Silogic 2007. Laure Bajard. + + Integration of the filter provided by: + Dublin Institute of Technology - Audio Research Group 2007 + www.audioresearchgroup.com + Author: Dan Barry + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef _MULTI_REAL_TIME_FILTER_H_ +#define _MULTI_REAL_TIME_FILTER_H_ + +#include "Filter.h" +#include "TimeStretchFilter.h" +#include "EqualizerFilter.h" + +class MultiRealTimeFilter : public Filter +{ + Q_OBJECT + +public: + MultiRealTimeFilter(); + virtual ~MultiRealTimeFilter(); + + virtual void putInput(float **input, size_t samples); + virtual void getOutput(float **output, size_t samples); + + virtual size_t getRequiredInputSamples(size_t outputSamplesNeeded); + size_t getRequiredSkipSamples(); + + virtual bool allowMultiple(){return false;} + +signals: + void playSpeedChanged(float); + +public slots : + void setFilterEnabled(bool b); + void setFilterEnabled(int b); + +protected: + + size_t m_framesize; + int m_hop; + + int m_transhold; + + float *m_inputBuffer; + + float *audioframe; + float *prev_audioframe; + float *window; + float *processedframe; + float *outbuffer; + float *holdbuffer3; + float *holdbuffer2; + float *holdbuffer1; + + float *c_phase; ///CURRENT FRAME phases + float *p_phase; ///PREVIOUS FRAME phases + float *c_synthphase; + float *p_synthphase; + float *synthframe; + + TimeStretchFilter * m_timeStretchFilter; + EqualizerFilter * m_equalizerFilter; + +}; + +#endif \ No newline at end of file
--- a/sv/filter/RealTimeFilterFactory.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/RealTimeFilterFactory.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -13,7 +13,7 @@ #include "RealTimeFilterFactory.h" -#include "TimeStretchFilter.h" +#include "MultiRealTimeFilter.h" #include <iostream> @@ -34,7 +34,7 @@ { FilterTypeSet types; - types.insert(TimeStretch); + types.insert(MultiRealTimeFilterType); return types; } @@ -42,15 +42,15 @@ QString RealTimeFilterFactory::getFilterLabel(FilterType type) { switch (type) { - case TimeStretch: return "Pitch-Time Stretching"; + case MultiRealTimeFilterType: return "DIT Filters"; default: return "unknown"; } } RealTimeFilterFactory::FilterType RealTimeFilterFactory::getFilterType(QString strType) { - if (strType == "Pitch-Time Stretching") { - return TimeStretch; + if (strType == "DIT Filters") { + return MultiRealTimeFilterType; } else { @@ -64,9 +64,9 @@ switch (type) { - case TimeStretch: + case MultiRealTimeFilterType: { - filter = new TimeStretchFilter; + filter = new MultiRealTimeFilter(); break; } default: break;
--- a/sv/filter/RealTimeFilterFactory.h Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/RealTimeFilterFactory.h Mon Feb 11 15:17:54 2008 +0000 @@ -23,7 +23,7 @@ public: enum FilterType { - TimeStretch, + MultiRealTimeFilterType, // Not-a-layer-type UnknownFilter = 255
--- a/sv/filter/TimeStretchFilter.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/TimeStretchFilter.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -27,117 +27,29 @@ #include "system/System.h" #include "main/MainWindow.h" -/*float *audioframe; -float *prev_audioframe; -float *window; -float *processedframe; -float *outbuffer; -float *holdbuffer3; -float *holdbuffer2; -float *holdbuffer1; - -float *c_phase; ///CURRENT FRAME phases -float *p_phase; ///PREVIOUS FRAME phases -float *c_synthphase; -float *p_synthphase; -float *synthframe;*/ - -float *c_mags; ///CURRENT FRAME MAGNITUDES -float *p_mags; ///PREVIOUS FRAME MAGNITUDES - -float *FFTframe; - float hopfactor = 1; -//need in DSP.cpp -float lastfactor; -int numpeaks; -float *peak_locations; -int currentposition; -// - -TimeStretchFilter::TimeStretchFilter() : Filter(), - m_bypass(false), +TimeStretchFilter::TimeStretchFilter() : PropertyContainer(), m_transcheck(true), m_peakcheck(false), - m_framesize(4096), m_interpfactor(1), - m_transhold(0), m_tmaxfactor(2), m_pmaxfactor(2) { - m_hop = m_framesize/4; - - currentposition = m_hop; - - m_inputBuffer = (float *)calloc(m_framesize*(m_pmaxfactor+1), sizeof(float)); - - /**********malloc***********/ - FFTframe=(float *)calloc((m_framesize), sizeof(float)); - - //This block specifically sets up the buffers required to do a 75% overlap scheme - audioframe=(float *)calloc((m_framesize), sizeof(float)); //The current frame - prev_audioframe=(float *)calloc((m_framesize), sizeof(float)); - window=(float *)calloc((m_framesize), sizeof(float)); //Window - processedframe=(float *)calloc((m_framesize), sizeof(float)); //The current frame - synthframe=(float *)calloc((m_framesize), sizeof(float)); - outbuffer=(float *)calloc((m_framesize/4), sizeof(float)); //The current output segment which is 1/4 framesize for 75% overlap - - holdbuffer3=(float *)calloc((m_framesize*0.75), sizeof(float)); //The hold buffer for the previous frame segment - holdbuffer2=(float *)calloc((m_framesize/2), sizeof(float)); //The fold buffer for the frame segment 2 frames ago - holdbuffer1=(float *)calloc((m_framesize/4), sizeof(float)); - - c_mags=(float *)calloc((m_framesize/2), sizeof(float)); //The magnitude and phase arrays - p_mags=(float *)calloc((m_framesize/2), sizeof(float)); - c_phase=(float *)calloc((m_framesize/2), sizeof(float)); - p_phase=(float *)calloc((m_framesize/2), sizeof(float)); - c_synthphase=(float *)calloc((m_framesize/2), sizeof(float)); - p_synthphase=(float *)calloc((m_framesize/2), sizeof(float)); - - peak_locations=(float *)calloc((m_framesize/2), sizeof(float)); - - hanning(window, m_framesize); + setObjectName("Pitch-Time Stretching"); connect(this, SIGNAL(playSpeedChanged(float)), MainWindow::instance(), SLOT(playSpeedChanged(float))); hopfactor = 1; - /***************************/ } TimeStretchFilter::~TimeStretchFilter() { - /**********de-alloc***********/ - delete m_inputBuffer; - delete FFTframe; - - delete audioframe; - delete prev_audioframe; - delete window; - delete processedframe; - delete synthframe; - - delete holdbuffer3; - delete holdbuffer2; - delete holdbuffer1; - - delete c_mags; - delete p_mags; - delete c_phase; - delete p_phase; - delete c_synthphase; - delete p_synthphase; - - delete peak_locations; - - delete outbuffer; - hopfactor = 1; emit playSpeedChanged(1); - - /***************************/ } TimeStretchFilter::PropertyList TimeStretchFilter::getProperties() const @@ -145,7 +57,7 @@ PropertyList list; list.push_back("Time"); list.push_back("Pitch"); - list.push_back("Bypass"); + //list.push_back("Bypass"); list.push_back("Transdetect"); list.push_back("Peaklock"); list.push_back("Equalizer"); @@ -156,7 +68,7 @@ { if (name == "Time") return tr("Time"); if (name == "Pitch") return tr("Pitch"); - if (name == "Bypass") return tr("Bypass Processing"); + //if (name == "Bypass") return tr("Bypass Processing"); if (name == "Transdetect") return tr("Transient Detection"); if (name == "Peaklock") return tr("Peak Locking"); if (name == "Equalizer") return tr("Equalizer"); @@ -167,7 +79,7 @@ { if (name == "Time") return RangeProperty; if (name == "Pitch") return RangeProperty; - if (name == "Bypass") return ToggleProperty; + //if (name == "Bypass") return ToggleProperty; if (name == "Transdetect") return ToggleProperty; if (name == "Peaklock") return ToggleProperty; if (name == "Equalizer") return PlotProperty; @@ -204,10 +116,10 @@ val = 0; } - if (name == "Bypass") { + /*if (name == "Bypass") { if (deflt) *deflt = 0; - val = (m_bypass ? 1 : 0); - } + val = (m_enabled ? 0 : 1); + }*/ if (name == "Transdetect") { if (deflt) *deflt = 0; @@ -248,7 +160,7 @@ if(value == 0){ hopfactor=1; } - if ((!m_bypass) && (isFilterEnabled())) + if (isEnabled()) emit playSpeedChanged(hopfactor); } else if (name == "Pitch") { @@ -261,19 +173,17 @@ if(value == 0){ m_interpfactor=1; } - } else if (name == "Bypass"){ + } /*else if (name == "Bypass"){ if (value > 0) { - m_bypass = true; - if (isFilterEnabled()) - emit playSpeedChanged(1); + m_enabled = false; } else { - m_bypass = false; - if (isFilterEnabled()) + m_enabled = true; + if (isEnabled()) emit playSpeedChanged(hopfactor); } - } else if (name == "Transdetect"){ + } */else if (name == "Transdetect"){ m_transcheck = (value > 0) ? true : false; } else if (name == "Peaklock"){ m_peakcheck = (value > 0) ? true : false; @@ -287,194 +197,26 @@ } -void TimeStretchFilter::putInput(float **input, size_t samples) -{ - int dd; - float sampdiff; - float difratio; - float interpsample; - - bool drum = 0; - float drumthresh = 65; - - int delta = m_hop; //the "current position" is shifted of m_hop - - if ( samples < ( (size_t) floor(m_framesize*(m_interpfactor + 1)) ) ) - return; - - int channel = getSourceChannelCount(); - - for (int i=0; i< ((int) samples); i++){ - if (channel > 1) - m_inputBuffer[i] = input[0][i];// + input[1][i]) /2; - else - m_inputBuffer[i] = input[0][i]; - } +void TimeStretchFilter::setFilterEnabled(bool b){ + m_enabled=b; - for (int i = 0; i< ((int) m_framesize); i++) - { - - //This block was specifically written to do resampling interpolation for crude pitch shifting - //if it's not being used the audioframe line after the else should be used which is also used in bypass mode - //At - - if (m_bypass == false) { - dd = floor(double(i*m_interpfactor)); - difratio = (double(i*m_interpfactor)) - floor(double(i*m_interpfactor)); - - // this block loads a frame as normal - sampdiff=m_inputBuffer[dd+delta+1]-m_inputBuffer[dd+delta]; - interpsample = (difratio*sampdiff)+m_inputBuffer[dd+delta]; - audioframe[i] = interpsample*window[i]; - - sampdiff=m_inputBuffer[dd+delta+1-m_hop]-m_inputBuffer[dd+delta-m_hop]; - interpsample = (difratio*sampdiff)+m_inputBuffer[dd+delta-m_hop]; - prev_audioframe[i] = interpsample*window[i]; - } - else { - audioframe[i] = m_inputBuffer[i+delta+1]*window[i]; - processedframe[i] = audioframe[i]*window[i]; - } - } - - FFTReal fft_object(m_framesize); - - if (m_bypass == false) - { - fft_object.do_fft(FFTframe,audioframe); - - cart2pol(FFTframe, c_mags, c_phase, m_framesize); - - //-------------------------------------------- - - fft_object.do_fft(FFTframe,prev_audioframe); - - cart2pol(FFTframe, p_mags, p_phase, m_framesize); - - drum = transient_detect(c_mags, c_mags, p_mags, p_mags, drumthresh, m_framesize); - - - if (m_transcheck) - { - - if (drum && m_transhold==0){ - cur2last(c_phase, c_synthphase, p_synthphase, m_framesize); - m_transhold=4; - } - else{ - if(m_peakcheck){ - rotatephases_peaklocked(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_interpfactor); - } - else{ - rotatephases(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_interpfactor); - } - } - } - else - { - if(m_peakcheck){ - rotatephases_peaklocked(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_interpfactor); - } - else{ - rotatephases(c_phase, p_phase, c_synthphase, p_synthphase, m_framesize, m_interpfactor); - } - } - - if(m_transhold != 0){ - m_transhold = m_transhold - 1; - } - - drum = 0; - - pol2cart(FFTframe, c_mags, c_synthphase, m_framesize); - - fft_object.do_ifft(FFTframe, processedframe); - fft_object.rescale(processedframe); //VIP######## I have edited this function to do rewindowing also###### - } - - for (int p = 0; p < ((int) m_framesize); p++){ - processedframe[p]=processedframe[p]*window[p]; - } - - for (int j = 0; j< ((int) m_framesize); j++) - { - //This block deals with the buffers for a 75% overlap scheme - - if (j < ((int) m_framesize)/4){ - outbuffer[j]=(processedframe[j]+holdbuffer1[j]+holdbuffer2[j]+holdbuffer3[j])*0.5; - holdbuffer1[j]=holdbuffer2[j+(m_framesize/4)]; - } - - if (j < ((int) m_framesize)/2){ - holdbuffer2[j]=holdbuffer3[j+(m_framesize/4)]; - } - - if (j < ((int) m_framesize)*0.75){ - holdbuffer3[j]=processedframe[j+(m_framesize/4)]; - } - } -} - -void TimeStretchFilter::getOutput(float **output, size_t samples) -{ - if (samples > m_framesize/4) - return; - - int channel = getSourceChannelCount(); - - for (int ch = 0; ch < channel; ++ch) - { - for (size_t i = 0; i < samples; ++i) { - output[ch][i] = outbuffer[i]; - } - } -} - -size_t TimeStretchFilter::getRequiredInputSamples(size_t outputSamplesNeeded) -{ - size_t need = (size_t) (floor(m_framesize*(m_interpfactor + 1))); - return need; -} - -size_t TimeStretchFilter::getRequiredSkipSamples() -{ - size_t skip = 1024; - - if (m_bypass == false && m_transhold==0) - { - skip = floor(m_hop*hopfactor); - currentposition += floor(m_hop*hopfactor); - } - else - { - skip = m_hop; - currentposition += m_hop; - } - return skip; -} - -void TimeStretchFilter::setFilterEnabled(bool b){ - filterEnabled=b; - - if (filterEnabled) - { - if (!m_bypass) - emit playSpeedChanged(hopfactor); - } + if (m_enabled) + emit playSpeedChanged(hopfactor); else emit playSpeedChanged(1); + + emit filterEnabled(m_enabled); } void TimeStretchFilter::setFilterEnabled(int b){ - filterEnabled=b; + m_enabled=b; - if (filterEnabled) - { - if (!m_bypass) - emit playSpeedChanged(hopfactor); - } + if (m_enabled) + emit playSpeedChanged(hopfactor); else emit playSpeedChanged(1); + + emit filterEnabled(m_enabled); }
--- a/sv/filter/TimeStretchFilter.h Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/filter/TimeStretchFilter.h Mon Feb 11 15:17:54 2008 +0000 @@ -19,9 +19,9 @@ #ifndef _TIME_STRETCH_FILTER_H_ #define _TIME_STRETCH_FILTER_H_ -#include "Filter.h" +#include "base/PropertyContainer.h" -class TimeStretchFilter : public Filter +class TimeStretchFilter : public PropertyContainer { Q_OBJECT @@ -29,6 +29,8 @@ TimeStretchFilter(); virtual ~TimeStretchFilter(); + virtual QString getPropertyContainerIconName() const {return "";} + virtual QString getPropertyContainerName() const {return "Time and Pitch filter";} virtual PropertyList getProperties() const; @@ -41,16 +43,16 @@ virtual void setProperty(const PropertyName &, int value); - virtual void putInput(float **input, size_t samples); - virtual void getOutput(float **output, size_t samples); + inline float getPitchFactor() {return m_interpfactor;} + inline float getMaxPitchFactor() {return m_pmaxfactor;} - virtual size_t getRequiredInputSamples(size_t outputSamplesNeeded); - size_t getRequiredSkipSamples(); - - virtual bool allowMultiple(){return false;} + inline bool bypass() {return !m_enabled;} + inline bool transcheck() {return m_transcheck;} + inline bool peakcheck() {return m_peakcheck;} signals: void playSpeedChanged(float); + void filterEnabled(bool); public slots : void setFilterEnabled(bool b); @@ -58,36 +60,13 @@ protected: - bool m_bypass; bool m_transcheck; bool m_peakcheck; float m_tmaxfactor; float m_pmaxfactor; - - size_t m_framesize; - int m_hop; - - int m_transhold; - - float *m_inputBuffer; float m_interpfactor; - - float *audioframe; - float *prev_audioframe; - float *window; - float *processedframe; - float *outbuffer; - float *holdbuffer3; - float *holdbuffer2; - float *holdbuffer1; - - float *c_phase; ///CURRENT FRAME phases - float *p_phase; ///PREVIOUS FRAME phases - float *c_synthphase; - float *p_synthphase; - float *synthframe; };
--- a/sv/main/MainWindow.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/main/MainWindow.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -2927,8 +2927,8 @@ connect(m_document, SIGNAL(modelRegenerationFailed(QString, QString)), this, SLOT(modelRegenerationFailed(QString, QString))); - connect(m_document, SIGNAL(newFilterAdded(Filter *)), - m_filterPropertyStack, SLOT(filterAdded(Filter *))); + connect(m_document, SIGNAL(newFilterAdded(PropertyContainer *)), + m_filterPropertyStack, SLOT(filterAdded(PropertyContainer *))); connect(m_document, SIGNAL(filterRemoved(QString)), m_filterPropertyStack, SLOT(filterRemoved(QString)));
--- a/sv/sound_access.vcproj Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/sound_access.vcproj Mon Feb 11 15:17:54 2008 +0000 @@ -349,6 +349,10 @@ > </File> <File + RelativePath=".\filter\EqualizerFilter.cpp" + > + </File> + <File RelativePath=".\document\ESFileReader.cpp" > </File> @@ -377,6 +381,10 @@ > </File> <File + RelativePath=".\filter\MultiRealTimeFilter.cpp" + > + </File> + <File RelativePath="osc\OSCMessage.cpp" > </File> @@ -793,6 +801,43 @@ </FileConfiguration> </File> <File + RelativePath=".\filter\EqualizerFilter.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> + <FileConfiguration + Name="Static_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_NO_DEBUG -DQT_STATIC -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> + </File> + <File RelativePath="transform\FeatureExtractionPluginTransform.h" > <FileConfiguration @@ -941,6 +986,43 @@ </FileConfiguration> </File> <File + RelativePath=".\filter\MultiRealTimeFilter.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> + <FileConfiguration + Name="Static_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_NO_DEBUG -DQT_STATIC -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> + </File> + <File RelativePath="osc\OSCQueue.h" > <FileConfiguration @@ -1127,6 +1209,10 @@ > </File> <File + RelativePath=".\tmp_moc\moc_EqualizerFilter.cpp" + > + </File> + <File RelativePath="tmp_moc\moc_FeatureExtractionPluginTransform.cpp" > </File> @@ -1143,6 +1229,10 @@ > </File> <File + RelativePath=".\tmp_moc\moc_MultiRealTimeFilter.cpp" + > + </File> + <File RelativePath="tmp_moc\moc_OSCQueue.cpp" > </File>
--- a/sv/sv.pro Mon Feb 11 10:08:48 2008 +0000 +++ b/sv/sv.pro Mon Feb 11 15:17:54 2008 +0000 @@ -56,7 +56,9 @@ filter/Filter.h \ filter/FilterStack.h \ filter/RealTimeFilterFactory.h \ - filter/TimeStretchFilter.h + filter/TimeStretchFilter.h \ + filter/MultiRealTimeFilter.h \ + filter/EqualizerFilter.h SOURCES += audioio/AudioCallbackPlaySource.cpp \ audioio/AudioCallbackPlayTarget.cpp \ audioio/AudioCoreAudioTarget.cpp \ @@ -85,7 +87,9 @@ filter/Filter.cpp \ filter/FilterStack.cpp \ filter/RealTimeFilterFactory.cpp \ - filter/TimeStretchFilter.cpp + filter/TimeStretchFilter.cpp \ + filter/MultiRealTimeFilter.cpp \ + filter/EqualizerFilter.cpp RESOURCES += sound-access.qrc
--- a/widgets/ItemAudioFilterList.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/widgets/ItemAudioFilterList.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -89,7 +89,7 @@ void ItemAudioFilterList::setPropertyBox(PropertyBox *box){ m_propertyBox = box; if(m_propertyBox!=0){ - m_container = (Filter *) m_propertyBox->container(); + m_container = m_propertyBox->container(); updateCheckboxs(); connect(m_propertyBox, SIGNAL(showLayer(bool)), this, SLOT(showLayer(bool))); connect(m_checkBoxPlay, SIGNAL(stateChanged(int)),m_container, SLOT(setFilterEnabled(int))); @@ -111,7 +111,7 @@ void ItemAudioFilterList::updateCheckboxs(){ - m_checkBoxPlay->setChecked(m_container->isFilterEnabled()); + //m_checkBoxPlay->setChecked(m_container->isFilterEnabled()); }
--- a/widgets/ItemAudioFilterList.h Mon Feb 11 10:08:48 2008 +0000 +++ b/widgets/ItemAudioFilterList.h Mon Feb 11 15:17:54 2008 +0000 @@ -46,7 +46,7 @@ QCheckBox *m_checkBoxPlay; QHBoxLayout *m_layoutMain; PropertyBox *m_propertyBox; - Filter *m_container; + PropertyContainer *m_container; private slots : void openPropertyBox();
--- a/widgets/RealTimeFilterPropertyStack.cpp Mon Feb 11 10:08:48 2008 +0000 +++ b/widgets/RealTimeFilterPropertyStack.cpp Mon Feb 11 15:17:54 2008 +0000 @@ -20,7 +20,7 @@ RealTimeFilterPropertyStack::~RealTimeFilterPropertyStack() {} -void RealTimeFilterPropertyStack::filterAdded(Filter * filter) +void RealTimeFilterPropertyStack::filterAdded(PropertyContainer * filter) { PropertyBox *box = new PropertyBox(filter);