Commit 60de1d50 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Fixing implementation errors

parent 22fb11d1
......@@ -44,7 +44,7 @@ class IVAInterface;
class VANET_API IVANetServer
{
public:
typedef std::pair<int, int> tPortRange;
typedef std::pair< int, int > tPortRange;
typedef std::list<tPortRange> tPortList;
enum
......@@ -146,7 +146,7 @@ public:
: iType( EVENT_NOTHING )
{};
inline CEvent( int iInitType, const std::string& sInitParam )
inline CEvent( const int iInitType, const std::string& sInitParam )
: iType( iInitType )
, sClient( sInitParam )
{};
......
......@@ -21,9 +21,6 @@
// Einen Server-String in Addresse und Port zerlegen ("localhost:12340" => localhost, 12340)
// Lst eine CVAException aus falls das Parsen fehlschlgt. Falls kein Port angegeben wurde,
// ("localhost") bekommt iPort den Wert des default port zugewiesen.
VANET_API void SplitServerString(const std::string& sServerString,
std::string& sAddress,
int& iPort,
int iDefaultPort=VANET_DEFAULT_PORT);
VANET_API void SplitServerString( const std::string& sServerString, std::string& sAddress, int& iPort, const int iDefaultPort = VANET_DEFAULT_PORT );
#endif // IW_VANET_UTILS
......@@ -29,4 +29,3 @@ bool CVANetAudioStreamServer::Initialize( const std::string& sBindInterface, con
{
return m_pImpl->InitializeInternal( sBindInterface, iBindPort );
}
......@@ -44,4 +44,4 @@ bool CVANetAudioStreamServerImpl::InitializeInternal( const std::string& sBindIn
const double dSyncTimeInterval = 0.001f; // 1 ms
return m_pSampleServer->Start( sBindInterface, iBindPort, dSyncTimeInterval );
}
\ No newline at end of file
}
......@@ -1796,7 +1796,7 @@ int CVANetClientImpl::Disconnect()
return VA_NO_ERROR;
}
void CVANetClientImpl::SendConnectionEvent( int nId )
void CVANetClientImpl::SendConnectionEvent( const int nId )
{
try
{
......@@ -1890,7 +1890,7 @@ void CVANetClientImpl::ProcessEventChannelError()
m_bShutdownFlag = true;
}
void CVANetClientImpl::ProcessNetEvent( int iEventID )
void CVANetClientImpl::ProcessNetEvent( const int iEventID )
{
switch( iEventID )
{
......
......@@ -39,7 +39,7 @@ public:
std::string GetServerAddress() const;
int Initialize( const std::string& sServerAddress, const int iServerPort, const int iHeadChannelMode = VA_HC_USE_EXISTING, const int IExceptionHandlingMode = EXC_CLIENT_THROW, const bool bBufferSynchronizedCommands = true );
int Disconnect();
void SendConnectionEvent( int nId );
void SendConnectionEvent( const int nId );
void AttachEventHandler( IVAEventHandler* pCoreEventHandler );
void DetachEventHandler( IVAEventHandler* pCoreEventHandler );
......@@ -50,7 +50,7 @@ public:
void SetExceptionHandlingMode( const int nMode );
int GetExceptionhandlingMode() const;
void ProcessNetEvent( int iEventID );
void ProcessNetEvent( const int iEventID );
void ProcessEventChannelError();
private:
......
......@@ -271,15 +271,15 @@ int CVANetMessage::GetAnswerType() const
return m_nAnswerType;
}
void CVANetMessage::SetExceptionMode( int nMode )
void CVANetMessage::SetExceptionMode( const int nMode )
{
m_nExceptionMode = nMode;
}
void CVANetMessage::SetMessageType( int nType )
void CVANetMessage::SetMessageType( const int nType )
{
m_nMessageType = nType;
}
void CVANetMessage::SetAnswerType( int nType )
void CVANetMessage::SetAnswerType( const int nType )
{
m_nAnswerType = nType;
}
......@@ -514,51 +514,63 @@ CVAVersionInfo CVANetMessage::ReadVersionInfo()
void CVANetMessage::WriteDirectivityInfo( const CVADirectivityInfo& oInfo )
{
WriteString( oInfo.sName );
WriteInt( oInfo.iID );
WriteInt( oInfo.iReferences );
WriteInt( oInfo.iClass );
WriteString( oInfo.sName );
WriteString( oInfo.sDesc );
WriteInt( oInfo.iReferences );
WriteVAStruct( oInfo.oParams );
}
CVADirectivityInfo CVANetMessage::ReadDirectivityInfo()
{
CVADirectivityInfo oInfo;
oInfo.sName = ReadString();
oInfo.iID = ReadInt();
oInfo.iReferences = ReadInt();
oInfo.iClass = ReadInt();
oInfo.sName = ReadString();
oInfo.sDesc = ReadString();
oInfo.iReferences = ReadInt();
ReadVAStruct( oInfo.oParams );
return oInfo;
}
void CVANetMessage::WriteSignalSourceInfo( const CVASignalSourceInfo& oInfo )
{
WriteString( oInfo.sName );
WriteString( oInfo.sState );
WriteString( oInfo.sID );
WriteInt( oInfo.iType );
WriteString( oInfo.sName );
WriteString( oInfo.sDesc );
WriteString( oInfo.sState );
WriteInt( oInfo.iReferences );
}
CVASignalSourceInfo CVANetMessage::ReadSignalSourceInfo()
{
CVASignalSourceInfo oInfo;
oInfo.sName = ReadString();
oInfo.sState = ReadString();
oInfo.sID = ReadString();
oInfo.iType = ReadInt();
oInfo.sName = ReadString();
oInfo.sDesc = ReadString();
oInfo.sState = ReadString();
oInfo.iReferences = ReadInt();
return oInfo;
}
void CVANetMessage::WriteSceneInfo( const CVASceneInfo& )
void CVANetMessage::WriteSceneInfo( const CVASceneInfo& oInfo )
{
// TODO: Add field when CVASceneInfo gets designed
WriteString( oInfo.sID );
WriteString( oInfo.sName );
WriteBool( oInfo.bEnabled );
WriteVAStruct( oInfo.oParams );
}
CVASceneInfo CVANetMessage::ReadSceneInfo()
{
CVASceneInfo oInfo;
// TODO: Add field when CVASceneInfo gets designed
oInfo.sID = ReadString();
oInfo.sName = ReadString();
oInfo.bEnabled = ReadBool();
ReadVAStruct( oInfo.oParams );
return oInfo;
}
......@@ -566,20 +578,22 @@ void CVANetMessage::WriteModuleInfo( const CVAModuleInfo& oInfo )
{
WriteString( oInfo.sName );
WriteString( oInfo.sDesc );
WriteVAStruct( oInfo.oParams );
}
void CVANetMessage::ReadModuleInfo( CVAModuleInfo& oInfo )
{
oInfo.sName = ReadString();
oInfo.sDesc = ReadString();
ReadVAStruct( oInfo.oParams );
}
void CVANetMessage::WriteBlob( const void* pBuf, int nBytes )
void CVANetMessage::WriteBlob( const void* pBuf, const int nBytes )
{
m_oOutgoing.WriteRawBuffer( pBuf, nBytes );
}
void CVANetMessage::ReadBlob( void* pBuf, int nBytes )
void CVANetMessage::ReadBlob( void* pBuf, const int nBytes )
{
int nReturn = m_oIncoming.ReadRawBuffer( pBuf, nBytes );
assert( nReturn == nBytes );
......@@ -591,7 +605,8 @@ void CVANetMessage::WriteVAStruct( const CVAStruct& oStruct )
WriteInt( oStruct.Size() );
int nBytes;
for( CVAStruct::const_iterator cit = oStruct.Begin(); cit != oStruct.End(); ++cit ) {
for( CVAStruct::const_iterator cit = oStruct.Begin(); cit != oStruct.End(); ++cit )
{
// Schlsselnamen
WriteString( cit->first );
......@@ -600,7 +615,8 @@ void CVANetMessage::WriteVAStruct( const CVAStruct& oStruct )
WriteInt( iDatatype );
// Wert
switch( iDatatype ) {
switch( iDatatype )
{
case CVAStructValue::UNASSIGNED:
// Keinen Wert => Nichts schreiben
break;
......@@ -654,7 +670,8 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct )
// Anzahl der Keys lesen
int nKeys = ReadInt();
for( int i = 0; i < nKeys; i++ ) {
for( int i = 0; i < nKeys; i++ )
{
// Schlsselnamen
std::string sKeyName = ReadString();
......@@ -662,7 +679,8 @@ void CVANetMessage::ReadVAStruct( CVAStruct& oStruct )
int iDatatype = ReadInt();
// Wert
switch( iDatatype ) {
switch( iDatatype )
{
case CVAStructValue::UNASSIGNED:
// Keinen Wert => Leeren Schssel
oStruct[ sKeyName ];
......@@ -765,16 +783,27 @@ void CVANetMessage::WriteAudioRenderingModuleInfo( const CVAAudioRendererInfo& o
{
WriteString( oRenderer.sID );
WriteString( oRenderer.sClass );
WriteBool( oRenderer.bEnabled );
WriteString( oRenderer.sDescription );
WriteBool( oRenderer.bEnabled );
WriteBool( oRenderer.bOutputDetectorEnabled );
WriteBool( oRenderer.bOutputRecordingEnabled );
WriteString( oRenderer.sOutputRecordingFilePath );
WriteVAStruct( oRenderer.oParams );
}
void CVANetMessage::WriteAudioReproductionModuleInfo( const CVAAudioReproductionInfo& oRepro )
{
WriteString( oRepro.sID );
WriteString( oRepro.sClass );
WriteBool( oRepro.bEnabled );
WriteString( oRepro.sDescription );
WriteBool( oRepro.bEnabled );
WriteBool( oRepro.bInputDetectorEnabled );
WriteBool( oRepro.bInputRecordingEnabled );
WriteString( oRepro.sInputRecordingFilePath );
WriteBool( oRepro.bOutputDetectorEnabled );
WriteBool( oRepro.bOutputRecordingEnabled );
WriteString( oRepro.sOutputRecordingFilePath );
WriteVAStruct( oRepro.oParams );
}
void CVANetMessage::WriteSoundSourceInfo( const CVASoundSourceInfo& oInfo )
......@@ -793,6 +822,33 @@ void CVANetMessage::WriteSoundSourceInfo( const CVASoundSourceInfo& oInfo )
WriteVec3( oInfo.v3View );
}
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 );
WriteInt( oInfo.iAuraMode );
WriteDouble( oInfo.dSensivitity );
WriteBool( oInfo.bEnabled );
WriteVec3( oInfo.v3Pos );
WriteVec3( oInfo.v3View );
WriteVec3( oInfo.v3Up );
WriteQuat( oInfo.qOrient );
WriteVec3( oInfo.v3HeadAboveTorsoOrientation );
WriteVAStruct( oInfo.oParams );
}
void CVANetMessage::WriteSoundPortalInfo( const CVASoundPortalInfo& oInfo )
{
WriteBool( oInfo.bEnabled );
......@@ -841,8 +897,12 @@ CVAAudioRendererInfo CVANetMessage::ReadAudioRenderingModuleInfo()
CVAAudioRendererInfo oRenderer;
oRenderer.sID = ReadString();
oRenderer.sClass = ReadString();
oRenderer.bEnabled = ReadBool();
oRenderer.sDescription = ReadString();
oRenderer.bEnabled = ReadBool();
oRenderer.bOutputDetectorEnabled = ReadBool();
oRenderer.bOutputRecordingEnabled = ReadBool();
oRenderer.sOutputRecordingFilePath = ReadString();
ReadVAStruct( oRenderer.oParams );
return oRenderer;
}
......@@ -851,8 +911,15 @@ CVAAudioReproductionInfo CVANetMessage::ReadAudioReproductionModuleInfo()
CVAAudioReproductionInfo oRepro;
oRepro.sID = ReadString();
oRepro.sClass = ReadString();
oRepro.bEnabled = ReadBool();
oRepro.sDescription = ReadString();
oRepro.bEnabled = ReadBool();
oRepro.bInputDetectorEnabled = ReadBool();
oRepro.bInputRecordingEnabled = ReadBool();
oRepro.sInputRecordingFilePath = ReadString();
oRepro.bOutputDetectorEnabled = ReadBool();
oRepro.bOutputRecordingEnabled = ReadBool();
oRepro.sOutputRecordingFilePath = ReadString();
ReadVAStruct( oRepro.oParams );
return oRepro;
}
......
......@@ -83,10 +83,11 @@ public:
void WriteSignalSourceInfo( const CVASignalSourceInfo& oInfo );
void WriteSceneInfo( const CVASceneInfo& oInfo );
void WriteModuleInfo( const CVAModuleInfo& oInfo );
void WriteBlob( const void* pBuf, int nBytes );
void WriteBlob( const void* pBuf, const int nBytes );
void WriteVAStruct( const CVAStruct& oStruct );
void WriteAudioRenderingModuleInfo( const CVAAudioRendererInfo& );
void WriteAudioReproductionModuleInfo( const CVAAudioReproductionInfo& );
void WriteSoundReceiverInfo( const CVASoundReceiverInfo& oInfo );
void WriteSoundSourceInfo( const CVASoundSourceInfo& oInfo );
void WriteSoundPortalInfo( const CVASoundPortalInfo& oInfo );
void WriteGeometryMesh( const CVAGeometryMesh& oMesh );
......@@ -108,7 +109,7 @@ public:
CVASignalSourceInfo ReadSignalSourceInfo();
CVASceneInfo ReadSceneInfo();
void ReadModuleInfo( CVAModuleInfo& oInfo );
void ReadBlob( void* pBuf, int nBytes );
void ReadBlob( void* pBuf, const int nBytes );
void ReadVAStruct( CVAStruct& oStruct );
CVAAudioRendererInfo ReadAudioRenderingModuleInfo();
CVAAudioReproductionInfo ReadAudioReproductionModuleInfo();
......
This diff is collapsed.
......@@ -79,7 +79,6 @@ public:
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;
static const int VA_NP_DELETE_DIRECTIVITY = 301;
......@@ -89,11 +88,8 @@ public:
static const int VA_NP_SET_DIRECTIVITY_PARAMETERS = 305;
static const int VA_NP_GET_DIRECTIVITY_NAME = 306;
static const int VA_NP_SET_DIRECTIVITY_NAME = 307;
// Signal sources
static const int VA_NP_GET_SIGNALSOURCE_INFO = 600;
static const int VA_NP_GET_SIGNALSOURCE_INFOS = 601;
static const int VA_NP_DELETE_SIGNALSOURCE = 602;
......@@ -101,61 +97,61 @@ public:
static const int VA_NP_SET_SIGNALSOURCE_PARAMETERS = 604;
static const int VA_NP_CREATE_SIGNAL_SOURCE_BUFFER_FROM_PARAMETERS = 610;
static const int VA_NP_GET_AUDIOFILE_SIGNALSOURCE_PLAYSTATE = 611;
static const int VA_NP_SET_AUDIOFILE_SIGNALSOURCE_PLAYACTION = 612;
static const int VA_NP_SET_AUDIOFILE_SIGNALSOURCE_PLAYPOS = 613;
static const int VA_NP_SET_AUDIOFILE_SIGNALSOURCE_LOOPING = 614;
static const int VA_NP_GET_AUDIOFILE_SIGNALSOURCE_LOOPING = 615;
static const int VA_NP_GET_SIGNAL_SOURCE_BUFFER_PLAYBACK_STATE = 611;
static const int VA_NP_SET_SIGNAL_SOURCE_BUFFER_PLAYBACK_ACTION = 612;
static const int VA_NP_SET_SIGNAL_SOURCE_BUFFER_PLAYBACK_POSITION = 613;
static const int VA_NP_GET_SIGNAL_SOURCE_BUFFER_LOOPING = 614;
static const int VA_NP_SET_SIGNAL_SOURCE_BUFFER_LOOPING = 615;
static const int VA_NP_CREATE_SEQUENCER_SIGNALSOURCE = 620;
static const int VA_NP_SEQUENCER_ADD_SOUND_PLAYBACK = 621;
static const int VA_NP_SEQUENCER_REMOVE_SOUND_PLAYBACK = 622;
static const int VA_NP_CREATE_SIGNAL_SOURCE_SEQUENCER = 620;
static const int VA_NP_SIGNAL_SOURCE_SEQUENCER_ADD_SOUND_PLAYBACK = 621;
static const int VA_NP_SIGNAL_SOURCE_SEQUENCER_REMOVE_SOUND_PLAYBACK = 622;
static const int VA_NP_CREATE_NETWORK_STREAM_SIGNALSOURCE = 630;
static const int VA_NP_CREATE_SIGNAL_SOURCE_NETWORK_STREAM = 630;
static const int VA_NP_CREATE_ENGINE_SIGNALSOURCE = 640;
static const int VA_NP_CREATE_SIGNAL_SOURCE_ENGINE = 640;
static const int VA_NP_CREATE_MACHINE_SIGNALSOURCE = 650;
static const int VA_NP_CREATE_SIGNAL_SOURCE_MACHINE = 650;
static const int VA_NP_CREATE_TTS_SIGNAL_SOURCE = 660;
static const int VA_NP_CREATE_SIGNAL_SOURCE_TEXT_TO_SPEECH = 660;
// Synchronization functions
static const int VA_NP_LOCK_SCENE = 700;
static const int VA_NP_UNLOCK_SCENE = 701;
static const int VA_NP_IS_SCENE_LOCKED = 702;
static const int VA_NP_GET_SCENE_LOCKED = 702;
// Sound sources
static const int VA_NP_GET_SOUND_SOURCE_IDS = 800;
static const int VA_NP_CREATE_SOUNDSOURCE = 801;
static const int VA_NP_CREATE_SOUNDSOURCE_EXPLICIT_RENDERER = 831;
static const int VA_NP_DELETE_SOUNDSOURCE = 802;
static const int VA_NP_SET_SOUNDSOURCE_NAME = 803;
static const int VA_NP_GET_SOUNDSOURCE_NAME = 804;
static const int VA_NP_SET_SOUNDSOURCE_SIGNALSOURCE = 805;
static const int VA_NP_GET_SOUNDSOURCE_SIGNALSOURCE = 806;
static const int VA_NP_SET_SOUNDSOURCE_AURAMODE = 807;
static const int VA_NP_GET_SOUNDSOURCE_AURAMODE = 808;
static const int VA_NP_SET_SOUNDSOURCE_DIRECTIVITY = 809;
static const int VA_NP_GET_SOUNDSOURCE_DIRECTIVITY = 810;
static const int VA_NP_SET_SOUNDSOURCE_SOUND_POWER = 811;
static const int VA_NP_GET_SOUNDSOURCE_SOUND_POWER = 812;
static const int VA_NP_SET_SOUNDSOURCE_MUTED = 813;
static const int VA_NP_IS_SOUNDSOURCE_MUTED = 814;
static const int VA_NP_SET_SOUNDSOURCE_POSE = 819;
static const int VA_NP_GET_SOUNDSOURCE_POSE = 820;
static const int VA_NP_SET_SOUNDSOURCE_POSITION = 815;
static const int VA_NP_GET_SOUNDSOURCE_POSITION = 816;
static const int VA_NP_SET_SOUNDSOURCE_ORIENTATION = 821;
static const int VA_NP_GET_SOUNDSOURCE_ORIENTATION = 822;
static const int VA_NP_SET_SOUNDSOURCE_ORIENTATION_VU = 817;
static const int VA_NP_GET_SOUNDSOURCE_ORIENTATION_VU = 818;
static const int VA_NP_SET_SOUNDSOURCE_PARAMETERS = 829;
static const int VA_NP_GET_SOUNDSOURCE_PARAMETERS = 830;
static const int VA_NP_SET_SOUNDSOURCE_ENABLED = 832;
static const int VA_NP_GET_SOUNDSOURCE_ENABLED = 833;
static const int VA_NP_CREATE_SOUND_SOURCE = 801;
static const int VA_NP_CREATE_SOUND_SOURCE_EXPLICIT_RENDERER = 831;
static const int VA_NP_DELETE_SOUND_SOURCE = 802;
static const int VA_NP_SET_SOUND_SOURCE_NAME = 803;
static const int VA_NP_GET_SOUND_SOURCE_NAME = 804;
static const int VA_NP_SET_SOUND_SOURCE_SIGNALSOURCE = 805;
static const int VA_NP_GET_SOUND_SOURCE_SIGNALSOURCE = 806;
static const int VA_NP_SET_SOUND_SOURCE_AURAMODE = 807;
static const int VA_NP_GET_SOUND_SOURCE_AURAMODE = 808;
static const int VA_NP_SET_SOUND_SOURCE_DIRECTIVITY = 809;
static const int VA_NP_GET_SOUND_SOURCE_DIRECTIVITY = 810;
static const int VA_NP_SET_SOUND_SOURCE_SOUND_POWER = 811;
static const int VA_NP_GET_SOUND_SOURCE_SOUND_POWER = 812;
static const int VA_NP_GET_SOUND_SOURCE_MUTED = 813;
static const int VA_NP_SET_SOUND_SOURCE_MUTED = 814;
static const int VA_NP_SET_SOUND_SOURCE_POSE = 819;
static const int VA_NP_GET_SOUND_SOURCE_POSE = 820;
static const int VA_NP_SET_SOUND_SOURCE_POSITION = 815;
static const int VA_NP_GET_SOUND_SOURCE_POSITION = 816;
static const int VA_NP_SET_SOUND_SOURCE_ORIENTATION = 821;
static const int VA_NP_GET_SOUND_SOURCE_ORIENTATION = 822;
static const int VA_NP_SET_SOUND_SOURCE_ORIENTATION_VU = 817;
static const int VA_NP_GET_SOUND_SOURCE_ORIENTATION_VU = 818;
static const int VA_NP_SET_SOUND_SOURCE_PARAMETERS = 829;
static const int VA_NP_GET_SOUND_SOURCE_PARAMETERS = 830;
static const int VA_NP_SET_SOUND_SOURCE_ENABLED = 832;
static const int VA_NP_GET_SOUND_SOURCE_ENABLED = 833;
static const int VA_NP_GET_SOUND_SOURCE_INFO = 834;
static const int VA_NP_GET_SOUND_SOURCE_GEOMETRY_MESH = 835;
static const int VA_NP_SET_SOUND_SOURCE_GEOMETRY_MESH = 836;
// Listeners
static const int VA_NP_GET_SOUND_RECEIVER_IDS = 900;
......@@ -189,8 +185,7 @@ 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;
// Scene
......@@ -202,6 +197,7 @@ public:
static const int VA_NP_GET_SCENE_ENABLED = 1005;
static const int VA_NP_SET_SCENE_ENABLED = 1006;
// Portals
static const int VA_NP_CREATE_SOUND_PORTAL = 1600;
static const int VA_NP_GET_SOUND_PORTAL_IDS = 1601;
static const int VA_NP_GET_SOUND_PORTAL_NAME = 1602;
......@@ -224,6 +220,7 @@ public:
static const int VA_NP_SET_SOUND_PORTAL_SOUND_RECEIVER = 1619;
static const int VA_NP_GET_SOUND_PORTAL_INFO = 1620;
// Geometry meshes
static const int VA_NP_CREATE_GEOMETRY_MESH = 1700;
static const int VA_NP_CREATE_GEOMETRY_MESH_FROM_PARAMETERS = 1701;
static const int VA_NP_DELETE_GEOMETRY_MESH = 1702;
......@@ -236,6 +233,7 @@ public:
static const int VA_NP_GET_GEOMETRY_MESH_ENABLED = 1709;
static const int VA_NP_SET_GEOMETRY_MESH_ENABLED = 1710;
// Acoustic materials
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;
......@@ -246,6 +244,7 @@ public:
static const int VA_NP_GET_ACOUSTIC_MATERIAL_PARAMETERS = 1408;
static const int VA_NP_SET_ACOUSTIC_MATERIAL_PARAMETERS = 1409;
// Medium
static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_SOUND_SPEED = 1500;
static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_SOUND_SPEED = 1501;
static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_TEMPERATURE = 1502;
......@@ -259,13 +258,14 @@ public:
static const int VA_NP_GET_HOMOGENEOUS_MEDIUM_PARAMETERS = 1510;
static const int VA_NP_SET_HOMOGENEOUS_MEDIUM_PARAMETERS = 1511;
// Control
static const int VA_NP_GET_INPUT_GAIN = 1100;
static const int VA_NP_SET_INPUT_GAIN = 1101;
static const int VA_NP_IS_INPUT_MUTED = 1102;
static const int VA_NP_GET_INPUT_MUTED = 1102;
static const int VA_NP_SET_INPUT_MUTED = 1103;
static const int VA_NP_GET_OUTPUT_GAIN = 1104;
static const int VA_NP_SET_OUTPUT_GAIN = 1105;
static const int VA_NP_IS_OUTPUT_MUTED = 1106;
static const int VA_NP_GET_OUTPUT_MUTED = 1106;
static const int VA_NP_SET_OUTPUT_MUTED = 1107;
static const int VA_NP_GET_GLOBAL_AURALIZATION_MODE = 1108;
static const int VA_NP_SET_GLOBAL_AURALIZATION_MODE = 1109;
......@@ -277,15 +277,17 @@ public:
static const int VA_NP_GET_ACTIVE_LISTENER_EXPLICIT_RENDERER = 1115;
static const int VA_NP_SET_ACTIVE_LISTENER_EXPLICIT_RENDERER = 1116;
// Renderers
static const int VA_NP_RENDERER_GET_INFOS = 1200;
static const int VA_NP_RENDERER_SET_MUTED = 1201;
static const int VA_NP_RENDERER_IS_MUTED = 1202;
static const int VA_NP_RENDERER_GET_MUTED = 1202;
static const int VA_NP_RENDERER_GET_GAIN = 1203;
static const int VA_NP_RENDERER_SET_GAIN = 1204;
// Reproductions
static const int VA_NP_REPRODUCTION_GET_INFOS = 1300;
static const int VA_NP_REPRODUCTION_SET_MUTED = 1301;
static const int VA_NP_REPRODUCTION_IS_MUTED = 1302;
static const int VA_NP_REPRODUCTION_GET_MUTED = 1302;
static const int VA_NP_REPRODUCTION_GET_GAIN = 1303;
static const int VA_NP_REPRODUCTION_SET_GAIN = 1304;
......
......@@ -16,37 +16,38 @@
#include <VAException.h>
#include <sstream>
void SplitServerString(const std::string& sServerString, std::string& sAddress, int& iPort, int iDefaultPort)
void SplitServerString( const std::string& sServerString, std::string& sAddress, int& iPort, const int iDefaultPort )
{
// Rckwarts nach einem Doppelpunkt suchen
size_t i = sServerString.rfind(':');
size_t i = sServerString.rfind( ':' );
// Adresse darf nicht leer sein bzw. mit Doppelpunkt beginnen
if (i==0)
VA_EXCEPT2(INVALID_PARAMETER, "Invalid address format, server name missing");
if( i == 0 )
VA_EXCEPT2( INVALID_PARAMETER, "Invalid address format, server name missing" );
// Kein Doppelpunkt oder keine Doppelpunkt ohne Portnummer => Ist OK, aber Standardport verwenden
if ( (i==std::string::npos) || (i == sServerString.length() - 1) ) {
if( ( i == std::string::npos ) || ( i == sServerString.length() - 1 ) )
{
// Default Port setzen
iPort = iDefaultPort;
// Serveradresse auslesen
if (i == sServerString.length() - 1)
sAddress = sServerString.substr(0, i); // Nur Doppelpunkt ohne Port
if( i == sServerString.length() - 1 )
sAddress = sServerString.substr( 0, i ); // Nur Doppelpunkt ohne Port
else
sAddress = sServerString; // Kein Doppelpunkt
// Adresse darf nicht leer sein
if (sAddress.empty())
VA_EXCEPT2(INVALID_PARAMETER, "Invalid address format, server name missing");
if( sAddress.empty() )
VA_EXCEPT2( INVALID_PARAMETER, "Invalid address format, server name missing" );
return;
}
sAddress = sServerString.substr(0, i);
std::string t = sServerString.substr(i+1, sServerString.length()-i-1);
std::stringstream ss(t);
sAddress = sServerString.substr( 0, i );
std::string t = sServerString.substr( i + 1, sServerString.length() - i - 1 );
std::stringstream ss( t );
if ((ss >> iPort).fail())
VA_EXCEPT2(INVALID_PARAMETER, "Invalid address format");
if( ( ss >> iPort ).fail() )
VA_EXCEPT2( INVALID_PARAMETER, "Invalid address format" );
}
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