Skip to content
Snippets Groups Projects
Commit b82cfdc2 authored by Marius Schmeling's avatar Marius Schmeling
Browse files

DirManager Logging, config now in Study folder

parent 135463be
No related branches found
No related tags found
1 merge request!4Release
......@@ -30,6 +30,9 @@ VADirectivity::VADirectivity(FString fileName, TArray<FString> phonemes_)
UE_LOG(LogTemp, Warning, TEXT(" Directivity file %s cannot be found!"), *fileName);
return;
}
VAUtils::logStuff("created new VADirectivity");
}
......
......
#include "VADirectivityManager.h"
#include "VAUtils.h"
#include "Core.h"
#include "Interfaces/IPluginManager.h"
......@@ -22,8 +25,12 @@ void VADirectivityManager::readConfigFile(FString configFileName_) {
configFileName = configFileName_;
// Read config File
FString BaseDir = IPluginManager::Get().FindPlugin("VAPlugin")->GetBaseDir();
FString dir = FPaths::Combine(*BaseDir, TEXT("config/directivities/"));
// FString BaseDir = IPluginManager::Get().FindPlugin("VAPlugin")->GetBaseDir();
// FString dir = FPaths::Combine(*BaseDir, TEXT("config/directivities/"));
FString RelativePath = FPaths::ProjectContentDir();
FString dir = IFileManager::Get().ConvertToAbsolutePathForExternalAppForRead(*RelativePath) + "Study/";
FString config_file_name = dir + configFileName;
GConfig->UnloadFile(config_file_name);
......@@ -32,9 +39,11 @@ void VADirectivityManager::readConfigFile(FString configFileName_) {
FConfigFile* config = GConfig->FindConfigFile(config_file_name);
if (config == nullptr) {
VAUtils::logStuff(FString("[VADirectivityManager::readConfigFile()] - Unable to load directivity config file") + config_file_name);
VAUtils::logStuff(FString("[VADirectivityManager::readConfigFile()] - Unable to load directivity config file: ") + config_file_name);
return;
}
VAUtils::logStuff(FString("[VADirectivityManager::readConfigFile()] - Config file loaded: ") + config_file_name);
FString listSymbol, mapToSymbol;
config->GetString(TEXT("DirectivityMapping"), TEXT("listSymbol"), listSymbol);
......@@ -83,6 +92,13 @@ void VADirectivityManager::readConfigFile(FString configFileName_) {
// continue;
// }
FString output = "Mapping from: ";
for (auto p : tmp_phonemes) {
output.Append(p + ",");
}
output.Append(" --> " + tmp_fileName);
VAUtils::logStuff(output);
VADirectivity* tmpDir = new VADirectivity(tmp_fileName, tmp_phonemes);
directivities.Add(tmpDir);
......
......
......@@ -174,11 +174,11 @@ void FVAPluginModule::askForSettings(FString host, int port, bool askForDebugMod
isMaster = IDisplayCluster::Get().GetClusterMgr() != nullptr && IDisplayCluster::Get().GetClusterMgr()->IsMaster();
EAppReturnType::Type ret = FMessageDialog::Open(EAppMsgType::YesNo, FText::FromString("Use VA Server (" + host + ":" + FString::FromInt(port) + ")? If yes, make sure to have it switched on."));
if (ret == EAppReturnType::Type::No) {
useVA = false;
if (ret == EAppReturnType::Type::Yes) {
useVA = true;
}
else {
useVA = true;
useVA = false;
debugMode = false;
initialized = true;
return;
......
......
......@@ -168,9 +168,14 @@ void AVAReceiverActor::Tick(float DeltaTime)
timeSinceUpdate = 0.0f;
}
if (totalTime > 8.0f) {
if (totalTime > 2.0f) {
if (FVAPluginModule::getDebugMode()) {
runOnAllNodes("debugMode = false");
timeSinceUpdate = -100000.0f;
}
else {
runOnAllNodes("debugMode = true");
}
totalTime = 0.0f;
}
}
......@@ -183,20 +188,18 @@ bool AVAReceiverActor::updateVirtualWorldPosition()
{
controller->GetPlayerViewPoint(tmpPosF, tmpRotF);
FString text = "Position of Receiver (id: " + FString::FromInt(receiverID) + ") is: ";
text.Append(FString::FromInt(tmpPosF.X)).Append("/").Append(FString::FromInt(tmpPosF.Y)).Append("/").Append(FString::FromInt(tmpPosF.Z));
VAUtils::logStuff(text);
text = "Rotation of Receiver (id: " + FString::FromInt(receiverID) + ") is: ";
text.Append(FString::FromInt(tmpRotF.Roll)).Append("/").Append(FString::FromInt(tmpRotF.Pitch)).Append("/").Append(FString::FromInt(tmpRotF.Yaw));
VAUtils::logStuff(text);
// FString text = "Position of Receiver (id: " + FString::FromInt(receiverID) + ") is: ";
// text.Append(FString::FromInt(tmpPosF.X)).Append("/").Append(FString::FromInt(tmpPosF.Y)).Append("/").Append(FString::FromInt(tmpPosF.Z));
// VAUtils::logStuff(text);
//
// text = "Rotation of Receiver (id: " + FString::FromInt(receiverID) + ") is: ";
// text.Append(FString::FromInt(tmpRotF.Roll)).Append("/").Append(FString::FromInt(tmpRotF.Pitch)).Append("/").Append(FString::FromInt(tmpRotF.Yaw));
//
// VAUtils::logStuff(text);
FVAPluginModule::setSoundReceiverPosition(receiverID, tmpPosF);
FVAPluginModule::setSoundReceiverRotation(receiverID, tmpRotF);
// FVAPluginModule::updateReceiverPos(tmpPosF, tmpRotF);
return false;
}
......@@ -395,6 +398,8 @@ void AVAReceiverActor::HandleClusterEvent(const FDisplayClusterClusterEvent & Ev
void AVAReceiverActor::handleClusterCommand(FString command)
{
VAUtils::logStuff("Cluster Command " + command + " received");
if (command == "useVA = false") {
FVAPluginModule::setUseVA(false);
}
......
......
......@@ -14,33 +14,6 @@ AVASoundSourceRepresentation::AVASoundSourceRepresentation()
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
// reflection Sphere
// sphereComp2 = CreateDefaultSubobject<USphereComponent>(FName("ShapeComponent"));
// sphereComp2->bHiddenInGame = false;
// sphereComp2->Mobility = EComponentMobility::Movable;
// RootComponent = sphereComp2;
//
// sphereMesh2 = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("VisualRepresentation"));
// sphereMesh2->AttachTo(RootComponent);
//
// // static ConstructorHelpers::FObjectFinder<UStaticMesh> SphereMeshAsset(TEXT("/VAPlugin/Shape_Cone.Shape_Cone"));
//
// static ConstructorHelpers::FObjectFinder<UStaticMesh> SphereMeshAsset(TEXT("/Game/StarterContent/Shapes/Shape_Cone.Shape_Cone"));
//
// // FString BaseDir = IPluginManager::Get().FindPlugin("VAPlugin")->GetBaseDir();
// // FString pathFile = FPaths::Combine(*BaseDir, TEXT("Content/Shape_Cone.Shape_Cone"));
// // BaseDir.Append("/Content/Shape_Cone.Shape_Cone");
// // static ConstructorHelpers::FObjectFinder<UStaticMesh> SphereMeshAsset(*BaseDir);
//
// if (SphereMeshAsset.Succeeded()) {
// sphereMesh2->SetStaticMesh(SphereMeshAsset.Object);
// sphereMesh2->SetRelativeLocation(FVector(80.0f, 0.0f, 0.0f));
// sphereMesh2->SetRelativeRotation(FRotator(90.0f, 0.0f, 0.0f));
// sphereMesh2->SetWorldScale3D(FVector(0.8f));
// }
//
// setVisibility(FVAPluginModule::isInDebugMode());
sphereComp = CreateDefaultSubobject<USphereComponent>(FName("SphereComp"));
sphereComp->bHiddenInGame = true;
sphereComp->Mobility = EComponentMobility::Movable;
......
......
......@@ -230,61 +230,4 @@ int VAUtils::EPlayActionToVAAction(EPlayAction action)
}
/*
bool VAUtils::getViewingPos(FVector* vec, FQuat* quat)
{
if (vec == NULL || quat == NULL)
return false;
FRotator* rot = new FRotator();
//UHeadMountedDisplayFunctionLibrary::GetOrientationAndPosition(*rot, *vec);
*quat = rot->Quaternion();
delete rot;
return true;
}
bool VAUtils::getViewingPos(VAVec3* vec, VAQuat* quat)
{
if (vec == NULL || quat == NULL)
return false;
FVector* vecF = new FVector();
FQuat* quatF = new FQuat();
FRotator* rot = new FRotator();
if(FVAPluginModule::isViewModeHMD())
{
//UHeadMountedDisplayFunctionLibrary::GetOrientationAndPosition(*rot, *vecF);
}
*quatF = rot->Quaternion();
fQuatToVAQuat(quatF, quat);
fVecToVAVec3(vecF, vec);
delete vecF, quatF, rot;
return true;
}
bool VAUtils::getViewingPosVA(VAVec3* vec, VAQuat* quat)
{
if (vec == NULL || quat == NULL)
return false;
FVector* vecF = new FVector();
FQuat* quatF = new FQuat();
FRotator* rot = new FRotator();
//UHeadMountedDisplayFunctionLibrary::GetOrientationAndPosition(*rot, *vecF);
*quatF = rot->Quaternion();
fQuatToVAQuatRot(quatF, quat);
fVecToVAVec3Rot(vecF, vec);
delete vecF, quatF, rot;
return true;
}
*/
......@@ -80,7 +80,7 @@ public:
// Factor for global output Gain
UPROPERTY(EditAnywhere, meta = (DisplayName = "Name of ini file for directivities", Category = "Directivity Manager"))
FString dirName = "default.ini";
FString dirName = "VADir_default.ini";
......
......
[DirectivityMapping]
# Symbol the list is devided (default: ",")
listSymbol=,
# Symbol the mapping is done (default ":")
mapToSymbol=:
# Mapping in form:
# mapping=phoneme1,phoeneme2,phoneme3:file1
# mapping=default,phoneme4:file2
mapping=a,b,c:$(HumanDir)
# old data, please ignore:
dirFolder=
default=defaultDir
dividingSymbol=,
pair=a,ab
pair=b,bb
pair=c,cb
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment