9.14修改
This commit is contained in:
parent
125c174e2e
commit
fe04693f89
60
Cut5.sln
60
Cut5.sln
@ -7,67 +7,49 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{233774
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}"
|
||||
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
|
||||
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
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1CCEC849-CC72-4C59-8C36-2F7C38706D4C}"
|
||||
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
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
DebugGame Editor|Android = DebugGame Editor|Android
|
||||
DebugGame Editor|Win64 = DebugGame Editor|Win64
|
||||
DebugGame|Android = DebugGame|Android
|
||||
DebugGame|Win64 = DebugGame|Win64
|
||||
Development Editor|Android = Development Editor|Android
|
||||
Development Editor|Win64 = Development Editor|Win64
|
||||
Development|Android = Development|Android
|
||||
Development|Win64 = Development|Win64
|
||||
Shipping|Android = Shipping|Android
|
||||
Shipping|Win64 = Shipping|Win64
|
||||
EndGlobalSection
|
||||
# UnrealVS Section
|
||||
GlobalSection(ddbf523f-7eb6-4887-bd51-85a714ff87eb) = preSolution
|
||||
AvailablePlatforms=Win64;Android
|
||||
AvailablePlatforms=Win64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame Editor|Android.ActiveCfg = Invalid|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Android.ActiveCfg = Android_DebugGame|Win64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Android.Build.0 = Android_DebugGame|Win64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Win64.ActiveCfg = DebugGame|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.DebugGame|Win64.Build.0 = DebugGame|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development Editor|Android.ActiveCfg = Invalid|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development Editor|Win64.ActiveCfg = Development_Editor|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development Editor|Win64.Build.0 = Development_Editor|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Android.ActiveCfg = Android_Development|Win64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Android.Build.0 = Android_Development|Win64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Win64.ActiveCfg = Development|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Development|Win64.Build.0 = Development|x64
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157}.Shipping|Android.ActiveCfg = Android_Shipping|Win64
|
||||
{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
|
||||
{6EE39883-7339-3FB6-AD82-931FB137D37F}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
|
||||
{6EE39883-7339-3FB6-AD82-931FB137D37F}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
|
||||
{6EE39883-7339-3FB6-AD82-931FB137D37F}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
|
||||
{6EE39883-7339-3FB6-AD82-931FB137D37F}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
|
||||
{6EE39883-7339-3FB6-AD82-931FB137D37F}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame|Win64.ActiveCfg = DebugGame|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.DebugGame|Win64.Build.0 = DebugGame|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.Development Editor|Win64.ActiveCfg = Development_Editor|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.Development Editor|Win64.Build.0 = Development_Editor|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.Development|Win64.ActiveCfg = Development|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.Development|Win64.Build.0 = Development|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.Shipping|Win64.ActiveCfg = Shipping|x64
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B}.Shipping|Win64.Build.0 = Shipping|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{C48D0E9D-C862-3EA3-96A7-752EE9D06362} = {233774A8-CC9D-3FA9-86D1-90573E92B704}
|
||||
{B95E7D0E-DB45-3765-9058-E00EBBC4B157} = {DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}
|
||||
{6EE39883-7339-3FB6-AD82-931FB137D37F} = {233774A8-CC9D-3FA9-86D1-90573E92B704}
|
||||
{AF5A253A-0F37-38CE-8998-45CA936C112B} = {DE1F8B53-6C02-3C13-9101-A7C8D96F3FF6}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
@ -24,7 +24,7 @@ uint32 FVideoThread::Run()
|
||||
{
|
||||
if (CurrentSeekingFrame != -1)
|
||||
{
|
||||
int32 VideoFPS = NewPropertyData.VideoCodecContext->framerate.num;
|
||||
int32 VideoFPS = NewPropertyData.VideoCodecContext->frame_number;
|
||||
if (VideoFPS < FGlobalData::GlobalFPS)
|
||||
{
|
||||
const double Interval = FGlobalData::GlobalFPS / VideoFPS;
|
||||
|
25
Source/Cut5/Utils/CutPlatformUtils.cpp
Normal file
25
Source/Cut5/Utils/CutPlatformUtils.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include "CutPlatformUtils.h"
|
||||
|
||||
#include <commctrl.h>
|
||||
|
||||
HWND FCutPlatformUtils::CreateProcessWindow()
|
||||
{
|
||||
HWND Process = ::FindWindowW(nullptr, *FApp::GetName());
|
||||
if (Process)
|
||||
{
|
||||
HWND ProcessBar = ::CreateWindowExW(0, PROGRESS_CLASS, NULL,
|
||||
WS_CHILD | WS_VISIBLE, 0, 0, 200, 20,
|
||||
Process, (HMENU) 0, NULL, NULL);
|
||||
|
||||
::SendMessageW(ProcessBar, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
|
||||
return ProcessBar;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void FCutPlatformUtils::UpdateProcess(HWND hwnd, float Progress, FString Message)
|
||||
{
|
||||
::SendMessageW(hwnd, PBM_SETPOS, Progress, 0);
|
||||
}
|
15
Source/Cut5/Utils/CutPlatformUtils.h
Normal file
15
Source/Cut5/Utils/CutPlatformUtils.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
#include "Windows/AllowWindowsPlatformTypes.h"
|
||||
#include "Windows/PreWindowsApi.h"
|
||||
#include "Windows/MinWindows.h"
|
||||
#include "Windows/PostWindowsApi.h"
|
||||
#include "Windows/HideWindowsPlatformTypes.h"
|
||||
|
||||
class FCutPlatformUtils
|
||||
{
|
||||
public:
|
||||
|
||||
static HWND CreateProcessWindow();
|
||||
static void UpdateProcess(HWND hwnd, float Progress, FString Message);
|
||||
|
||||
};
|
@ -329,10 +329,15 @@ TArray<FEncodeVideoInfo> FUtils::TrackEncodeVideo(const FTrackData& TrackData, c
|
||||
FEncodeVideoInfo EncodeVideoInfo;
|
||||
FTimespan EndTimespan = FTimespan::FromSeconds(TempClipData.VideoEndFrame / FGlobalData::GlobalFPS);
|
||||
FTimespan StartTimespan = FTimespan::FromSeconds(TempClipData.VideoStartFrame / FGlobalData::GlobalFPS);
|
||||
int32 StartMilli = TempClipData.VideoStartFrame % static_cast<int32>(FGlobalData::GlobalFPS);
|
||||
int32 EndMilli = TempClipData.VideoEndFrame % static_cast<int32>(FGlobalData::GlobalFPS);
|
||||
FString NewStartMilli = FUtils::GetMsFromString(FGlobalData::GetTimeData(StartMilli));
|
||||
FString NewEndMilli = FUtils::GetMsFromString(FGlobalData::GetTimeData(EndMilli));
|
||||
NewStartMilli = FString::Printf(TEXT("%04d"), FCString::Atoi(*NewStartMilli));
|
||||
NewEndMilli = FString::Printf(TEXT("%04d"), FCString::Atoi(*NewEndMilli));
|
||||
|
||||
|
||||
FString StartTime = FString::Printf(TEXT("%02d:%02d:%02d"), StartTimespan.GetHours(), StartTimespan.GetMinutes(), StartTimespan.GetSeconds());
|
||||
FString EndTime = FString::Printf(TEXT("%02d:%02d:%02d"), EndTimespan.GetHours(), EndTimespan.GetMinutes(), EndTimespan.GetSeconds());
|
||||
FString StartTime = FString::Printf(TEXT("%02d:%02d:%02d.%s"), StartTimespan.GetHours(), StartTimespan.GetMinutes(), StartTimespan.GetSeconds(), *NewStartMilli);
|
||||
FString EndTime = FString::Printf(TEXT("%02d:%02d:%02d.%s"), EndTimespan.GetHours(), EndTimespan.GetMinutes(), EndTimespan.GetSeconds(), *NewEndMilli);
|
||||
FString InputFile = "\"" + TempClipData.ResourcePropertyDataPtr->MoviePath + "\"";
|
||||
|
||||
|
||||
@ -481,6 +486,10 @@ FEncodeVideoInfo FUtils::TrackEncodeAudio(const FTrackData& TrackData, const FSt
|
||||
// }
|
||||
// i++;
|
||||
// }
|
||||
if (AudioCount == 0)
|
||||
{
|
||||
return FEncodeVideoInfo();
|
||||
}
|
||||
|
||||
EncodeVideoInfo.EncodedVideoTimeCode = FGlobalData::GetTimeData(SavedClipData.ClipStartFrame);
|
||||
EncodeVideoInfo.EncodedVideoName = ExportPath + TEXT(".mp3");
|
||||
@ -506,6 +515,10 @@ FEncodeVideoInfo FUtils::CombineAudio(const FEncodeVideoInfo& LeftEncodeData,
|
||||
{
|
||||
RightPathName = RightEncodeData.EncodedVideoName;
|
||||
}
|
||||
if (LeftPathName == "" && RightPathName == "")
|
||||
{
|
||||
return FEncodeVideoInfo();
|
||||
}
|
||||
|
||||
FString Command = "";
|
||||
|
||||
@ -565,14 +578,17 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
|
||||
VideoCapture capture;
|
||||
bool ret = false;
|
||||
FString Command = FString::Printf(TEXT("-i \"%s\" -y \"%s\""), *TempPath, TEXT("C:/temp/Temp.mp4"));
|
||||
FString Guid = FGuid::NewGuid().ToString();
|
||||
FString Mp4TempPath = TEXT("C:/temp/") + Guid + ".mp4";
|
||||
FString Command = FString::Printf(TEXT("-i \"%s\" -y \"%s\""), *TempPath, *Mp4TempPath);
|
||||
FPlatformProcess::ExecProcess(*FUtils::GetFfmepg(), *Command, nullptr, nullptr, nullptr);
|
||||
FPlatformProcess::Sleep(2.0f);
|
||||
ret = capture.open("C:\\temp\\Temp.mp4");
|
||||
FPlatformProcess::Sleep(1.0f);
|
||||
ret = capture.open(TCHAR_TO_UTF8(*Mp4TempPath));
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
FGlobalData::ExportErrorString.Add(FString::Printf(TEXT("%s"), *FPaths::GetCleanFilename(ExportPath)));
|
||||
capture.release();
|
||||
}
|
||||
|
||||
//setNumThreads(2);
|
||||
@ -675,11 +691,26 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
|
||||
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));
|
||||
int8 r = frame.at<Vec3b>(row, col)[2];
|
||||
int8 g = frame.at<Vec3b>(row, col)[1];
|
||||
int8 b = frame.at<Vec3b>(row, col)[0];
|
||||
|
||||
if (r == 1)
|
||||
{
|
||||
r -= 1;
|
||||
}
|
||||
if (g == 1)
|
||||
{
|
||||
g -= 1;
|
||||
}
|
||||
if (b == 1)
|
||||
{
|
||||
b -= 1;
|
||||
}
|
||||
|
||||
outfile.write(reinterpret_cast<const char*>(&r), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&g), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&b), sizeof(uint8));
|
||||
//UE_LOG(LogTemp, Log, TEXT("row -> %s ,col - > %s "),
|
||||
// *FString::FromInt(row), *FString::FromInt(col));
|
||||
}
|
||||
@ -690,10 +721,26 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
|
||||
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
|
||||
|
||||
int8 r = frame.at<Vec3b>(row, col)[2];
|
||||
int8 g = frame.at<Vec3b>(row, col)[1];
|
||||
int8 b = frame.at<Vec3b>(row, col)[0];
|
||||
|
||||
if (r == 1)
|
||||
{
|
||||
r -= 1;
|
||||
}
|
||||
if (g == 1)
|
||||
{
|
||||
g -= 1;
|
||||
}
|
||||
if (b == 1)
|
||||
{
|
||||
b -= 1;
|
||||
}
|
||||
|
||||
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));
|
||||
outfile.write(reinterpret_cast<const char*>(&r), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&g), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&b), sizeof(uint8));
|
||||
|
||||
}
|
||||
|
||||
@ -707,11 +754,26 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
for (int32 col = 0; col < frame.cols; col++) {
|
||||
|
||||
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
|
||||
int8 r = frame.at<Vec3b>(row, col)[2];
|
||||
int8 g = frame.at<Vec3b>(row, col)[1];
|
||||
int8 b = frame.at<Vec3b>(row, col)[0];
|
||||
|
||||
if (r == 1)
|
||||
{
|
||||
r -= 1;
|
||||
}
|
||||
if (g == 1)
|
||||
{
|
||||
g -= 1;
|
||||
}
|
||||
if (b == 1)
|
||||
{
|
||||
b -= 1;
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
outfile.write(reinterpret_cast<const char*>(&r), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&g), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&b), sizeof(uint8));
|
||||
|
||||
}
|
||||
|
||||
@ -721,11 +783,26 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
for (int32 col = frame.cols - 1; col >= 0; col--) {
|
||||
|
||||
frame.at<Vec3b>(row, col) = frameOrg.at<Vec3b>(row, col);
|
||||
int8 r = frame.at<Vec3b>(row, col)[2];
|
||||
int8 g = frame.at<Vec3b>(row, col)[1];
|
||||
int8 b = frame.at<Vec3b>(row, col)[0];
|
||||
|
||||
if (r == 1)
|
||||
{
|
||||
r -= 1;
|
||||
}
|
||||
if (g == 1)
|
||||
{
|
||||
g -= 1;
|
||||
}
|
||||
if (b == 1)
|
||||
{
|
||||
b -= 1;
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
outfile.write(reinterpret_cast<const char*>(&r), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&g), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&b), sizeof(uint8));
|
||||
|
||||
}
|
||||
}
|
||||
@ -737,11 +814,26 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
|
||||
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));
|
||||
|
||||
int8 r = frame.at<Vec3b>(row, col)[2];
|
||||
int8 g = frame.at<Vec3b>(row, col)[1];
|
||||
int8 b = frame.at<Vec3b>(row, col)[0];
|
||||
|
||||
if (r == 1)
|
||||
{
|
||||
r -= 1;
|
||||
}
|
||||
if (g == 1)
|
||||
{
|
||||
g -= 1;
|
||||
}
|
||||
if (b == 1)
|
||||
{
|
||||
b -= 1;
|
||||
}
|
||||
|
||||
outfile.write(reinterpret_cast<const char*>(&r), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&g), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&b), sizeof(uint8));
|
||||
}
|
||||
|
||||
}
|
||||
@ -750,11 +842,26 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
|
||||
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));
|
||||
|
||||
int8 r = frame.at<Vec3b>(row, col)[2];
|
||||
int8 g = frame.at<Vec3b>(row, col)[1];
|
||||
int8 b = frame.at<Vec3b>(row, col)[0];
|
||||
|
||||
if (r == 1)
|
||||
{
|
||||
r -= 1;
|
||||
}
|
||||
if (g == 1)
|
||||
{
|
||||
g -= 1;
|
||||
}
|
||||
if (b == 1)
|
||||
{
|
||||
b -= 1;
|
||||
}
|
||||
|
||||
outfile.write(reinterpret_cast<const char*>(&r), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&g), sizeof(uint8));
|
||||
outfile.write(reinterpret_cast<const char*>(&b), sizeof(uint8));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -784,7 +891,7 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
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));
|
||||
// UE_LOG(LogTemp, Log, TEXT("fileSize2 -> %s"), *FString::FromInt(fileSize));
|
||||
|
||||
capture.release();
|
||||
|
||||
@ -797,7 +904,7 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
|
||||
UE_LOG(LogTemp, Log, TEXT("proecess completed , video close"));
|
||||
}
|
||||
FEncodeVideoInfo EncodeVideoInfo;
|
||||
FString String = ExportPath + ExportName + FString::FromInt(i) + ".psaf";
|
||||
FString String = ExportPath + FString::FromInt(i) + ".psaf";
|
||||
EncodeVideoInfo.EncodedVideoName = FPaths::GetBaseFilename(String) + ".psaf";
|
||||
EncodeVideoInfo.EncodedVideoTimeCode = FGlobalData::GetTimeData(TempClipData.ClipStartFrame);
|
||||
|
||||
@ -822,7 +929,7 @@ FString FUtils::GetMsFromString(FString TimeString)
|
||||
int32 Seconds = FCString::Atoi(*TimeParts[2]);
|
||||
int32 Frames = TimeParts.Num() == 4 ? FCString::Atoi(*TimeParts[3]) : 0;
|
||||
// Nano -> Milli
|
||||
Timespan = FTimespan(0, Hours, Minutes, Seconds, Frames * 33 * 1000000); // 假设每帧为33毫秒
|
||||
Timespan = FTimespan(0, Hours, Minutes, Seconds, Frames * (1000 / FGlobalData::GlobalFPS) * 1000000); // 假设每帧为33毫秒
|
||||
}
|
||||
|
||||
// 将FTimespan对象转换为毫秒
|
||||
@ -831,11 +938,31 @@ FString FUtils::GetMsFromString(FString TimeString)
|
||||
return FString::FromInt(Milliseconds);
|
||||
}
|
||||
|
||||
FString FUtils::GetMsNumberFromStringWithZFill(FString TimeString)
|
||||
{
|
||||
FTimespan Timespan;
|
||||
TArray<FString> TimeParts;
|
||||
TimeString.ParseIntoArray(TimeParts, TEXT(":"));
|
||||
if (TimeParts.Num() == 3 || TimeParts.Num() == 4)
|
||||
{
|
||||
int32 Hours = FCString::Atoi(*TimeParts[0]);
|
||||
int32 Minutes = FCString::Atoi(*TimeParts[1]);
|
||||
int32 Seconds = FCString::Atoi(*TimeParts[2]);
|
||||
int32 Frames = TimeParts.Num() == 4 ? FCString::Atoi(*TimeParts[3]) : 0;
|
||||
// Nano -> Milli
|
||||
Timespan = FTimespan(0, Hours, Minutes, Seconds, Frames * 33 * 1000000); // 假设每帧为33毫秒
|
||||
}
|
||||
|
||||
// 将FTimespan对象转换为毫秒
|
||||
int32 Milliseconds = Timespan.GetTotalMilliseconds();
|
||||
return FString::Printf(TEXT("%04d"), Milliseconds);
|
||||
}
|
||||
|
||||
FString FUtils::Color2Hex3(FColor Color)
|
||||
{
|
||||
Color.R = FMath::GetMappedRangeValueClamped(FVector2D(0, 0xFF), FVector2D(0, 0x64), Color.R);
|
||||
Color.G = FMath::GetMappedRangeValueClamped(FVector2D(0, 0xFF), FVector2D(0, 0x64), Color.R);
|
||||
Color.B = FMath::GetMappedRangeValueClamped(FVector2D(0, 0xFF), FVector2D(0, 0x64), Color.R);
|
||||
Color.G = FMath::GetMappedRangeValueClamped(FVector2D(0, 0xFF), FVector2D(0, 0x64), Color.G);
|
||||
Color.B = FMath::GetMappedRangeValueClamped(FVector2D(0, 0xFF), FVector2D(0, 0x64), Color.B);
|
||||
return FString::Printf(TEXT("%02X%02X%02X"), Color.R, Color.G, Color.B);
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,7 @@ public:
|
||||
|
||||
|
||||
static FString GetMsFromString(FString TimeString);
|
||||
static FString GetMsNumberFromStringWithZFill(FString TimeString);
|
||||
static FString Color2Hex3(FColor Color);
|
||||
|
||||
|
||||
|
9
Source/Cut5/Widgets/Commands/TrackGroupCommands.cpp
Normal file
9
Source/Cut5/Widgets/Commands/TrackGroupCommands.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "TrackGroupCommands.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FTrackGroupCommands"
|
||||
void FTrackGroupCommands::RegisterCommands()
|
||||
{
|
||||
UI_COMMAND(Rename, "重命名组", "Executes My TimelineClipCommands", EUserInterfaceActionType::Button, FInputChord());
|
||||
UI_COMMAND(RemoveGroup, "删除整组", "Executes My TimelineClipCommands", EUserInterfaceActionType::Button, FInputChord());
|
||||
}
|
||||
#undef LOCTEXT_NAMESPACE
|
22
Source/Cut5/Widgets/Commands/TrackGroupCommands.h
Normal file
22
Source/Cut5/Widgets/Commands/TrackGroupCommands.h
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "CoreMinimal.h"
|
||||
#include "Framework/Commands/Commands.h"
|
||||
|
||||
class FTrackGroupCommands : public TCommands<FTrackGroupCommands>
|
||||
{
|
||||
public:
|
||||
|
||||
FTrackGroupCommands()
|
||||
: TCommands<FTrackGroupCommands>(TEXT("FTrackGroupCommands"), NSLOCTEXT("Contexts", "FTimelineClipCommands", "FTimelineClipCommands"), NAME_None, FAppStyle::GetAppStyleSetName())
|
||||
{
|
||||
// 这里可以设置你的命令的默认键盘快捷键
|
||||
}
|
||||
|
||||
// TCommands<> 接口
|
||||
virtual void RegisterCommands() override;
|
||||
|
||||
TSharedPtr<FUICommandInfo> Rename;
|
||||
TSharedPtr<FUICommandInfo> RemoveGroup;
|
||||
};
|
@ -18,6 +18,7 @@
|
||||
#include "Commands/MainMenuCommands.h"
|
||||
#include "Commands/ShortcunCommands.h"
|
||||
#include "CustomPanel/SCustomPanel.h"
|
||||
#include "Cut5/Utils/CutPlatformUtils.h"
|
||||
#include "Cut5/Utils/FFMPEGUtils.h"
|
||||
#include "Cut5/Utils/Utils.h"
|
||||
#include "Cut5/Xml/tinyxml2.h"
|
||||
@ -126,6 +127,24 @@ void SCutMainWindow::Construct(const FArguments& InArgs)
|
||||
SNew(STextBlock)
|
||||
.Text(FText::FromString(FString::Printf(TEXT("Ver. %s"), *FGlobalData::CutVersion)))
|
||||
.Justification(ETextJustify::Center)
|
||||
.OnDoubleClicked_Lambda([this](const FGeometry&, const FPointerEvent&)
|
||||
{
|
||||
for (int32 i = CutTimeline->DeviceTrackGroups.Num() - 1; i >= 0; i--)
|
||||
{
|
||||
if (CutTimeline->DeviceTrackGroups[i].GroupType == ETrackType::AtomSphereLightTrack)
|
||||
{
|
||||
CutTimeline->DeviceTrackGroups.RemoveAt(i);
|
||||
}
|
||||
// for (int32 j = CutTimeline->DeviceTrackGroups[i].DeviceTracks.Num() - 1; j >= 0; j--)
|
||||
// {
|
||||
// if (CutTimeline->DeviceTrackGroups[i].DeviceTracks[j].DeviceType == ETrackType::AtomSphereLightTrack)
|
||||
// {
|
||||
// CutTimeline->DeviceTrackGroups[i].DeviceTracks.RemoveAt(j);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return FReply::Handled();
|
||||
})
|
||||
]
|
||||
+ SHorizontalBox::Slot()
|
||||
.SizeParam(FStretch(1.0))
|
||||
@ -1048,6 +1067,11 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
|
||||
|
||||
if (ExportPath.IsEmpty())
|
||||
return;
|
||||
|
||||
|
||||
HWND hwnd = FCutPlatformUtils::CreateProcessWindow();
|
||||
FCutPlatformUtils::UpdateProcess(hwnd, 50, TEXT(""));
|
||||
|
||||
FGlobalData::ExportPath = ExportPath / FGlobalData::CurrentProjectName + TEXT("_XML");
|
||||
|
||||
FPlatformFileManager::Get().GetPlatformFile().DeleteDirectoryRecursively(*FGlobalData::ExportPath);
|
||||
@ -1292,6 +1316,13 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
|
||||
|
||||
IFileManager::Get().Move(*XMLExportPath, TEXT("C:\\temp\\Process.xml"), true, true, false, false);
|
||||
|
||||
FString Ended;
|
||||
for (int32 i = 0; i < FGlobalData::ExportErrorString.Num(); i++)
|
||||
{
|
||||
Ended += FGlobalData::ExportErrorString[i] + TEXT("\n");
|
||||
}
|
||||
|
||||
FFileHelper::SaveStringToFile(Ended, *FUtils::GetProjectTempPath());
|
||||
|
||||
}
|
||||
|
||||
@ -1631,9 +1662,13 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
|
||||
Event1->InsertNewChildElement("Value")->InsertNewText("-1");
|
||||
Event1->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipStartFrame)))));
|
||||
|
||||
tinyxml2::XMLElement* Event2 = Event_List->InsertNewChildElement("Event");
|
||||
Event2->InsertNewChildElement("Value")->InsertNewText("0");
|
||||
Event2->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipEndFrame)))));
|
||||
if (!NewClipArrayData[k].bIsCycle)
|
||||
{
|
||||
tinyxml2::XMLElement* Event2 = Event_List->InsertNewChildElement("Event");
|
||||
Event2->InsertNewChildElement("Value")->InsertNewText("0");
|
||||
Event2->InsertNewChildElement("TimeCode")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(TempClipData.ClipEndFrame)))));
|
||||
}
|
||||
|
||||
Count++;
|
||||
}
|
||||
if (Count == 0)
|
||||
@ -1715,20 +1750,34 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
|
||||
NewSpeicalEffect->InsertNewChildElement("EndColor")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(TempClipData.PresetsCustomData.Colors[0].ToFColor(false)))));
|
||||
|
||||
const int32 Frame = TempClipData.ClipEndFrame - TempClipData.ClipStartFrame;
|
||||
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(Frame)))));
|
||||
|
||||
if (TempClipData.bIsCycle)
|
||||
{
|
||||
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText("-1");
|
||||
}
|
||||
else
|
||||
{
|
||||
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::GetMsFromString(FGlobalData::GetTimeData(Frame)))));
|
||||
}
|
||||
|
||||
|
||||
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)));
|
||||
}
|
||||
|
||||
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");
|
||||
if (TempClipDataArray[k].bIsCycle == false)
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -1792,7 +1841,7 @@ tinyxml2::XMLElement* SCutMainWindow::GetDeviceElement(tinyxml2::XMLElement* Par
|
||||
{
|
||||
if (Curtain.bIsActive)
|
||||
{
|
||||
Filename = Curtain.CurtainName;
|
||||
Filename = Curtain.CurtainName + (CurrentTrackHead->TrackData.TrackType == ETrackType::LightArrayTrack ? TEXT("光阵") : TEXT("光条"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1918,37 +1967,6 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Pare
|
||||
VolumeEventValue->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ClipData.CurrentVolume)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (VolumeTrack.ClipData.Num() > Index + 1)
|
||||
{
|
||||
if (ClipData.ClipEndFrame == VolumeTrack.ClipData[Index + 1].ClipStartFrame)
|
||||
{
|
||||
Index++;
|
||||
continue;
|
||||
}
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEvent = VolumeEventList->InsertNewChildElement("VolumeEvent");
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEventTimeCode = VolumeEvent->InsertNewChildElement("TimeCode");
|
||||
tinyxml2::XMLElement* VolumeEventValue = VolumeEvent->InsertNewChildElement("Value");
|
||||
|
||||
VolumeEventTimeCode->InsertNewText(TCHAR_TO_UTF8(*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipEndFrame - EncodeVideoInfo.ClipStartFrame))));
|
||||
VolumeEventValue->InsertNewText("100");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEvent = VolumeEventList->InsertNewChildElement("VolumeEvent");
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEventTimeCode = VolumeEvent->InsertNewChildElement("TimeCode");
|
||||
tinyxml2::XMLElement* VolumeEventValue = VolumeEvent->InsertNewChildElement("Value");
|
||||
|
||||
VolumeEventTimeCode->InsertNewText(TCHAR_TO_UTF8(*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipEndFrame - EncodeVideoInfo.ClipStartFrame))));
|
||||
VolumeEventValue->InsertNewText("100");
|
||||
}
|
||||
}
|
||||
Index++;
|
||||
}
|
||||
|
||||
@ -2107,7 +2125,7 @@ tinyxml2::XMLElement* SCutMainWindow::GetSoundElement(tinyxml2::XMLElement* Pare
|
||||
if (ClipData.ClipStartFrame < EncodeVideoInfo.ClipStartFrame || ClipData.Work4Audio != true)
|
||||
continue;
|
||||
|
||||
if (ClipData.ClipStartFrame != EncodeVideoInfo.ClipStartFrame)
|
||||
if (ClipData.ClipStartFrame != EncodeVideoInfo.ClipStartFrame && Index == 0)
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEvent = VolumeEventList->InsertNewChildElement("VolumeEvent");
|
||||
{
|
||||
@ -2130,37 +2148,7 @@ tinyxml2::XMLElement* SCutMainWindow::GetSoundElement(tinyxml2::XMLElement* Pare
|
||||
VolumeEventValue->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ClipData.CurrentVolume)));
|
||||
}
|
||||
}
|
||||
|
||||
if (VolumeTrack.ClipData.Num() > Index + 1)
|
||||
{
|
||||
if (ClipData.ClipEndFrame == VolumeTrack.ClipData[Index + 1].ClipStartFrame)
|
||||
{
|
||||
Index++;
|
||||
continue;
|
||||
}
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEvent = VolumeEventList->InsertNewChildElement("VolumeEvent");
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEventTimeCode = VolumeEvent->InsertNewChildElement("TimeCode");
|
||||
tinyxml2::XMLElement* VolumeEventValue = VolumeEvent->InsertNewChildElement("Value");
|
||||
|
||||
VolumeEventTimeCode->InsertNewText(TCHAR_TO_UTF8(*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipEndFrame - EncodeVideoInfo.ClipStartFrame))));
|
||||
VolumeEventValue->InsertNewText("100");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEvent = VolumeEventList->InsertNewChildElement("VolumeEvent");
|
||||
{
|
||||
tinyxml2::XMLElement* VolumeEventTimeCode = VolumeEvent->InsertNewChildElement("TimeCode");
|
||||
tinyxml2::XMLElement* VolumeEventValue = VolumeEvent->InsertNewChildElement("Value");
|
||||
|
||||
VolumeEventTimeCode->InsertNewText(TCHAR_TO_UTF8(*FUtils::GetMsFromString(FGlobalData::GetTimeData(ClipData.ClipEndFrame - EncodeVideoInfo.ClipStartFrame))));
|
||||
VolumeEventValue->InsertNewText("100");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Index++;
|
||||
}
|
||||
@ -2558,7 +2546,17 @@ tinyxml2::XMLElement* SCutMainWindow::GetBreatheLight(tinyxml2::XMLElement* Pare
|
||||
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)))));
|
||||
float PerLength = (ClipData.PresetsCustomData.Time / ClipData.PresetsCustomData.Times);
|
||||
Parent->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), int32(ClipData.PresetsCustomData.Time * 1000))));
|
||||
|
||||
if (ClipData.bIsCycle)
|
||||
{
|
||||
Parent->InsertNewChildElement("TimeLength")->InsertNewText("-1");
|
||||
}
|
||||
else
|
||||
{
|
||||
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("Cycle")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), static_cast<int32>(PerLength * 1000))));
|
||||
return nullptr;
|
||||
@ -2570,7 +2568,18 @@ 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("EndColor")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"), *FUtils::Color2Hex3(FLinearColor::Black.ToFColor(false)))));
|
||||
float PerLength = (ClipData.PresetsCustomData.Time / ClipData.PresetsCustomData.Times);
|
||||
Parent->InsertNewChildElement("TimeLength")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), int32(ClipData.PresetsCustomData.Time * 1000))));
|
||||
|
||||
if (ClipData.bIsCycle)
|
||||
{
|
||||
Parent->InsertNewChildElement("TimeLength")->InsertNewText("-1");
|
||||
}
|
||||
else
|
||||
{
|
||||
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("Cycle")->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%d"), static_cast<int32>(PerLength * 500))));
|
||||
return nullptr;
|
||||
@ -2638,11 +2647,21 @@ tinyxml2::XMLElement* SCutMainWindow::GetGradientLight(tinyxml2::XMLElement* Par
|
||||
|
||||
NewSpeicalEffect->InsertNewChildElement("EndColor")
|
||||
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),*FUtils::Color2Hex3(ClipData.PresetsCustomData.Cursors[Index + 1].Color.ToFColor(false)))));
|
||||
|
||||
|
||||
if (ClipData.bIsCycle)
|
||||
{
|
||||
NewSpeicalEffect->InsertNewChildElement("TimeLength")->InsertNewText("-1");
|
||||
}
|
||||
else
|
||||
{
|
||||
NewSpeicalEffect->InsertNewChildElement("TimeLength")
|
||||
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
|
||||
*FUtils::GetMsFromString(FGlobalData::GetTimeData(
|
||||
ClipData.PresetsCustomData.Cursors[Index + 1].CursorFrameOffset - CursorData.CursorFrameOffset)))));
|
||||
}
|
||||
|
||||
NewSpeicalEffect->InsertNewChildElement("TimeLength")
|
||||
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
|
||||
*FUtils::GetMsFromString(FGlobalData::GetTimeData(
|
||||
ClipData.PresetsCustomData.Cursors[Index + 1].CursorFrameOffset - CursorData.CursorFrameOffset)))));
|
||||
|
||||
|
||||
NewSpeicalEffect->InsertNewChildElement("TimeCode")
|
||||
->InsertNewText(TCHAR_TO_UTF8(*FString::Printf(TEXT("%ls"),
|
||||
|
@ -7,10 +7,12 @@
|
||||
#include "SlateOptMacros.h"
|
||||
#include "STimelineTick.h"
|
||||
#include "STrackBody.h"
|
||||
#include "Commands/TrackGroupCommands.h"
|
||||
#include "Cut5/Utils/FFMPEGUtils.h"
|
||||
#include "Cut5/Utils/Utils.h"
|
||||
#include "DragDropOperator/DragDropOperator.h"
|
||||
#include "MicroWidgets/SClickEditableText.h"
|
||||
#include "MicroWidgets/SNewProjectTips.h"
|
||||
#include "TimelineClips/ClipProxy.h"
|
||||
#include "Widgets/Input/SButton.h"
|
||||
#include "Widgets/Input/SEditableTextBox.h"
|
||||
@ -70,7 +72,6 @@ void SCutTimeline::UpdateCursorPosition(int32 Frame)
|
||||
{
|
||||
if (Frame >= 0 && Frame <= FGlobalData::TrackLength)
|
||||
{
|
||||
TimelineTick->UpdateNewCursorPosition(Frame);
|
||||
MainWidgetInterface->PreSettingBeforeSeek();
|
||||
for (const FSingleTrackGroupInstance& Interface : TrackGroupInstances)
|
||||
{
|
||||
@ -83,8 +84,8 @@ void SCutTimeline::UpdateCursorPosition(int32 Frame)
|
||||
{
|
||||
SetAutoPlay(false);
|
||||
}
|
||||
|
||||
}
|
||||
TimelineTick->UpdateNewCursorPosition(Frame);
|
||||
}
|
||||
|
||||
int32 SCutTimeline::GetCursorPosition() const
|
||||
@ -401,9 +402,21 @@ void SCutTimeline::Construct(const FArguments& InArgs)
|
||||
|
||||
TickCursorTimeThread = new FTickCursorTimeThread(FGlobalData::GlobalFPS, [this]()
|
||||
{
|
||||
UpdateCursorPosition(GetCursorPosition() + 1);
|
||||
IterateCursor();
|
||||
});
|
||||
FRunnableThread::Create(TickCursorTimeThread, TEXT("TickCursorTimeThread"));
|
||||
|
||||
|
||||
FTrackGroupCommands::Register();
|
||||
CommandList = MakeShared<FUICommandList>();
|
||||
CommandList->MapAction(FTrackGroupCommands::Get().Rename, FExecuteAction::CreateLambda([this]()
|
||||
{
|
||||
SNew(SNewProjectTips).Title(TEXT("修改名称")).OnEnsure_Lambda([this](const FString& NewString)
|
||||
{
|
||||
// OnGroupNameEdited(NewString, );
|
||||
});
|
||||
}));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -476,6 +489,11 @@ void SCutTimeline::SetAutoPlay(bool bStart)
|
||||
|
||||
}
|
||||
|
||||
void SCutTimeline::IterateCursor()
|
||||
{
|
||||
UpdateCursorPosition(GetCursorPosition() + 1);
|
||||
}
|
||||
|
||||
TArray<FClipData> SCutTimeline::GetClipData()
|
||||
{
|
||||
TArray<FClipData> ResultClipData;
|
||||
@ -555,7 +573,7 @@ void SCutTimeline::OnGroupNameEdited(FString NewText, FString OldText)
|
||||
if (TSharedPtr<STrackHead> Head = StaticCastSharedPtr<STrackHead>(SingleTrackGroupInstance.Head))
|
||||
{
|
||||
Head->GroupName = NewText;
|
||||
if (Head->TrackData.TrackType == ETrackType::PlayerTrack)
|
||||
if (Head->TrackData.TrackType == ETrackType::AtomSphereLightTrack)
|
||||
{
|
||||
Head->TrackData.TrackName = NewText;
|
||||
}
|
||||
@ -627,7 +645,7 @@ void SCutTimeline::RenderGroup()
|
||||
}
|
||||
return FReply::Handled();
|
||||
})
|
||||
.Image(DeviceTrackGroups[i].bIsCollapse ? FUtils::GetBrushFromImage(FUtils::GetResourcesPath(TEXT("Expaned.png")), {32, 16}) : FUtils::GetBrushFromImage(FUtils::GetResourcesPath(TEXT("Collapse.png")), {32, 16}))
|
||||
.Image(DeviceTrackGroups[i].bIsCollapse ? FUtils::GetBrushFromImage(FUtils::GetResourcesPath(TEXT("Expaned.png")), {32, 16}) : FUtils::GetBrushFromImage(FUtils::GetResourcesPath(TEXT("Collapse.png")), {16, 8}))
|
||||
]
|
||||
]
|
||||
];
|
||||
|
@ -75,8 +75,11 @@ public:
|
||||
float LastTime = 0.1f;
|
||||
void AddNewTrackToGroup(FString GroupName, FTrackData TrackData, ETrackType GroupType = ETrackType::None);
|
||||
void SetAutoPlay(bool bStart);
|
||||
void IterateCursor();
|
||||
FTickCursorTimeThread* TickCursorTimeThread = nullptr;
|
||||
|
||||
TSharedPtr<FUICommandList> CommandList;
|
||||
|
||||
TArray<FClipData> GetClipData();
|
||||
FTimerHandle TimerHandle;
|
||||
bool AutoPlaying = false;
|
||||
|
@ -406,7 +406,8 @@ void STimelineClip::Seek(int32 Frame)
|
||||
}
|
||||
break;
|
||||
}
|
||||
else if (ClipData->PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::None)
|
||||
else if (ClipData->PresetsCustomData.PresetCustomType == FPresetsCustomData::EPresetCustomType::None
|
||||
&& !ClipData->ResourcePropertyDataPtr)
|
||||
{
|
||||
MainWidgetInterface->OnUpdateLightArray(FUtils::SingleColor2ColorArray(ClipData->ClipColors[0].ToFColor(false)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user