修改一大堆内容

This commit is contained in:
Sch 2023-09-04 22:43:50 +08:00
parent e6f57bf33a
commit 0a1e95ef90
13 changed files with 612 additions and 315 deletions

View File

@ -7,67 +7,49 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{233774
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cut5", "Intermediate\ProjectFiles\Cut5.vcxproj", "{B95E7D0E-DB45-3765-9058-E00EBBC4B157}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE5", "Intermediate\ProjectFiles\UE5.vcxproj", "{6EE39883-7339-3FB6-AD82-931FB137D37F}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE5", "Intermediate\ProjectFiles\UE5.vcxproj", "{C48D0E9D-C862-3EA3-96A7-752EE9D06362}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cut5", "Intermediate\ProjectFiles\Cut5.vcxproj", "{AF5A253A-0F37-38CE-8998-45CA936C112B}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1CCEC849-CC72-4C59-8C36-2F7C38706D4C}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1CCEC849-CC72-4C59-8C36-2F7C38706D4C}"
ProjectSection(SolutionItems) = preProject ProjectSection(SolutionItems) = preProject
..\..\Software\UE_5.2\Engine\Extras\VisualStudioDebugging\Unreal.natvis = ..\..\Software\UE_5.2\Engine\Extras\VisualStudioDebugging\Unreal.natvis D:\UE\UE_5.2\Engine\Extras\VisualStudioDebugging\Unreal.natvis = D:\UE\UE_5.2\Engine\Extras\VisualStudioDebugging\Unreal.natvis
EndProjectSection EndProjectSection
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugGame Editor|Android = DebugGame Editor|Android
DebugGame Editor|Win64 = DebugGame Editor|Win64 DebugGame Editor|Win64 = DebugGame Editor|Win64
DebugGame|Android = DebugGame|Android
DebugGame|Win64 = DebugGame|Win64 DebugGame|Win64 = DebugGame|Win64
Development Editor|Android = Development Editor|Android
Development Editor|Win64 = Development Editor|Win64 Development Editor|Win64 = Development Editor|Win64
Development|Android = Development|Android
Development|Win64 = Development|Win64 Development|Win64 = Development|Win64
Shipping|Android = Shipping|Android
Shipping|Win64 = Shipping|Win64 Shipping|Win64 = Shipping|Win64
EndGlobalSection EndGlobalSection
# UnrealVS Section # UnrealVS Section
GlobalSection(ddbf523f-7eb6-4887-bd51-85a714ff87eb) = preSolution GlobalSection(ddbf523f-7eb6-4887-bd51-85a714ff87eb) = preSolution
AvailablePlatforms=Win64;Android AvailablePlatforms=Win64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame Editor|Android.ActiveCfg = Invalid|x64 {6EE39883-7339-3FB6-AD82-931FB137D37F}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64 {6EE39883-7339-3FB6-AD82-931FB137D37F}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64 {6EE39883-7339-3FB6-AD82-931FB137D37F}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Android.ActiveCfg = Android_DebugGame|Win64 {6EE39883-7339-3FB6-AD82-931FB137D37F}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Android.Build.0 = Android_DebugGame|Win64 {6EE39883-7339-3FB6-AD82-931FB137D37F}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Win64.ActiveCfg = DebugGame|x64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Win64.Build.0 = DebugGame|x64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development Editor|Android.ActiveCfg = Invalid|x64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame|Win64.ActiveCfg = DebugGame|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development Editor|Win64.ActiveCfg = Development_Editor|x64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame|Win64.Build.0 = DebugGame|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development Editor|Win64.Build.0 = Development_Editor|x64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.Development Editor|Win64.ActiveCfg = Development_Editor|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Android.ActiveCfg = Android_Development|Win64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.Development Editor|Win64.Build.0 = Development_Editor|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Android.Build.0 = Android_Development|Win64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.Development|Win64.ActiveCfg = Development|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Win64.ActiveCfg = Development|x64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.Development|Win64.Build.0 = Development|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Win64.Build.0 = Development|x64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.Shipping|Win64.ActiveCfg = Shipping|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Shipping|Android.ActiveCfg = Android_Shipping|Win64 {AF5A253A-0F37-38CE-8998-45CA936C112B}.Shipping|Win64.Build.0 = Shipping|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Shipping|Android.Build.0 = Android_Shipping|Win64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Shipping|Win64.ActiveCfg = Shipping|x64
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Shipping|Win64.Build.0 = Shipping|x64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.DebugGame Editor|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.DebugGame|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.Development Editor|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.Development|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.Shipping|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win64
{C48D0E9D-C862-3EA3-96A7-752EE9D06362}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{C48D0E9D-C862-3EA3-96A7-752EE9D06362} = {233774A8-CC9D-3FA9-86D1-90573E92B704} {6EE39883-7339-3FB6-AD82-931FB137D37F} = {233774A8-CC9D-3FA9-86D1-90573E92B704}
{B95E7D0E-DB45-3765-9058-E00EBBC4B157} = {DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6} {AF5A253A-0F37-38CE-8998-45CA936C112B} = {DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=psaf/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

BIN
Resources/OutOfFile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

View File

@ -104,6 +104,36 @@ uint32 FVideoThread::Run()
continue;; continue;;
} }
uint8* RawData = nullptr;
int32 Width = AllocatedFrame->width;
if (ClipData.ClipType == ETrackType::LightArrayTrack)
{
RawData = new uint8[FGlobalData::LightArrayX * FGlobalData::LightArrayY * 4];
Width = FGlobalData::LightArrayX;
}
else if (ClipData.ClipType == ETrackType::VideoTrack)
{
RawData = new uint8[AllocatedFrame->width * AllocatedFrame->height * 4];
Width = AllocatedFrame->width;
}
uint8* Dest[4] = {RawData, nullptr, nullptr, nullptr};
int32 DestLineSize[4] = {Width * 4, 0, 0, 0};
if (AllocatedFrame->data[0] == nullptr)
{
CurrentSeekingFrame = -1;
delete RawData;
continue;;
}
if (ClipData.ClipType == ETrackType::VideoTrack)
{
const AVCodecContext* VideoCodecContext = NewPropertyData.VideoCodecContext; const AVCodecContext* VideoCodecContext = NewPropertyData.VideoCodecContext;
struct SwsContext* SwsCtx = sws_getContext( struct SwsContext* SwsCtx = sws_getContext(
@ -118,30 +148,51 @@ uint32 FVideoThread::Run()
continue;; continue;;
} }
uint8* RawData = new uint8[AllocatedFrame->width * AllocatedFrame->height * 4];
uint8* Dest[4] = {RawData, nullptr, nullptr, nullptr};
const int32 DestLineSize[4] = {AllocatedFrame->width * 4, 0, 0, 0};
sws_scale(SwsCtx, AllocatedFrame->data, AllocatedFrame->linesize, 0, AllocatedFrame->height, Dest, DestLineSize); sws_scale(SwsCtx, AllocatedFrame->data, AllocatedFrame->linesize, 0, AllocatedFrame->height, Dest, DestLineSize);
sws_freeContext(SwsCtx); sws_freeContext(SwsCtx);
int32 DataSize = AllocatedFrame->width * AllocatedFrame->height * 4; }
if (AllocatedFrame->data[0] == nullptr) else if (ClipData.ClipType == ETrackType::LightArrayTrack)
{ {
const AVCodecContext* VideoCodecContext = NewPropertyData.VideoCodecContext;
struct SwsContext* SwsCtx = sws_getContext(
AllocatedFrame->width, AllocatedFrame->height, VideoCodecContext->pix_fmt,
FGlobalData::LightArrayX, FGlobalData::LightArrayY, AV_PIX_FMT_BGRA,
SWS_BILINEAR, nullptr, nullptr, nullptr
);
if (!SwsCtx)
{
UE_LOG(LogTemp, Error, TEXT("Error creating swsContext"));
CurrentSeekingFrame = -1; CurrentSeekingFrame = -1;
delete RawData;
continue;; continue;;
} }
sws_scale(SwsCtx, AllocatedFrame->data, AllocatedFrame->linesize, 0, AllocatedFrame->height, Dest, DestLineSize);
sws_freeContext(SwsCtx);
}
int32 X = AllocatedFrame->width; int32 X = AllocatedFrame->width;
int32 Y = AllocatedFrame->height; int32 Y = AllocatedFrame->height;
AsyncTask(ENamedThreads::GameThread, [this, X, Y, RawData]()
AsyncTask(ENamedThreads::GameThread, [this, X, Y, RawData, AllocatedFrame]()
{
if (ClipData.ClipType == ETrackType::VideoTrack)
{ {
MainInterface->OnUpdateVideo(FGuid(), X, Y, RawData); MainInterface->OnUpdateVideo(FGuid(), X, Y, RawData);
}
if (ClipData.ClipType == ETrackType::LightArrayTrack)
{
TArray<FColor> ColorArray;
ColorArray.Init(FColor::Black, FGlobalData::LightArrayX * FGlobalData::LightArrayY);
FMemory::Memcpy(ColorArray.GetData(), RawData, FGlobalData::LightArrayX * FGlobalData::LightArrayY * 4);
MainInterface->OnUpdateLightArray(ColorArray);
}
}); });
// });
LastFrame = av_frame_alloc(); LastFrame = av_frame_alloc();
// av_frame_copy(LastFrame, AllocatedFrame); // av_frame_copy(LastFrame, AllocatedFrame);
LastFrame = av_frame_clone(AllocatedFrame); LastFrame = av_frame_clone(AllocatedFrame);

