OSC seperation
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "OscServer.h"
|
||||
#include "RuntimeControlBridge.h"
|
||||
#include "RuntimeHost.h"
|
||||
#include "RuntimeStore.h"
|
||||
#include <windows.h>
|
||||
|
||||
ControlServices::ControlServices() :
|
||||
@@ -34,9 +35,9 @@ bool ControlServices::Start(OpenGLComposite& composite, RuntimeHost& runtimeHost
|
||||
return true;
|
||||
}
|
||||
|
||||
void ControlServices::BeginPolling(RuntimeHost& runtimeHost)
|
||||
void ControlServices::BeginPolling(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore)
|
||||
{
|
||||
StartPolling(runtimeHost);
|
||||
StartPolling(runtimeHost, runtimeStore);
|
||||
}
|
||||
|
||||
void ControlServices::Stop()
|
||||
@@ -174,12 +175,12 @@ RuntimePollEvents ControlServices::ConsumePollEvents()
|
||||
return events;
|
||||
}
|
||||
|
||||
void ControlServices::StartPolling(RuntimeHost& runtimeHost)
|
||||
void ControlServices::StartPolling(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore)
|
||||
{
|
||||
if (mPollRunning.exchange(true))
|
||||
return;
|
||||
|
||||
mPollThread = std::thread([this, &runtimeHost]() { PollLoop(runtimeHost); });
|
||||
mPollThread = std::thread([this, &runtimeHost, &runtimeStore]() { PollLoop(runtimeHost, runtimeStore); });
|
||||
}
|
||||
|
||||
void ControlServices::StopPolling()
|
||||
@@ -191,7 +192,7 @@ void ControlServices::StopPolling()
|
||||
mPollThread.join();
|
||||
}
|
||||
|
||||
void ControlServices::PollLoop(RuntimeHost& runtimeHost)
|
||||
void ControlServices::PollLoop(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore)
|
||||
{
|
||||
while (mPollRunning)
|
||||
{
|
||||
@@ -203,7 +204,7 @@ void ControlServices::PollLoop(RuntimeHost& runtimeHost)
|
||||
for (const auto& entry : pendingCommits)
|
||||
{
|
||||
std::string commitError;
|
||||
if (runtimeHost.UpdateLayerParameterByControlKey(
|
||||
if (runtimeStore.SetStoredParameterValueByControlKey(
|
||||
entry.second.layerKey,
|
||||
entry.second.parameterKey,
|
||||
entry.second.value,
|
||||
|
||||
@@ -15,6 +15,7 @@ class ControlServer;
|
||||
class OpenGLComposite;
|
||||
class OscServer;
|
||||
class RuntimeHost;
|
||||
class RuntimeStore;
|
||||
|
||||
struct RuntimePollEvents
|
||||
{
|
||||
@@ -45,7 +46,7 @@ public:
|
||||
~ControlServices();
|
||||
|
||||
bool Start(OpenGLComposite& composite, RuntimeHost& runtimeHost, std::string& error);
|
||||
void BeginPolling(RuntimeHost& runtimeHost);
|
||||
void BeginPolling(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore);
|
||||
void Stop();
|
||||
void BroadcastState();
|
||||
void RequestBroadcastState();
|
||||
@@ -73,9 +74,9 @@ private:
|
||||
uint64_t generation = 0;
|
||||
};
|
||||
|
||||
void StartPolling(RuntimeHost& runtimeHost);
|
||||
void StartPolling(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore);
|
||||
void StopPolling();
|
||||
void PollLoop(RuntimeHost& runtimeHost);
|
||||
void PollLoop(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore);
|
||||
|
||||
std::unique_ptr<ControlServer> mControlServer;
|
||||
std::unique_ptr<OscServer> mOscServer;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "RuntimeServices.h"
|
||||
|
||||
#include "RuntimeStore.h"
|
||||
|
||||
RuntimeServices::RuntimeServices() :
|
||||
mControlServices(std::make_unique<ControlServices>())
|
||||
{
|
||||
@@ -15,10 +17,10 @@ bool RuntimeServices::Start(OpenGLComposite& composite, RuntimeHost& runtimeHost
|
||||
return mControlServices && mControlServices->Start(composite, runtimeHost, error);
|
||||
}
|
||||
|
||||
void RuntimeServices::BeginPolling(RuntimeHost& runtimeHost)
|
||||
void RuntimeServices::BeginPolling(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore)
|
||||
{
|
||||
if (mControlServices)
|
||||
mControlServices->BeginPolling(runtimeHost);
|
||||
mControlServices->BeginPolling(runtimeHost, runtimeStore);
|
||||
}
|
||||
|
||||
void RuntimeServices::Stop()
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
class OpenGLComposite;
|
||||
class RuntimeHost;
|
||||
class RuntimeStore;
|
||||
|
||||
class RuntimeServices
|
||||
{
|
||||
@@ -17,7 +18,7 @@ public:
|
||||
~RuntimeServices();
|
||||
|
||||
bool Start(OpenGLComposite& composite, RuntimeHost& runtimeHost, std::string& error);
|
||||
void BeginPolling(RuntimeHost& runtimeHost);
|
||||
void BeginPolling(RuntimeHost& runtimeHost, RuntimeStore& runtimeStore);
|
||||
void Stop();
|
||||
void BroadcastState();
|
||||
void RequestBroadcastState();
|
||||
|
||||
Reference in New Issue
Block a user