VJ Master 1.0
Real-time audio analysis and visualisation.
Loading...
Searching...
No Matches
ST_AudioControlManagerBase.h
1// Copyright (c) 2025 Aaron Trotter (ShaderTech). All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Subsystems/GameInstanceSubsystem.h"
7#include "Main/ST_AudioControlSettings.h"
8#include "ST_AudioControlManagerBase.generated.h"
9
17UCLASS(Abstract)
18class ST_AUDIOCONTROL_API UST_AudioControlManagerBase : public UGameInstanceSubsystem
19{
20 GENERATED_BODY()
21
22public:
27
28protected:
35 virtual void Initialize(FSubsystemCollectionBase& Collection) override;
36
42 virtual void Deinitialize() override;
43
44public:
51 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl")
52 bool RegisterManagedItem(UObject* ManagedItem);
53
60 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl")
61 bool DeregisterManagedItem(UObject* ManagedItem);
62
69 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl")
71
78 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl")
80
86 inline const TArray<UObject*>& GetManagedItems() const;
87
93 inline const TArray<FST_AudioController>& GetRegisteredControllers() const;
94
95protected:
102 virtual void OnManagedItemRegistered(UObject* ManagedItem, bool bFirstManagedItemRegistered);
103
110 virtual void OnManagedItemDeregistered(UObject* ManagedItem, bool bAllManagedItemDeregistered);
111
118 virtual void OnControllerRegistered(FST_AudioController Controller, bool bFirstControllerRegistered);
119
126 virtual void OnControllerDeregistered(FST_AudioController Controller, bool bAllControllersDeregistered);
127
128private:
130 UPROPERTY(Transient)
131 TArray<UObject*> ManagedItems;
132
134 UPROPERTY(Transient)
135 TArray<FST_AudioController> RegisteredControllers;
136};
137
138inline const TArray<UObject*>& UST_AudioControlManagerBase::GetManagedItems() const
139{
140 return ManagedItems;
141}
142
143inline const TArray<FST_AudioController>& UST_AudioControlManagerBase::GetRegisteredControllers() const
144{
145 return RegisteredControllers;
146}
bool RegisterManagedItem(UObject *ManagedItem)
Registers a managed item with the subsystem.
Definition ST_AudioControlManagerBase.cpp:38
UST_AudioControlManagerBase()
Constructor for UST_AudioControlManagerBase.
Definition ST_AudioControlManagerBase.cpp:8
const TArray< FST_AudioController > & GetRegisteredControllers() const
Gets the list of currently registered controllers.
Definition ST_AudioControlManagerBase.h:143
const TArray< UObject * > & GetManagedItems() const
Gets the list of currently managed items.
Definition ST_AudioControlManagerBase.h:138
virtual void Deinitialize() override
Called before the subsystem is destroyed.
Definition ST_AudioControlManagerBase.cpp:21
virtual void Initialize(FSubsystemCollectionBase &Collection) override
Called when the subsystem is initialized.
Definition ST_AudioControlManagerBase.cpp:14
bool DeregisterManagedItem(UObject *ManagedItem)
Deregisters a managed item from the subsystem.
Definition ST_AudioControlManagerBase.cpp:50
virtual void OnControllerRegistered(FST_AudioController Controller, bool bFirstControllerRegistered)
Called internally when a controller is registered.
Definition ST_AudioControlManagerBase.cpp:96
bool RegisterController(FST_AudioController Controller)
Registers an audio controller with the subsystem.
Definition ST_AudioControlManagerBase.cpp:62
bool DeregisterController(FST_AudioController Controller)
Deregisters an audio controller from the subsystem.
Definition ST_AudioControlManagerBase.cpp:74
virtual void OnManagedItemRegistered(UObject *ManagedItem, bool bFirstManagedItemRegistered)
Called internally when a managed item is registered.
Definition ST_AudioControlManagerBase.cpp:86
virtual void OnControllerDeregistered(FST_AudioController Controller, bool bAllControllersDeregistered)
Called internally when a controller is deregistered.
Definition ST_AudioControlManagerBase.cpp:100
virtual void OnManagedItemDeregistered(UObject *ManagedItem, bool bAllManagedItemDeregistered)
Called internally when a managed item is deregistered.
Definition ST_AudioControlManagerBase.cpp:91
Represents a basic audio controller reference.
Definition ST_AudioControlSettings.h:73