view sv/filter/Filter.h @ 282:d9319859a4cf tip

(none)
author benoitrigolleau
date Fri, 31 Oct 2008 11:00:24 +0000
parents 3200ed3fc957
children
line wrap: on
line source
/* -*- 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. 
	
	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 _FILTER_H_
#define _FILTER_H_

#include <QXmlAttributes>

#include "base/PropertyContainer.h"

class Filter : public QObject //: public PropertyContainer
{
	Q_OBJECT

public:
	Filter();
	virtual ~Filter();

	//virtual QString getPropertyLabel(const PropertyName &) const {return "";}
	//virtual QString getPropertyContainerName() const {return "";}
    //virtual QString getPropertyContainerIconName() const {return "";}


	/**
     * Put (and possibly process) a given number of input samples.
     * Number should usually equal the value returned from
     * getRequiredInputSamples().
     */
    virtual void putInput(float **input, size_t samples) = 0;

	/**
     * Get some processed samples.
     */
    virtual void getOutput(float **output, size_t samples) = 0;

	virtual size_t getRequiredInputSamples(size_t outputSamplesNeeded) = 0;

	inline void setSourceChannelCount(size_t channel){m_sourceChannelCount = channel;}
	inline size_t getSourceChannelCount(){return m_sourceChannelCount;}
	bool isFilterEnabled() const;

	/*allow or not to add another filter of this type*/
	virtual bool allowMultiple() = 0;

	QString toEasaierXmlString(QString indent, QString extraAttributes) const;

	void setProperties(const QXmlAttributes &attributes);

	std::vector<PropertyContainer*> getFilterCollection(){ return m_filterCollection;}

signals :
	void filterEnableChange(bool);
	void propertyContainerRemoved(QString);

	void propertiesChanged(PropertyContainer *);

protected:

	size_t		m_sourceChannelCount; 
	bool filterEnabled;

public slots :
	void setFilterEnabled(bool b);
	void setFilterEnabled(int b);

protected:
	std::vector<PropertyContainer*> m_filterCollection;
};

#endif