上传预设视频

This commit is contained in:
Sch 2023-08-20 03:49:54 +08:00
parent 4497c2b6c4
commit aeecc56e6f
14 changed files with 41 additions and 17 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -529,11 +529,11 @@ void DragDropOperator::OnDrop(const FGeometry& MyGeometry, const FDragDropEvent&
}
if (TrackHead->TrackData.TrackType == ETrackType::AudioTrack ||
TrackHead->TrackData.TrackType == ETrackType::AudioTrackR ||
TrackHead->TrackData.TrackType == ETrackType::VideoTrack)
TrackHead->TrackData.TrackType == ETrackType::AudioTrackR)
{
return;
}
@ -579,6 +579,18 @@ void DragDropOperator::OnDrop(const FGeometry& MyGeometry, const FDragDropEvent&
NewClipData.ClipEndFrame = NewClipData.ClipStartFrame + 15;
}
if (PresetDragOperation->PresetData.PresetType == EPresetType::Video)
{
NewClipData.ClipType = ETrackType::VideoTrack;
if (FUtils::DetectDragTypeCanDrop(NewClipData, TrackHead->TrackData.TrackType)
{
TrackHead->TrackData.ClipData.Add(NewClipData);
TrackBody->CallRender();
}
return ;
}
TrackHead->TrackData.ClipData.Add(NewClipData);

View File

@ -4,6 +4,7 @@
#include "SEffectPreset.h"
#include "SlateOptMacros.h"
#include "Cut5/Utils/FFMPEGUtils.h"
#include "Cut5/Utils/Utils.h"
#include "Cut5/Widgets/MicroWidgets/SNewProjectTips.h"
#include "Cut5/Widgets/Style/CutButtonWidgetStyle.h"
@ -26,13 +27,23 @@ void SEffectPreset::Construct(const FArguments& InArgs)
if (!PresetPath.IsEmpty())
{
TArray<uint8> Data;
FString LoadPath = FUtils::GetResourcesPath(TEXT("Presets/") + PresetPath, true);
// GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Cyan, LoadPath);
FFileHelper::LoadFileToArray(Data, *LoadPath);
if (PresetType == EPresetType::Video)
{
FString LoadPath = FUtils::GetResourcesPath(TEXT("Presets/PresetVideo/") + PresetPath, true);
FFFMPEGUtils::LoadMedia(LoadPath, &NewPropertyData);
PresetsData.PresetType = EPresetType::Video;
}
else
{
TArray<uint8> Data;
FString LoadPath = FUtils::GetResourcesPath(TEXT("Presets/") + PresetPath, true);
// GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Cyan, LoadPath);
FFileHelper::LoadFileToArray(Data, *LoadPath);
FMemoryReader MemoryReader(Data);
MemoryReader << PresetsData;
}
FMemoryReader MemoryReader(Data);
MemoryReader << PresetsData;
}
PresetsData.PresetType = PresetType;

View File

@ -30,6 +30,7 @@ public:
FString PresetPath;
FPresetsData PresetsData;
ICutMainWidgetInterface* MainInterface;
FTimelinePropertyData NewPropertyData;
EPresetType PresetType;
TSharedPtr<SComboBox<TSharedPtr<FString>>> GroupComboBox;
virtual TSharedPtr<SWidget> GetPropertiesWidget() override;

View File

@ -368,15 +368,15 @@ void SCustomInputPanel::Construct(const FArguments& InArgs)
AddPreset(TEXT("青柠"), TEXT("青柠.dat"), EPresetType::Color);
AddPreset(TEXT("红-暗"), TEXT("红-暗.dat"), EPresetType::Gradient);
AddPreset(TEXT("闪电"), TEXT("闪电.dat"), EPresetType::Video);
AddPreset(TEXT("跑马灯-玫红"), TEXT(""));
AddPreset(TEXT("心跳-宏"), TEXT(""));
AddPreset(TEXT("5次闪电"), TEXT(""));
AddPreset(TEXT("闪电-绿"), TEXT(""));
AddPreset(TEXT("雷-红"), TEXT(""));
AddPreset(TEXT("雷-蓝"), TEXT(""));
AddPreset(TEXT("闪烁彩云"), TEXT(""));
AddPreset(TEXT("跑马灯-橘"), TEXT(""));
AddPreset(TEXT("随机闪电"), TEXT(""));
AddPreset(TEXT("跑马灯-玫红"), TEXT("跑马灯-玫红.mp4"), EPresetType::Video);
AddPreset(TEXT("心跳-宏"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("5次闪电"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("闪电-绿"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("雷-红"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("雷-蓝"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("闪烁彩云"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("跑马灯-橘"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("随机闪电"), TEXT(""), EPresetType::Video);
AddPreset(TEXT("启动投影"), TEXT(""), EPresetType::EnableProjector);
AddPreset(TEXT("屏蔽投影"), TEXT(""), EPresetType::DisableProjector);