Avionics
Dropship Simulator
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TeamSpeak.h
Go to the documentation of this file.
1 // TeamSpeak
2 #include "../ts3_sdk_3.0.2/include/public_definitions.h"
3 
4 #include "Bus.h"
5 
6 namespace Devices
7 {
9  {
10  public:
11  bool enable;
14  std::string captureDevice; // 0 for default
15  std::string playbackDevice;
16  std::string identity; // I have seen them up to 208 long (209 bytes)
17  std::string handle; // like "goose" or "maverick"?
18  char gain;
19  char volume;
21  };
22 
23  class TeamSpeak
24  {
25  private:
26  Logger* logger = nullptr;
27  TeamSpeakConfig* config = nullptr;
28  Bus* bus = nullptr;
29 
30  uint64 scHandlerID = 0;
31  bool lostConnection = false;
32 
33  void Log(char* method, const char* msg, Logger::Level level = Logger::Level::Info, int errorno = 0) const;
34  void SetPTT(bool shouldTalk) const;
35 
36  static void onUserLoggingMessageEvent(const char* logMessage, int logLevel, const char* logChannel, uint64 logID, const char* logTime, const char* completeLogString);
37  static void onConnectStatusChangeEvent(uint64 serverConnectionHandlerID, int newStatus, unsigned int errorNumber);
38  static void onNewChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID);
39  static void onNewChannelCreatedEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier);
40  static void onDelChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char* invokerName, const char* invokerUniqueIdentifier);
41  static void onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* moveMessage);
42  static void onClientMoveSubscriptionEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility);
43  static void onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char* timeoutMessage);
44  static void onTalkStatusChangeEvent(uint64 serverConnectionHandlerID, int status, int isReceivedWhisper, anyID clientID);
45  static void onIgnoredWhisperEvent(uint64 serverConnectionHandlerID, anyID clientID);
46  static void onServerErrorEvent(uint64 serverConnectionHandlerID, const char* errorMessage, unsigned int error, const char* returnCode, const char* extraMessage);
47 
48  public:
49  void Initialize(Logger* prmLogger, TeamSpeakConfig* prmConfig, Bus* prmBus);
50  void FrameMove();
51  void Connect() const;
52  void Destroy() const;
53  };
54 }
static void onNewChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID)
Definition: TeamSpeak.cpp:72
std::string captureDevice
Definition: TeamSpeak.h:14
Definition: Logger.h:5
static void onNewChannelCreatedEvent(uint64 serverConnectionHandlerID, uint64 channelID, uint64 channelParentID, anyID invokerID, const char *invokerName, const char *invokerUniqueIdentifier)
Definition: TeamSpeak.cpp:104
void Initialize(Logger *prmLogger, TeamSpeakConfig *prmConfig, Bus *prmBus)
Definition: TeamSpeak.cpp:297
void SetPTT(bool shouldTalk) const
Definition: TeamSpeak.cpp:604
static void onConnectStatusChangeEvent(uint64 serverConnectionHandlerID, int newStatus, unsigned int errorNumber)
Definition: TeamSpeak.cpp:22
okay, the portable keyboard numbers don't work like the outside keypad because the outside keypad is ...
Definition: Analog.cpp:3
static void onClientMoveEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char *moveMessage)
Definition: TeamSpeak.cpp:146
void Log(char *method, const char *msg, Logger::Level level=Logger::Level::Info, int errorno=0) const
Definition: TeamSpeak.cpp:560
Definition: Bus.h:12
Logger * logger
Definition: TeamSpeak.h:26
static void onIgnoredWhisperEvent(uint64 serverConnectionHandlerID, anyID clientID)
Definition: TeamSpeak.cpp:235
void Destroy() const
Definition: TeamSpeak.cpp:531
std::string playbackDevice
Definition: TeamSpeak.h:15
static void onTalkStatusChangeEvent(uint64 serverConnectionHandlerID, int status, int isReceivedWhisper, anyID clientID)
Definition: TeamSpeak.cpp:206
static void onUserLoggingMessageEvent(const char *logMessage, int logLevel, const char *logChannel, uint64 logID, const char *logTime, const char *completeLogString)
Definition: TeamSpeak.cpp:270
TeamSpeakConfig * config
Definition: TeamSpeak.h:27
std::string identity
Definition: TeamSpeak.h:16
void Connect() const
Definition: TeamSpeak.cpp:287
static void onServerErrorEvent(uint64 serverConnectionHandlerID, const char *errorMessage, unsigned int error, const char *returnCode, const char *extraMessage)
Definition: TeamSpeak.cpp:252
static void onDelChannelEvent(uint64 serverConnectionHandlerID, uint64 channelID, anyID invokerID, const char *invokerName, const char *invokerUniqueIdentifier)
Definition: TeamSpeak.cpp:128
Level
Definition: Logger.h:11
uint64 scHandlerID
Definition: TeamSpeak.h:30
static void onClientMoveSubscriptionEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility)
Definition: TeamSpeak.cpp:164
static void onClientMoveTimeoutEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, uint64 newChannelID, int visibility, const char *timeoutMessage)
Definition: TeamSpeak.cpp:190