66 lines
1.8 KiB
C++
66 lines
1.8 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "SCompoundWidget.h"
|
|
#include "SMixerTrack.h"
|
|
#include "Mixer/MixerTrack.h"
|
|
#include "UI/Widget/IChildWindow.h"
|
|
|
|
class SScrollBox;
|
|
class SMixerEffectList;
|
|
|
|
DECLARE_MULTICAST_DELEGATE_OneParam(FMixerTrackDelegate, FMixerTrack*)
|
|
|
|
class FMixerSelector
|
|
{
|
|
public:
|
|
void AddTrack(FMixerTrack* MixerTrack);
|
|
bool RemoveTrack(FMixerTrack* MixerTrack);
|
|
void UnselectAll();
|
|
|
|
const TArray<FMixerTrack*>& GetSelectedTracks() const { return SelectedTracks; }
|
|
|
|
FMixerTrackDelegate OnMixerTrackSelected;
|
|
FMixerTrackDelegate OnMixerTrackDeselected;
|
|
private:
|
|
TArray<FMixerTrack*> SelectedTracks;
|
|
};
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class ARONA_API SMixer : public SCompoundWidget, public IChildWindow
|
|
{
|
|
public:
|
|
~SMixer();
|
|
SLATE_BEGIN_ARGS(SMixer)
|
|
{
|
|
}
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
/** Constructs this widget with InArgs */
|
|
void Construct(const FArguments& InArgs);
|
|
virtual FReply OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
|
|
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override;
|
|
virtual FReply OnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent) override;
|
|
|
|
virtual TSharedRef<SWidget> GetWidget() override { return AsShared(); }
|
|
protected:
|
|
void OnMixerTrackCreated(FMixerTrack* MixerTrack);
|
|
void OnMixerTrackRemoved(FMixerTrack* MixerTrack);
|
|
void OnMixerTrackClicked(FMixerTrack* InMixerTrack);
|
|
|
|
void OnMixerTrackSelected(FMixerTrack* InMixerTrack);
|
|
void OnMixerTrackDeselected(FMixerTrack* InMixerTrack);
|
|
|
|
void ForeachMixerTrackWidget(TFunction<bool(TSharedRef<SMixerTrack>)> InFunction);
|
|
private:
|
|
TSharedPtr<SScrollBox> ListView;
|
|
TSharedPtr<SMixerEffectList> EffectList;
|
|
FMixerSelector Selector;
|
|
bool bShiftDown = false;
|
|
};
|