This commit is contained in:
Sch 2023-09-13 17:11:44 +08:00
parent b8c97bf52b
commit 125c174e2e
11 changed files with 248 additions and 53 deletions

View File

@ -1,2 +1,3 @@
<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"> <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:String x:Key="/Default/CodeInspection/PencilsConfiguration/ActualSeverity/@EntryValue">SUGGESTION</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=psaf/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> <s:Boolean x:Key="/Default/UserDictionary/Words/=psaf/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@ -44,7 +44,7 @@ uint32 FSoundThread::Run()
{ {
const int32 Offset = SeekedFrame * (SampleRate / FGlobalData::GlobalFPS) * ByteNum * 2; const int32 Offset = SeekedFrame * (SampleRate / FGlobalData::GlobalFPS) * ByteNum * 2;
const int32 Size = SampleRate / FGlobalData::GlobalFPS; const int32 Size = SampleRate / FGlobalData::GlobalFPS;
if (Audio.Num() < Offset + Size) if (Audio.Num() < Offset + Size * ByteNum)
{ {
SeekedFrame = 0; SeekedFrame = 0;
continue; continue;

View File

@ -589,8 +589,8 @@ TArray<FEncodeVideoInfo> FUtils::ExportPsaf(FTrackData TrackData, const FString&
FString psafPath = ExportPath + ExportName + FString::FromInt(i) + ".psaf"; FString psafPath = ExportPath + FString::FromInt(i) + ".psaf";
FString psafPath2 = leftStr + ".psaf2"; FString psafPath2 = leftStr + ".psaf2";

View File

@ -47,7 +47,27 @@ void SCurtain::Construct(const FArguments& InArgs)
.ButtonStyle(FCutButtonStyle::Get(), Curtain->bIsActive ? "Curtain.CurtainButtonSelected" : "Curtain.CurtainButton") .ButtonStyle(FCutButtonStyle::Get(), Curtain->bIsActive ? "Curtain.CurtainButtonSelected" : "Curtain.CurtainButton")
.OnClicked_Lambda([this]() .OnClicked_Lambda([this]()
{ {
TSharedPtr<FCurtainDragDrop> CurtainDragDrop = OpenThis(); TSharedPtr<FCurtainDragDrop> CurtainDragDrop;
if (!Curtain->bIsActive)
{
CurtainDragDrop = OpenThis();
InlineEditableTextBlock->EnterEditingMode();
}
else
{
InlineEditableTextBlock->EnterEditingMode();
}
if (CurtainDragDrop == nullptr)
{
CurtainDragDrop = MakeShared<FCurtainDragDrop>();
CurtainDragDrop->CurtainIndex = CurtainIndex;
CurtainDragDrop->GroupIndex = CurtainGroup - &CurtainPanel->Groups[0];
CurtainDragDrop->DragDropType = FCutDragDropBase::EType::CurtainDrag;
CurtainDragDrop->DraggingWidget = SharedThis(this);
}
return FReply::Handled().DetectDrag(SharedThis(this), EKeys::LeftMouseButton).BeginDragDrop(CurtainDragDrop.ToSharedRef()); return FReply::Handled().DetectDrag(SharedThis(this), EKeys::LeftMouseButton).BeginDragDrop(CurtainDragDrop.ToSharedRef());
}) })
] ]
@ -66,6 +86,13 @@ void SCurtain::Construct(const FArguments& InArgs)
+ SHorizontalBox::Slot() + SHorizontalBox::Slot()
[ [
SAssignNew(InlineEditableTextBlock, SInlineEditableTextBlock) SAssignNew(InlineEditableTextBlock, SInlineEditableTextBlock)
.OnEnterEditingMode_Lambda([this]()
{
if (!Curtain->bIsActive)
{
OpenThis();
}
})
.Text(FText::FromString(Curtain->CurtainName)) .Text(FText::FromString(Curtain->CurtainName))
.Font(TitleText.Font) .Font(TitleText.Font)
.OnTextCommitted_Lambda([this](const FText& Text, ETextCommit::Type CommitType) .OnTextCommitted_Lambda([this](const FText& Text, ETextCommit::Type CommitType)
@ -114,10 +141,11 @@ FReply SCurtain::OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEv
CurtainPanel->ShowCurtainCommand(Curtain->CurtainUUID); CurtainPanel->ShowCurtainCommand(Curtain->CurtainUUID);
return FReply::Handled(); return FReply::Handled();
} }
if (!Curtain->bIsActive) InlineEditableTextBlock->EnterEditingMode();
{ // if (!Curtain->bIsActive)
OpenThis(); // {
} // OpenThis();
// }
return SCompoundWidget::OnMouseButtonDown(MyGeometry, MouseEvent); return SCompoundWidget::OnMouseButtonDown(MyGeometry, MouseEvent);
} }

View File

@ -418,9 +418,7 @@ void SEffectCardGroup::CallRender()
.VAlign(VAlign_Fill) .VAlign(VAlign_Fill)
.OnClicked_Lambda([this]() .OnClicked_Lambda([this]()
{ {
// 新建卡牌后 对卡牌进行个体保存。
FEffectCardProperty NewCard;
NewCard.Name = TEXT("未命名") + NewCard.Guid.ToString();
@ -437,6 +435,10 @@ void SEffectCardGroup::CallRender()
} }
ID++; ID++;
} }
// 新建卡牌后 对卡牌进行个体保存。
FEffectCardProperty NewCard;
NewCard.Name = TEXT("未命名") + FString::FromInt(ID);
NewCard.ID = ID; NewCard.ID = ID;

View File

@ -11,6 +11,7 @@ BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SNewProjectTips::Construct(const FArguments& InArgs) void SNewProjectTips::Construct(const FArguments& InArgs)
{ {
OnEnsure = InArgs._OnEnsure; OnEnsure = InArgs._OnEnsure;
AlreadyExistsData = InArgs._AlreadyExistsData;
FTextBlockStyle NormalText = FAppStyle::GetWidgetStyle<FTextBlockStyle>("NormalText"); FTextBlockStyle NormalText = FAppStyle::GetWidgetStyle<FTextBlockStyle>("NormalText");
NormalText.SetFontSize(20); NormalText.SetFontSize(20);
ChildSlot ChildSlot
@ -58,6 +59,12 @@ void SNewProjectTips::Construct(const FArguments& InArgs)
ConfirmButton->SetEnabled(false); ConfirmButton->SetEnabled(false);
return false; return false;
} }
if (AlreadyExistsData.Contains(InText.ToString()))
{
OutText = FText::FromString(TEXT("项目名称已存在"));
ConfirmButton->SetEnabled(false);
return false;
}
ConfirmButton->SetEnabled(true); ConfirmButton->SetEnabled(true);
return true; return true;
}) })
@ -68,7 +75,7 @@ void SNewProjectTips::Construct(const FArguments& InArgs)
{ {
if (OnEnsure.ExecuteIfBound(InText.ToString())) if (OnEnsure.ExecuteIfBound(InText.ToString()))
{ {
} }
} }

