2024-01-25 11:21:15 +08:00

52 lines
1.1 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "SCompoundWidget.h"
class SBorder;
class SMixer;
class FMixerTrack;
DECLARE_DELEGATE_OneParam(FMixerTrackEvent, FMixerTrack*)
/**
*
*/
class ARONA_API SMixerTrack : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SMixerTrack)
{
}
SLATE_ARGUMENT(FMixerTrack*, MixerTrack)
SLATE_EVENT(FMixerTrackEvent, OnClicked)
SLATE_END_ARGS()
/** Constructs this widget with InArgs */
void Construct(const FArguments& InArgs);
virtual FReply OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
FMixerTrack* GetMixerTrack() const { return MixerTrack; }
void SetSelected(bool bInSelected);
private:
void ShowMenu();
void DeleteTrack();
void DeleteInstrument();
TArray<float> MeterValue() const;
void OnVolumeChanged(float X);
bool LeftMouseButtonDown = false;
FMixerTrackEvent OnClicked;
FMixerTrack* MixerTrack = nullptr;
TSharedPtr<SBorder> Border;
FSlateColorBrush White = FSlateColorBrush(FColor::White);
};