37 lines
881 B
C++
37 lines
881 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "SSamplePatternThumbnail.h"
|
|
|
|
#include "SlateApplication.h"
|
|
#include "SlateOptMacros.h"
|
|
#include "PluginHost/Sampler.h"
|
|
|
|
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
|
|
|
TArrayView<const FSamplePeak> FSamplePatternWaveformHandle::GetWaveform(int32 SizeX)
|
|
{
|
|
if (!RenderData)
|
|
{
|
|
RenderData = new FWaveform(1, 1024);
|
|
RenderData->UpdatePeak(Sampler->GetSampleBuffer());
|
|
}
|
|
return RenderData->GetPeakFromRange(0, SizeX, 0, Sampler->GetFrameCount());
|
|
}
|
|
|
|
void SSamplePatternThumbnail::Construct(const FArguments& InArgs, FSampler* InSampler)
|
|
{
|
|
WaveformHandle = MakeShared<FSamplePatternWaveformHandle>(InSampler);
|
|
ChildSlot
|
|
[
|
|
SAssignNew(WaveformViewer, SWaveformViewer)
|
|
.WaveformHandle(WaveformHandle)
|
|
];
|
|
}
|
|
|
|
void SSamplePatternThumbnail::Redraw()
|
|
{
|
|
}
|
|
|
|
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
|