View File

@ -429,153 +429,243 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
FString ExportName = FGuid::NewGuid().ToString();; FString ExportName = FGuid::NewGuid().ToString();;
if (TempClipData.ResourcePropertyDataPtr) if (TempClipData.ResourcePropertyDataPtr)
{ {
FTimelinePropertyData PropertyData; TempClipData.ResourcePropertyDataPtr->MoviePath;
FFFMPEGUtils::LoadContextPure(TempClipData.ResourcePropertyDataPtr->MoviePath, &PropertyData); FString TempPath = TempClipData.ResourcePropertyDataPtr->MoviePath;
const FString PsafSavePath = ExportPath + FString::FromInt(i) + ".psaf"; frames.Empty();
int32 TimeStamp = av_rescale_q(static_cast<float>(TempClipData.VideoStartFrame) / FGlobalData::GlobalFPS * AV_TIME_BASE, AVRational{1, AV_TIME_BASE}, PropertyData.Context->streams[PropertyData.VideoStream]->time_base); VideoCapture capture;
int32 EndTimeStamp = av_rescale_q(static_cast<float>(TempClipData.VideoEndFrame) / FGlobalData::GlobalFPS * AV_TIME_BASE, AVRational{1, AV_TIME_BASE}, PropertyData.Context->streams[PropertyData.VideoStream]->time_base); bool ret = capture.open(TCHAR_TO_UTF8(*TempPath));
av_seek_frame(PropertyData.Context, PropertyData.VideoStream, TimeStamp, AVSEEK_FLAG_BACKWARD);
TArray<uint8> LightArrayResult; //setNumThreads(2);
uint8 Width = FGlobalData::LightArrayX;
uint8 Height = FGlobalData::LightArrayY;
uint8 p[128] = "pasf";
LightArrayResult.Append(p, 128);
std::ofstream outfile;
AVPacket* Packet = av_packet_alloc(); FString leftStr;
AVFrame* Frame = av_frame_alloc(); FString rightStr;
while (av_read_frame(PropertyData.Context, Packet) >= 0)
{
avcodec_send_packet(PropertyData.VideoCodecContext, Packet);
int32 Response = avcodec_receive_frame(PropertyData.VideoCodecContext, Frame);
if (Response == AVERROR(EAGAIN) || AVERROR_EOF)
{
} FString SourceLeft;
if (Frame->best_effort_timestamp >= EndTimeStamp) FString SourceRight;
{ UKismetStringLibrary::Split(TempPath,".",SourceLeft, SourceRight, ESearchCase::IgnoreCase,ESearchDir::FromEnd);
break; UKismetStringLibrary::Split(SourceLeft,"/",SourceLeft, SourceRight, ESearchCase::IgnoreCase,ESearchDir::FromEnd);
}
if (Frame->best_effort_timestamp >= TimeStamp)
{
SwsContext* FormatContext = sws_getContext(
Frame->width,
Frame->height,
PropertyData.VideoCodecContext->pix_fmt,
FGlobalData::LightArrayX,
FGlobalData::LightArrayY,
AVPixelFormat::AV_PIX_FMT_RGB24,
SWS_BILINEAR,
nullptr,
nullptr,
nullptr
);
uint8* RawData = static_cast<uint8*>(FMemory::Malloc(FGlobalData::LightArrayX * FGlobalData::LightArrayY * 3)); FString psafPath = ExportPath + ExportName + FString::FromInt(i) + ".psaf";
uint8* Dest[4] = {RawData, nullptr, nullptr ,nullptr};
const int32 DestLineSize[4] = {FGlobalData::LightArrayX * 3, 0, 0, 0};
sws_scale(FormatContext, Frame->data, Frame->linesize, 0, Frame->height, Dest, DestLineSize);
sws_freeContext(FormatContext);
FString psafPath2 = leftStr + ".psaf2";
LightArrayResult.Add(static_cast<uint8>(FGlobalData::GlobalFPS)); //outfile.open(TCHAR_TO_UTF8(*leftStr), ios::binary);
LightArrayResult.Add(blockNum); outfile.open(*psafPath, std::ios::binary);
LightArrayResult.Add(Height); // outfile.close();
LightArrayResult.Add(Width); UE_LOG(LogTemp, Log, TEXT("open flie -> %s "), *leftStr);
LightArrayResult.Add(0);
LightArrayResult.Add(0);
LightArrayResult.Add(0);
LightArrayResult.Add(0);
int32 Length = TempClipData.VideoEndFrame - TempClipData.VideoStartFrame;
LightArrayResult.Append(reinterpret_cast<uint8*>(&Length), sizeof(int32));
uint8 width = capture.get(CAP_PROP_FRAME_WIDTH);
uint8 height = capture.get(CAP_PROP_FRAME_HEIGHT);
Size frameSize = Size(width,height );
for (int32 CurrentHeight = Height / 3 - 1; CurrentHeight >= 0; CurrentHeight--) uint8 fps = capture.get(CAP_PROP_FPS);
{
if (CurrentHeight % 2 == 0) float duration = capture.get(CV_CAP_PROP_FRAME_COUNT) / capture.get(CV_CAP_PROP_FPS);
{
for (int32 CurrentWidth = Width - 1; CurrentWidth >= 0; CurrentWidth--) Size old_size = frameSize;
{
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 0]); capture.set(CAP_PROP_POS_FRAMES, TempClipData.ClipStartFrame);
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 1]); int32 frameCount = capture.get(CV_CAP_PROP_FRAME_COUNT);
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 2]); frameCount -= ClipData[i].ClipStartFrame;
} UE_LOG(LogTemp, Log, TEXT("frameCount: %s"), *FString::FromInt(frameCount));
}
else char p[128] = "pasf";
{ outfile.write(reinterpret_cast<const char*>(p), sizeof(p));
for (int32 CurrentWidth = 0; CurrentWidth < Width; CurrentWidth++) #if 1
{
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 0]); Mat frameOrg;
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 1]); Mat frame;
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 2]); int frameIndex = 0;
}
} while (ret && frameIndex < frameCount) {
if (frameIndex % 2 == 0) {
capture.grab();
frameIndex++;
continue;
} }
/* */
tempIndex = frameIndex;
for (int32 CurrentHeight = Height / 3; CurrentHeight < 2 * Height / 3 ; CurrentHeight++) { if (capture.read(frameOrg)) {
if (CurrentHeight % 2 == 0)
if (!capture.isOpened())
{ {
for (int32 CurrentWidth = 0; CurrentWidth < Width; CurrentWidth++) UE_LOG(LogTemp, Log, TEXT("cant open video -> %s"), *TempPath);
{ i++;
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 0]); continue;;
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 1]);
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 2]);
}
}
else
{
for (int32 CurrentWidth = Width - 1; CurrentWidth >= 0; CurrentWidth--)
{
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 0]);
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 1]);
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 2]);
}
}
} }
for (int32 CurrentHeight = 2 * Height / 3; CurrentHeight < Height; CurrentHeight++) { if (frameOrg.empty())
if (CurrentHeight % 2 == 0)
{ {
for (int32 CurrentWidth = 0; CurrentWidth < Width; CurrentWidth++) UE_LOG(LogTemp, Log, TEXT("no frame"));
{ i++;
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 0]); continue;;
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 1]);
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 2]);
} }
UE_LOG(LogTemp, Log, TEXT("frameOrg size - > (%s, %s),frameOrg type -> %s "),
*FString::FromInt(frameOrg.rows),*FString::FromInt(frameOrg.cols), *FString::FromInt(frameOrg.type()));
resize(frameOrg, frameOrg, Size(70, 42), 0, 0, INTER_LINEAR);
frameOrg.copyTo(frame);
if (frame.empty()) {
UE_LOG(LogTemp, Log, TEXT(" read none "));
return EncodeVideoInfos;
}
/* 每帧标头 */
outfile.write(reinterpret_cast<const char*>(&fps), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&blockNum), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&height), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&width), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>("00"), sizeof(float));
outfile.write(reinterpret_cast<const char*>(&duration), sizeof(float));
for (int32 row = frame.rows / 3 - 1; row >= 0; row--) {
if (row % interval == 0) {
for (int32 col = frame.cols - 1; col >= 0; col--) {
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
//outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)), sizeof(uint8) * 3);
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[2]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[1]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[0]), sizeof(uint8));
//UE_LOG(LogTemp, Log, TEXT("row -> %s ,col - > %s "),
// *FString::FromInt(row), *FString::FromInt(col));
}
} }
else { else {
for (int32 CurrentWidth = Width - 1; CurrentWidth >= 0; CurrentWidth--) for (int32 col = 0; col < frame.cols; col++) {
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[2]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[1]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[0]), sizeof(uint8));
}
}
}
for (int32 row = frame.rows/3; row < 2 * frame.rows / 3 ; row++) {
if (row % interval == 0) {
for (int32 col = 0; col < frame.cols; col++) {
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[2]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[1]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[0]), sizeof(uint8));
}
}
else {
for (int32 col = frame.cols - 1; col >= 0; col--) {
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[2]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[1]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[0]), sizeof(uint8));
}
}
}
for (int32 row = 2 * frame.rows/3; row < frame.rows ; row++) {
if (row % interval == 0) {
for (int32 col = 0; col < frame.cols ; col++) {
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[2]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[1]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[0]), sizeof(uint8));
}
}
else {
for (int32 col = frame.cols - 1; col >= 0 ; col--) {
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[2]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[1]), sizeof(uint8));
outfile.write(reinterpret_cast<const char*>(&frame.at<Vec3b>(row, col)[0]), sizeof(uint8));
}
}
}
#if EXPORT_PROCESSED_VIDEO
writer.write(frame);
#endif
//frames.Add(MatToTexture2D(frame, width, height, true));
frameIndex++;
//UE_LOG(LogTemp, Log, TEXT(" write frame,frameSize( %s, %s )"), *FString::FromInt(frame.rows), *FString::FromInt(frame.cols));
}
else
{ {
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 0]); frameIndex++;
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 1]);
LightArrayResult.Add(RawData[CurrentHeight * FGlobalData::LightArrayX + CurrentWidth + 2]);
} }
} }
#endif
outfile.seekp(0, outfile.end);
size_t fileSize = outfile.tellp();
UE_LOG(LogTemp, Log, TEXT("fileSize1 -> %s"), *FString::FromInt(fileSize));
int32 remains = 1024 - fileSize % (1024);
outfile.write(reinterpret_cast<const char*>("0x00"), sizeof(uint8)* remains);
fileSize = outfile.tellp();
UE_LOG(LogTemp, Log, TEXT("fileSize2 -> %s"), *FString::FromInt(fileSize));
capture.release();
#if EXPORT_PROCESSED_VIDEO
writer.release();
#endif
outfile.close();
UE_LOG(LogTemp, Log, TEXT("proecess completed , video close"));
} }
}
}
int32 RemainData = 1024 - LightArrayResult.Num() % 1024;
LightArrayResult.AddZeroed(RemainData);
FFileHelper::SaveArrayToFile(LightArrayResult, *PsafSavePath);
FEncodeVideoInfo EncodeVideoInfo; FEncodeVideoInfo EncodeVideoInfo;
EncodeVideoInfo.EncodedVideoName = ExportName + FString::FromInt(i) + ".psaf"; FString String = ExportPath + ExportName + FString::FromInt(i) + ".psaf";
EncodeVideoInfo.EncodedVideoName = FPaths::GetBaseFilename(String) + ".psaf";
EncodeVideoInfo.EncodedVideoTimeCode = FGlobalData::GetTimeData(TempClipData.ClipStartFrame); EncodeVideoInfo.EncodedVideoTimeCode = FGlobalData::GetTimeData(TempClipData.ClipStartFrame);
EncodeVideoInfo.TrackData = TrackData;
EncodeVideoInfo.ClipData = TempClipData;
EncodeVideoInfos.Add(EncodeVideoInfo); EncodeVideoInfos.Add(EncodeVideoInfo);
FFFMPEGUtils::UnLoadContext(&PropertyData);
av_packet_free(&Packet);
av_frame_free(&Frame);
}
i++; i++;
} }
return EncodeVideoInfos; return EncodeVideoInfos;

