UnrealVoxta 0.1.1
 
Loading...
Searching...
No Matches
VoiceRunnerThread.h
Go to the documentation of this file.
1// Copyright(c) 2024 grrimgrriefer & DZnnah, see LICENSE for details.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "HAL/ThreadSafeBool.h"
7
8#define VOICE_RUNNER_ERROR_COMPONENT_NULL 255
9#define VOICE_RUNNER_ERROR_DEFAULT 254
10#define VOICE_RUNNER_SUCCESS_SEND 1
11
13class FRunnableThread;
14
22class FVoiceRunnerThread : public FRunnable
23{
24#pragma region public API
25public:
32 FVoiceRunnerThread(AudioCaptureHandler* voiceComponent, float sleepTime);
33
38 void Start();
39#pragma endregion
40
41#pragma region FRunnable overrides
42public:
44 virtual ~FVoiceRunnerThread() override;
45
52 virtual void Stop() override;
53
62 uint32 Run() override;
63#pragma endregion
64
65#pragma region data
66private:
67 AudioCaptureHandler* m_voiceComponent;
68 FRunnableThread* m_thread;
69
70 float m_sleepTime;
71 FThreadSafeBool m_isStopped;
72#pragma endregion
73};
AudioCaptureHandler.
Definition AudioCaptureHandler.h:19
FVoiceRunnerThread(AudioCaptureHandler *voiceComponent, float sleepTime)
Register values for the runner but does not start it yet.
Definition VoiceRunnerThread.cpp:9
uint32 Run() override
Runs the runnable object.
Definition VoiceRunnerThread.cpp:27
virtual ~FVoiceRunnerThread() override
Virtual destructor.
Definition VoiceRunnerThread.cpp:17
void Start()
Create & start a new background thread, triggering 'CaptureAndSendVoiceData' on the provided voice co...
Definition VoiceRunnerThread.cpp:57
virtual void Stop() override
Stops the runnable object.
Definition VoiceRunnerThread.cpp:73