Skip to main content

UI Delegates

FOnTapStarted

Broadcast when a button is tapped.
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FOnTapStarted);

Usage

Button->OnTapStarted.AddDynamic(this, &AMyActor::HandleButtonTap);

void AMyActor::HandleButtonTap()
{
    // Handle button press
}

FOnStepperValueChanged

Broadcast when a stepper value changes.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnStepperValueChanged, int8, NewValue);
ParameterTypeDescription
NewValueint8Direction: -1 (decrease), +1 (increase)

FOnPad2DChanged

Broadcast when 2D pad direction changes.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnPad2DChanged, FIntPoint, NewValue);
ParameterTypeDescription
NewValueFIntPointDirection as (X, Y) where values are -1, 0, or 1

Service Delegates

FOnRecordingError

Broadcast when a recording error occurs.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnRecordingError,
    FString, ErrorMessage, int32, ErrorCode);
ParameterTypeDescription
ErrorMessageFStringDescription of the error
ErrorCodeint32Numeric error code

Usage

Service->OnRecordingError.AddDynamic(this, &AMyActor::HandleRecordingError);

void AMyActor::HandleRecordingError(FString ErrorMessage, int32 ErrorCode)
{
    UE_LOG(LogTemp, Error, TEXT("Recording error %d: %s"), ErrorCode, *ErrorMessage);
}

FOnCameraModeChanged

Broadcast when camera mode changes.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnCameraModeChanged, UClass*, ModeClass);
ParameterTypeDescription
ModeClassUClass*The new camera mode class

FOnRecordingSaveFinished

Broadcast when recording save completes.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnRecordingSaveFinished, bool, Success);
ParameterTypeDescription
SuccessboolTrue if save succeeded

FOnRecordingSaveProgress

Broadcast during save operation with progress.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnRecordingSaveProgress, float, Progress);
ParameterTypeDescription
ProgressfloatProgress value 0.0 to 1.0

Audio Delegates

FDelegateRenderAudio

Audio data callback for audio sources.
DECLARE_MULTICAST_DELEGATE_ThreeParams(FDelegateRenderAudio,
    TArrayView<const float>/*PCM*/,
    int32/*Channels*/,
    ELCKAudioChannel/*Source*/);

typedef FDelegateRenderAudio::FDelegate FOnRenderAudioDelegate;
ParameterTypeDescription
PCMTArrayView<const float>Interleaved audio samples
Channelsint32Number of audio channels
SourceELCKAudioChannelSource channel type
OnAudioDataDelegate is a single delegate, not multicast. Use BindLambda() to bind and ExecuteIfBound() to fire.

Usage

// Use BindLambda for single delegate (replaces any existing binding)
AudioSource->OnAudioDataDelegate.BindLambda([](
    TArrayView<const float> PCM,
    int32 Channels,
    ELCKAudioChannel SourceChannel)
{
    // PCM contains interleaved float samples
    // Channels is typically 2 (stereo)
    // SourceChannel identifies the audio type
});

// Fire the delegate from audio source implementation
OnAudioDataDelegate.ExecuteIfBound(PCM, 2, ELCKAudioChannel::Game);

Core Delegates

FOnLCKRecorderBoolResult

Result callback for async recording operations.
DECLARE_DELEGATE_OneParam(FOnLCKRecorderBoolResult, bool /*bSuccess*/);

Usage

Recorder->StartRecordingAsync(FOnLCKRecorderBoolResult::CreateLambda([](bool bSuccess) {
    if (bSuccess)
        UE_LOG(LogTemp, Log, TEXT("Recording started"));
    else
        UE_LOG(LogTemp, Error, TEXT("Failed to start"));
}));

FOnLCKRecorderProgress

Progress callback for save operations.
DECLARE_DELEGATE_OneParam(FOnLCKRecorderProgress, float /*Progress*/);

Usage

Recorder->StopRecordingAsync(
    FOnLCKRecorderBoolResult::CreateLambda([](bool bSuccess) {
        UE_LOG(LogTemp, Log, TEXT("Recording stopped"));
    }),
    FOnLCKRecorderProgress::CreateLambda([](float Progress) {
        UE_LOG(LogTemp, Log, TEXT("Progress: %.1f%%"), Progress * 100.0f);
    })
);

Binding Patterns

For UFUNCTION binding with Blueprint support:
// Header
UFUNCTION()
void HandleButtonTap();

// Implementation
Button->OnTapStarted.AddDynamic(this, &AMyActor::HandleButtonTap);