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

(none)
author benoitrigolleau
date Fri, 31 Oct 2008 11:00:24 +0000
parents 2aea571dc9d4
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 2008. 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 <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