VJ Master 1.0
Real-time audio analysis and visualisation.
Loading...
Searching...
No Matches
ST_AudioControlFunctionLibrary.h
1// Copyright (c) 2025 Aaron Trotter (ShaderTech). All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Kismet/BlueprintFunctionLibrary.h"
7#include "MIDIDeviceManager.h"
8#include "MIDIDeviceController.h"
9#include "MIDIDeviceInputController.h"
10#include "MIDIDeviceOutputController.h"
11#include "MIDIDeviceControllerBase.h"
12#include "Main/ST_AudioControlSettings.h"
13#include "ST_AudioControlFunctionLibrary.generated.h"
14
22UCLASS()
23class ST_AUDIOCONTROL_API UST_AudioControlFunctionLibrary : public UBlueprintFunctionLibrary
24{
25 GENERATED_BODY()
26
27public:
28
35 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl|MIDI")
36 static TArray<FName> GetMIDIDevices(bool bInputs = true, bool bOuputs = true);
37
44 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl|MIDI")
45 static bool GetFoundMIDIDevice(FName NiceName, FFoundMIDIDevice& Device);
46
52 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl|MIDI")
53 static FName GetMIDIDeviceNiceName(FFoundMIDIDevice FoundDevice);
54
60 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl|Vis")
61 static void ReadRenderTargetPixels(class UTextureRenderTarget2D* RenderTarget, TArray<FColor>& RenderTargetPixels);
62
71 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl|Vis")
72 static bool MapColours(TArray<FColor> PrevisColours, TArray<FColor>& MappedLEDColours, FIntPoint PrevisResolution, FIntPoint LEDResolution);
73
80 UFUNCTION(BlueprintCallable, Category = "ShaderTech|AudioControl|Vis")
81 static void PrepareLEDColours(TArray<FColor> MappedLEDColours, TArray<uint8>& LEDColourByteArray, FLEDConfig LEDConfig);
82
88 UFUNCTION(BlueprintPure, Category = "ShaderTech|AudioControl|Utils")
89 static int32 GetIntPointLength(FIntPoint Point);
90};
Utility function library for ShaderTech Audio and Control systems.
Definition ST_AudioControlFunctionLibrary.h:24
static void ReadRenderTargetPixels(class UTextureRenderTarget2D *RenderTarget, TArray< FColor > &RenderTargetPixels)
Reads pixel colors from a render target texture.
Definition ST_AudioControlFunctionLibrary.cpp:61
static int32 GetIntPointLength(FIntPoint Point)
Calculates the length (magnitude) of an FIntPoint as an integer.
Definition ST_AudioControlFunctionLibrary.cpp:197
static TArray< FName > GetMIDIDevices(bool bInputs=true, bool bOuputs=true)
Returns a list of available MIDI device names.
Definition ST_AudioControlFunctionLibrary.cpp:9
static void PrepareLEDColours(TArray< FColor > MappedLEDColours, TArray< uint8 > &LEDColourByteArray, FLEDConfig LEDConfig)
Prepares LED color data into a byte array format.
Definition ST_AudioControlFunctionLibrary.cpp:122
static bool MapColours(TArray< FColor > PrevisColours, TArray< FColor > &MappedLEDColours, FIntPoint PrevisResolution, FIntPoint LEDResolution)
Maps preview colors to LED resolution.
Definition ST_AudioControlFunctionLibrary.cpp:76
static bool GetFoundMIDIDevice(FName NiceName, FFoundMIDIDevice &Device)
Retrieves a found MIDI device by its nice name.
Definition ST_AudioControlFunctionLibrary.cpp:43
static FName GetMIDIDeviceNiceName(FFoundMIDIDevice FoundDevice)
Returns the user-friendly name of a found MIDI device.
Definition ST_AudioControlFunctionLibrary.cpp:27
LED configuration for color formats and alpha mapping.
Definition ST_AudioControlSettings.h:139