VAJetEngineSignalSource.h 1.39 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
#ifndef IW_VA_JET_ENGINE_SIGNAL_SOURCE
#define IW_VA_JET_ENGINE_SIGNAL_SOURCE

// STL includes
#include <string>

// VA includes
#include <VAAudioSignalSource.h>
#include <ITADatasourceDelegator.h>
#include <ITASampleBuffer.h>

class CVACoreImpl;

/**
  * Jet engine signal source based on the
  * pure data patch by Andy Farnell / Designing Sound.
  */
class CVAJetEngineSignalSource : public IVAAudioSignalSource
{
public:
	class Config
	{
	public:
		std::map< double, double > lFreqModesSpectrum; //!< Mode spectrum [Hz], Amplitude
		CVACoreImpl* pCore;
	};

	CVAJetEngineSignalSource( const Config& );
	virtual ~CVAJetEngineSignalSource();

	// IVAAudioSignalSource interface
	int GetType() const { return VA_SS_JETENGINE; };
	std::string GetTypeString() const { return "jetengine"; };
	std::string GetDesc() const { return "Jet engine (turbine & burn) signal source"; };
	std::string GetStateString() const { return "running"; };
	IVAInterface* GetAssociatedCore() const { return m_pAssociatedCore; };
	std::vector< const float* > GetStreamBlock( const CVAAudiostreamState* pStreamInfo );
	CVAStruct GetParameters( const CVAStruct & ) const;
	void SetParameters( const CVAStruct& oIn );

private:
	IVAInterface* m_pAssociatedCore;
	ITASampleBuffer m_sbBuffer;

	void HandleRegistration( IVAInterface* pParentCore );
	void HandleUnregistration( IVAInterface* pParentCore );
};

#endif // IW_VA_JET_ENGINE_SIGNAL_SOURCE