Skip to content
Snippets Groups Projects
Commit 9edacff9 authored by Ehret's avatar Ehret
Browse files

have seperate sound source classes for each signal source, for easier...

have seperate sound source classes for each signal source, for easier usability and avoiding problems in blueprints
parent a0fe0fbd
No related branches found
No related tags found
No related merge requests found
Showing with 224 additions and 209 deletions
......@@ -5,12 +5,11 @@
#include <string>
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "VAAbstractSignalSource.generated.h"
UCLASS( ClassGroup=(VA), Abstract, meta=(BlueprintSpawnableComponent), HideDropdown, HideCategories=("Tags", "AssetUserData", "Activation", "Collision", "Cooking") )
class UVAAbstractSignalSource : public UActorComponent
UCLASS( ClassGroup=(VA), Abstract, HideCategories=("Tags", "AssetUserData", "Activation", "Collision", "Cooking") )
class UVAAbstractSignalSource : public UObject
{
GENERATED_BODY()
......
// Fill out your copyright notice in the Description page of Project Settings.
#include "VASourceComponent.h"
#include "SoundSource/VAAbstractSourceComponent.h"
#include "SoundSource/VASoundSource.h"
#include "VAReceiverActor.h"
......@@ -17,7 +17,7 @@
// Sets default values for this component's properties
UVASourceComponent::UVASourceComponent()
UVAAbstractSourceComponent::UVAAbstractSourceComponent()
{
PrimaryComponentTick.bCanEverTick = true;
......@@ -34,28 +34,21 @@ UVASourceComponent::UVASourceComponent()
}
}
void UVASourceComponent::OnComponentCreated()
{
Super::OnComponentCreated();
ForceUpdateSignalSourceType(SignalSourceType);
}
// Called when the game starts
void UVASourceComponent::BeginPlay()
void UVAAbstractSourceComponent::BeginPlay()
{
Super::BeginPlay();
BindSignalSourceEvents();
}
void UVASourceComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
void UVAAbstractSourceComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
SoundSource.Reset();
UnbindSignalSourceEvents();
Super::EndPlay(EndPlayReason);
}
// Called every frame
void UVASourceComponent::TickComponent(const float DeltaTime, const ELevelTick TickType,
void UVAAbstractSourceComponent::TickComponent(const float DeltaTime, const ELevelTick TickType,
FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
......@@ -90,7 +83,7 @@ void UVASourceComponent::TickComponent(const float DeltaTime, const ELevelTick T
}
void UVASourceComponent::Initialize()
void UVAAbstractSourceComponent::Initialize()
{
if (!FVAPlugin::GetUseVA() || bInitialized)
{
......@@ -199,7 +192,7 @@ void UVASourceComponent::Initialize()
bInitialized = true;
}
void UVASourceComponent::UpdatePose()
void UVAAbstractSourceComponent::UpdatePose()
{
if (!FVAPlugin::GetUseVA() || !SoundSource.IsValid())
{
......@@ -215,36 +208,8 @@ void UVASourceComponent::UpdatePose()
}
}
bool UVASourceComponent::ForceUpdateSignalSourceType(TSubclassOf<UVAAbstractSignalSource> SignalSourceTypeN)
{
if (SignalSource != nullptr)
{
UnbindSignalSourceEvents();
SignalSource->Rename(*MakeUniqueObjectName(this, UVAAbstractSignalSource::StaticClass(), "SignalSource_EXPIRED").ToString());
SignalSource->MarkPendingKill();
SignalSource = nullptr;
}
if (SignalSourceTypeN == UVAAudiofileSignalSource::StaticClass())
{
SignalSource = NewObject<UVAAbstractSignalSource>(this, SignalSourceTypeN);
}
else if (SignalSourceTypeN == UVAJetEngineSignalSource::StaticClass())
{
SignalSource = NewObject<UVAAbstractSignalSource>(this, SignalSourceTypeN);
}
else if (SignalSourceTypeN != nullptr)
{
FVAUtils::OpenMessageBox("[UVASourceComponent::PostEditChangeProperty()]: Signal source type is not supported", true);
return false;
}
SignalSourceType = SignalSourceTypeN;
BindSignalSourceEvents();
return true;
}
bool UVASourceComponent::SetSignalSourceID(const std::string& SignalSourceID)
bool UVAAbstractSourceComponent::SetSignalSourceID(const std::string& SignalSourceID)
{
if (!SoundSource.IsValid())
{
......@@ -262,76 +227,17 @@ bool UVASourceComponent::SetSignalSourceID(const std::string& SignalSourceID)
return true;
}
void UVASourceComponent::OnSignalSourceIDChanged(const std::string& SignalSourceID)
{
SetSignalSourceID(SignalSourceID);
}
void UVASourceComponent::BindSignalSourceEvents()
{
UVAAudiofileSignalSource* AudioSignalSource = Cast<UVAAudiofileSignalSource>(SignalSource);
if (AudioSignalSource && !AudioSignalSource->OnAudiofileChanged().IsBoundToObject(this))
{
SignalSourceChangedDelegate = AudioSignalSource->OnAudiofileChanged().AddUObject(this, &UVASourceComponent::OnSignalSourceIDChanged);
}
}
void UVASourceComponent::UnbindSignalSourceEvents()
{
if (SignalSourceChangedDelegate.IsValid())
{
UVAAudiofileSignalSource* AudioSignalSource = Cast<UVAAudiofileSignalSource>(SignalSource);
if (AudioSignalSource)
{
AudioSignalSource->OnAudiofileChanged().Remove(SignalSourceChangedDelegate);
}
SignalSourceChangedDelegate.Reset();
}
}
bool UVASourceComponent::ShouldSendCommand() const
bool UVAAbstractSourceComponent::ShouldSendCommand() const
{
return (bInitialized && FVAPlugin::GetUseVA() && FVAPlugin::GetIsMaster());
}
// ****************************************************************** //
// ******* Signal Source ******************************************** //
// ****************************************************************** //
bool UVASourceComponent::SetSignalSourceType(TSubclassOf<UVAAbstractSignalSource> SignalSourceTypeN)
{
if(SignalSourceType == SignalSourceTypeN)
return true;
if (!ForceUpdateSignalSourceType(SignalSourceTypeN))
return false;
if (SignalSource)
{
SignalSource->Initialize();
return SetSignalSourceID(SignalSource->GetID());
}
return true;
}
TSubclassOf<UVAAbstractSignalSource> UVASourceComponent::GetSignalSourceType() const
{
return SignalSourceType;
}
UVAAbstractSignalSource* UVASourceComponent::GetSignalSource() const
{
return SignalSource;
}
// ****************************************************************** //
// ******* Sound Source Settings ************************************ //
// ****************************************************************** //
bool UVASourceComponent::MuteSound(const bool bMute)
bool UVAAbstractSourceComponent::MuteSound(const bool bMute)
{
if (!ShouldSendCommand())
{
......@@ -349,7 +255,7 @@ bool UVASourceComponent::MuteSound(const bool bMute)
}
bool UVASourceComponent::SetSoundPower(const float Power)
bool UVAAbstractSourceComponent::SetSoundPower(const float Power)
{
if (!ShouldSendCommand())
{
......@@ -367,7 +273,7 @@ bool UVASourceComponent::SetSoundPower(const float Power)
return true;
}
float UVASourceComponent::GetSoundPower() const
float UVAAbstractSourceComponent::GetSoundPower() const
{
return SoundPower;
}
......@@ -376,7 +282,7 @@ float UVASourceComponent::GetSoundPower() const
// ******* Image Sources / Reflections ****************************** //
// ****************************************************************** //
bool UVASourceComponent::GetHandleReflections() const
bool UVAAbstractSourceComponent::GetHandleReflections() const
{
return bHandleReflections;
}
......@@ -387,7 +293,7 @@ bool UVASourceComponent::GetHandleReflections() const
// ******* Sound Pose *********************************************** //
// ****************************************************************** //
FVector UVASourceComponent::GetPosition() const
FVector UVAAbstractSourceComponent::GetPosition() const
{
FVector Pos;
switch (MovementSetting)
......@@ -418,7 +324,7 @@ FVector UVASourceComponent::GetPosition() const
return Pos;
}
FRotator UVASourceComponent::GetRotation() const
FRotator UVAAbstractSourceComponent::GetRotation() const
{
FRotator Rot;
switch (MovementSetting)
......@@ -449,7 +355,7 @@ FRotator UVASourceComponent::GetRotation() const
return Rot;
}
bool UVASourceComponent::SetMovementSetting(const EMovement::Type NewMovementSetting)
bool UVAAbstractSourceComponent::SetMovementSetting(const EMovement::Type NewMovementSetting)
{
if (!FVAPlugin::GetUseVA() || !SoundSource.IsValid())
{
......@@ -467,7 +373,7 @@ bool UVASourceComponent::SetMovementSetting(const EMovement::Type NewMovementSet
return true;
}
bool UVASourceComponent::SetUsePoseOffset(const bool bNewUsePoseOffset)
bool UVAAbstractSourceComponent::SetUsePoseOffset(const bool bNewUsePoseOffset)
{
if (!FVAPlugin::GetUseVA() || !SoundSource.IsValid())
{
......@@ -485,7 +391,7 @@ bool UVASourceComponent::SetUsePoseOffset(const bool bNewUsePoseOffset)
return true;
}
bool UVASourceComponent::SetOffsetPosition(const FVector Pos)
bool UVAAbstractSourceComponent::SetOffsetPosition(const FVector Pos)
{
if (!FVAPlugin::GetUseVA() || !SoundSource.IsValid())
{
......@@ -504,7 +410,7 @@ bool UVASourceComponent::SetOffsetPosition(const FVector Pos)
return true;
}
bool UVASourceComponent::SetOffsetRotation(const FRotator Rot)
bool UVAAbstractSourceComponent::SetOffsetRotation(const FRotator Rot)
{
if (!FVAPlugin::GetUseVA() || !SoundSource.IsValid())
{
......@@ -528,7 +434,7 @@ bool UVASourceComponent::SetOffsetRotation(const FRotator Rot)
// ******* Directivity stuff **************************************** //
// ****************************************************************** //
bool UVASourceComponent::SetDirectivityByMapping(const FString Phoneme)
bool UVAAbstractSourceComponent::SetDirectivityByMapping(const FString Phoneme)
{
if (!ShouldSendCommand())
{
......@@ -541,7 +447,7 @@ bool UVASourceComponent::SetDirectivityByMapping(const FString Phoneme)
return SoundSource->SetDirectivity(CurrentReceiverActor->GetDirectivityByMapping(Phoneme));
}
bool UVASourceComponent::SetDirectivityByFileName(const FString FileName)
bool UVAAbstractSourceComponent::SetDirectivityByFileName(const FString FileName)
{
if (!ShouldSendCommand())
{
......@@ -559,7 +465,7 @@ bool UVASourceComponent::SetDirectivityByFileName(const FString FileName)
return SoundSource->SetDirectivity(CurrentReceiverActor->GetDirectivityByFileName(FileName));
}
FString UVASourceComponent::GetDirectivityFileName() const
FString UVAAbstractSourceComponent::GetDirectivityFileName() const
{
if (SoundSource.IsValid())
{
......@@ -575,7 +481,7 @@ FString UVASourceComponent::GetDirectivityFileName() const
// ******* Graphical Representation ********************************* //
// ****************************************************************** //
bool UVASourceComponent::SetVisibility(const bool bVis)
bool UVAAbstractSourceComponent::SetVisibility(const bool bVis)
{
if (!FVAPlugin::GetUseVA() || !SoundSource.IsValid())
{
......@@ -590,12 +496,12 @@ bool UVASourceComponent::SetVisibility(const bool bVis)
return true;
}
bool UVASourceComponent::GetVisibility() const
bool UVAAbstractSourceComponent::GetVisibility() const
{
return SoundSource->GetVisibility();
}
bool UVASourceComponent::SetBoneName(const FString NewBoneName)
bool UVAAbstractSourceComponent::SetBoneName(const FString NewBoneName)
{
if (!FVAPlugin::GetUseVA())
{
......@@ -622,7 +528,7 @@ bool UVASourceComponent::SetBoneName(const FString NewBoneName)
return false;
}
FString UVASourceComponent::GetBoneName() const
FString UVAAbstractSourceComponent::GetBoneName() const
{
if (MovementSetting != EMovement::AttachToBone)
{
......@@ -640,42 +546,31 @@ FString UVASourceComponent::GetBoneName() const
#if WITH_EDITOR
void UVASourceComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
if (PropertyChangedEvent.GetPropertyName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, SignalSourceType))
{
ForceUpdateSignalSourceType(SignalSourceType);
}
Super::PostEditChangeProperty(PropertyChangedEvent);
}
bool UVASourceComponent::CanEditChange(const FProperty* InProperty) const
bool UVAAbstractSourceComponent::CanEditChange(const FProperty* InProperty) const
{
const bool ParentVal = Super::CanEditChange(InProperty);
// Check Bone Name
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, BoneName))
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVAAbstractSourceComponent, BoneName))
{
return MovementSetting == EMovement::AttachToBone;
}
// Check Directivity Config
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, DirectivityByFileName))
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVAAbstractSourceComponent, DirectivityByFileName))
{
return DirectivitySetting == EDirectivitySetting::ManualFile;
}
// Check Bone Name
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, DirectivityByMapping))
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVAAbstractSourceComponent, DirectivityByMapping))
{
return DirectivitySetting == EDirectivitySetting::Phoneme;
}
// Check Bone Name
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, OffsetPosition) ||
InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVASourceComponent, OffsetRotation))
if (InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVAAbstractSourceComponent, OffsetPosition) ||
InProperty->GetFName() == GET_MEMBER_NAME_CHECKED(UVAAbstractSourceComponent, OffsetRotation))
{
return bUsePoseOffset;
}
......
// Fill out your copyright notice in the Description page of Project Settings.
#include "SoundSource/VAAudiofileSourceComponent.h"
// Sets default values for this component's properties
UVAAudiofileSourceComponent::UVAAudiofileSourceComponent() : Super()
{
SignalSource = CreateDefaultSubobject<UVAAudiofileSignalSource>("AudiofileSignalSource");
}
UVAAudiofileSignalSource* UVAAudiofileSourceComponent::GetAudiofileSignalSource() const
{
return Cast<UVAAudiofileSignalSource>(SignalSource);
}
bool UVAAudiofileSourceComponent::Play() const
{
return GetAudiofileSignalSource()->Play();
}
bool UVAAudiofileSourceComponent::PlayFromTime(float fTime) const
{
return GetAudiofileSignalSource()->PlayFromTime(fTime);
}
bool UVAAudiofileSourceComponent::Pause() const
{
return GetAudiofileSignalSource()->Pause();
}
bool UVAAudiofileSourceComponent::Stop() const
{
return GetAudiofileSignalSource()->Stop();
}
// Called when the game starts
void UVAAudiofileSourceComponent::BeginPlay()
{
Super::BeginPlay();
BindSignalSourceEvents();
}
void UVAAudiofileSourceComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
{
UnbindSignalSourceEvents();
Super::EndPlay(EndPlayReason);
}
void UVAAudiofileSourceComponent::OnAudiofileChanged(const std::string& newSignalSourceID)
{
SetSignalSourceID(newSignalSourceID);
}
void UVAAudiofileSourceComponent::BindSignalSourceEvents()
{
if (!GetAudiofileSignalSource()->OnAudiofileChanged().IsBoundToObject(this))
{
AudiofileChangedDelegate = GetAudiofileSignalSource()->OnAudiofileChanged().AddUObject(this, &UVAAudiofileSourceComponent::OnAudiofileChanged);
}
}
void UVAAudiofileSourceComponent::UnbindSignalSourceEvents()
{
if (AudiofileChangedDelegate.IsValid())
{
GetAudiofileSignalSource()->OnAudiofileChanged().Remove(AudiofileChangedDelegate);
AudiofileChangedDelegate.Reset();
}
}
// Fill out your copyright notice in the Description page of Project Settings.
#include "SoundSource/VAJetEngineSourceComponent.h"
// Sets default values for this component's properties
UVAJetEngineSourceComponent::UVAJetEngineSourceComponent() : Super()
{
SignalSource = CreateDefaultSubobject<UVAJetEngineSignalSource>("JetEngineSignalSource");
}
UVAJetEngineSignalSource* UVAJetEngineSourceComponent::GetJetEngineSignalSource() const
{
return Cast<UVAJetEngineSignalSource>(SignalSource);
}
......@@ -22,7 +22,7 @@
#include "VAUtils.h"
#include "VAReceiverActor.h"
#include "VASourceComponent.h"
#include "SoundSource/VAAbstractSourceComponent.h"
#include "VASettings.h"
#include "Engine.h"
......@@ -1327,9 +1327,9 @@ void FVAPlugin::SetDebugMode(const bool bDebugModeN)
for (AActor* Actor : ActorArray)
{
TArray<UVASourceComponent*> VAComponents;
TArray<UVAAbstractSourceComponent*> VAComponents;
Actor->GetComponents(VAComponents);
for (UVASourceComponent* VAComponent : VAComponents)
for (UVAAbstractSourceComponent* VAComponent : VAComponents)
{
VAComponent->SetVisibility(bDebugMode);
}
......
......@@ -7,7 +7,7 @@
#include "VAUtils.h"
#include "VADefines.h"
#include "VASourceComponent.h"
#include "SoundSource/VAAbstractSourceComponent.h"
#include "ImageSourceModel/VAReflectionWall.h"
#include "Directivity/VADirectivityManager.h"
#include "HRIR/VAHRIRManager.h"
......@@ -139,9 +139,9 @@ void AVAReceiverActor::BeginPlay()
for (AActor* Actor : ActorsA)
{
TArray<UVASourceComponent*> VASourceComponents;
TArray<UVAAbstractSourceComponent*> VASourceComponents;
Actor->GetComponents(VASourceComponents);
for (UVASourceComponent* SourceComponent : VASourceComponents)
for (UVAAbstractSourceComponent* SourceComponent : VASourceComponents)
{
SourceComponent->Initialize();
}
......
......@@ -3,24 +3,23 @@
#pragma once
#include "VAEnums.h" // EDir, EPlayAction, EMovement
#include "SignalSources/VAAbstractSignalSource.h"
#include "SignalSources/VAAudiofileSignalSource.h"
#include "GameFramework/Actor.h"
#include "Templates/SharedPointer.h"
#include <string>
#include "VASourceComponent.generated.h"
#include "VAAbstractSourceComponent.generated.h"
//forward declarations to not include private header files
class FVASoundSource;
class FVAImageSourceModel;
class AVAReceiverActor;
class UVAAbstractSignalSource;
UCLASS( ClassGroup=(VA), meta=(BlueprintSpawnableComponent) )
class VAPLUGIN_API UVASourceComponent : public UActorComponent
UCLASS( ClassGroup=(VA), Abstract, meta=(BlueprintSpawnableComponent), HideDropdown )
class VAPLUGIN_API UVAAbstractSourceComponent : public UActorComponent
{
GENERATED_BODY()
......@@ -36,16 +35,6 @@ protected:
ClampMin = "0.0", ClampMax = "100.0", UIMin = "0.0", UIMax = "100.0"))
float SoundPower = 0.0316227749f;
// Select the class of the signal source
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (DisplayName = "Signal Type", Category = "Signal Source", AllowAbstract = "false"))
TSubclassOf<UVAAbstractSignalSource> SignalSourceType = UVAAudiofileSignalSource::StaticClass();
// Select the type of the signal source
UPROPERTY(EditAnywhere, Instanced, NoClear, meta = (DisplayName = "Signal Source", Category = "Signal Source", AllowAbstract = "false"))
UVAAbstractSignalSource* SignalSource = nullptr;
// Decide whether to use manual Transform (below) or use Transform / Movement of Actor
UPROPERTY(EditAnywhere, meta = (DisplayName = "Position Settings", Category = "Position",
CustomStructureParam = "Move With the Object, At Object Spawn Point (unmovable, also reflections), Attatch to a Bone"))
......@@ -66,7 +55,7 @@ protected:
// Name of Bone bound to if Position is set to "Attatch to a Bone"
UPROPERTY(EditAnywhere, meta = (DisplayName = "Bone Name", Category = "Position"))
FString BoneName = "CC_Base_Head";
FString BoneName = "head";
// Choose Directivity Setting for Receiver
UPROPERTY(EditAnywhere, meta = (DisplayName = "Directivity", Category = "Directivity"))
......@@ -80,7 +69,6 @@ protected:
UPROPERTY(EditAnywhere, meta = (DisplayName = "Phoneme Directivity from config", Category = "Directivity"))
FString DirectivityByMapping = "";
// Activate to generate 1st order image sources based on VAReflectionWalls
UPROPERTY(EditAnywhere, meta = (DisplayName = "Enable", Category = "Image Source Model"))
bool bHandleReflections = false;
......@@ -89,28 +77,11 @@ protected:
public:
// Sets default values for this component's properties
UVASourceComponent();
void OnComponentCreated() override;
UVAAbstractSourceComponent();
// Called every frame
void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
// *** Signal Source *** //
// Sets the signal type used for this sound source
UFUNCTION(BlueprintCallable)
bool SetSignalSourceType(TSubclassOf<UVAAbstractSignalSource> SignalSourceTypeN);
// Gets the signal type used for this sound source
UFUNCTION(BlueprintCallable)
TSubclassOf<UVAAbstractSignalSource> GetSignalSourceType() const;
// Returns a pointer to the signal source component
UFUNCTION(BlueprintCallable)
UVAAbstractSignalSource* GetSignalSource() const;
// *** Sound Source Settings *** //
// Mute sound (true = mute)
......@@ -147,6 +118,14 @@ public:
UFUNCTION(BlueprintCallable)
bool SetMovementSetting(EMovement::Type NewMovementSetting);
// Sets the Bone name and sets the Movement Setting to follow the bone if it is found. Otherwise keeps old settings
UFUNCTION(BlueprintCallable)
bool SetBoneName(FString NewBoneName);
// Gets the Bone Name
UFUNCTION(BlueprintCallable)
FString GetBoneName() const;
// Sets to use Position Offset
UFUNCTION(BlueprintCallable)
bool SetUsePoseOffset(bool bNewUsePoseOffset);
......@@ -185,37 +164,19 @@ public:
UFUNCTION(BlueprintCallable)
bool GetVisibility() const;
// Sets the Bone name and sets the Movement Setting to follow the bone if it is found. Otherwise keeps old settings
UFUNCTION(BlueprintCallable)
bool SetBoneName(FString NewBoneName);
// Gets the Bone Name
UFUNCTION(BlueprintCallable)
FString GetBoneName() const;
protected:
// Called when the game starts
void BeginPlay() override;
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
// initialize Sound Source with the settings set //
void Initialize();
virtual void Initialize();
void UpdatePose();
bool ForceUpdateSignalSourceType(TSubclassOf<UVAAbstractSignalSource> SignalSourceTypeN);
bool SetSignalSourceID(const std::string& ID);
void OnSignalSourceIDChanged(const std::string& ID);
// *** Event/Delegates *** //
void BindSignalSourceEvents();
void UnbindSignalSourceEvents();
AVAReceiverActor* CurrentReceiverActor;
......@@ -236,13 +197,10 @@ protected:
FRotator SpawnRotation;
int UpdateRate;
private:
FDelegateHandle SignalSourceChangedDelegate;
UPROPERTY(EditAnywhere, Instanced, SimpleDisplay, NoClear, meta = (Category = "Signal Source (what to play?)"))
UVAAbstractSignalSource* SignalSource;
protected:
#if WITH_EDITOR
virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
// Function to improve settings displayed in Editor, can only be used in editor mode
bool CanEditChange(const FProperty* InProperty) const override;
#endif
......
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "SignalSources/VAAudiofileSignalSource.h"
#include "SoundSource/VAAbstractSourceComponent.h"
#include "VAAudiofileSourceComponent.generated.h"
UCLASS( ClassGroup=(VA), meta=(BlueprintSpawnableComponent) )
class VAPLUGIN_API UVAAudiofileSourceComponent : public UVAAbstractSourceComponent
{
GENERATED_BODY()
public:
UVAAudiofileSourceComponent();
//holds most interface calls to the signal source
UFUNCTION(BlueprintCallable)
UVAAudiofileSignalSource* GetAudiofileSignalSource() const;
//some convenience methods, forwarding to the UVAAudiofileSignalSource directly
UFUNCTION(BlueprintCallable)
bool Play() const;
UFUNCTION(BlueprintCallable)
bool PlayFromTime(float fTime) const; //in seconds
UFUNCTION(BlueprintCallable)
bool Pause() const;
UFUNCTION(BlueprintCallable)
bool Stop() const;
protected:
void BeginPlay() override;
void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
void OnAudiofileChanged(const std::string& newSignalSourceID);
// *** Event/Delegates *** //
void BindSignalSourceEvents();
void UnbindSignalSourceEvents();
private:
FDelegateHandle AudiofileChangedDelegate;
};
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "SignalSources/VAJetEngineSignalSource.h"
#include "SoundSource/VAAbstractSourceComponent.h"
#include "VAJetEngineSourceComponent.generated.h"
UCLASS( ClassGroup=(VA), meta=(BlueprintSpawnableComponent) )
class VAPLUGIN_API UVAJetEngineSourceComponent : public UVAAbstractSourceComponent
{
GENERATED_BODY()
public:
UVAJetEngineSourceComponent();
//holds most interface calls to the signal source
UFUNCTION(BlueprintCallable)
UVAJetEngineSignalSource* GetJetEngineSignalSource() const;
};
......@@ -28,7 +28,7 @@ class VAPLUGIN_API AVAReceiverActor : public AActor
{
GENERATED_BODY()
friend class UVASourceComponent;
friend class UVAAbstractSourceComponent;
friend class FVAPlugin;
protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment