Skip to content
Snippets Groups Projects

VAServerLauncher Improvement (now also sending reproduction type and ini)

13 files
+ 251
87
Compare changes
  • Side-by-side
  • Inline

Files

@@ -13,6 +13,7 @@
void UVAAudiofileSignalSource::Initialize()
{
StorePlayStateInternallyEvent.Attach(this);
if (bInitialized)
{
FVAUtils::LogStuff("[UVAAudiofileSignalSource::Initialize()]: Signal source is already initialized, aborting...", false);
@@ -27,6 +28,15 @@ void UVAAudiofileSignalSource::Initialize()
bInitialized = true;
}
UVAAudiofileSignalSource::~UVAAudiofileSignalSource()
{
if(bInitialized)
{
StorePlayStateInternallyEvent.Detach();
//otherwise it was never attached and would throw a warning
}
}
// ****************************************************************** //
// ******* Bluepring Functions ************************************** //
// ****************************************************************** //
@@ -111,6 +121,7 @@ bool UVAAudiofileSignalSource::SetLoop(const bool bLoopN)
return true;
}
bLoop = bLoopN;
if (!UVirtualRealityUtilities::IsMaster())
{
@@ -122,7 +133,6 @@ bool UVAAudiofileSignalSource::SetLoop(const bool bLoopN)
return true;
}
bLoop = bLoopN;
return FVAPlugin::SetSignalSourceBufferLooping(ID, bLoop);
}
@@ -137,15 +147,14 @@ bool UVAAudiofileSignalSource::SetPlayBackPosition(const float Time)
bool UVAAudiofileSignalSource::SetPlayAction(const int Action)
{
InterallyStoredPlayAction = Action;
StorePlayStateInternallyEvent.Send(Action); //also send this to all slaves, so potentially still pending send numbers from GetPlayAction are overwritten
if (!UVirtualRealityUtilities::IsMaster())
{
return false;
}
if (int(GetPlayAction()) == Action)
{
return true;
}
return FVAPlugin::SetSignalSourceBufferPlayAction(ID, EPlayAction::Type(Action));
}
@@ -165,18 +174,29 @@ bool UVAAudiofileSignalSource::GetLoop() const
return bLoop;
}
EPlayAction::Type UVAAudiofileSignalSource::GetPlayActionEnum() const
EPlayAction::Type UVAAudiofileSignalSource::GetPlayActionEnum(bool bDirectOnMaster /*= false*/)
{
return EPlayAction::Type(GetPlayAction());
return EPlayAction::Type(GetPlayAction(bDirectOnMaster));
}
int UVAAudiofileSignalSource::GetPlayAction() const
int UVAAudiofileSignalSource::GetPlayAction(bool bDirectOnMaster /*= false*/)
{
if (!UVirtualRealityUtilities::IsMaster())
{
return -1;
//we return the internally stored action in case this is in cluster and not the master
//but also update the internally stored data by the one which the master can get from the VAServer
//However, using cluster events to sync, so new data might only be available next frame!
if (UVirtualRealityUtilities::IsMaster())
{
// in case of not being in cluster mode this directly calls StorePlayStateInternally() updating InterallyStoredPlayAction directly
// otherwise (in cluster mode) this emits acluster event, so the internal data will be updated before next Tick
int VAServerPlayAction = FVAPlugin::GetSignalSourceBufferPlayAction(ID);
StorePlayStateInternallyEvent.Send(VAServerPlayAction);
if(bDirectOnMaster)
{
return VAServerPlayAction;
}
}
return FVAPlugin::GetSignalSourceBufferPlayAction(ID);
return InterallyStoredPlayAction;
}
bool UVAAudiofileSignalSource::CopySignalSourceSettings(const std::string& OtherID)
@@ -202,3 +222,8 @@ bool UVAAudiofileSignalSource::CopySignalSourceSettings(const std::string& Other
}
return FVAPlugin::SetSignalSourceBufferPlayAction(OtherID, EPlayAction::Type(PlayAction));
}
void UVAAudiofileSignalSource::StorePlayStateInternally(int PlayAction)
{
InterallyStoredPlayAction = PlayAction;
}
Loading