View File

@ -17,6 +17,7 @@ public:
{ {
} }
SLATE_ARGUMENT(FString, Title) SLATE_ARGUMENT(FString, Title)
SLATE_ARGUMENT(TArray<FString>, AlreadyExistsData)
SLATE_ARGUMENT(FString, SubTitle) SLATE_ARGUMENT(FString, SubTitle)
SLATE_EVENT(FOnEnsure, OnEnsure) SLATE_EVENT(FOnEnsure, OnEnsure)
SLATE_END_ARGS() SLATE_END_ARGS()
@ -26,5 +27,7 @@ public:
TSharedPtr<SEditableTextBox> EditableTextBox; TSharedPtr<SEditableTextBox> EditableTextBox;
TSharedPtr<SButton> ConfirmButton; TSharedPtr<SButton> ConfirmButton;
TArray<FString> AlreadyExistsData;
FOnEnsure OnEnsure; FOnEnsure OnEnsure;
}; };

View File

@ -121,6 +121,13 @@ void SCutMainWindow::Construct(const FArguments& InArgs)
] ]
] ]
+ SHorizontalBox::Slot() + SHorizontalBox::Slot()
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.Text(FText::FromString(FString::Printf(TEXT("Ver. %s"), *FGlobalData::CutVersion)))
.Justification(ETextJustify::Center)
]
+ SHorizontalBox::Slot()
.SizeParam(FStretch(1.0)) .SizeParam(FStretch(1.0))
[ [
SNew(SSpacer) SNew(SSpacer)
@ -493,29 +500,43 @@ void SCutMainWindow::Construct(const FArguments& InArgs)
CutTimeline->CopyClipData.Empty(); CutTimeline->CopyClipData.Empty();
TArray<uint8> ClipBoardData; TArray<uint8> ClipBoardData;
FMemoryWriter Archive(ClipBoardData); FMemoryWriter Archive(ClipBoardData);
int32 Count = CutTimeline->SelectedClips.Num();
TArray<FClipData> SavedData; // first nest is the number of track group instances
// second nest is the number of clips in each track group instance
// nest can be empty
TArray<TArray<FClipData>> SavedData;
int32 i = 0;
bool bHasData = false;
for (FSingleTrackGroupInstance& Instance : CutTimeline->TrackGroupInstances) for (FSingleTrackGroupInstance& Instance : CutTimeline->TrackGroupInstances)
{ {
TSharedPtr<STrackBody> TrackBody = StaticCastSharedPtr<STrackBody>(Instance.Body); TArray<FClipData> TempSavedData;
const TSharedPtr<STrackBody> TrackBody = StaticCastSharedPtr<STrackBody>(Instance.Body);
for (FClipData& ClipData : TrackBody->TrackHead->TrackData.ClipData) for (FClipData& ClipData : TrackBody->TrackHead->TrackData.ClipData)
{ {
if (CutTimeline->SelectedClips.Contains(ClipData.ClipGuid)) if (CutTimeline->SelectedClips.Contains(ClipData.ClipGuid))
{ {
SavedData.Add(ClipData); bHasData = true;
break; TempSavedData.Add(ClipData);
continue;
} }
}
if (bHasData)
{
i++;
SavedData.Add(TempSavedData);
} }
} }
Archive << SavedData; Archive << SavedData;
FString Base = FBase64::Encode(ClipBoardData); const FString Base = FBase64::Encode(ClipBoardData);
FPlatformApplicationMisc::ClipboardCopy(*Base); FPlatformApplicationMisc::ClipboardCopy(*Base);
})); }));
CommandList->MapAction(FShortCutCommands::Get().Paste, FExecuteAction::CreateLambda([this]() CommandList->MapAction(FShortCutCommands::Get().Paste, FExecuteAction::CreateLambda([this]()
{ {
UpdateProperties(nullptr);
FString ClipBoardString; FString ClipBoardString;
FPlatformApplicationMisc::ClipboardPaste(ClipBoardString); FPlatformApplicationMisc::ClipboardPaste(ClipBoardString);
TArray<uint8> Dest; TArray<uint8> Dest;
@ -524,27 +545,64 @@ void SCutMainWindow::Construct(const FArguments& InArgs)
FMemoryReader Reader(Dest); FMemoryReader Reader(Dest);
TArray<FClipData> CopyClipData; TArray<TArray<FClipData>> CopyClipData;
Reader << CopyClipData; Reader << CopyClipData;
// for (FClipData& ClipData : CopyClipData)
// { // 先计算出最靠左侧的片段
// for (FSingleTrackGroupInstance& Instance : CutTimeline->TrackGroupInstances) int32 MostLeftFrame = INT_MAX;
// { for (TArray<FClipData>& ClipDataArray : CopyClipData)
// TSharedPtr<STrackBody> TrackBody = StaticCastSharedPtr<STrackBody>(Instance.Body); {
// FVector2D Pos = TrackBody->GetCachedGeometry().AbsoluteToLocal(NewMouseEvent.GetScreenSpacePosition()); for (const FClipData& ClipData : ClipDataArray)
// if (TrackBody->TrackHead->TrackData.DeviceTrack.Guid == ClipData.BindTrackGuid) {
// { MostLeftFrame = FMath::Min(MostLeftFrame, ClipData.ClipStartFrame);
// FClipData NewClipData = ClipData; }
// NewClipData.ClipGuid = FGuid::NewGuid(); }
// int32 Length = NewClipData.ClipEndFrame - NewClipData.ClipStartFrame;
// NewClipData.ClipStartFrame = FMath::RoundToInt(Pos.X / FGlobalData::DefaultTimeTickSpace);
// NewClipData.ClipEndFrame = NewClipData.ClipStartFrame + Length; int32 CurrentIndex = 0;
// DragDropOperator::GetDragDropOperator()->UpdateClipProcess(this, NewClipData); TSharedPtr<STrackBody> BeginBody = CutTimeline->GetCurrentCursorUsingBody();
// TrackBody->TrackHead->TrackData.ClipData.Add(NewClipData); for (TArray<FClipData>& ClipDataArray : CopyClipData)
// TrackBody->CallRender(); {
// } if (ClipDataArray.Num() == 0)
// } {
// } BeginBody = CutTimeline->IterateTrackBody(BeginBody);
CurrentIndex++;
continue;
}
if (BeginBody == nullptr)
{
// IterateTrackBody will return nullptr if the track body is the last one
break;
}
for (FClipData& ClipData : ClipDataArray)
{
if (FUtils::DetectDragTypeCanDrop(ClipData, BeginBody->TrackHead->TrackData.TrackType))
{
FVector2D Pos = BeginBody->GetCachedGeometry().AbsoluteToLocal(NewMouseEvent.GetScreenSpacePosition());
FClipData NewClipData = ClipData;
NewClipData.ClipGuid = FGuid::NewGuid();
NewClipData.BindTrackGuid = BeginBody->TrackHead->TrackData.DeviceTrack.Guid;
int32 Offset = NewClipData.ClipStartFrame - MostLeftFrame;
int32 Length = NewClipData.ClipEndFrame - NewClipData.ClipStartFrame;
NewClipData.ClipStartFrame = FMath::RoundToInt(Pos.X / FGlobalData::DefaultTimeTickSpace) + Offset;
NewClipData.ClipEndFrame = NewClipData.ClipStartFrame + Length;
BeginBody->TrackHead->TrackData.ClipData.Add(NewClipData);
DragDropOperator::GetDragDropOperator()->UpdateClipProcess(this, NewClipData);
}
}
BeginBody->CallRender();
BeginBody = CutTimeline->IterateTrackBody(BeginBody);
CurrentIndex++;
}
})); }));
FMainMenuCommands::Register(); FMainMenuCommands::Register();
@ -993,9 +1051,11 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
FGlobalData::ExportPath = ExportPath / FGlobalData::CurrentProjectName + TEXT("_XML"); FGlobalData::ExportPath = ExportPath / FGlobalData::CurrentProjectName + TEXT("_XML");
FPlatformFileManager::Get().GetPlatformFile().DeleteDirectoryRecursively(*FGlobalData::ExportPath); FPlatformFileManager::Get().GetPlatformFile().DeleteDirectoryRecursively(*FGlobalData::ExportPath);
IDList.Empty(); IDList.Empty();
FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*FGlobalData::ExportPath); FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*FGlobalData::ExportPath);
FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(TEXT("C://temp"));
FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*(FGlobalData::ExportPath / "Video")); FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*(FGlobalData::ExportPath / "Video"));
FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*(FGlobalData::ExportPath / "Sound")); FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*(FGlobalData::ExportPath / "Sound"));
FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*(FGlobalData::ExportPath / "PSAF")); FPlatformFileManager::Get().GetPlatformFile().CreateDirectoryTree(*(FGlobalData::ExportPath / "PSAF"));
@ -1151,7 +1211,7 @@ void SCutMainWindow::ExportProject(const FString& ExportPath)
} }
Card->InsertNewChildElement("Step")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ToStepID))); Card->InsertNewChildElement("Step")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(ToStepID)));
Card->InsertNewChildElement("SpecialEffectID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].Cards[j].ID))); Card->InsertNewChildElement("SpecialEffectID")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].Cards[j].ID - 1)));
Card->InsertNewChildElement("SerialNumberList")->InsertNewChildElement("SerialNumber")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].Cards[j].ID))); Card->InsertNewChildElement("SerialNumberList")->InsertNewChildElement("SerialNumber")->InsertNewText(TCHAR_TO_UTF8(*FString::FromInt(EffectCardsPanel->EffectCardGroups[i].Cards[j].ID)));
} }
} }
@ -1261,10 +1321,7 @@ void SCutMainWindow::ImportProject(const FString& ImportPath)
void SCutMainWindow::NewProject(const FString& NewPath) void SCutMainWindow::NewProject(const FString& NewPath)
{ {
FUtils::AddTips(SNew(STips).Title(TEXT("警告")).SubTitle(TEXT("目录不为空!")).OnEnsure_Lambda([](const FString& String)
{
}));
FGlobalData::BasePath = NewPath; FGlobalData::BasePath = NewPath;
CutTimeline->TimelineInfo.CurrentOpenFullPath = FUtils::MainSaveFullPath(); CutTimeline->TimelineInfo.CurrentOpenFullPath = FUtils::MainSaveFullPath();
@ -1332,15 +1389,43 @@ bool SCutMainWindow::PreNewProject()
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get(); IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
DesktopPlatform->OpenDirectoryDialog(nullptr, TEXT("选择新建路径"), String, String); DesktopPlatform->OpenDirectoryDialog(nullptr, TEXT("选择新建路径"), String, String);
if (String.IsEmpty()) if (String.IsEmpty())
{
return false; return false;
FGlobalData::BasePath = String; }
// 检测目录是否为空
class FDirectoryVisitor : public IPlatformFile::FDirectoryVisitor
{
virtual bool Visit(const TCHAR* FilenameOrDirectory, bool bIsDirectory) override
{
if (bIsDirectory)
{
Directories.Add(FilenameOrDirectory);
}
return true;
};
public:
TArray<FString> Directories;
};
FDirectoryVisitor Visitor;
FPlatformFileManager::Get().GetPlatformFile().IterateDirectory(*String, Visitor);
TSharedPtr<SNewProjectTips> NewProjectTips = TSharedPtr<SNewProjectTips> NewProjectTips =
SNew(SNewProjectTips) SNew(SNewProjectTips)
.AlreadyExistsData(Visitor.Directories)
.Title(TEXT("新建项目名字")); .Title(TEXT("新建项目名字"));
NewProjectTips->OnEnsure.BindLambda([this, NewProjectTips](FString String)
NewProjectTips->OnEnsure.BindLambda([this, NewProjectTips, String](FString EnsureString)
{ {
FGlobalData::CurrentProjectName = String; FGlobalData::BasePath = String;
FGlobalData::CurrentProjectName = EnsureString;
GEngine->GameViewport->RemoveViewportWidgetContent(NewProjectTips.ToSharedRef()); GEngine->GameViewport->RemoveViewportWidgetContent(NewProjectTips.ToSharedRef());
}); });
GEngine->GameViewport->AddViewportWidgetContent( GEngine->GameViewport->AddViewportWidgetContent(
@ -1864,8 +1949,21 @@ tinyxml2::XMLElement* SCutMainWindow::GetVideoElement(tinyxml2::XMLElement* Pare
VolumeEventValue->InsertNewText("100"); VolumeEventValue->InsertNewText("100");
} }
} }
Index++;
}
if (Index == 0)
{
tinyxml2::XMLElement* VolumeEvent = VolumeEventList->InsertNewChildElement("VolumeEvent");
{
tinyxml2::XMLElement* VolumeEventTimeCode = VolumeEvent->InsertNewChildElement("TimeCode");
tinyxml2::XMLElement* VolumeEventValue = VolumeEvent->InsertNewChildElement("Value");
VolumeEventTimeCode->InsertNewText("0");
VolumeEventValue->InsertNewText("100");
}
} }
Index++;
} }
else else
{ {
@ -2066,6 +2164,18 @@ tinyxml2::XMLElement* SCutMainWindow::GetSoundElement(tinyxml2::XMLElement* Pare
Index++; Index++;
} }
if (Index == 0)
{
tinyxml2::XMLElement* VolumeEvent = VolumeEventList->InsertNewChildElement("VolumeEvent");
{
tinyxml2::XMLElement* VolumeEventTimeCode = VolumeEvent->InsertNewChildElement("TimeCode");
tinyxml2::XMLElement* VolumeEventValue = VolumeEvent->InsertNewChildElement("Value");
VolumeEventTimeCode->InsertNewText("0");
VolumeEventValue->InsertNewText("100");
}
}
} }
else else

