feature: Project builds with integrated SPIT client (however with some exclusions)

This commit is contained in:
2025-02-15 22:18:06 +01:00
parent 500641a6e2
commit 4e94d7ad78
15 changed files with 257 additions and 910 deletions
+4 -9
View File
@@ -20,9 +20,6 @@
using namespace std;
int main();
class MyApp : SPIT_ClientInterface {
public:
MyApp();
@@ -30,10 +27,6 @@ public:
//Client's infos is set by the client
static string s_ClientName;
static string s_ClientProjectID;
static string s_ClientProjectName;
static int s_ClientDefaultFramesPerSecond;
void loadClientProject();
private:
@@ -53,6 +46,8 @@ private:
string m_ServerProjectID;
string m_ServerProjectName;
int m_ServerFramesPerSecond; //set when the server reports his project, see eventProjectReport
//liveSHOWsoftware will use 44100 frames per second as time resolution
//All times are given in frames,
//Reconnect to the server when connection is lost see eventConnectionStatus and eventServerDetected
bool m_FlagReconnect; //true = on eventServerDetected connect to the server identified by m_ServerID
@@ -63,8 +58,8 @@ private:
public:
//---------- SPIT_ClientInterface -------------
string getClientProjectID(); //should return the client's project id, maybe the same as project name
string getClientProjectName(); //should return the client's project name
string getClientProjectName();
//----- ServerAutoDetection -----
void startServerAutoDetect(); //starts the autodetection of SPITServers in the local network area (see eventServerDetected)
void stopServerAutoDetect(); //stopps the autodetection
-8
View File
@@ -15,12 +15,7 @@
#define SPIT_CLIENT_H
#include "_SPITMACROS.h"
#if defined OS_WINDOWS
#include "WindowsSocket.h"
#endif
#if defined OS_MAC || defined OS_LINUX
#include "UnixSocket.h"
#endif
#include "SPITSocket.h"
#include "SAD_Client.h"
@@ -35,9 +30,6 @@
#include "SPITPlayer.h"
#include <chrono>
//#include <thread>
using namespace std;
//static char nullChar[] = "\0";
-4
View File
@@ -15,9 +15,6 @@
#define UNIXSOCKET_H
#include "_SPITMACROS.h"
#if defined(OS_MAC) || defined(OS_LINUX)
#include <ifaddrs.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
@@ -50,7 +47,6 @@ public:
int sendMessageTo(int p_InetFamily, string p_ServerIP, string p_ServerPort, const char* p_MessageBytes, int p_MessageLength);
int receiveMessage(int p_InetFamily, char* p_Buffer, int p_BufferLength, string* p_ServerIP);
};
#endif
#endif /* UNIXSOCKET_H */
-53
View File
@@ -1,53 +0,0 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: WindowsSocket.h
* Author: Hagi
*
* Created on 11. April 2019, 08:36
*/
#ifndef WINDOWSSOCKET_H
#define WINDOWSSOCKET_H
#include "_SPITMACROS.h"
#if defined(OS_WINDOWS)
#include "WindowsSocket.h"
#include <WinSock2.h>
#include <iphlpapi.h>
#include <ws2tcpip.h>
#include <thread>
#include "SPITSocket.h"
using namespace std;
class WindowsSocket : public SPITSocket{
public:
WindowsSocket();
virtual ~WindowsSocket();
private:
SOCKET m_UDPSocketIP4;
SOCKET m_UDPSocketIP6;
public:
void getAdaptersInfo();
string getBroadcastIP4(IPAddress* p_IPAdress);
int setBroadcast(bool p_Broadcast);
static int init();
static int cleanUp();
bool createSocket_UDP();
int bindSocket(string p_ClientIP, string p_ClientPort);
int sendMessageTo(int p_InetFamily, string p_ServerIP, string p_ServerPort, const char* p_MessageBytes, int p_MessageLength);
int receiveMessage(int p_InetFamily, char* p_Buffer, int p_BufferLength, string* p_ServerIP);
};
#endif
#endif /* WINDOWSSOCKET_H */
+6 -45
View File
@@ -1,57 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
#pragma once
/*
* File: _SPITMACROS.h
* Author: Hagi
*
* Created on 13. April 2019, 13:37
*/
#include <unistd.h>
// #include <uuid/uuid.h>
#ifndef _SPITMACROS_H
#define _SPITMACROS_H
//To compile for a specific operating system, you must change the precompiler comments.
//In windows Ws2_32.lib Iphlpapi.lib (in gcc: -liphlpapi -lole32) should be added to the linker options
#ifndef OS_WINDOWS
// #define OS_WINDOWS
// #include <WinSock2.h> //include this here, because it must be included before string.h .. is included
#endif
#ifndef OS_MAC
// #define OS_MAC
// #include <unistd.h>
// #include<uuid/uuid.h>
#endif
#ifndef OS_LINUX
#define OS_LINUX
#include <unistd.h>
#include<uuid/uuid.h>
#endif
//To output debug information (printf calls in the code)
//you must set or comment out this precompiler definition
// To output debug information (printf calls in the code)
// you must set or comment out this precompiler definition
#ifndef DEBUGOUTPUT
#define DEBUGOUTPUT
#define DEBUGOUTPUT
#endif
#include <string>
using namespace std;
//--------- OS specific functions ---------
/** Returns an guid */
string createGUID();
/** Returns the name of the client's host computer*/
string getClientHostName();
#endif /* _SPITMACROS_H */