49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "SCompoundWidget.h"
|
|
#include "SLeafWidget.h"
|
|
#include "Pattern/MidiPattern.h"
|
|
#include "UI/Widget/SUpdatableImage.h"
|
|
|
|
class SUpdatableImage;
|
|
class FPluginHost;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class ARONA_API SChannelRackMidiThumbnail : public SCompoundWidget
|
|
{
|
|
public:
|
|
SLATE_BEGIN_ARGS(SChannelRackMidiThumbnail)
|
|
{
|
|
}
|
|
SLATE_ARGUMENT(FMidiPattern*, Pattern)
|
|
|
|
SLATE_END_ARGS()
|
|
|
|
~SChannelRackMidiThumbnail();
|
|
void SetPattern(FMidiPattern* InPattern);
|
|
|
|
/** Constructs this widget with InArgs */
|
|
void Construct(const FArguments& InArgs, FPluginHost* InPluginHost);
|
|
|
|
virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
|
|
virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
|
|
private:
|
|
void OnChanged(FPluginHost* Host, FMidiMessageSequence* Changed);
|
|
void OnPatternPlay(FPatternInstance* PatternInstance, AudioFrame PatternTick, uint32 Length);
|
|
|
|
void UpdateMidiThumbnail(FImageData& ImageData);
|
|
|
|
FPluginHost* PluginHost;
|
|
FMidiPattern* CurrentPattern;
|
|
|
|
TSharedPtr<SUpdatableImage> UpdatableImage;
|
|
|
|
AudioFrame LastPatternPos;
|
|
};
|
|
|