View File

@ -81,7 +81,7 @@ void SCurtain::Construct(const FArguments& InArgs)
{ {
FSlateApplication::Get().SetKeyboardFocus(InlineEditableTextBlock); FSlateApplication::Get().SetKeyboardFocus(InlineEditableTextBlock);
} }
Curtain->Step = 1 + Offset + (Curtain - CurtainGroup->Curtains.GetData()); Curtain->Step = Offset + (Curtain - CurtainGroup->Curtains.GetData());
} }
FReply SCurtain::OnDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) FReply SCurtain::OnDragDetected(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)

View File

@ -31,7 +31,7 @@ public:
inline static float GlobalFPS = 30.0f; inline static float GlobalFPS = 30.0f;
inline static FString CurrentProjectName = "DefaultProject"; inline static FString CurrentProjectName = "DefaultProject";
inline static FString BasePath = FPaths::ProjectDir(); inline static FString BasePath = FPaths::ProjectDir();
inline static FString Version = "1.0.1"; inline static FString Version = "3.0";
inline static FString ExportPath = ""; inline static FString ExportPath = "";
inline static TArray<FColor> Colors = inline static TArray<FColor> Colors =
@ -384,7 +384,7 @@ struct CUT5_API FClipData : public TSharedFromThis<FClipData>
if (CropMethod == ECropMethod::FromFront) if (CropMethod == ECropMethod::FromFront)
{ {
ClipStartFrame += CropFrame; ClipStartFrame += CropFrame;
if (ClipType == ETrackType::VideoTrack || ClipType == ETrackType::AudioTrack || ClipType == ETrackType::LightArrayTrack || ClipType == ETrackType::LightBarTrack) if (ClipType == ETrackType::VideoTrack || ClipType == ETrackType::AudioTrack || ClipType == ETrackType::AudioTrackR || ClipType == ETrackType::LightArrayTrack || ClipType == ETrackType::LightBarTrack)
{ {
VideoStartFrame += CropFrame; VideoStartFrame += CropFrame;
} }
@ -392,11 +392,10 @@ struct CUT5_API FClipData : public TSharedFromThis<FClipData>
else else
{ {
ClipEndFrame -= CropFrame; ClipEndFrame -= CropFrame;
if (ClipType == ETrackType::VideoTrack || ClipType == ETrackType::AudioTrack || ClipType == ETrackType::LightArrayTrack || ClipType == ETrackType::LightBarTrack) if (ClipType == ETrackType::VideoTrack || ClipType == ETrackType::AudioTrack || ClipType == ETrackType::AudioTrackR || ClipType == ETrackType::LightArrayTrack || ClipType == ETrackType::LightBarTrack)
{ {
VideoEndFrame -= CropFrame; VideoEndFrame -= CropFrame;
} }
} }
if (PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::None) if (PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::None)
{ {
@ -1037,3 +1036,17 @@ enum class ESoundSolveType
OnlyLeft, OnlyLeft,
OnlyRight, OnlyRight,
}; };
static bool IsVideo(enum ETrackType TrackType)
{
if ( TrackType == ETrackType::VideoTrack
|| TrackType == ETrackType::AudioTrack
|| TrackType == ETrackType::AudioTrackR
|| TrackType == ETrackType::LightArrayTrack
|| TrackType == ETrackType::LightBarTrack)
{
return true;
}
return false;
}

View File

@ -770,6 +770,7 @@ void DragDropOperator::OnDrop(const FGeometry& MyGeometry, const FDragDropEvent&
if (ClipDragOperation.TimelinePropertyData->Type != TrackHead->TrackData.TrackType) if (ClipDragOperation.TimelinePropertyData->Type != TrackHead->TrackData.TrackType)
{ {
if ((ClipDragOperation.TimelinePropertyData->Type == ETrackType::VideoTrack && TrackHead->TrackData.TrackType == ETrackType::LightArrayTrack) if ((ClipDragOperation.TimelinePropertyData->Type == ETrackType::VideoTrack && TrackHead->TrackData.TrackType == ETrackType::LightArrayTrack)
|| (ClipDragOperation.TimelinePropertyData->Type == ETrackType::VideoTrack && TrackHead->TrackData.TrackType == ETrackType::LightBarTrack)
|| (ClipDragOperation.TimelinePropertyData->Type == ETrackType::VideoTrack && TrackHead->TrackData.TrackType == ETrackType::PlayerTrack) || (ClipDragOperation.TimelinePropertyData->Type == ETrackType::VideoTrack && TrackHead->TrackData.TrackType == ETrackType::PlayerTrack)
|| (ClipDragOperation.TimelinePropertyData->Type == ETrackType::AudioTrack && TrackHead->TrackData.TrackType == ETrackType::AudioTrackR) || (ClipDragOperation.TimelinePropertyData->Type == ETrackType::AudioTrack && TrackHead->TrackData.TrackType == ETrackType::AudioTrackR)
|| (ClipDragOperation.TimelinePropertyData->Type == ETrackType::VideoTrack && TrackHead->TrackData.TrackType == ETrackType::AtomSphereLightTrack)) || (ClipDragOperation.TimelinePropertyData->Type == ETrackType::VideoTrack && TrackHead->TrackData.TrackType == ETrackType::AtomSphereLightTrack))
@ -797,11 +798,11 @@ void DragDropOperator::OnDrop(const FGeometry& MyGeometry, const FDragDropEvent&
NewClipData.MovieBrushes = FFFMPEGUtils::GetMovieBrush(&NewClipData); NewClipData.MovieBrushes = FFFMPEGUtils::GetMovieBrush(&NewClipData);
if (TrackHead->TrackData.TrackType == ETrackType::LightArrayTrack) // if (TrackHead->TrackData.TrackType == ETrackType::LightArrayTrack)
{ // {
NewClipData.ClipType = ETrackType::LightArrayTrack; // NewClipData.ClipType = ETrackType::LightArrayTrack;
NewClipData.LightArrayData = FFFMPEGUtils::GetVideoFrameLightArray(ClipDragOperation.TimelinePropertyData->MoviePath, FGlobalData::LightArrayX, FGlobalData::LightArrayY); // NewClipData.LightArrayData = FFFMPEGUtils::GetVideoFrameLightArray(ClipDragOperation.TimelinePropertyData->MoviePath, FGlobalData::LightArrayX, FGlobalData::LightArrayY);
} // }
if (TrackHead->TrackData.TrackType == ETrackType::PlayerTrack) if (TrackHead->TrackData.TrackType == ETrackType::PlayerTrack)
{ {
NewClipData.ClipType = ETrackType::PlayerTrack; NewClipData.ClipType = ETrackType::PlayerTrack;
@ -814,15 +815,6 @@ void DragDropOperator::OnDrop(const FGeometry& MyGeometry, const FDragDropEvent&
NewClipData.PlayerName = TrackBody->MainWidgetInterface->GetGroupName(TrackHead); NewClipData.PlayerName = TrackBody->MainWidgetInterface->GetGroupName(TrackHead);
NewClipData.PlayerLightData = FOpencvUtils::GetVideoSingleLightColor(ClipDragOperation.TimelinePropertyData->MoviePath); NewClipData.PlayerLightData = FOpencvUtils::GetVideoSingleLightColor(ClipDragOperation.TimelinePropertyData->MoviePath);
} }
if (TrackHead->TrackData.TrackType == ETrackType::VideoTrack)
{
SCutMainWindow* MainWidget = static_cast<SCutMainWindow*>(TrackHead->MainWidgetInterface);
if (!MainWidget->CutTimeline->GetTrackGroupByName(TEXT("视频附着")))
{
MainWidget->CutTimeline->AddNewTrackToGroup(TEXT("视频附着"), FTrackData(TEXT("附着音频"), ETrackType::AudioTrack, FDeviceTrack(TEXT("附着音频"), ETrackType::AudioTrack)));
}
}
} }
else if (ClipDragOperation.TimelinePropertyData->Type == ETrackType::LightArrayTrack) else if (ClipDragOperation.TimelinePropertyData->Type == ETrackType::LightArrayTrack)
{ {

View File

@ -854,6 +854,7 @@ void SCutMainWindow::OpenProject(const FString& Project)
FFileManagerGeneric::Get().FindFiles(CutlinkName, *FPaths::Combine(Project, TEXT("*.cutlink")), true, false); FFileManagerGeneric::Get().FindFiles(CutlinkName, *FPaths::Combine(Project, TEXT("*.cutlink")), true, false);
if (CutlinkName.Num() == 0) if (CutlinkName.Num() == 0)
{ {
// GEngine->GameViewport->AddViewportWidgetContent(SNew(SNewProjectTips).Title(FText::FromString(TEXT("存档失效或这不是一个存档"))).OnEnsure_Lambda([]))
UE_LOG(LogTemp, Error, TEXT("项目关联文件不存在")); UE_LOG(LogTemp, Error, TEXT("项目关联文件不存在"));
return; return;
} }
@ -988,7 +989,7 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
File->InsertNewChildElement("Author")->InsertNewText("Sch"); File->InsertNewChildElement("Author")->InsertNewText("Sch");
File->InsertNewChildElement("Date")->InsertNewText("2020-12-12"); File->InsertNewChildElement("Date")->InsertNewText("2020-12-12");
File->InsertNewChildElement("Describe")->InsertNewText("描述"); File->InsertNewChildElement("Describe")->InsertNewText("描述");
File->InsertNewChildElement("FileVersion")->InsertNewText("1.0"); File->InsertNewChildElement("FileVersion")->InsertNewText("3.0");
File->InsertNewChildElement("SoftWareVersion")->InsertNewText(TCHAR_TO_UTF8(*FGlobalData::Version)); File->InsertNewChildElement("SoftWareVersion")->InsertNewText(TCHAR_TO_UTF8(*FGlobalData::Version));
// Device List // Device List
@ -1034,8 +1035,8 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
tinyxml2::XMLElement* RotationSpeaker = RoundSpeakerList->InsertNewChildElement("RotationSpeaker"); tinyxml2::XMLElement* RotationSpeaker = RoundSpeakerList->InsertNewChildElement("RotationSpeaker");
RotationSpeaker->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID))); RotationSpeaker->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID)));
RotationSpeaker->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName)); RotationSpeaker->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName));
DeviceID++;
IDList.Add(TrackData.Guid, DeviceID); IDList.Add(TrackData.Guid, DeviceID);
DeviceID++;
RotatorSpeakerIndex = DeviceID; RotatorSpeakerIndex = DeviceID;
} }
break; break;
@ -1044,8 +1045,8 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
tinyxml2::XMLElement* LightArray = LightArrayList->InsertNewChildElement("GuangZhen"); tinyxml2::XMLElement* LightArray = LightArrayList->InsertNewChildElement("GuangZhen");
LightArray->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID))); LightArray->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID)));
LightArray->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName)); LightArray->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName));
DeviceID++;
IDList.Add(TrackData.Guid, DeviceID); IDList.Add(TrackData.Guid, DeviceID);
DeviceID++;
LightArrayIndex = DeviceID; LightArrayIndex = DeviceID;
} }
break; break;
@ -1054,6 +1055,7 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
tinyxml2::XMLElement* Projector = ProjectorList->InsertNewChildElement("Projector"); tinyxml2::XMLElement* Projector = ProjectorList->InsertNewChildElement("Projector");
Projector->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID))); Projector->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID)));
Projector->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName)); Projector->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName));
IDList.Add(TrackData.Guid, DeviceID);
DeviceID++; DeviceID++;
} }
break; break;
@ -1062,8 +1064,8 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
tinyxml2::XMLElement* DMLight = DMLightList->InsertNewChildElement("DMLight"); tinyxml2::XMLElement* DMLight = DMLightList->InsertNewChildElement("DMLight");
DMLight->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID))); DMLight->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID)));
DMLight->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName)); DMLight->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName));
DeviceID++;
IDList.Add(TrackData.Guid, DeviceID); IDList.Add(TrackData.Guid, DeviceID);
DeviceID++;
break; break;
} }
case ETrackType::LightBarTrack: case ETrackType::LightBarTrack:
@ -1075,8 +1077,8 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
tinyxml2::XMLElement* LightArray = LightArrayList->InsertNewChildElement("GuangZhen2"); tinyxml2::XMLElement* LightArray = LightArrayList->InsertNewChildElement("GuangZhen2");
LightArray->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID))); LightArray->InsertNewChildElement("ID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(DeviceID)));
LightArray->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName)); LightArray->InsertNewChildElement("Name")->InsertNewText(TCHAR_TO_UTF8(*TrackData.DeviceName));
DeviceID++;
IDList.Add(TrackData.Guid, DeviceID); IDList.Add(TrackData.Guid, DeviceID);
DeviceID++;
bIsLightBar = true; bIsLightBar = true;
break; break;
} }
@ -1109,13 +1111,13 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
int32 ToStepID = 0; int32 ToStepID = 0;
if (TypeID == 1) if (TypeID == 1)
{ {
for (int32 k = 0; i < CurtainPanel->Groups.Num(); k++) for (int32 k = 0; k < CurtainPanel->Groups.Num(); k++)
{ {
for (FCurtain& Curtain : CurtainPanel->Groups[k].Curtains) for (FCurtain& Curtain : CurtainPanel->Groups[k].Curtains)
{ {
if (Curtain.CurtainUUID == EffectCardsPanel->EffectCardGroups[i].Cards[j].JumpStepCurtains.Guid) if (Curtain.CurtainUUID == EffectCardsPanel->EffectCardGroups[i].Cards[j].JumpStepCurtains.Guid)
{ {
ToStepID = Curtain.Step + 1; ToStepID = Curtain.Step;
break; break;
} }
} }
@ -1147,13 +1149,13 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
int32 ToStepID = 0; int32 ToStepID = 0;
if (TypeID == 3) if (TypeID == 3)
{ {
for (int32 k = 0; i < CurtainPanel->Groups.Num(); k++) for (int32 k = 0; k < CurtainPanel->Groups.Num(); k++)
{ {
for (FCurtain& Curtain : CurtainPanel->Groups[k].Curtains) for (FCurtain& Curtain : CurtainPanel->Groups[k].Curtains)
{ {
if (Curtain.CurtainUUID == EffectCardsPanel->EffectCardGroups[i].JumpStepCurtains.Guid) if (Curtain.CurtainUUID == EffectCardsPanel->EffectCardGroups[i].JumpStepCurtains.Guid)
{ {
ToStepID = Curtain.Step + 1; ToStepID = Curtain.Step;
break; break;
} }
} }
@ -1488,12 +1490,29 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
DMLight->SetAttribute("ID", TCHAR_TO_UTF8(*FString::FromInt(GetTrackID(TrackData.DeviceTrack.Guid)))); DMLight->SetAttribute("ID", TCHAR_TO_UTF8(*FString::FromInt(GetTrackID(TrackData.DeviceTrack.Guid))));
tinyxml2::XMLElement* Event_List = DMLight->InsertNewChildElement("Event_List"); tinyxml2::XMLElement* Event_List = DMLight->InsertNewChildElement("Event_List");
int32 Count = 0;
for (int32 k = 0; k < TrackData.ClipData.Num(); k++) TArray<FClipData> NewClipArrayData = TrackData.ClipData;
Sort(NewClipArrayData.GetData(), NewClipArrayData.Num(), [](const FClipData& A, const FClipData& B)
{
return A.ClipStartFrame < B.ClipStartFrame;
});
if (NewClipArrayData.Num() > 0)
{
if (NewClipArrayData[0].ClipStartFrame != 0)
{ {
const FClipData& TempClipData = TrackData.ClipData[k];
tinyxml2::XMLElement* Event1 = Event_List->InsertNewChildElement("Event"); tinyxml2::XMLElement* Event1 = Event_List->InsertNewChildElement("Event");
Event1->InsertNewChildElement("Value")->InsertNewText("1"); Event1->InsertNewChildElement("Value")->InsertNewText("0");
Event1->InsertNewChildElement("TimeCode")->InsertNewText("0");
}
}
int32 Count = 0;
for (int32 k = 0; k < NewClipArrayData.Num(); k++)
{
const FClipData& TempClipData = NewClipArrayData[k];
tinyxml2::XMLElement* Event1 = Event_List->InsertNewChildElement("Event");
Event1->InsertNewChildElement("Value")->InsertNewText("-1");
Event1->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipStartFrame))))); Event1->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipStartFrame)))));
tinyxml2::XMLElement* Event2 = Event_List->InsertNewChildElement("Event"); tinyxml2::XMLElement* Event2 = Event_List->InsertNewChildElement("Event");
@ -1527,16 +1546,37 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
// Default // Default
tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect"); tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect");
NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("0"); NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("InitialColor")->InsertNewText("106090"); NewSpeicalEffect->InsertNewChildElement("InitialColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("EndColor")->InsertNewText("000000"); NewSpeicalEffect->InsertNewChildElement("EndColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText("-1"); NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText("-1");
NewSpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText("0"); NewSpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("Cycle")->InsertNewText("0"); NewSpeicalEffect->InsertNewChildElement("Cycle")->InsertNewText("0");
} }
for (int32 k = 0; k < TrackData.ClipData.Num(); k++)
{
const FClipData& TempClipData = TrackData.ClipData[k]; TArray<FClipData> TempClipDataArray = TrackData.ClipData;
Sort(TempClipDataArray.GetData(), TempClipDataArray.Num(), [](const FClipData& A, const FClipData& B)
{
return A.ClipStartFrame < B.ClipStartFrame;
});
if (TempClipDataArray.Num() > 0)
{
if (TempClipDataArray[0].ClipStartFrame != 0)
{
tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect");
NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("InitialColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("EndColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipDataArray[0].ClipStartFrame)))));
NewSpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("Cycle")->InsertNewText("0");
}
}
for (int32 k = 0; k < TempClipDataArray.Num(); k++)
{
const FClipData& TempClipData = TempClipDataArray[k];
if (TempClipData.PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::Breathe) if (TempClipData.PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::Breathe)
{ {
tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect"); tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect");
@ -1549,8 +1589,7 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
} }
if (TempClipData.PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::Gradient) if (TempClipData.PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::Gradient)
{ {
tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect"); GetGradientLight(SpeicalEffect, TempClipData);
GetGradientLight(NewSpeicalEffect, TempClipData);
} }
if (TempClipData.PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::None) if (TempClipData.PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::None)
{ {
@ -1564,6 +1603,28 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
NewSpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipStartFrame))))); NewSpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipStartFrame)))));
NewSpeicalEffect->InsertNewChildElement("Cycle")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), 1))); NewSpeicalEffect->InsertNewChildElement("Cycle")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), 1)));
} }
if (TempClipDataArray.Num() <= k + 1)
{
tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect");
NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("InitialColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("EndColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText("-1");
NewSpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipEndFrame)))));
NewSpeicalEffect->InsertNewChildElement("Cycle")->InsertNewText("0");
}
else if (TempClipDataArray[k + 1].ClipStartFrame - TempClipData.ClipEndFrame != 0)
{
tinyxml2::XMLElement* NewSpeicalEffect = SpeicalEffect->InsertNewChildElement("Special_Effect");
NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("InitialColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("EndColor")->InsertNewText("000000");
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipDataArray[k + 1].ClipStartFrame - TempClipData.ClipEndFrame)))));
NewSpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipEndFrame)))));
NewSpeicalEffect->InsertNewChildElement("Cycle")->InsertNewText("0");
}
} }
j++; j++;
} }
@ -1577,7 +1638,9 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
for (int32 k = 0; k < CutTimeline->TrackGroupInstances.Num(); k++) for (int32 k = 0; k < CutTimeline->TrackGroupInstances.Num(); k++)
{ {
int32 Index = 0; int32 Index = 0;
const FTrackData& TrackData = StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[k].Head)->TrackData; const TSharedPtr<STrackHead> CurrentTrackHead = StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[k].Head);
const FTrackData& TrackData = CurrentTrackHead->TrackData;
int32 Count = 0;
if (TrackData.TrackType == ETrackType::LightArrayTrack || TrackData.TrackType == ETrackType::LightBarTrack) if (TrackData.TrackType == ETrackType::LightArrayTrack || TrackData.TrackType == ETrackType::LightBarTrack)
{ {
if (GetTrackID(TrackData.DeviceTrack.Guid) == -1) if (GetTrackID(TrackData.DeviceTrack.Guid) == -1)
@ -1586,13 +1649,26 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
} }
auto GuangZhen = GuangZhenList->InsertNewChildElement("GuangZhen"); auto GuangZhen = GuangZhenList->InsertNewChildElement("GuangZhen");
GuangZhen->SetAttribute("ID", TCHAR_TO_UTF8(*FString::FromInt(GetTrackID(TrackData.DeviceTrack.Guid)))); GuangZhen->SetAttribute("ID", TCHAR_TO_UTF8(*FString::FromInt(GetTrackID(TrackData.DeviceTrack.Guid))));
int32 Count = 0;
auto GuangZhenSpecialEffectList = GuangZhen->InsertNewChildElement("SpecialEffectList"); auto GuangZhenSpecialEffectList = GuangZhen->InsertNewChildElement("SpecialEffectList");
for (int32 i = 0; i < CutTimeline->TrackGroupInstances.Num(); i++)
TArray<FClipData> TempClipData = TrackData.ClipData;
Sort(TempClipData.GetData(), TempClipData.Num(), [](const FClipData& A, const FClipData& B)
{ {
if (StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::LightArrayTrack) return A.ClipStartFrame < B.ClipStartFrame;
});
if (TempClipData.Num() > 0)
{ {
if (TempClipData[0].ClipStartFrame != 0)
{
auto SpeicalEffect = GuangZhenSpecialEffectList->InsertNewChildElement("SpecialEffect");
{
SpeicalEffect->InsertNewChildElement("TimeCode")->InsertNewText("0");
SpeicalEffect->InsertNewChildElement("URL")->InsertNewText("");
SpeicalEffect->InsertNewChildElement("Loop")->InsertNewText("1");
SpeicalEffect->InsertNewChildElement("Mode")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(0)));
}
}
}
FString Filename; FString Filename;
for (FCurtainGroup& CurtainGroup : CurtainPanel->Groups) for (FCurtainGroup& CurtainGroup : CurtainPanel->Groups)
{ {
@ -1604,7 +1680,7 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
} }
} }
} }
TArray<FEncodeVideoInfo> EncodeVideoInfos = FUtils::ExportPsaf(StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData, *(FGlobalData::ExportPath / "PSAF" / Filename)); TArray<FEncodeVideoInfo> EncodeVideoInfos = FUtils::ExportPsaf(StaticCastSharedPtr<STrackHead>(CurrentTrackHead)->TrackData, *(FGlobalData::ExportPath / "PSAF" / Filename));
for (int32 j = 0; j < EncodeVideoInfos.Num(); j++) for (int32 j = 0; j < EncodeVideoInfos.Num(); j++)
{ {
auto SpeicalEffect = GuangZhenSpecialEffectList->InsertNewChildElement("SpecialEffect"); auto SpeicalEffect = GuangZhenSpecialEffectList->InsertNewChildElement("SpecialEffect");
@ -1628,8 +1704,6 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
} }
Count++; Count++;
} }
}
}
if (Count == 0) if (Count == 0)
{ {
GuangZhenSpecialEffectList->InsertNewText(""); GuangZhenSpecialEffectList->InsertNewText("");
@ -1658,6 +1732,19 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Parent, FEncodeVideoInfo EncodeVideoInfo) tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Parent, FEncodeVideoInfo EncodeVideoInfo)
{ {
int32 TempProjectorID = 0; int32 TempProjectorID = 0;
for (FSingleTrackGroupInstance& SingleTrackGroupInstance : CutTimeline->TrackGroupInstances)
{
const TSharedPtr<STrackHead> TempTrackHead = StaticCastSharedPtr<STrackHead>(SingleTrackGroupInstance.Head);
if (TempTrackHead->TrackData.TrackType != ETrackType::ProjectorTrack)
{
continue;
}
if (GetTrackID(TempTrackHead->TrackData.DeviceTrack.Guid) != -1)
{
TempProjectorID = GetTrackID(TempTrackHead->TrackData.DeviceTrack.Guid);
}
}
tinyxml2::XMLElement* Video = Parent->InsertNewChildElement("Video"); tinyxml2::XMLElement* Video = Parent->InsertNewChildElement("Video");
tinyxml2::XMLElement* URL = Video->InsertNewChildElement("URL"); tinyxml2::XMLElement* URL = Video->InsertNewChildElement("URL");
@ -1703,8 +1790,6 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Pare
VolumeEventTimeCode->InsertNewText("0"); VolumeEventTimeCode->InsertNewText("0");
VolumeEventValue->InsertNewText("100"); VolumeEventValue->InsertNewText("100");
} }
} }
} }
@ -1724,11 +1809,28 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Pare
int32 Value; int32 Value;
}; };
TArray<FProjectorEvent> ProjectorEvents; TArray<FProjectorEvent> ProjectorEvents;
ProjectorEvents.Add(FProjectorEvent{ FUtils::GetMsFromString(FGlobalData::GetTimeData(EncodeVideoInfo.ClipStartFrame)), 1 }); ProjectorEvents.Add(FProjectorEvent{ FUtils::GetMsFromString(FGlobalData::GetTimeData(EncodeVideoInfo.ClipStartFrame)), 1 });
for (int32 i = 0; i < CutTimeline->TrackGroupInstances.Num(); i++) for (int32 i = 0; i < CutTimeline->TrackGroupInstances.Num(); i++)
{ {
if (StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::ProjectorTrack) if (StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::ProjectorTrack)
{ {
TArray<FClipData> TempClipData = StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.ClipData;
Sort(TempClipData.GetData(), TempClipData.Num(), [](const FClipData& A, const FClipData& B)
{
return A.ClipStartFrame < B.ClipStartFrame;
});
if (TempClipData.Num() > 0)
{
if (TempClipData[0].ClipStartFrame != 0)
{
ProjectorEvents.Add({"0", 1 });
}
}
for (FClipData& ClipData : StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.ClipData) for (FClipData& ClipData : StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.ClipData)
{ {
if (ClipData.ClipStartFrame > EncodeVideoInfo.ClipStartFrame - 10 && ClipData.ClipEndFrame < EncodeVideoInfo.ClipEndFrame + 10) if (ClipData.ClipStartFrame > EncodeVideoInfo.ClipStartFrame - 10 && ClipData.ClipEndFrame < EncodeVideoInfo.ClipEndFrame + 10)
@ -1737,7 +1839,6 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Pare
ClipData.PresetType == EPresetType::EnableProjector ? ShowProjector = 1 : ShowProjector = 0; ClipData.PresetType == EPresetType::EnableProjector ? ShowProjector = 1 : ShowProjector = 0;
ProjectorEvents.Add({FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame - EncodeVideoInfo.ClipStartFrame)), ShowProjector}); ProjectorEvents.Add({FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame - EncodeVideoInfo.ClipStartFrame)), ShowProjector});
} }
} }
} }
} }
@ -1771,9 +1872,26 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Pare
tinyxml2::XMLElement* SCutMainWindow::GetSoundElement(tinyxml2::XMLElement* Parent, FEncodeVideoInfo EncodeVideoInfo) tinyxml2::XMLElement* SCutMainWindow::GetSoundElement(tinyxml2::XMLElement* Parent, FEncodeVideoInfo EncodeVideoInfo)
{ {
int32 TempSoundID = 0;
for (FSingleTrackGroupInstance& SingleTrackGroupInstance : CutTimeline->TrackGroupInstances)
{
const TSharedPtr<STrackHead> TempTrackHead = StaticCastSharedPtr<STrackHead>(SingleTrackGroupInstance.Head);
if (TempTrackHead->TrackData.TrackType != ETrackType::AudioTrackR)
{
continue;
}
if (GetTrackID(TempTrackHead->TrackData.DeviceTrack.Guid) != -1)
{
TempSoundID = GetTrackID(TempTrackHead->TrackData.DeviceTrack.Guid);
}
}
tinyxml2::XMLElement* Sound = Parent->InsertNewChildElement("Sound"); tinyxml2::XMLElement* Sound = Parent->InsertNewChildElement("Sound");
{ {
Sound->InsertNewChildElement("RotationSpeakerID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(RotatorSpeakerIndex))); Sound->InsertNewChildElement("RotationSpeakerID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(TempSoundID)));
if (EncodeVideoInfo.EncodedVideoName == "") if (EncodeVideoInfo.EncodedVideoName == "")
{ {
Sound->InsertNewChildElement("URL")->InsertNewText(""); Sound->InsertNewChildElement("URL")->InsertNewText("");
@ -1855,7 +1973,6 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoListElement(tinyxml2::XMLElement*
GetVideoElement(VideoList, EncodeVideoInfo); GetVideoElement(VideoList, EncodeVideoInfo);
Count++; Count++;
} }
} }
} }
if (Count == 0) if (Count == 0)
@ -1875,16 +1992,16 @@ tinyxml2::XMLElement* SCutMainWindow::GetSoundListElement(tinyxml2::XMLElement*
if (StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::AudioTrack || if (StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::AudioTrack ||
StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::AudioTrackR) StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::AudioTrackR)
{ {
FString Filename; FString Filename = GetCurrentSelectFileName();
for (FCurtainGroup& CurtainGroup : CurtainPanel->Groups)
if (StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::AudioTrackR)
{ {
for (const FCurtain& Curtain : CurtainGroup.Curtains) Filename += TEXT("_R");
{
if (Curtain.bIsActive)
{
Filename = Curtain.CurtainName;
}
} }
if (StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData.TrackType == ETrackType::AudioTrack)
{
Filename += TEXT("_L");
} }
FString NewExportFilePath = FGlobalData::ExportPath / "Sound" / Filename; FString NewExportFilePath = FGlobalData::ExportPath / "Sound" / Filename;
TArray<FEncodeVideoInfo> EncodeVideoInfos = FUtils::TrackEncodeAudio(StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData, NewExportFilePath); TArray<FEncodeVideoInfo> EncodeVideoInfos = FUtils::TrackEncodeAudio(StaticCastSharedPtr<STrackHead>(CutTimeline->TrackGroupInstances[i].Head)->TrackData, NewExportFilePath);
@ -1957,7 +2074,8 @@ tinyxml2::XMLElement* SCutMainWindow::GetProcessB(tinyxml2::XMLElement* Parent,
if (!EffectCardsPanel->EffectCardGroups[i].bIsDedicated) if (!EffectCardsPanel->EffectCardGroups[i].bIsDedicated)
{ {
if (EffectCardsPanel->EffectCardGroups[i].UsedCurtains.Contains(Curtain->CurtainUUID)) if (EffectCardsPanel->EffectCardGroups[i].UsedCurtains.Contains(Curtain->CurtainUUID) ||
EffectCardsPanel->EffectCardGroups[i].UsedCurtains.Contains(FStringWithGUID()))
{ {
tinyxml2::XMLElement* SerialNumber = EnableCard->InsertNewChildElement("SerialNumber"); tinyxml2::XMLElement* SerialNumber = EnableCard->InsertNewChildElement("SerialNumber");
SerialNumber->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].ID))); SerialNumber->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].ID)));
@ -1968,7 +2086,8 @@ tinyxml2::XMLElement* SCutMainWindow::GetProcessB(tinyxml2::XMLElement* Parent,
for (int32 j = 0 ; j < EffectCardsPanel->EffectCardGroups[i].Cards.Num(); j++) for (int32 j = 0 ; j < EffectCardsPanel->EffectCardGroups[i].Cards.Num(); j++)
{ {
if (EffectCardsPanel->EffectCardGroups[i].Cards[j].UsedCurtains.Contains(Curtain->CurtainUUID)) if (EffectCardsPanel->EffectCardGroups[i].Cards[j].UsedCurtains.Contains(Curtain->CurtainUUID) ||
EffectCardsPanel->EffectCardGroups[i].Cards[j].UsedCurtains.Contains(FStringWithGUID()))
{ {
tinyxml2::XMLElement* SerialNumber = EnableCard->InsertNewChildElement("SerialNumber"); tinyxml2::XMLElement* SerialNumber = EnableCard->InsertNewChildElement("SerialNumber");
SerialNumber->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].Cards[j].ID))); SerialNumber->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].Cards[j].ID)));
@ -2118,9 +2237,9 @@ tinyxml2::XMLElement* SCutMainWindow::GetFlashLight(tinyxml2::XMLElement* Parent
Parent->InsertNewChildElement("InitialColor")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Colors[0].ToFColor(false))))); Parent->InsertNewChildElement("InitialColor")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Colors[0].ToFColor(false)))));
Parent->InsertNewChildElement("EndColor")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(FLinearColor::Black.ToFColor(false))))); Parent->InsertNewChildElement("EndColor")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(FLinearColor::Black.ToFColor(false)))));
float PerLength = (ClipData.PresetsCustomData.Time / ClipData.PresetsCustomData.Times); float PerLength = (ClipData.PresetsCustomData.Time / ClipData.PresetsCustomData.Times);
Parent->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), int32(PerLength * 1000)))); Parent->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), int32(ClipData.PresetsCustomData.Time * 1000))));
Parent->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame))))); Parent->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame)))));
Parent->InsertNewChildElement("Cycle")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), static_cast<int32>(PerLength * 1000)))); Parent->InsertNewChildElement("Cycle")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), static_cast<int32>(PerLength * 500))));
return nullptr; return nullptr;
} }
@ -2131,22 +2250,23 @@ tinyxml2::XMLElement* SCutMainWindow::GetGradientLight(tinyxml2::XMLElement* Par
if (ClipData.PresetsCustomData.Cursors[0].CursorFrameOffset > 0) if (ClipData.PresetsCustomData.Cursors[0].CursorFrameOffset > 0)
{ {
Parent->InsertNewChildElement("Mode")->InsertNewText("0"); tinyxml2::XMLElement* NewSpeicalEffect = Parent->InsertNewChildElement("Special_Effect");
Parent->InsertNewChildElement("InitialColor") NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("InitialColor")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[0].Color.ToFColor(false))))); ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[0].Color.ToFColor(false)))));
Parent->InsertNewChildElement("EndColor") NewSpeicalEffect->InsertNewChildElement("EndColor")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),*FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[0].Color.ToFColor(false))))); ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),*FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[0].Color.ToFColor(false)))));
Parent->InsertNewChildElement("TimeLength") NewSpeicalEffect->InsertNewChildElement("TimeLength")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.PresetsCustomData.Cursors[0].CursorFrameOffset))))); *FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.PresetsCustomData.Cursors[0].CursorFrameOffset)))));
Parent->InsertNewChildElement("TimeCode") NewSpeicalEffect->InsertNewChildElement("TimeCode")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame + ClipData.PresetsCustomData.Cursors[0].CursorFrameOffset))))); *FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame)))));
Parent->InsertNewChildElement("Cycle") NewSpeicalEffect->InsertNewChildElement("Cycle")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.PresetsCustomData.Cursors[0].CursorFrameOffset))))); *FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.PresetsCustomData.Cursors[0].CursorFrameOffset)))));
} }
@ -2157,47 +2277,49 @@ tinyxml2::XMLElement* SCutMainWindow::GetGradientLight(tinyxml2::XMLElement* Par
{ {
if (Index == CursorNum - 1 && CursorData.CursorFrameOffset <= (ClipData.ClipEndFrame - ClipData.ClipStartFrame)) if (Index == CursorNum - 1 && CursorData.CursorFrameOffset <= (ClipData.ClipEndFrame - ClipData.ClipStartFrame))
{ {
Parent->InsertNewChildElement("Mode")->InsertNewText("0"); tinyxml2::XMLElement* NewSpeicalEffect = Parent->InsertNewChildElement("Special_Effect");
Parent->InsertNewChildElement("InitialColor") NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("0");
NewSpeicalEffect->InsertNewChildElement("InitialColor")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index].Color.ToFColor(false))))); ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index].Color.ToFColor(false)))));
Parent->InsertNewChildElement("EndColor") NewSpeicalEffect->InsertNewChildElement("EndColor")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),*FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index].Color.ToFColor(false))))); ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),*FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index].Color.ToFColor(false)))));
Parent->InsertNewChildElement("TimeLength") NewSpeicalEffect->InsertNewChildElement("TimeLength")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData( *FUtils::GetMsFromString(FGlobalData::GetTimeData(
(ClipData.ClipEndFrame - ClipData.ClipStartFrame) - (ClipData.ClipEndFrame - ClipData.ClipStartFrame) -
ClipData.PresetsCustomData.Cursors[Index].CursorFrameOffset))))); ClipData.PresetsCustomData.Cursors[Index].CursorFrameOffset)))));
Parent->InsertNewChildElement("TimeCode") NewSpeicalEffect->InsertNewChildElement("TimeCode")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame + ClipData.PresetsCustomData.Cursors[Index].CursorFrameOffset))))); *FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame + ClipData.PresetsCustomData.Cursors[Index].CursorFrameOffset)))));
Parent->InsertNewChildElement("Cycle") NewSpeicalEffect->InsertNewChildElement("Cycle")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData( *FUtils::GetMsFromString(FGlobalData::GetTimeData(
(ClipData.ClipEndFrame - ClipData.ClipStartFrame) - (ClipData.ClipEndFrame - ClipData.ClipStartFrame) -
ClipData.PresetsCustomData.Cursors[Index].CursorFrameOffset))))); ClipData.PresetsCustomData.Cursors[Index].CursorFrameOffset)))));
break; break;
} }
Parent->InsertNewChildElement("Mode")->InsertNewText("1"); tinyxml2::XMLElement* NewSpeicalEffect = Parent->InsertNewChildElement("Special_Effect");
Parent->InsertNewChildElement("InitialColor") NewSpeicalEffect->InsertNewChildElement("Mode")->InsertNewText("1");
NewSpeicalEffect->InsertNewChildElement("InitialColor")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index].Color.ToFColor(false))))); ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index].Color.ToFColor(false)))));
Parent->InsertNewChildElement("EndColor") NewSpeicalEffect->InsertNewChildElement("EndColor")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),*FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index + 1].Color.ToFColor(false))))); ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),*FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index + 1].Color.ToFColor(false)))));
Parent->InsertNewChildElement("TimeLength") NewSpeicalEffect->InsertNewChildElement("TimeLength")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData( *FUtils::GetMsFromString(FGlobalData::GetTimeData(
ClipData.PresetsCustomData.Cursors[Index + 1].CursorFrameOffset - CursorData.CursorFrameOffset))))); ClipData.PresetsCustomData.Cursors[Index + 1].CursorFrameOffset - CursorData.CursorFrameOffset)))));
Parent->InsertNewChildElement("TimeCode") NewSpeicalEffect->InsertNewChildElement("TimeCode")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame + CursorData.CursorFrameOffset))))); *FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipStartFrame + CursorData.CursorFrameOffset)))));
Parent->InsertNewChildElement("Cycle") NewSpeicalEffect->InsertNewChildElement("Cycle")
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), ->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
*FUtils::GetMsFromString( *FUtils::GetMsFromString(
FGlobalData::GetTimeData(ClipData.PresetsCustomData.Cursors[Index + 1].CursorFrameOffset - CursorData.CursorFrameOffset))))); FGlobalData::GetTimeData(ClipData.PresetsCustomData.Cursors[Index + 1].CursorFrameOffset - CursorData.CursorFrameOffset)))));
@ -2207,6 +2329,27 @@ tinyxml2::XMLElement* SCutMainWindow::GetGradientLight(tinyxml2::XMLElement* Par
return nullptr; return nullptr;
} }
void SCutMainWindow::DeselectAll()
{
for (FCurtainGroup& CurtainGroup : CurtainPanel->Groups)
{
for (FCurtain& Curtain : CurtainGroup.Curtains)
{
Curtain.bIsActive = false;
}
}
for (int32 i = 0; i < EffectCardsPanel->EffectCardGroups.Num(); ++i)
{
for (int32 j = 0; j < EffectCardsPanel->EffectCardGroups[i].Cards.Num(); ++j)
{
if (EffectCardsPanel->EffectCardGroups[i].Cards[j].bIsActive)
{
EffectCardsPanel->EffectCardGroups[i].Cards[j].bIsActive = false;
}
}
}
}
int32 SCutMainWindow::GetTrackID(FGuid Guid) const int32 SCutMainWindow::GetTrackID(FGuid Guid) const
{ {
const int32* Index = IDList.Find(Guid); const int32* Index = IDList.Find(Guid);

View File

@ -14,6 +14,7 @@
#include "StatePanel/SVideoPlayer.h" #include "StatePanel/SVideoPlayer.h"
#include "Cut5/Interface/CutMainWidgetInterface.h" #include "Cut5/Interface/CutMainWidgetInterface.h"
#include "Cut5/Interface/SoundInterface.h" #include "Cut5/Interface/SoundInterface.h"
#include "FX/SEffectCardsPanel.h"
#include "StatePanel/SStatePanel.h" #include "StatePanel/SStatePanel.h"
#include "Widgets/SCompoundWidget.h" #include "Widgets/SCompoundWidget.h"
@ -120,6 +121,8 @@ public:
tinyxml2::XMLElement* GetBreatheLight(tinyxml2::XMLElement* Parent, const FClipData& ClipData); tinyxml2::XMLElement* GetBreatheLight(tinyxml2::XMLElement* Parent, const FClipData& ClipData);
tinyxml2::XMLElement* GetFlashLight(tinyxml2::XMLElement* Parent, const FClipData& ClipData); tinyxml2::XMLElement* GetFlashLight(tinyxml2::XMLElement* Parent, const FClipData& ClipData);
tinyxml2::XMLElement* GetGradientLight(tinyxml2::XMLElement* Parent, const FClipData& ClipData); tinyxml2::XMLElement* GetGradientLight(tinyxml2::XMLElement* Parent, const FClipData& ClipData);
FString GetCurrentSelectFileName();
void DeselectAll();
int32 RotatorSpeakerIndex = 0; int32 RotatorSpeakerIndex = 0;
int32 LightArrayIndex = 0; int32 LightArrayIndex = 0;
@ -133,4 +136,29 @@ public:
void RemoveThread(const FGuid& Guid); void RemoveThread(const FGuid& Guid);
}; };
inline FString SCutMainWindow::GetCurrentSelectFileName()
{
for (FCurtainGroup& CurtainGroup : CurtainPanel->Groups)
{
for (const FCurtain& Curtain : CurtainGroup.Curtains)
{
if (Curtain.bIsActive)
{
return Curtain.CurtainName;
}
}
}
for (int32 i = 0; i < EffectCardsPanel->EffectCardGroups.Num(); ++i)
{
for (int32 j = 0; j < EffectCardsPanel->EffectCardGroups[i].Cards.Num(); ++j)
{
if (EffectCardsPanel->EffectCardGroups[i].Cards[j].bIsActive)
{
return EffectCardsPanel->EffectCardGroups[i].Cards[j].Name;
}
}
}
return "NULL";
}

