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

Adding sound receiver info getter

parent 60de1d50
......@@ -622,6 +622,13 @@ public:
return m_pProtocol->ClientDeleteSoundReceiver( iSoundReceiverID );
};
inline CVASoundReceiverInfo GetSoundReceiverInfo( const int iID ) const
{
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientGetSoundReceiverInfo( iID );
};
inline void SetSoundReceiverEnabled( const int iSoundReceiverID, const bool bEnabled = true )
{
VA_REQUIRE_CONNECTED;
......
......@@ -824,16 +824,6 @@ void CVANetMessage::WriteSoundSourceInfo( const CVASoundSourceInfo& oInfo )
void CVANetMessage::WriteSoundReceiverInfo( const CVASoundReceiverInfo& oInfo )
{
VAVec3 v3RealWorldPos; //!< Position vector of location between ears [m] in real world (from tracking)
VAVec3 v3RealWorldView; //!< Orientation of ears/eyes (view and up vectors in OpenGL convention) in real world (from tracking)
VAVec3 vRealWorldUp; //!< Orientation of ears/eyes (view and up vectors in OpenGL convention) in real world (from tracking)
VAQuat qRealWorldOrient; //!< Orientation of ears/eyes (quaternion) in real world (from tracking)
VAVec3 v3RealWorldHeadAboveTorsoOrientation; //!< Orientation of head above torso in real world (from tracking)
CVAStruct oParams; //!< Special parameters
WriteInt( oInfo.iID );
WriteString( oInfo.sName );
WriteInt( oInfo.iDirectivityID );
......@@ -844,8 +834,12 @@ void CVANetMessage::WriteSoundReceiverInfo( const CVASoundReceiverInfo& oInfo )
WriteVec3( oInfo.v3View );
WriteVec3( oInfo.v3Up );
WriteQuat( oInfo.qOrient );
WriteVec3( oInfo.v3HeadAboveTorsoOrientation );
WriteQuat( oInfo.qHeadAboveTorsoOrientation );
WriteVec3( oInfo.v3RealWorldPos );
WriteVec3( oInfo.v3RealWorldView );
WriteVec3( oInfo.v3RealWorldUp );
WriteQuat( oInfo.qRealWorldOrient );
WriteQuat( oInfo.qRealWorldHeadAboveTorsoOrientation );
WriteVAStruct( oInfo.oParams );
}
......@@ -923,6 +917,29 @@ CVAAudioReproductionInfo CVANetMessage::ReadAudioReproductionModuleInfo()
return oRepro;
}
CVASoundReceiverInfo CVANetMessage::ReadSoundReceiverInfo()
{
CVASoundReceiverInfo oInfo;
oInfo.iID = ReadInt();
oInfo.sName = ReadString();
oInfo.iDirectivityID = ReadInt();
oInfo.iAuraMode = ReadInt();
oInfo.dSensivitity = ReadDouble();
oInfo.bEnabled = ReadBool();
oInfo.v3Pos = ReadVec3();
oInfo.v3View = ReadVec3();
oInfo.v3Up = ReadVec3();
oInfo.qOrient = ReadQuat();
oInfo.qHeadAboveTorsoOrientation = ReadQuat();
oInfo.v3RealWorldPos = ReadVec3();
oInfo.v3RealWorldView = ReadVec3();
oInfo.v3RealWorldUp = ReadVec3();
oInfo.qRealWorldOrient = ReadQuat();
oInfo.qRealWorldHeadAboveTorsoOrientation = ReadQuat();
ReadVAStruct( oInfo.oParams );
return oInfo;
}
CVASoundSourceInfo CVANetMessage::ReadSoundSourceInfo()
{
CVASoundSourceInfo oInfo;
......
......@@ -113,6 +113,7 @@ public:
void ReadVAStruct( CVAStruct& oStruct );
CVAAudioRendererInfo ReadAudioRenderingModuleInfo();
CVAAudioReproductionInfo ReadAudioReproductionModuleInfo();
CVASoundReceiverInfo ReadSoundReceiverInfo();
CVASoundSourceInfo ReadSoundSourceInfo();
CVASoundPortalInfo ReadSoundPortalInfo();
CVAGeometryMesh ReadGeometryMesh();
......
......@@ -131,13 +131,13 @@ void CVANetNetworkProtocol::ServerCallFunctionByMessageType( const int nMessageT
SERVER_FUNCTION_MAPPING( VA_NP_GET_DIRECTIVITY_INFO, ServerGetDirectivityInfo() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_DIRECTIVITY_INFOS, ServerGetDirectivityInfos() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_DIRECTIVITY_PARAMETERS, ServerGetDirectivityParameters() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_DIRECTIVITY_PARAMETERS ServerSetDirectivityParameters() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_DIRECTIVITY_PARAMETERS, ServerSetDirectivityParameters() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_DIRECTIVITY_NAME, ServerGetDirectivityName() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_DIRECTIVITY_NAME, ServerSetDirectivityName() );
// Signal sources
SERVER_FUNCTION_MAPPING( VA_NP_CREATE_SIGNAL_SOURCE_BUFFER_FROM_PARAMETERS, ServerCreateSignalSourceBufferFromParameters() );
SERVER_FUNCTION_MAPPING( VA_NP_CREATE__SIGNAL_SOURCE_TEXT_TO_SPEECH, ServerCreateTextToSpeechSignalSource() );
SERVER_FUNCTION_MAPPING( VA_NP_CREATE_SIGNAL_SOURCE_TEXT_TO_SPEECH, ServerCreateTextToSpeechSignalSource() );
SERVER_FUNCTION_MAPPING( VA_NP_CREATE_SIGNAL_SOURCE_SEQUENCER, ServerCreateSequencerSignalSource() );
SERVER_FUNCTION_MAPPING( VA_NP_CREATE_SIGNAL_SOURCE_NETWORK_STREAM, ServerCreateNetworkStreamSignalSource() );
SERVER_FUNCTION_MAPPING( VA_NP_CREATE_SIGNAL_SOURCE_ENGINE, ServerCreateEngineSignalSource() );
......@@ -167,7 +167,7 @@ void CVANetNetworkProtocol::ServerCallFunctionByMessageType( const int nMessageT
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_SOURCE_ENABLED, ServerGetSoundSourceEnabled() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_SOUND_SOURCE_NAME, ServerSetSoundSourceName() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_SOURCE_NAME, ServerGetSoundSourceName() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_SOUNDSOURCE_SIGNALSOURCE, ServerSetSoundSourceSignalSource() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_SOUND_SOURCE_SIGNALSOURCE, ServerSetSoundSourceSignalSource() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_SOURCE_SIGNALSOURCE, ServerGetSoundSourceSignalSource() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_SOUND_SOURCE_AURAMODE, ServerSetSoundSourceAuralizationMode() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_SOURCE_AURAMODE, ServerGetSoundSourceAuralizationMode() );
......@@ -182,9 +182,10 @@ void CVANetNetworkProtocol::ServerCallFunctionByMessageType( const int nMessageT
SERVER_FUNCTION_MAPPING( VA_NP_SET_SOUND_SOURCE_POSITION, ServerSetSoundSourcePosition() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_SOURCE_POSITION, ServerGetSoundSourcePosition() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_SOUND_SOURCE_ORIENTATION, ServerSetSoundSourceOrientation() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUNDSOURCE_ORIENTATION, ServerGetSoundSourceOrientation() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_SOURCE_ORIENTATION, ServerGetSoundSourceOrientation() );
SERVER_FUNCTION_MAPPING( VA_NP_SET_SOUND_SOURCE_ORIENTATION_VU, ServerSetSoundSourceOrientationVU() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_SOURCE_ORIENTATION_VU, ServerGetSoundSourceOrientationVU() );
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_RECEIVER_INFO, ServerGetSoundReceiverInfo() );
// SoundReceivers
SERVER_FUNCTION_MAPPING( VA_NP_GET_SOUND_RECEIVER_IDS, ServerGetSoundReceiverIDs() );
......@@ -887,7 +888,7 @@ void CVANetNetworkProtocol::ServerCreateSignalSourceBufferFromParameters()
std::string CVANetNetworkProtocol::ClientCreateTextToSpeechSignalSource( const std::string& sName )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_CREATE__SIGNAL_SOURCE_TEXT_TO_SPEECH, MESSAGE_WITH_ANSWER );
CVANetMessage* pMsg = ClientInitMessage( VA_NP_CREATE_SIGNAL_SOURCE_TEXT_TO_SPEECH, MESSAGE_WITH_ANSWER );
pMsg->WriteString( sName );
ClientSendCommand( pMsg );
return pMsg->ReadString();
......@@ -1607,7 +1608,7 @@ void CVANetNetworkProtocol::ServerSetSoundSourcePose()
void CVANetNetworkProtocol::ClientGetSoundSourcePose( const int iID, VAVec3& vPos, VAQuat& qOrient )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUNDSOURCE_POSE, MESSAGE_WITH_ANSWER );
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUND_SOURCE_POSE, MESSAGE_WITH_ANSWER );
pMsg->WriteInt( iID );
ClientSendCommand( pMsg );
vPos = pMsg->ReadVec3();
......@@ -1677,7 +1678,7 @@ void CVANetNetworkProtocol::ServerSetSoundSourceOrientation()
VAQuat CVANetNetworkProtocol::ClientGetSoundSourceOrientation( const int iID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUNDSOURCE_ORIENTATION, MESSAGE_WITH_ANSWER );
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUND_SOURCE_ORIENTATION, MESSAGE_WITH_ANSWER );
pMsg->WriteInt( iID );
ClientSendCommand( pMsg );
const VAQuat qOrient = pMsg->ReadQuat();
......@@ -1764,7 +1765,7 @@ void CVANetNetworkProtocol::ServerGetSoundSourceOrientationVU()
void CVANetNetworkProtocol::ClientSetSoundSourceSignalSource( const int iSoundSourceID, const std::string& sSignalSourceID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_SET_SOUNDSOURCE_SIGNALSOURCE, MESSAGE_ALLOWS_BUFFERING );
CVANetMessage* pMsg = ClientInitMessage( VA_NP_SET_SOUND_SOURCE_SIGNALSOURCE, MESSAGE_ALLOWS_BUFFERING );
pMsg->WriteInt( iSoundSourceID );
pMsg->WriteString( sSignalSourceID );
ClientSendCommand( pMsg );
......@@ -1849,6 +1850,23 @@ void CVANetNetworkProtocol::ServerDeleteSoundReceiver()
pMsg->WriteInt( iResult );
}
CVASoundReceiverInfo CVANetNetworkProtocol::ClientGetSoundReceiverInfo( const int iID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUND_RECEIVER_INFO, MESSAGE_WITH_ANSWER );
pMsg->WriteInt( iID );
ClientSendCommand( pMsg );
return pMsg->ReadSoundReceiverInfo();
}
void CVANetNetworkProtocol::ServerGetSoundReceiverInfo()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iID = pMsg->ReadInt();
const CVASoundReceiverInfo oInfo = m_pRealCore->GetSoundReceiverInfo( iID );
pMsg->WriteSoundReceiverInfo( oInfo );
}
void CVANetNetworkProtocol::ClientSetSoundReceiverEnabled( const int iID, const bool bEnabled )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_SET_SOUND_RECEIVER_ENABLED, MESSAGE_ALLOWS_BUFFERING );
......
......@@ -185,7 +185,9 @@ public:
static const int VA_NP_GET_SOUND_RECEIVER_REAL_WORLD_POSE = 935;
static const int VA_NP_SET_SOUND_RECEIVER_REAL_WORLD_POSE = 936;
static const int VA_NP_GET_SOUND_RECEIVER_REAL_WORLD_HEAD_ABOVE_TORSO_ORIENTATION = 937;
static const int VA_NP_SET_SOUND_RECEIVER_REAL_WORLD_HEAD_ABOVE_TORSO_ORIENTATION = 938;
static const int VA_NP_SET_SOUND_RECEIVER_REAL_WORLD_HEAD_ABOVE_TORSO_ORIENTATION = 938;
static const int VA_NP_GET_SOUND_RECEIVER_INFO = 939;
// Scene
......@@ -578,6 +580,8 @@ public:
int ClientDeleteSoundReceiver( const int iID );
void ServerDeleteSoundReceiver();
CVASoundReceiverInfo ClientGetSoundReceiverInfo( const int iID );
void ServerGetSoundReceiverInfo();
void ClientSetSoundReceiverEnabled( const int, const bool );
void ServerSetSoundReceiverEnabled();
......
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