# HG changeset patch
# User lbajardsilogic
# Date 1182266112 0
# Node ID afcf540ae3a2188d11485ee17f96bc253be4693d
# Parent d99441818cd99af04a51e6e1be6bbe26495056e7
add the real time filter stack to manage real time filters and their attributes
diff -r d99441818cd9 -r afcf540ae3a2 data/svdata.vcproj
--- a/data/svdata.vcproj Wed Jun 13 15:49:23 2007 +0000
+++ b/data/svdata.vcproj Tue Jun 19 15:15:12 2007 +0000
@@ -736,7 +736,7 @@
diff -r d99441818cd9 -r afcf540ae3a2 plugin/LADSPAPluginFactory.cpp
--- a/plugin/LADSPAPluginFactory.cpp Wed Jun 13 15:49:23 2007 +0000
+++ b/plugin/LADSPAPluginFactory.cpp Tue Jun 19 15:15:12 2007 +0000
@@ -645,7 +645,7 @@
i != pathList.end(); ++i) {
QDir pluginDir(*i, PLUGIN_GLOB);
-
+
for (unsigned int j = 0; j < pluginDir.count(); ++j) {
discoverPlugins(QString("%1/%2").arg(*i).arg(pluginDir[j]));
}
diff -r d99441818cd9 -r afcf540ae3a2 sv/audioio/AudioCallbackPlaySource.cpp
--- a/sv/audioio/AudioCallbackPlaySource.cpp Wed Jun 13 15:49:23 2007 +0000
+++ b/sv/audioio/AudioCallbackPlaySource.cpp Tue Jun 19 15:15:12 2007 +0000
@@ -59,7 +59,8 @@
m_fillThread(0),
m_converter(0),
m_crapConverter(0),
- m_resampleQuality(Preferences::getInstance()->getResampleQuality())
+ m_resampleQuality(Preferences::getInstance()->getResampleQuality()),
+ m_filterStack(0)
{
m_viewManager->setAudioPlaySource(this);
@@ -827,6 +828,8 @@
applyAuditioningEffect(count, buffer);
+ applyRealTimeFilters(count, buffer);
+
m_condition.wakeAll();
return got;
}
@@ -918,6 +921,8 @@
applyAuditioningEffect(count, buffer);
+ applyRealTimeFilters(count, buffer);
+
m_condition.wakeAll();
return count;
@@ -1463,3 +1468,11 @@
s.m_mutex.unlock();
}
+void AudioCallbackPlaySource::applyRealTimeFilters(size_t count, float **buffers)
+{
+ if (!m_filterStack) return;
+
+ m_filterStack->putInput(buffers, count);
+ m_filterStack->getOutput(buffers, count);
+
+}
\ No newline at end of file
diff -r d99441818cd9 -r afcf540ae3a2 sv/audioio/AudioCallbackPlaySource.h
--- a/sv/audioio/AudioCallbackPlaySource.h Wed Jun 13 15:49:23 2007 +0000
+++ b/sv/audioio/AudioCallbackPlaySource.h Tue Jun 19 15:15:12 2007 +0000
@@ -20,6 +20,7 @@
#include "base/AudioPlaySource.h"
#include "base/PropertyContainer.h"
#include "base/Scavenger.h"
+#include "FilterStack.h"
#include
#include
@@ -215,6 +216,8 @@
*/
void setAuditioningPlugin(RealTimePluginInstance *plugin);
+ void setRealTimeFilterStack(FilterStack *filterStack){ m_filterStack = filterStack;}
+
signals:
void modelReplaced();
@@ -305,6 +308,8 @@
// Called from getSourceSamples.
void applyAuditioningEffect(size_t count, float **buffers);
+ void applyRealTimeFilters(size_t count, float **buffers);
+
class FillThread : public Thread
{
public:
@@ -325,6 +330,8 @@
SRC_STATE *m_crapConverter; // for use when playing very fast
int m_resampleQuality;
void initialiseConverter();
+
+ FilterStack *m_filterStack;
};
#endif
diff -r d99441818cd9 -r afcf540ae3a2 sv/document/Document.cpp
--- a/sv/document/Document.cpp Wed Jun 13 15:49:23 2007 +0000
+++ b/sv/document/Document.cpp Tue Jun 19 15:15:12 2007 +0000
@@ -35,6 +35,14 @@
m_mainModel(0),
m_audioSourceInfoModel(0)
{
+ m_filterStack = new FilterStack();
+
+ connect(m_filterStack, SIGNAL(filterRemoved(QString)),
+ this, SIGNAL(filterRemoved(QString)));
+
+ connect(m_filterStack, SIGNAL(newFilterAdded(Filter *)),
+ this, SIGNAL(newFilterAdded(Filter *)));
+
connect(this, SIGNAL(modelAboutToBeDeleted(Model *)),
TransformFactory::getInstance(),
SLOT(modelAboutToBeDeleted(Model *)));
@@ -84,6 +92,7 @@
emit mainModelChanged(0);
delete m_mainModel;
+ delete m_filterStack;
}
Layer *
@@ -896,3 +905,29 @@
return s;
}
+
+
+Filter * Document::createFilter(RealTimeFilterFactory::FilterType type)
+{
+ Filter *newFilter = RealTimeFilterFactory::getInstance()->createFilter(type);
+ if (!newFilter) return 0;
+
+ newFilter->setObjectName(m_filterStack->getUniqueFilterName(newFilter->objectName()));
+
+ m_filterStack->addFilter(newFilter);
+
+ return newFilter;
+}
+
+void Document::removeFilter(QString &name)
+{
+ if (name == "")
+ return;
+
+ m_filterStack->removeFilter(name);
+}
+
+void Document::removeAllFilters()
+{
+ m_filterStack->removeAllFilters();
+}
\ No newline at end of file
diff -r d99441818cd9 -r afcf540ae3a2 sv/document/Document.h
--- a/sv/document/Document.h Wed Jun 13 15:49:23 2007 +0000
+++ b/sv/document/Document.h Tue Jun 19 15:15:12 2007 +0000
@@ -21,6 +21,8 @@
#include "transform/PluginTransform.h"
#include "base/Command.h"
#include "data/model/AudioSourceInfoModel.h"
+#include "filter/RealTimeFilterFactory.h"
+#include "filter/FilterStack.h"
#include