View File

@ -382,8 +382,6 @@ void SCutTimeline::Construct(const FArguments& InArgs)
AddNewDeviceToGroup(TEXT("固定轨道"), LightArrayData); AddNewDeviceToGroup(TEXT("固定轨道"), LightArrayData);
FDeviceTrack LightBarData(TEXT("灯带"), ETrackType::LightBarTrack); FDeviceTrack LightBarData(TEXT("灯带"), ETrackType::LightBarTrack);
AddNewDeviceToGroup(TEXT("固定轨道"), LightBarData); AddNewDeviceToGroup(TEXT("固定轨道"), LightBarData);
FDeviceTrack LightBarData2(TEXT("灯带2"), ETrackType::LightBarTrack);
AddNewDeviceToGroup(TEXT("固定轨道"), LightBarData2);
FDeviceTrack SpotLightData(TEXT("投射灯一"), ETrackType::SpotLightTrack); FDeviceTrack SpotLightData(TEXT("投射灯一"), ETrackType::SpotLightTrack);
AddNewDeviceToGroup(TEXT("固定轨道"), SpotLightData); AddNewDeviceToGroup(TEXT("固定轨道"), SpotLightData);

View File

@ -238,7 +238,7 @@ void STimelineClip::Construct(const FArguments& InArgs)
// FRunnableThread::Create(Thread, TEXT("VideoThread")); // FRunnableThread::Create(Thread, TEXT("VideoThread"));
// } // }
} }
if (ClipData->ClipType == ETrackType::VideoTrack) if (ClipData->ClipType == ETrackType::VideoTrack || ClipData->ClipType == ETrackType::LightArrayTrack || ClipData->ClipType == ETrackType::LightBarTrack)
{ {
if (!MainWidgetInterface->GetSelf()->GetThread(FUtils::GetVideoThreadGuid(ClipData->ClipGuid))) if (!MainWidgetInterface->GetSelf()->GetThread(FUtils::GetVideoThreadGuid(ClipData->ClipGuid)))
{ {
@ -346,11 +346,12 @@ void STimelineClip::Seek(int32 Frame)
const int32 Offset = Frame - ClipData->ClipStartFrame; const int32 Offset = Frame - ClipData->ClipStartFrame;
const int32 SeekMovieFrame = ClipData->VideoStartFrame + Offset; const int32 SeekMovieFrame = ClipData->VideoStartFrame + Offset;
if (ClipData->LightArrayData.Num() != 0 && SeekMovieFrame < ClipData->LightArrayData.Num())
if (MainWidgetInterface->GetSelf()->GetThread(FUtils::GetVideoThreadGuid(ClipData->ClipGuid)))
{ {
MainWidgetInterface->OnUpdateLightArray(ClipData->LightArrayData[SeekMovieFrame]); static_cast<FVideoThread*>(MainWidgetInterface->GetSelf()->GetThread(FUtils::GetVideoThreadGuid(ClipData->ClipGuid)))->SeekFrame(SeekMovieFrame);
break;
} }
if (ClipData->PresetsCustomData.PresetCustomType != FPresetsCustomData::EPresetCustomType::None) if (ClipData->PresetsCustomData.PresetCustomType != FPresetsCustomData::EPresetCustomType::None)
{ {
if (ClipData->PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::Breathe) if (ClipData->PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::Breathe)
@ -446,7 +447,7 @@ void STimelineClip::UpdatePosition(int32 StartFrame)
SetRenderTransform(FSlateRenderTransform(FVector2D(NewPosX, 0))); SetRenderTransform(FSlateRenderTransform(FVector2D(NewPosX, 0)));
ClipDataBox->SetWidthOverride((ClipData->ClipEndFrame - StartFrame) * FGlobalData::DefaultTimeTickSpace); ClipDataBox->SetWidthOverride((ClipData->ClipEndFrame - StartFrame) * FGlobalData::DefaultTimeTickSpace);
if (ClipData->ClipType == ETrackType::VideoTrack) if (ClipData->ClipType == ETrackType::VideoTrack || ClipData->ClipType == ETrackType::AudioTrack || ClipData->ClipType == ETrackType::AudioTrackR)
{ {
ClipData->VideoStartFrame += StartFrame - ClipData->ClipStartFrame; ClipData->VideoStartFrame += StartFrame - ClipData->ClipStartFrame;
} }
@ -479,7 +480,7 @@ void STimelineClip::UpdateLength(int32 EndFrame)
ClipDataBox->SetWidthOverride((EndFrame - ClipData->ClipStartFrame) * FGlobalData::DefaultTimeTickSpace); ClipDataBox->SetWidthOverride((EndFrame - ClipData->ClipStartFrame) * FGlobalData::DefaultTimeTickSpace);
if (ClipData->ClipType == ETrackType::VideoTrack) if (ClipData->ClipType == ETrackType::VideoTrack || ClipData->ClipType == ETrackType::AudioTrack || ClipData->ClipType == ETrackType::AudioTrackR)
{ {
ClipData->VideoEndFrame += EndFrame - ClipData->ClipEndFrame; ClipData->VideoEndFrame += EndFrame - ClipData->ClipEndFrame;
} }
@ -492,10 +493,8 @@ void STimelineClip::UpdateLength(int32 EndFrame)
{ {
ClipData->PresetsCustomData.Cursors[i].CursorFrameOffset = ClipData->ClipEndFrame - ClipData->ClipStartFrame; ClipData->PresetsCustomData.Cursors[i].CursorFrameOffset = ClipData->ClipEndFrame - ClipData->ClipStartFrame;
} }
} }
} }
} }
void STimelineClip::UpdateMove(int32 X, int32 DragOffset) void STimelineClip::UpdateMove(int32 X, int32 DragOffset)

View File

@ -284,7 +284,6 @@ void STrackBody::BreakClip(const FGuid& Guid)
FFFMPEGUtils::GetAudioBrush(&NewClipData); FFFMPEGUtils::GetAudioBrush(&NewClipData);
} }
} }
} }
CallRender(); CallRender();