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

Refactoring

parents b634789d 4d282051
......@@ -310,8 +310,8 @@ CVACoreImpl::CVACoreImpl( const CVAStruct& oArgs )
m_pInputAmp( nullptr ),
m_pR2RPatchbay( nullptr ),
m_pOutputPatchbay( nullptr ),
m_pInputPeakDetector( nullptr ),
m_pOutputPeakDetector( nullptr ),
m_pInputStreamDetector( nullptr ),
m_pOutputStreamDetector( nullptr ),
m_pOutputTracker( nullptr ),
m_pStreamProbeDeviceInput( nullptr ),
m_pStreamProbeFinal( nullptr ),
......@@ -481,8 +481,8 @@ void CVACoreImpl::Initialize() {
if( pInputTail )
{
m_pInputAmp = new ITAStreamAmplifier( pInputTail, ( float ) m_dInputGain );
m_pInputPeakDetector = new ITAStreamDetector( m_pInputAmp );
pInputTail = m_pInputPeakDetector;
m_pInputStreamDetector = new ITAStreamDetector( m_pInputAmp );
pInputTail = m_pInputStreamDetector;
if( m_oCoreConfig.bRecordDeviceInputEnabled )
{
......@@ -554,10 +554,11 @@ void CVACoreImpl::Initialize() {
*/
// Create output peak detector that uses patch bay output stream
m_pOutputPeakDetector = new ITAStreamDetector( m_pOutputPatchbay->GetOutputDatasource( iPhysicalHardwareOutput ) );
m_pOutputStreamDetector = new ITAStreamDetector( m_pOutputPatchbay->GetOutputDatasource( iPhysicalHardwareOutput ) );
// Setup output dump (if set)
ITADatasource* pOutputTail = m_pOutputPeakDetector;
ITADatasource* pOutputTail = m_pOutputStreamDetector;
if( m_oCoreConfig.bRecordDeviceOutputEnabled )
{
m_pStreamProbeFinal = new ITAStreamProbe( pOutputTail, m_oCoreConfig.sRecordFinalOutputFilePath );
......@@ -709,8 +710,8 @@ void CVACoreImpl::Tidyup() {
delete m_pInputAmp;
m_pInputAmp = nullptr;
delete m_pInputPeakDetector;
m_pInputPeakDetector = nullptr;
delete m_pInputStreamDetector;
m_pInputStreamDetector = nullptr;
delete m_pR2RPatchbay;
m_pR2RPatchbay = nullptr;
......@@ -718,8 +719,8 @@ void CVACoreImpl::Tidyup() {
delete m_pOutputPatchbay;
m_pOutputPatchbay = nullptr;
delete m_pOutputPeakDetector;
m_pOutputPeakDetector = nullptr;
delete m_pOutputStreamDetector;
m_pOutputStreamDetector = nullptr;
delete m_pOutputTracker;
m_pOutputTracker = nullptr;
......@@ -816,8 +817,8 @@ void CVACoreImpl::Finalize()
delete m_pInputAmp;
m_pInputAmp = nullptr;
delete m_pInputPeakDetector;
m_pInputPeakDetector = nullptr;
delete m_pInputStreamDetector;
m_pInputStreamDetector = nullptr;
m_voReproductionModules.clear();
......@@ -827,8 +828,8 @@ void CVACoreImpl::Finalize()
delete m_pOutputPatchbay;
m_pOutputPatchbay = nullptr;
delete m_pOutputPeakDetector;
m_pOutputPeakDetector = nullptr;
delete m_pOutputStreamDetector;
m_pOutputStreamDetector = nullptr;
delete m_pOutputTracker;
m_pOutputTracker = nullptr;
......@@ -3783,7 +3784,8 @@ void CVACoreImpl::SetOutputGain( double dGain ) {
} VA_RETHROW;
}
bool CVACoreImpl::IsOutputMuted() const {
bool CVACoreImpl::IsOutputMuted() const
{
VA_NO_REENTRANCE;
VA_CHECK_INITIALIZED;
......@@ -3793,7 +3795,8 @@ bool CVACoreImpl::IsOutputMuted() const {
return false;
}
void CVACoreImpl::SetOutputMuted( bool bMuted ) {
void CVACoreImpl::SetOutputMuted( bool bMuted )
{
VA_NO_REENTRANCE;
VA_CHECK_INITIALIZED;
......@@ -3814,22 +3817,26 @@ void CVACoreImpl::SetOutputMuted( bool bMuted ) {
} VA_RETHROW;
}
int CVACoreImpl::GetGlobalAuralizationMode() const {
int CVACoreImpl::GetGlobalAuralizationMode() const
{
VA_NO_REENTRANCE;
VA_CHECK_INITIALIZED;
return m_iGlobalAuralizationMode;
}
void CVACoreImpl::SetGlobalAuralizationMode( int iAuralizationMode ) {
void CVACoreImpl::SetGlobalAuralizationMode( int iAuralizationMode )
{
VA_NO_REENTRANCE;
VA_CHECK_INITIALIZED;
VA_TRY{
VA_TRY
{
if( !IsValidAuralizationMode( iAuralizationMode ) )
VA_EXCEPT2( INVALID_PARAMETER, "Invalid auralization mode" );
if( m_iGlobalAuralizationMode == iAuralizationMode ) {
if( m_iGlobalAuralizationMode == iAuralizationMode )
{
return;
}
......@@ -3847,7 +3854,8 @@ void CVACoreImpl::SetGlobalAuralizationMode( int iAuralizationMode ) {
VA_VERBOSE( "Core", "Set global auralization mode = " << IVACore::GetAuralizationModeStr( iAuralizationMode, true ) );
} VA_RETHROW;
}
VA_RETHROW;
}
int CVACoreImpl::GetActiveListener() const
......@@ -4561,16 +4569,16 @@ void CVACoreImpl::SendAudioDeviceDetectorUpdateEvent()
ev.iEventType = CVACoreEvent::VA_COREEVENT_MEASURES_UPDATE;
ev.pSender = this;
if( m_pInputPeakDetector )
if( m_pInputStreamDetector )
{
ev.vfInputPeaks.resize( m_oCoreConfig.oAudioDriverConfig.iInputChannels );
m_pInputPeakDetector->GetPeaks( ev.vfInputPeaks, true );
m_pInputStreamDetector->GetPeaks( ev.vfInputPeaks, true );
}
if( m_pOutputPeakDetector )
if( m_pOutputStreamDetector )
{
ev.vfOutputPeaks.resize( m_oCoreConfig.oAudioDriverConfig.iOutputChannels );
m_pOutputPeakDetector->GetPeaks( ev.vfOutputPeaks, true );
m_pOutputStreamDetector->GetPeaks( ev.vfOutputPeaks, true );
}
ev.fSysLoad = 0;
......
......@@ -337,8 +337,10 @@ private:
ITAStreamAmplifier* m_pInputAmp;
ITAStreamPatchbay* m_pR2RPatchbay; //!< Patchbay linking audio renderers to audio reproduction modules
ITAStreamPatchbay* m_pOutputPatchbay; //!< Patchbay linking audio reproduction modules to hardware outputs
ITAStreamDetector* m_pInputPeakDetector;
ITAStreamDetector* m_pOutputPeakDetector;
ITAStreamDetector* m_pInputStreamDetector;
ITAStreamDetector* m_pOutputStreamDetector;
CVAAudiostreamTracker* m_pOutputTracker;
// --= Signal sources and sounds =----------------------------------
......
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