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

Finishing acoustic material methods

parent 061c4a17
......@@ -774,7 +774,7 @@ public:
{
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
m_pProtocol->ClientSetSoundReceiverGeometryMesh( iSoundReceiverID , iGeometryMeshID);
m_pProtocol->ClientSetSoundReceiverGeometryMesh( iSoundReceiverID, iGeometryMeshID );
};
inline void GetSoundReceiverRealWorldPose( const int iID, VAVec3& v3Pos, VAQuat& qOrient ) const
......@@ -818,7 +818,7 @@ public:
VA_MUTAL_EXCLUDE;
m_pProtocol->ClientSetSoundReceiverRealWorldPositionOrientationVU( iID, v3Pos, v3View, v3Up );
};
inline void SetHomogeneousMediumSoundSpeed( const double dSoundSpeed )
{
......@@ -879,7 +879,7 @@ public:
{
VA_EXCEPT_NOT_IMPLEMENTED;
};
inline std::string CreateScene( const CVAStruct& oParams, const std::string& sName = "" )
{
......@@ -1258,32 +1258,44 @@ public:
inline CVAAcousticMaterial GetAcousticMaterialInfo( const int iID ) const
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientGetAcousticMaterialInfo( iID );
};
inline void GetAcousticMaterialInfos( std::vector< CVAAcousticMaterial >& voDest ) const
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientGetAcousticMaterialInfos( voDest );
};
inline void SetAcousticMaterialName( const int iID, const std::string& sName )
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientSetAcousticMaterialName( iID, sName );
};
inline std::string GetAcousticMaterialName( const int iID ) const
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientGetAcousticMaterialName( iID );
};
inline CVAStruct GetAcousticMaterialParameters( const int iID, const CVAStruct& oParams ) const
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientGetAcousticMaterialParameters( iID, oParams );
};
inline void SetAcousticMaterialParameters( const int iID, const CVAStruct& oParams )
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
m_pProtocol->ClientSetAcousticMaterialParameters( iID, oParams );
};
......@@ -1429,7 +1441,7 @@ public:
m_pParent->ProcessEventChannelError();
}
return false;
};
};
inline void PreLoop()
{
......@@ -1452,7 +1464,7 @@ private:
std::list<IVAEventHandler*> m_liCoreEventHandlers;
VistaMutex m_oHandlerListLock;
VistaMutex* m_pEventChannelLock;
};
};
......@@ -1554,7 +1566,7 @@ int CVANetClientImpl::Initialize( const std::string& sServerAddress, const int i
// server responded, but establishing the connection sockets failed
Cleanup();
return VA_CONNECTION_ERROR;
}
}
else if( iCommandChannelPort == -2 )
{
// server responded, but it doesn't accept any more connections
......@@ -1665,7 +1677,7 @@ int CVANetClientImpl::Initialize( const std::string& sServerAddress, const int i
m_pProtocol->InitializeAsClient( this, m_pCommandChannel, m_pHeadChannel,
IExceptionHandlingMode, bBufferSynchronizedCommands );
return VA_NO_ERROR;
}
}
int CVANetClientImpl::Disconnect()
{
......@@ -1794,7 +1806,7 @@ void CVANetClientImpl::ProcessEventChannelError()
catch( VistaExceptionBase& )
{
// its okay for this call to fail - the connection may already be closed
}
}
m_bShutdownFlag = true;
}
......@@ -1838,7 +1850,7 @@ void CVANetClientImpl::ProcessNetEvent( int iEventID )
}
}
}
}
void CVANetClientImpl::EmitEvent( const IVANetClient::CEvent& oEvent )
{
......
......@@ -2934,6 +2934,111 @@ void CVANetNetworkProtocol::ServerDeleteAcousticMaterial()
}
CVAAcousticMaterial CVANetNetworkProtocol::ClientGetAcousticMaterialInfo( const int iID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_ACOUSTIC_MATERIAL_INFO, MESSAGE_WITH_ANSWER );
pMsg->WriteInt( iID );
ClientSendCommand( pMsg );
return pMsg->ReadAcousticMaterial();
}
void CVANetNetworkProtocol::ServerGetAcousticMaterialInfo()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iID = pMsg->ReadInt();
CVAAcousticMaterial oMat = m_pRealCore->GetAcousticMaterialInfo( iID );
pMsg->WriteAcousticMaterial( oMat );
}
void CVANetNetworkProtocol::ClientGetAcousticMaterialInfos( std::vector< CVAAcousticMaterial >& voInfos )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_ACOUSTIC_MATERIAL_INFOS, MESSAGE_WITH_ANSWER );
ClientSendCommand( pMsg );
const int iNumMaterials = pMsg->ReadInt();
for( int i = 0; i < iNumMaterials; i++ )
voInfos.push_back( pMsg->ReadAcousticMaterial() );
}
void CVANetNetworkProtocol::ServerGetAcousticMaterialInfos()
{
CVANetMessage* pMsg = ServerGetMessage();
std::vector< CVAAcousticMaterial > voInfos;
m_pRealCore->GetAcousticMaterialInfos( voInfos );
pMsg->WriteInt( int( voInfos.size() ) );
for( size_t i = 0; i < voInfos.size(); i++ )
pMsg->WriteAcousticMaterial( voInfos[ i ] );
}
std::string CVANetNetworkProtocol::ClientGetAcousticMaterialName( const int iID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_ACOUSTIC_MATERIAL_NAME, MESSAGE_WITH_ANSWER );
pMsg->WriteInt( iID );
ClientSendCommand( pMsg );
return pMsg->ReadString();
}
void CVANetNetworkProtocol::ServerGetAcousticMaterialName()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iID = pMsg->ReadInt();
const std::string sName = m_pRealCore->GetAcousticMaterialName( iID );
pMsg->WriteString( sName );
}
void CVANetNetworkProtocol::ClientSetAcousticMaterialName( const int iID, const std::string& sName )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_SET_ACOUSTIC_MATERIAL_NAME, MESSAGE_ALLOWS_BUFFERING );
pMsg->WriteInt( iID );
pMsg->WriteString( sName );
ClientSendCommand( pMsg );
}
void CVANetNetworkProtocol::ServerSetAcousticMaterialName()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iID = pMsg->ReadInt();
const std::string sName = pMsg->ReadString();
m_pRealCore->SetAcousticMaterialName( iID, sName );
}
CVAStruct CVANetNetworkProtocol::ClientGetAcousticMaterialParameters( const int iID, const CVAStruct& oParams )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_ACOUSTIC_MATERIAL_PARAMETERS, MESSAGE_WITH_ANSWER );
pMsg->WriteInt( iID );
pMsg->WriteVAStruct( oParams );
ClientSendCommand( pMsg );
CVAStruct oReturn;
pMsg->ReadVAStruct( oReturn );
return oReturn;
}
void CVANetNetworkProtocol::ServerGetAcousticMaterialParameters()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iID = pMsg->ReadInt();
CVAStruct oParams;
pMsg->ReadVAStruct( oParams );
const CVAStruct oReturn = m_pRealCore->GetAcousticMaterialParameters( iID, oParams );
pMsg->WriteVAStruct( oReturn );
}
void CVANetNetworkProtocol::ClientSetAcousticMaterialParameters( const int iID, const CVAStruct& oParams )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_SET_ACOUSTIC_MATERIAL_PARAMETERS, MESSAGE_ALLOWS_BUFFERING );
pMsg->WriteInt( iID );
pMsg->WriteVAStruct( oParams );
ClientSendCommand( pMsg );
}
void CVANetNetworkProtocol::ServerSetAcousticMaterialParameters()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iID = pMsg->ReadInt();
CVAStruct oParams;
pMsg->ReadVAStruct( oParams );
m_pRealCore->SetAcousticMaterialParameters( iID, oParams );
}
bool CVANetNetworkProtocol::ClientIsRenderingModuleMuted( const std::string& sID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_RENDERER_IS_MUTED, MESSAGE_WITH_ANSWER );
......
......@@ -211,6 +211,12 @@ public:
static const int VA_NP_CREATE_ACOUSTIC_MATERIAL = 1400;
static const int VA_NP_CREATE_ACOUSTIC_MATERIAL_FROM_PARAMETERS = 1401;
static const int VA_NP_DELETE_ACOUSTIC_MATERIAL = 1402;
static const int VA_NP_GET_ACOUSTIC_MATERIAL_INFO = 1403;
static const int VA_NP_GET_ACOUSTIC_MATERIAL_INFOS = 1405;
static const int VA_NP_GET_ACOUSTIC_MATERIAL_NAME = 1406;
static const int VA_NP_SET_ACOUSTIC_MATERIAL_NAME = 1407;
static const int VA_NP_GET_ACOUSTIC_MATERIAL_PARAMETERS = 1408;
static const int VA_NP_SET_ACOUSTIC_MATERIAL_PARAMETERS = 1409;
static const int VA_NP_GET_INPUT_GAIN = 1100;
static const int VA_NP_SET_INPUT_GAIN = 1101;
......@@ -723,6 +729,22 @@ public:
bool ClientDeleteAcousticMaterial( const int iID );
void ServerDeleteAcousticMaterial();
CVAAcousticMaterial ClientGetAcousticMaterialInfo( const int iID );
void ServerGetAcousticMaterialInfo();
void ClientGetAcousticMaterialInfos( std::vector< CVAAcousticMaterial >& voDest );
void ServerGetAcousticMaterialInfos();
std::string ClientGetAcousticMaterialName( const int iID );
void ServerGetAcousticMaterialName();
void ClientSetAcousticMaterialName( const int iID, const std::string& sName );
void ServerSetAcousticMaterialName();
CVAStruct ClientGetAcousticMaterialParameters( const int iID, const CVAStruct& oParams );
void ServerGetAcousticMaterialParameters();
void ClientSetAcousticMaterialParameters( const int iID, const CVAStruct& oParams );
void ServerSetAcousticMaterialParameters();
private:
VistaConnectionIP* m_pCommandChannel;
......
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