Better info and error messages

parent b876d14f
......@@ -41,7 +41,7 @@ void CVACoreImpl::SetInputMuted( const bool bMuted )
m_pInputAmp->SetGain( ( float ) m_dInputGain );
}
VA_INFO( "Core", "Input mute toggled" );
VA_INFO( "Core", "Input mute toggled, now " << ( m_bInputMuted ? "muted" : "not muted" ) );
CVAEvent ev;
ev.iEventType = CVAEvent::INPUT_MUTING_CHANGED;
......@@ -90,7 +90,7 @@ void CVACoreImpl::SetInputGain( double dGain )
ev.dVolume = dGain;
m_pEventManager->BroadcastEvent( ev );
VA_VERBOSE( "Core", "Set input gain = " << IVAInterface::GetVolumeStrDecibel( dGain ) );
VA_VERBOSE( "Core", "New input gain: " << IVAInterface::GetVolumeStrDecibel( dGain ) << "dB" );
}
VA_RETHROW;
}
......@@ -131,7 +131,7 @@ void CVACoreImpl::SetOutputGain( const double dGain )
ev.dVolume = dGain;
m_pEventManager->BroadcastEvent( ev );
VA_VERBOSE( "Core", "Set output gain = " << IVAInterface::GetVolumeStrDecibel( dGain ) );
VA_VERBOSE( "Core", "New output gain: " << IVAInterface::GetVolumeStrDecibel( dGain ) << "dB" );
}
VA_RETHROW;
......@@ -155,7 +155,7 @@ void CVACoreImpl::SetOutputMuted( const bool bMuted )
if( m_bOutputMuted == bMuted )
return;
m_bOutputMuted = bMuted;
VA_INFO( "Core", "Output mute toggled" );
VA_INFO( "Core", "Output mute toggled, now " << ( m_bOutputMuted ? "muted" : "not muted" ) );
if( m_pOutputPatchbay )
m_pOutputPatchbay->SetOutputMuted( 0, bMuted );
......@@ -205,7 +205,7 @@ void CVACoreImpl::SetGlobalAuralizationMode( const int iAuralizationMode )
ev.iAuralizationMode = iAuralizationMode;
m_pEventManager->BroadcastEvent( ev );
VA_VERBOSE( "Core", "Set global auralization mode = " << IVAInterface::GetAuralizationModeStr( iAuralizationMode, true ) );
VA_INFO( "Core", "Global auralization mode has been updated, now " << IVAInterface::GetAuralizationModeStr( iAuralizationMode, true ) );
}
VA_RETHROW;
}
......@@ -55,7 +55,7 @@ bool CVACoreImpl::DeleteDirectivity( const int iDirID )
ev.iObjectID = iDirID;
m_pEventManager->BroadcastEvent( ev );
VA_INFO( "Core", "FreeDirectivity successful, freed directivity " << iDirID );
VA_INFO( "Core", "Released directivity " << iDirID );
return bSuccess;
......
......@@ -30,7 +30,11 @@ std::string CVACoreImpl::CreateSignalSourceBufferFromParameters( const CVAStruct
const std::string sFilePath = oParams[ "filepath" ];
const std::string sDestFilePath = FindFilePath( sFilePath );
if( sDestFilePath.empty() )
VA_EXCEPT2( INVALID_PARAMETER, "Looked everywhere, but could not find file '" + sFilePath + "'" );
{
std::string sErrorMessage = "Looked everywhere, but could not find file '" + sFilePath + "'";
VA_ERROR( "core", sErrorMessage );
VA_EXCEPT2( INVALID_PARAMETER, sErrorMessage );
}
std::string sID = m_pSignalSourceManager->CreateAudiofileSignalSource( sDestFilePath, sName );
assert( !sID.empty() );
......@@ -41,13 +45,15 @@ std::string CVACoreImpl::CreateSignalSourceBufferFromParameters( const CVAStruct
ev.sObjectID = sID;
m_pEventManager->BroadcastEvent( ev );
VA_INFO( "Core", "Created audiofile signal source (ID=" << sID << ", Name=\"" << sName << "\", Filename=\"" << sDestFilePath << "\")" );
VA_INFO( "Core", "Created signal source buffer from audiofile (ID=" << sID << ", Name=\"" << sName << "\", Filename=\"" << sDestFilePath << "\")" );
return sID;
}
else
{
VA_EXCEPT2( INVALID_PARAMETER, "Could not interpret parameter arguments to create a buffer signal source" );
auto sErrorMessage = "Could not interpret parameter arguments to create a buffer signal source";
VA_ERROR( "core", sErrorMessage );
VA_EXCEPT2( INVALID_PARAMETER, sErrorMessage );
}
}
VA_RETHROW;
......@@ -156,6 +162,15 @@ std::string CVACoreImpl::CreateSignalSourceMachine( const CVAStruct&, const std:
VA_TRY
{
std::string sID = m_pSignalSourceManager->CreateMachineSignalSource( sName );
CVAEvent ev;
ev.iEventType = CVAEvent::SIGNALSOURCE_CREATED;
ev.pSender = this;
ev.sObjectID = sID;
m_pEventManager->BroadcastEvent( ev );
VA_INFO( "Core", "Created machine signal source (ID=" << sID << ", Name=\"" << sName << "\")" );
return sID;
}
VA_RETHROW;
......@@ -326,7 +341,9 @@ void CVACoreImpl::SetSignalSourceBufferPlaybackAction( const std::string& sSigna
VA_TRY
{
if( !GetSignalSourceBufferPlaybackActionValid( iPlaybackAction ) )
VA_EXCEPT2( INVALID_PARAMETER, "Invalid playback action" );
{
VA_EXCEPT2( INVALID_PARAMETER, "Invalid playback action" );
}
IVAAudioSignalSource* pSource = m_pSignalSourceManager->RequestSignalSource( sSignalSourceID );
......
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