edit level

This commit is contained in:
2025-04-09 02:35:22 +09:00
parent 2aae5b391a
commit 072b4bd146
163 changed files with 600 additions and 626 deletions

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#pragma once

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#include "FMODAudioLinkComponent.h"
#include "FMODAudioLinkFactory.h"

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#include "FMODAudioLinkFactory.h"
#include "FMODAudioLinkSynchronizer.h"

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#pragma once

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#include "FMODAudioLinkInputClient.h"
#include "FMODAudioLinkLog.h"
@ -98,7 +98,7 @@ FFMODAudioLinkInputClient::~FFMODAudioLinkInputClient()
Unregister();
}
FMOD_RESULT F_CALLBACK pcmreadcallback(FMOD_SOUND* inSound, void* data, unsigned int datalen)
FMOD_RESULT F_CALL pcmreadcallback(FMOD_SOUND* inSound, void* data, unsigned int datalen)
{
FMOD::Sound* sound = (FMOD::Sound*)inSound;
FFMODAudioLinkInputClient* ConsumerSP;
@ -109,7 +109,7 @@ FMOD_RESULT F_CALLBACK pcmreadcallback(FMOD_SOUND* inSound, void* data, unsigned
return FMOD_OK;
}
FMOD_RESULT F_CALLBACK SoundCallback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE* event, void* parameters)
FMOD_RESULT F_CALL SoundCallback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, FMOD_STUDIO_EVENTINSTANCE* event, void* parameters)
{
FMOD_RESULT result = FMOD_OK;
FMOD::Studio::EventInstance* eventInstance = (FMOD::Studio::EventInstance*)event;
@ -202,7 +202,20 @@ void FFMODAudioLinkInputClient::Start(USceneComponent* InComponent)
InputClientRef* callbackMemory = new InputClientRef(SelfSP);
EventInst->setUserData(callbackMemory);
EventInst->start();
bool bIs3d = 0;
EventDesc->is3D(&bIs3d);
if (bIs3d)
{
// delay start
SelfSP->bShouldDelayStart = true;
UE_LOG(LogFMODAudioLink, Verbose, TEXT("FFMODAudioLinkInputClient::Start: Delaying start of 3D EventInstance."));
}
else
{
SelfSP->bShouldDelayStart = false;
EventInst->start();
}
}
}
};
@ -240,6 +253,12 @@ void FFMODAudioLinkInputClient::UpdateWorldState(const FWorldState& InParams)
// TODO: velocity
EventInstance->set3DAttributes(&attr);
if (bShouldDelayStart)
{
EventInstance->start();
UE_LOG(LogFMODAudioLink, Verbose, TEXT("FFMODAudioLinkInputClient::UpdateWorldState: Starting EventInstance."));
bShouldDelayStart = false;
}
}
}

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#pragma once
@ -40,6 +40,7 @@ public:
FName GetProducerName() const { return ProducerName; }
FMOD::Studio::EventInstance* EventInstance;
bool bShouldDelayStart = 0;
private:
void Register(const FName& NameOfProducingSource);

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#include "FMODAudioLinkLog.h"

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#include "FMODAudioLinkSettings.h"
#include "FMODAudioLinkFactory.h"

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#include "FMODAudioLinkSourcePushed.h"
#include "FMODAudioLinkSettings.h"

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#pragma once
#include "FMODAudioLinkInputClient.h"

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#include "FMODAudioLinkSynchronizer.h"
#include "fmod_studio.hpp"
@ -7,7 +7,7 @@
#include "AudioDeviceManager.h"
FMOD_RESULT F_CALLBACK MixCallback(FMOD_SYSTEM* system, FMOD_SYSTEM_CALLBACK_TYPE type, void* commanddata1, void* commanddata2, void* userdata)
FMOD_RESULT F_CALL MixCallback(FMOD_SYSTEM* system, FMOD_SYSTEM_CALLBACK_TYPE type, void* commanddata1, void* commanddata2, void* userdata)
{
FFMODAudioLinkSynchronizer *Synchro = static_cast<FFMODAudioLinkSynchronizer*>(userdata);
if (Synchro)

View File

@ -1,4 +1,4 @@
// Copyright (c), Firelight Technologies Pty, Ltd. 2024-2024.
// Copyright (c), Firelight Technologies Pty, Ltd. 2025-2025.
#pragma once
@ -54,5 +54,5 @@ struct FFMODAudioLinkSynchronizer : IAudioLinkSynchronizer, TSharedFromThis<FFMO
#undef MAKE_DELEGATE_FUNC
friend FMOD_RESULT F_CALLBACK MixCallback(FMOD_SYSTEM* system, FMOD_SYSTEM_CALLBACK_TYPE type, void* commanddata1, void* commanddata2, void* userdata);
friend FMOD_RESULT F_CALL MixCallback(FMOD_SYSTEM* system, FMOD_SYSTEM_CALLBACK_TYPE type, void* commanddata1, void* commanddata2, void* userdata);
};