Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion include/DMDUtil/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,19 @@ class DMDUTILAPI Config
void SetPixelcade(bool pixelcade) { m_pixelcade = pixelcade; }
void SetPixelcadeDevice(const char* port) { m_pixelcadeDevice = port; }
const char* GetPixelcadeDevice() const { return m_pixelcadeDevice.c_str(); }
void SetDMDServer(bool dmdServer) { m_dmdServer = dmdServer; }
void SetDMDServer(bool dmdServer)
{
m_dmdServer = dmdServer;
// backward compatibility, use SetLocalDisplaysActive() afterwards to use both.
m_localDisplaysActive = !dmdServer;
}
bool IsDmdServer() { return m_dmdServer; }
void SetDMDServerAddr(const char* addr) { m_dmdServerAddr = addr; }
const char* GetDMDServerAddr() const { return m_dmdServerAddr.c_str(); }
void SetDMDServerPort(int port) { m_dmdServerPort = port; }
int GetDMDServerPort() const { return m_dmdServerPort; }
void SetLocalDisplaysActive(bool localDisplaysActive) { m_localDisplaysActive = localDisplaysActive; }
bool IsLocalDisplaysActive() { return m_localDisplaysActive; }
DMDUtil_LogLevel GetLogLevel() const { return m_logLevel; }
void SetLogLevel(DMDUtil_LogLevel logLevel) { m_logLevel = logLevel; }
DMDUtil_LogCallback GetLogCallback() const { return m_logCallback; }
Expand Down Expand Up @@ -121,6 +128,7 @@ class DMDUTILAPI Config
bool m_zedmdWiFiEnabled;
std::string m_zedmdWiFiAddr;
bool m_dmdServer;
bool m_localDisplaysActive;
std::string m_dmdServerAddr;
int m_dmdServerPort;
bool m_pixelcade;
Expand Down
1 change: 1 addition & 0 deletions src/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Config::Config()
m_dmdServer = false;
m_dmdServerAddr = "localhost";
m_dmdServerPort = 6789;
m_localDisplaysActive = true;
m_logLevel = DMDUtil_LogLevel_INFO;
m_logCallback = nullptr;
memset(&m_pupTriggerCallbackContext, 0, sizeof(m_pupTriggerCallbackContext));
Expand Down
4 changes: 3 additions & 1 deletion src/DMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,13 @@ void DMD::FindDisplays()
if (m_finding) return;

Config* const pConfig = Config::GetInstance();

if (pConfig->IsDmdServer())
{
ConnectDMDServer();
}
else

if (pConfig->IsLocalDisplaysActive())
{
m_finding = true;

Expand Down