#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "UObject/NoExportTypes.h"
#include "CameraSequenceSystemPropertyChanged.h"
#include "BhvrAssetViewCameraSequence.h"
#include "BhvrAssetViewCameraSequenceSystem.generated.h"

class UMoviePipelinePrimaryConfig;

UCLASS(Blueprintable)
class BHVRASSETVIEWER_API ABhvrAssetViewCameraSequenceSystem : public AActor
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	FDirectoryPath SequencesPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintAssignable)
	FCameraSequenceSystemPropertyChanged CameraSequencesChanged;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintAssignable)
	FCameraSequenceSystemPropertyChanged SelectedCameraSequenceChanged;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintAssignable)
	FCameraSequenceSystemPropertyChanged HasActiveSequenceChanged;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, BlueprintAssignable)
	FCameraSequenceSystemPropertyChanged PlaybackPositionChanged;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	TArray<FBhvrAssetViewCameraSequence> CameraSequences;

private:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	FString SelectedCameraSequence;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	int32 PlaybackPosition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	int32 MaxPlaybackPosition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(AllowPrivateAccess=true))
	bool bIsLooping;

public:
	UFUNCTION(BlueprintCallable)
	void StopSequence();

	UFUNCTION(BlueprintCallable)
	void SetPlaybackPosition(int32 NewPlaybackPosition);

	UFUNCTION(BlueprintCallable)
	void SetIsLooping(bool bNewValue);

	UFUNCTION(BlueprintCallable)
	void SelectCameraSequence(const FString& DisplayName);

	UFUNCTION(BlueprintCallable)
	void RestartSequence();

	UFUNCTION(BlueprintCallable)
	void RecordSequence(const FString& FileName, UMoviePipelinePrimaryConfig* Configuration);

	UFUNCTION(BlueprintCallable)
	void PlaySequence();

	UFUNCTION(BlueprintCallable)
	void PauseSequence();

	UFUNCTION(BlueprintCallable)
	void LoadSequences(const TArray<FAssetData>& SequenceAssetDatas);

	UFUNCTION(BlueprintPure)
	FString GetSelectedCameraSequenceName() const;

	UFUNCTION(BlueprintPure)
	int32 GetPlaybackPosition() const;

	UFUNCTION(BlueprintPure)
	int32 GetMaxPlaybackPosition() const;

	UFUNCTION(BlueprintPure)
	bool GetIsLooping() const;

public:
	ABhvrAssetViewCameraSequenceSystem();
};

FORCEINLINE uint32 GetTypeHash(const ABhvrAssetViewCameraSequenceSystem) { return 0; }
