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

Some more methods

parent 52b4032e
......@@ -37,7 +37,7 @@
#define VA_MUTAL_EXCLUDE VistaMutexLock oLock( m_oCommandMutex )
// State checking macro
#define VA_REQUIRE_CONNECTED { if( m_pParent->IsConnected() == false) VA_EXCEPT2(MODAL_ERROR, "Not connected."); }
#define VA_REQUIRE_CONNECTED { if( m_pParent->IsConnected() == false ) VA_EXCEPT2( MODAL_ERROR, "Not connected." ); }
////////////////////////////////////////////////
......@@ -137,6 +137,12 @@ public:
return m_pProtocol->ClientGetSearchPaths();
};
inline std::string FindFilePath( const std::string& sFilePath ) const
{
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientFindFilePath( sFilePath );
};
inline void GetModules( std::vector< CVAModuleInfo >& viModuleInfos ) const
{
......@@ -332,6 +338,7 @@ public:
return m_pProtocol->ClientGetSignalSourceParameters( sSignalSourceID, oParams );
};
inline bool GetUpdateLocked() const
{
VA_REQUIRE_CONNECTED;
......@@ -521,6 +528,7 @@ public:
VA_MUTAL_EXCLUDE;
m_pProtocol->ClientSetSoundSourcePosition( iID, v3Pos );
};
inline void SetSoundSourceOrientation( const int iID, const VAQuat& qOrient )
{
VA_REQUIRE_CONNECTED;
......@@ -535,9 +543,6 @@ public:
m_pProtocol->ClientSetSoundSourceOrientationVU( iID, v3View, v3Up );
};
inline VAVec3 GetSoundSourcePosition( const int iID ) const
{
VA_REQUIRE_CONNECTED;
......@@ -559,14 +564,19 @@ public:
m_pProtocol->ClientGetSoundSourceOrientationVU( iSoundSourceID, v3View, v3Up );
};
inline int GetSoundSourceGeometryMesh( const int iID ) const
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
return m_pProtocol->ClientGetSoundSourceGeometryMesh( iID );
};
inline void SetSoundSourceGeometryMesh( const int iSoundSourceID, const int iGeometryMeshID )
{
VA_EXCEPT_NOT_IMPLEMENTED;
VA_REQUIRE_CONNECTED;
VA_MUTAL_EXCLUDE;
m_pProtocol->ClientSetSoundSourceGeometryMesh( iSoundSourceID, iGeometryMeshID );
};
......@@ -788,9 +798,7 @@ public:
{
VA_EXCEPT_NOT_IMPLEMENTED;
};
inline void SetHomogeneousMediumSoundSpeed( const double dSoundSpeed )
{
......@@ -851,11 +859,7 @@ public:
{
VA_EXCEPT_NOT_IMPLEMENTED;
};
inline std::string CreateScene( const CVAStruct& oParams, const std::string& sName = "" )
{
......@@ -1202,6 +1206,7 @@ public:
return m_pProtocol->ClientGetReproductionModuleGain( sModuleID );
};
inline int CreateAcousticMaterial( const CVAAcousticMaterial& oMaterial, const std::string& sName = "" )
{
VA_EXCEPT_NOT_IMPLEMENTED;
......@@ -1303,13 +1308,6 @@ public:
VA_EXCEPT_NOT_IMPLEMENTED;
};
inline std::string FindFilePath( const std::string& sFilePath ) const
{
VA_EXCEPT_NOT_IMPLEMENTED;
};
protected:
CVANetClientImpl* m_pParent;
......
......@@ -44,11 +44,11 @@ public:
void AttachEventHandler( IVAEventHandler* pCoreEventHandler );
void DetachEventHandler( IVAEventHandler* pCoreEventHandler );
virtual bool AttachEventHandler( IVANetClient::IEventHandler* pHandler );
virtual bool DetachEventHandler( IVANetClient::IEventHandler* pHandler );
bool AttachEventHandler( IVANetClient::IEventHandler* pHandler );
bool DetachEventHandler( IVANetClient::IEventHandler* pHandler );
virtual void SetExceptionHandlingMode( const int nMode );
virtual int GetExceptionhandlingMode() const;
void SetExceptionHandlingMode( const int nMode );
int GetExceptionhandlingMode() const;
void ProcessNetEvent( int iEventID );
void ProcessEventChannelError();
......
......@@ -666,6 +666,22 @@ void CVANetNetworkProtocol::ServerGetSearchPaths()
pMsg->WriteVAStruct( oPaths );
}
std::string CVANetNetworkProtocol::ClientFindFilePath( const std::string& sFilePath )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_FIND_FILE_PATH, MESSAGE_WITH_ANSWER );
pMsg->WriteString( sFilePath );
ClientSendCommand( pMsg );
return pMsg->ReadString();
}
void CVANetNetworkProtocol::ServerClientFindFilePath()
{
CVANetMessage* pMsg = ServerGetMessage();
const std::string sFilePath = pMsg->ReadString();
const std::string sFoundFilePath = m_pRealCore->FindFilePath( sFilePath );
pMsg->WriteString( sFoundFilePath );
}
CVAStruct CVANetNetworkProtocol::ClientCallModule( const std::string& sModuleName, const CVAStruct& oArgs )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_CALL_MODULE, MESSAGE_WITH_ANSWER );
......@@ -1690,6 +1706,38 @@ void CVANetNetworkProtocol::ServerSetSoundSourceOrientationVU()
m_pRealCore->SetSoundSourceOrientationVU( iID, v3View, v3Up );
}
int CVANetNetworkProtocol::ClientGetSoundSourceGeometryMesh( const int iID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUND_SOURCE_GEOMETRY_MESH, MESSAGE_WITH_ANSWER );
pMsg->WriteInt( iID );
ClientSendCommand( pMsg );
return pMsg->ReadInt();
}
void CVANetNetworkProtocol::ServerGetSoundSourceGeometryMesh()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iID = pMsg->ReadInt();
const int iGeometryMeshID = m_pRealCore->GetSoundSourceGeometryMesh( iID );
pMsg->WriteInt( iGeometryMeshID );
}
void CVANetNetworkProtocol::ClientSetSoundSourceGeometryMesh( const int iSoundSourceID, const int iGeometryMeshID )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUND_SOURCE_GEOMETRY_MESH, MESSAGE_ALLOWS_BUFFERING );
pMsg->WriteInt( iSoundSourceID );
pMsg->WriteInt( iGeometryMeshID );
ClientSendCommand( pMsg );
}
void CVANetNetworkProtocol::ServerSetSoundSourceGeometryMesh()
{
CVANetMessage* pMsg = ServerGetMessage();
const int iSoundSourceID = pMsg->ReadInt();
const int iGeometryMeshID = pMsg->ReadInt();
m_pRealCore->SetSoundSourceGeometryMesh( iSoundSourceID, iGeometryMeshID );
}
void CVANetNetworkProtocol::ClientGetSoundSourceOrientationVU( const int iID, VAVec3& v3View, VAVec3& v3Up )
{
CVANetMessage* pMsg = ClientInitMessage( VA_NP_GET_SOUNDSOURCE_ORIENTATION_VU, MESSAGE_WITH_ANSWER );
......
......@@ -77,6 +77,8 @@ public:
static const int VA_NP_GET_MODULES = 221;
static const int VA_NP_CALL_MODULE = 222;
static const int VA_NP_GET_SEARCH_PATHS = 230;
static const int VA_NP_FIND_FILE_PATH = 231;
// Directivities
static const int VA_NP_CREATE_DIRECTIVITY = 300;
......@@ -88,19 +90,6 @@ public:
static const int VA_NP_GET_DIRECTIVITY_NAME = 306;
static const int VA_NP_SET_DIRECTIVITY_NAME = 307;
// Head-related impulse responses (HRIRs)
static const int VA_NP_LOAD_HRIR_DATASET = 400;
static const int VA_NP_FREE_HRIR_DATASET = 401;
static const int VA_NP_GET_HRIR_INFO = 402;
static const int VA_NP_GET_HRIR_INFOS = 403;
// Sounds
static const int VA_NP_LOAD_SOUND = 500;
static const int VA_NP_FREE_SOUND = 501;
static const int VA_NP_GET_SOUND_INFO = 502;
static const int VA_NP_GET_SOUND_INFOS = 503;
static const int VA_NP_PLAY_SOUND = 504;
// Signal sources
......@@ -166,6 +155,7 @@ public:
static const int VA_NP_SET_SOUNDSOURCE_ENABLED = 832;
static const int VA_NP_GET_SOUNDSOURCE_ENABLED = 833;
static const int VA_NP_GET_SOUND_SOURCE_INFO = 834;
static const int VA_NP_GET_SOUND_SOURCE_GEOMETRY_MESH = 835;
// Listeners
static const int VA_NP_GET_SOUND_RECEIVER_IDS = 900;
......@@ -350,6 +340,9 @@ public:
CVAStruct ClientGetSearchPaths();
void ServerGetSearchPaths();
std::string ClientFindFilePath( const std::string& sFilePath );
void ServerClientFindFilePath();
virtual CVAStruct ClientCallModule( const std::string& sModuleName, const CVAStruct& oArgs );
virtual void ServerCallModule();
......@@ -507,6 +500,11 @@ public:
virtual void ClientSetSoundSourceOrientationVU( const int iID, const VAVec3& v3View, const VAVec3& v3Up );
virtual void ServerSetSoundSourceOrientationVU();
int ClientGetSoundSourceGeometryMesh( const int iID );
void ServerGetSoundSourceGeometryMesh();
void ClientSetSoundSourceGeometryMesh( const int iSoundSourceID, const int iGeometryMeshID );
void ServerSetSoundSourceGeometryMesh();
virtual void ClientGetSoundReceiverIDs( std::vector<int>& viIDs );
virtual void ServerGetSoundReceiverIDs();
......
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