Commit d3360879 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Adding jet engine signal source class, nothing implemented yet. also needs...

Adding jet engine signal source class, nothing implemented yet. also needs interface modification :(
parent d4f40a55
......@@ -25,6 +25,7 @@
#include "VAEngineSignalSource.h"
#include "VAMachineSignalSource.h"
#include "VATextToSpeechSignalSource.h"
#include "VAJetEngineSignalSource.h"
#include <ITAException.h>
#include <ITAStringUtils.h>
......@@ -285,6 +286,15 @@ std::string CVAAudioSignalSourceManager::CreateMachineSignalSource( const std::s
return RegisterSignalSource( pSource, sName, true, true );
}
std::string CVAAudioSignalSourceManager::CreateJetEngineSignalSource( const std::string& sName, const CVAStruct& oParams )
{
CVAJetEngineSignalSource::Config oMSSConfig;
oMSSConfig.pCore= m_pParentCore;
auto pSource = new CVAJetEngineSignalSource( oMSSConfig );
return RegisterSignalSource( pSource, sName, true, true );
}
void CVAAudioSignalSourceManager::DeleteSignalSource( const std::string& sID )
{
m_csSignalSourceAccess.enter();
......
......@@ -103,6 +103,8 @@ public:
std::string CreateMachineSignalSource( const std::string& sName );
std::string CreateJetEngineSignalSource( const std::string& sName, const CVAStruct& oParams );
//! Erwirkt das Lschen eine Audiosignalquelle (d.h. gibt diese frei)
/**
* Wichtig: Nur dynamische, gemanagete Quellen knnen gelscht werden
......
#include "VAJetEngineSignalSource.h"
// VA includes
#include <VACore.h>
#include "../VAAudiostreamTracker.h"
// STL includes
CVAJetEngineSignalSource::CVAJetEngineSignalSource( const Config& oConf )
: m_pAssociatedCore(nullptr)
{
}
CVAJetEngineSignalSource::~CVAJetEngineSignalSource()
{
}
void CVAJetEngineSignalSource::HandleRegistration( IVAInterface* pParentCore )
{
m_pAssociatedCore = pParentCore;
}
void CVAJetEngineSignalSource::HandleUnregistration( IVAInterface* pParentCore )
{
m_pAssociatedCore = nullptr;
}
std::vector< const float* > CVAJetEngineSignalSource::GetStreamBlock( const CVAAudiostreamState* pStreamInfo )
{
m_sbBuffer.Zero();
std::vector< const float* > vpfBuffer = { m_sbBuffer.GetData() };
return vpfBuffer;
}
CVAStruct CVAJetEngineSignalSource::GetParameters( const CVAStruct & ) const
{
return CVAStruct();
}
void CVAJetEngineSignalSource::SetParameters( const CVAStruct& oIn )
{
}
#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
......@@ -12,6 +12,8 @@ set( DirFiles
VADeviceInputSignalSource.h
VAEngineSignalSource.cpp
VAEngineSignalSource.h
VAJetEngineSignalSource.cpp
VAJetEngineSignalSource.h
VAMachineSignalSource.cpp
VAMachineSignalSource.h
VANetstreamSignalSource.cpp
......
......@@ -280,6 +280,7 @@ public:
std::string CreateSignalSourceNetworkStream( const std::string& sInterface, const int iPort, const std::string& sName = "" );
std::string CreateSignalSourceEngine( const CVAStruct& oParams, const std::string& sName = "" );
std::string CreateSignalSourceMachine( const CVAStruct& oParams, const std::string& sName = "" );
std::string CreateSignalSourceJetEngine( const CVAStruct& oParams, const std::string& sName = "" );
bool DeleteSignalSource( const std::string& sID );
std::string RegisterSignalSource( IVAAudioSignalSource* pSignalSource, const std::string& sName = "" );
bool UnregisterSignalSource( IVAAudioSignalSource* pSignalSource );
......
......@@ -177,6 +177,30 @@ std::string CVACoreImpl::CreateSignalSourceMachine( const CVAStruct&, const std:
}
std::string CVACoreImpl::CreateSignalSourceJetEngine( const CVAStruct& oParams, const std::string& sName/*="" */ )
{
VA_NO_REENTRANCE;
VA_CHECK_INITIALIZED;
VA_TRY
{
std::string sID = m_pSignalSourceManager->CreateJetEngineSignalSource( sName, oParams );
CVAEvent ev;
ev.iEventType = CVAEvent::SIGNALSOURCE_CREATED;
ev.pSender = this;
ev.sObjectID = sID;
m_pEventManager->BroadcastEvent( ev );
VA_INFO( "Core", "Created jet engine signal source (ID=" << sID << ", Name=\"" << sName << "\")" );
return sID;
}
VA_RETHROW;
}
bool CVACoreImpl::DeleteSignalSource( const std::string& sID )
{
VA_NO_REENTRANCE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment