/**
 * Copyright 2022-2025 Theai, Inc. dba Inworld AI
 */

#pragma once

#include "CoreMinimal.h"
#include "Graph/InworldGraphRuntimeData.h"
#include "Primitives/TTS/InworldTTSTypes.h"

#include "InworldGraphRuntimeData_Voice.generated.h"

/**
 * @class UInworldGraphRuntimeData_Voice
 * @brief Runtime data class for managing voice configuration in Inworld graphs.
 *
 * This class stores and manages voice properties used for text-to-speech operations
 * within Inworld graphs. It provides simple get/set functionality for voice configuration
 * including voice ID and language settings.
 */
UCLASS(BlueprintType, meta = (DisplayName = "Voice Data"))
class INWORLDRUNTIME_API UInworldGraphRuntimeData_Voice : public UInworldGraphRuntimeData
{
	GENERATED_BODY()

public:
	/**
	 * @brief Default constructor for the voice runtime data.
	 */
	UInworldGraphRuntimeData_Voice();

	/**
	 * @brief Retrieves the voice data wrapped in an InworldDataHandle.
	 *
	 * This override implementation returns the current voice configuration data,
	 * making it accessible to TTS nodes within the graph system.
	 *
	 * @return Handle containing the voice configuration data
	 */
	virtual FInworldDataHandle GetData() override;

	/**
	 * @brief Retrieves the current voice configuration.
	 *
	 * This function returns the voice configuration currently stored in this runtime data,
	 * including voice ID and language settings.
	 *
	 * @return Reference to the current voice configuration
	 */
	UFUNCTION(BlueprintCallable, Category = "Inworld|Voice Runtime Data")
	const FInworldVoice& Get() const
	{
		return Voice;
	}

	/**
	 * @brief Sets the voice configuration for this runtime data.
	 *
	 * This function updates the voice configuration that will be used for text-to-speech
	 * operations during graph execution.
	 *
	 * @param InVoice The new voice configuration to set
	 */
	UFUNCTION(BlueprintCallable, Category = "Inworld|Voice Runtime Data")
	void Set(const FInworldVoice& InVoice)
	{
		Voice = InVoice;
	}

protected:
	/** The voice configuration settings including voice ID and language */
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Voice Runtime Data",
		meta = (ExposeOnSpawn = "true", ToolTip = "The voice configuration settings including voice ID and language"))
	FInworldVoice Voice;
};