View File

@ -320,7 +320,7 @@ void SCutTimeline::Construct(const FArguments& InArgs)
[ [
// Track Body // Track Body
SAssignNew(TrackBodyScrollBox, SScrollBox) SAssignNew(TrackBodyScrollBox, SScrollBox)
.AllowOverscroll(EAllowOverscroll::Yes)
.ScrollBarVisibility(EVisibility::Hidden) .ScrollBarVisibility(EVisibility::Hidden)
.AnimateWheelScrolling(true) .AnimateWheelScrolling(true)
.OnUserScrolled_Lambda([this](float ScrollValue) .OnUserScrolled_Lambda([this](float ScrollValue)
@ -841,6 +841,44 @@ TArray<FClipData> SCutTimeline::GetClipDataByType(ETrackType TrackType)
return ClipData; return ClipData;
} }
TSharedPtr<STrackBody> SCutTimeline::GetCurrentCursorUsingBody()
{
float Y = TrackBodyScrollBox->GetCachedGeometry().AbsoluteToLocal(FSlateApplication::Get().GetCursorPos()).Y + TrackBodyScrollBox->GetScrollOffset();
int32 i = 0;
for (FSingleTrackGroupInstance& TrackGroup : TrackGroupInstances)
{
float CurrentY = FGlobalData::DefaultTrackHeight * i;
TSharedPtr<STrackBody> TrackBody = StaticCastSharedPtr<STrackBody>(TrackGroup.Body);
if (Y >= CurrentY && Y <= CurrentY + TrackBody->GetCachedGeometry().GetLocalSize().Y)
{
return TrackBody;
}
i++;
}
return nullptr;
}
TSharedPtr<STrackBody> SCutTimeline::IterateTrackBody(TSharedPtr<STrackBody> CurrentBody)
{
int32 i = 0;
for (FSingleTrackGroupInstance& TrackGroup : TrackGroupInstances)
{
if (TrackGroup.Body == CurrentBody)
{
if (i + 1 < TrackGroupInstances.Num())
{
return StaticCastSharedPtr<STrackBody>(TrackGroupInstances[i + 1].Body);
}
else
{
return nullptr;
}
}
i++;
}
return nullptr;
}
FReply SCutTimeline::OnDrop(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent) FReply SCutTimeline::OnDrop(const FGeometry& MyGeometry, const FDragDropEvent& DragDropEvent)
{ {

View File

@ -107,6 +107,8 @@ public:
FTrackGroup* GetTrackGroupByName(FString GroupName); FTrackGroup* GetTrackGroupByName(FString GroupName);
FTrackData* GetTrackDataByType(ETrackType TrackType); FTrackData* GetTrackDataByType(ETrackType TrackType);
TArray<FClipData> GetClipDataByType(ETrackType TrackType); TArray<FClipData> GetClipDataByType(ETrackType TrackType);
TSharedPtr<class STrackBody> GetCurrentCursorUsingBody();
TSharedPtr<class STrackBody> IterateTrackBody(TSharedPtr<class STrackBody> CurrentBody);
ICutMainWidgetInterface* MainWidgetInterface; ICutMainWidgetInterface* MainWidgetInterface;

View File

@ -320,6 +320,10 @@ void STimelineClip::Seek(int32 Frame)
{ {
MainWidgetInterface->OnUpdateProjector(0, false); MainWidgetInterface->OnUpdateProjector(0, false);
} }
else
{
MainWidgetInterface->OnUpdateProjector(0, true);
}
break; break;
} }
case ETrackType::VideoTrack: case ETrackType::VideoTrack:
@ -668,11 +672,11 @@ int32 STimelineClip::OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGe
} }
if (ClipData->bIsCycle == true) if (ClipData->bIsCycle == true)
{ {
FSlateDrawElement::MakeText(OutDrawElements, LayerId + 9, AllottedGeometry.ToPaintGeometry(), FText::FromString(TEXT("循环播放")), FAppStyle::Get().GetWidgetStyle<FTextBlockStyle>("NormalText").Font, ESlateDrawEffect::None, FLinearColor::White); FSlateDrawElement::MakeText(OutDrawElements, LayerId + 9, AllottedGeometry.ToPaintGeometry(), FText::FromString(TEXT("循环\n播放")), FAppStyle::Get().GetWidgetStyle<FTextBlockStyle>("NormalText").Font, ESlateDrawEffect::None, FLinearColor::White);
} }
if (ClipData->bIsVirtual == true) if (ClipData->bIsVirtual == true)
{ {
FSlateDrawElement::MakeText(OutDrawElements, LayerId + 9, AllottedGeometry.ToPaintGeometry(), FText::FromString(TEXT("虚拟轨道(不可编辑)")), FAppStyle::Get().GetWidgetStyle<FTextBlockStyle>("NormalText").Font, ESlateDrawEffect::None, FLinearColor::White); FSlateDrawElement::MakeText(OutDrawElements, LayerId + 9, AllottedGeometry.ToPaintGeometry(), FText::FromString(TEXT("虚拟轨道\n(不可编辑)")), FAppStyle::Get().GetWidgetStyle<FTextBlockStyle>("NormalText").Font, ESlateDrawEffect::None, FLinearColor::White);
} }