#pragma once
#include "GameFramework/Actor.h"
#include "VJTimeline.generated.h"

UENUM(BlueprintType)
enum ETimeline_Beats
{
Timeline_Beats_01 = 1, Timeline_Beats_04 = 4, Timeline_Beats_08 = 8, Timeline_Beats_16 = 16,
Timeline_Beats_24 = 24, Timeline_Beats_32 = 32, Timeline_Beats_64 = 64, Timeline_Beats_128 = 128
};

UENUM(BlueprintType)
enum ETimeline_Degree
{
Timeline_Degree_025, Timeline_Degree_045, Timeline_Degree_075, Timeline_Degree_090, Timeline_Degree_115, Timeline_Degree_135, Timeline_Degree_155,
Timeline_Degree_180, Timeline_Degree_205, Timeline_Degree_225, Timeline_Degree_245, Timeline_Degree_270, Timeline_Degree_295, Timeline_Degree_315,
Timeline_Degree_335, Timeline_Degree_360, Timeline_Degree_720, Timeline_Degree_1080
};

UCLASS()
class CRASHANGELARTS_API AVJTimeline : public AActor
{
GENERATED_BODY()

FTimeline TimeLine;
FTimerHandle TimerHandle;
FRichCurve xEditCurve;
FKeyHandle KeyHandle;
UCurveFloat* xCurveFloat;

bool StartConfig;
bool xTimeLineUpdate;
bool xTimeLineChange;

UFUNCTION()
float CalculateBPMSecondsToBeats(float xBPM, ETimeline_Beats xBeats);

UFUNCTION()
float CalculateDegree(ETimeline_Degree xDegree);

UFUNCTION()
void TickTimeline();

UFUNCTION()
void Timeline_Execute_Change();

UFUNCTION()
void TimeLine_Update(float xValue);

public:
AVJTimeline();

virtual void BeginPlay() override;

virtual void Tick(float DeltaSeconds) override;

UPROPERTY(BlueprintReadWrite, Category = "CrashAngelArts|VJTimeline")
TEnumAsByte<ETimeline_Beats> Beats;

UPROPERTY(BlueprintReadWrite, Category = "CrashAngelArts|VJTimeline")
TEnumAsByte<ETimeline_Degree> Degree;

UPROPERTY(BlueprintReadWrite, Category = "CrashAngelArts|VJTimeline")
TEnumAsByte<ERichCurveInterpMode> Curve;

UPROPERTY(BlueprintReadWrite, Category = "CrashAngelArts|VJTimeline")
float BPM;

UPROPERTY(BlueprintReadWrite, Category = "CrashAngelArts|VJTimeline")
float DeltaTime;

UPROPERTY(BlueprintReadWrite, Category = "CrashAngelArts|VJTimeline")
bool IsLoop;

UPROPERTY(BlueprintReadWrite, Category = "CrashAngelArts|VJTimeline")
float ReturnFloat;

UFUNCTION(BlueprintCallable, Category = "CrashAngelArts|VJTimeline")
void VJTimeLine_Execute();

UFUNCTION(BlueprintCallable, Category = "CrashAngelArts|VJTimeline")
void VJTimeLine_Update(float xValue);
};



Created: 12/05/2015
Visits: 321
Online: 0