Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #223 from lucoiso/SlateAdjustments
Browse files Browse the repository at this point in the history
Slate adjustments
  • Loading branch information
lucoiso authored Aug 15, 2023
2 parents dcd4267 + f57e579 commit d900efe
Show file tree
Hide file tree
Showing 10 changed files with 411 additions and 401 deletions.
2 changes: 1 addition & 1 deletion Source/AzSpeech/Private/AzSpeech.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void FAzSpeechModule::StartupModule()
#endif

#if WITH_EDITOR && !AZSPEECH_SUPPORTED_PLATFORM
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString("Currently, AzSpeech does not officially support the platform you're using/targeting. If you encounter any issue and can/want to contribute, get in touch! :)\n\nRepository Link: github.com/lucoiso/UEAzSpeech"));
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("Currently, AzSpeech does not officially support the platform you're using/targeting. If you encounter any issue and can/want to contribute, get in touch! :)\n\nRepository Link: github.com/lucoiso/UEAzSpeech")));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion Source/AzSpeech/Private/AzSpeech/AzSpeechSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void UAzSpeechSettings::PostEditChangeProperty(FPropertyChangedEvent& PropertyCh

if (DefaultOptions.RecognitionOptions.CandidateLanguages.Num() > MaxCandidateLanguages)
{
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString("You can only include up to 4 languages for at-start LID and up to 10 languages for continuous LID."));
FMessageDialog::Open(EAppMsgType::Ok, FText::FromString(TEXT("You can only include up to 4 languages for at-start LID and up to 10 languages for continuous LID.")));
DefaultOptions.RecognitionOptions.CandidateLanguages.RemoveAtSwap(MaxCandidateLanguages, DefaultOptions.RecognitionOptions.CandidateLanguages.Num() - MaxCandidateLanguages, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ THIRD_PARTY_INCLUDES_END
/**
*
*/
class FAzSpeechRecognitionRunnable : public FAzSpeechRunnableBase
class FAzSpeechRecognitionRunnable : public FAzSpeechRunnableBase
{
public:
FAzSpeechRecognitionRunnable() = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ THIRD_PARTY_INCLUDES_END
/**
*
*/
class FAzSpeechSynthesisRunnable : public FAzSpeechRunnableBase
class FAzSpeechSynthesisRunnable : public FAzSpeechRunnableBase
{
public:
FAzSpeechSynthesisRunnable() = delete;
Expand Down
6 changes: 3 additions & 3 deletions Source/AzSpeechEditor/Private/AzSpeechEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Repo: https://github.com/lucoiso/UEAzSpeech

#include "AzSpeechEditor.h"
#include "SAzSpeechAudioGenerator.h"
#include "Generator/SAzSpeechAudioGenerator.h"
#include <ToolMenus.h>
#include <Widgets/Docking/SDockTab.h>
#include <WorkspaceMenuStructure.h>
Expand Down Expand Up @@ -50,8 +50,8 @@ void FAzSpeechEditorModule::RegisterMenus()
const TSharedPtr<FWorkspaceItem> Menu = WorkspaceMenu::GetMenuStructure().GetToolsCategory()->AddGroup(LOCTEXT("AzSpeechCategory", "AzSpeech"), LOCTEXT("AzSpeechCategoryTooltip", "AzSpeech Plugin Tabs"), FSlateIcon(AppStyleName, "Icons.Package"));

FGlobalTabmanager::Get()->RegisterNomadTabSpawner(AzSpeechEditorTabName, EditorTabSpawnerDelegate)
.SetDisplayName(FText::FromString("AzSpeech Audio Generator"))
.SetTooltipText(FText::FromString("Open AzSpeech Audio Generator"))
.SetDisplayName(FText::FromString(TEXT("AzSpeech Audio Generator")))
.SetTooltipText(FText::FromString(TEXT("Open AzSpeech Audio Generator")))
.SetIcon(FSlateIcon(AppStyleName, "Icons.Plus"))
.SetGroup(Menu.ToSharedRef());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Author: Lucas Vilas-Boas
// Year: 2023
// Repo: https://github.com/lucoiso/UEAzSpeech

#include "AzSpeechPropertiesGetter.h"

#ifdef UE_INLINE_GENERATED_CPP_BY_NAME
#include UE_INLINE_GENERATED_CPP_BY_NAME(AzSpeechPropertiesGetter)
#endif

UAzSpeechPropertiesGetter::UAzSpeechPropertiesGetter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
}

void UAzSpeechPropertiesGetter::OnAvailableVoicesChanged(const TArray<FString>& Voices)
{
OnAvailableVoicesUpdated.ExecuteIfBound(Voices);
Destroy();
}

void UAzSpeechPropertiesGetter::SynthesisCompleted(const TArray<uint8>& AudioData)
{
OnAudioDataGenerated.ExecuteIfBound(AudioData);
Destroy();
}

void UAzSpeechPropertiesGetter::TaskFail()
{
Destroy();
}

void UAzSpeechPropertiesGetter::Destroy()
{
ClearFlags(RF_Standalone);

#if ENGINE_MAJOR_VERSION >= 5
MarkAsGarbage();
#else
MarkPendingKill();
#endif
}
35 changes: 35 additions & 0 deletions Source/AzSpeechEditor/Private/Generator/AzSpeechPropertiesGetter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Author: Lucas Vilas-Boas
// Year: 2023
// Repo: https://github.com/lucoiso/UEAzSpeech

#pragma once

#include <CoreMinimal.h>
#include <UObject/Object.h>
#include "AzSpeechPropertiesGetter.generated.h"

DECLARE_DELEGATE_OneParam(FAvailableVoicesUpdated, TArray<FString>);
DECLARE_DELEGATE_OneParam(FAudioDataGenerated, TArray<uint8>);

UCLASS(MinimalAPI, NotBlueprintable, NotPlaceable, Category = "Implementation")
class UAzSpeechPropertiesGetter : public UObject
{
GENERATED_BODY()

public:
explicit UAzSpeechPropertiesGetter(const FObjectInitializer& ObjectInitializer = FObjectInitializer::Get());

FAvailableVoicesUpdated OnAvailableVoicesUpdated;
FAudioDataGenerated OnAudioDataGenerated;

UFUNCTION()
void OnAvailableVoicesChanged(const TArray<FString>& Voices);

UFUNCTION()
void SynthesisCompleted(const TArray<uint8>& AudioData);

UFUNCTION()
void TaskFail();

void Destroy();
};
Loading

0 comments on commit d900efe

Please sign in to comment.