home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / TeamSpeak / TeamSpeak3-Client-win32-3.0.0.exe / pluginsdk / include / public_definitions.h < prev    next >
Encoding:
C/C++ Source or Header  |  2011-08-08  |  14.3 KB  |  285 lines

  1. #ifndef PUBLIC_DEFINITIONS_H
  2. #define PUBLIC_DEFINITIONS_H
  3.  
  4. //limited length, measured in characters
  5. #define TS3_MAX_SIZE_CHANNEL_NAME 40
  6. #define TS3_MAX_SIZE_VIRTUALSERVER_NAME 64
  7. #define TS3_MAX_SIZE_CLIENT_NICKNAME 64
  8. #define TS3_MIN_SIZE_CLIENT_NICKNAME 3
  9. #define TS3_MAX_SIZE_REASON_MESSAGE 80
  10.  
  11. //limited length, measured in bytes (utf8 encoded)
  12. #define TS3_MAX_SIZE_TEXTMESSAGE 1024
  13. #define TS3_MAX_SIZE_CHANNEL_TOPIC 255
  14. #define TS3_MAX_SIZE_CHANNEL_DESCRIPTION 8192
  15. #define TS3_MAX_SIZE_VIRTUALSERVER_WELCOMEMESSAGE 1024
  16.  
  17. //minimum amount of seconds before a clientID that was in use can be assigned to a new client
  18. #define TS3_MIN_SECONDS_CLIENTID_REUSE 300
  19.  
  20. #if defined(WIN32) || defined(__WIN32__) || defined(_WIN32)
  21.     typedef unsigned __int16 anyID;
  22.     typedef unsigned __int64 uint64;
  23.     #ifdef BUILDING_DLL
  24.         #define EXPORTDLL __declspec(dllexport)
  25.     #else
  26.         #define EXPORTDLL
  27.     #endif
  28. #else
  29.     #include <stdint.h>
  30.     typedef uint16_t anyID;
  31.     typedef uint64_t uint64;
  32.     #ifdef BUILDING_DLL
  33.         #define EXPORTDLL __attribute__ ((visibility("default")))
  34.     #else
  35.         #define EXPORTDLL
  36.     #endif
  37. #endif
  38.  
  39. enum TalkStatus {
  40.     STATUS_NOT_TALKING = 0,
  41.     STATUS_TALKING = 1,
  42.     STATUS_TALKING_WHILE_DISABLED = 2,
  43. };
  44.  
  45. enum CodecType {
  46.     CODEC_SPEEX_NARROWBAND = 0,   //mono, 16bit,  8kHz, bitrate dependant on the quality setting
  47.     CODEC_SPEEX_WIDEBAND,         //mono, 16bit, 16kHz, bitrate dependant on the quality setting
  48.     CODEC_SPEEX_ULTRAWIDEBAND,    //mono, 16bit, 32kHz, bitrate dependant on the quality setting
  49.     CODEC_CELT_MONO,              //mono, 16bit, 48kHz, bitrate dependant on the quality setting
  50. };
  51.  
  52. enum CodecEncryptionMode {
  53.     CODEC_ENCRYPTION_PER_CHANNEL = 0,
  54.     CODEC_ENCRYPTION_FORCED_OFF,
  55.     CODEC_ENCRYPTION_FORCED_ON,
  56. };
  57.  
  58. enum TextMessageTargetMode {
  59.     TextMessageTarget_CLIENT=1,
  60.     TextMessageTarget_CHANNEL,
  61.     TextMessageTarget_SERVER,
  62.     TextMessageTarget_MAX
  63. };
  64.  
  65. enum MuteInputStatus {
  66.     MUTEINPUT_NONE = 0,
  67.     MUTEINPUT_MUTED,
  68. };
  69.  
  70. enum MuteOutputStatus {
  71.     MUTEOUTPUT_NONE = 0,
  72.     MUTEOUTPUT_MUTED,
  73. };
  74.  
  75. enum HardwareInputStatus {
  76.     HARDWAREINPUT_DISABLED = 0,
  77.     HARDWAREINPUT_ENABLED,
  78. };
  79.  
  80. enum HardwareOutputStatus {
  81.     HARDWAREOUTPUT_DISABLED = 0,
  82.     HARDWAREOUTPUT_ENABLED,
  83. };
  84.  
  85. enum InputDeactivationStatus {
  86.     INPUT_ACTIVE = 0,
  87.     INPUT_DEACTIVATED = 1,
  88. };
  89.  
  90. enum ReasonIdentifier {
  91.     REASON_NONE                              = 0,  //no reason data
  92.     REASON_MOVED                             = 1,  //{SectionInvoker}
  93.     REASON_SUBSCRIPTION                      = 2,  //no reason data
  94.     REASON_LOST_CONNECTION                   = 3,  //reasonmsg=reason
  95.     REASON_KICK_CHANNEL                      = 4,  //{SectionInvoker} reasonmsg=reason               //{SectionInvoker} is only added server->client
  96.     REASON_KICK_SERVER                       = 5,  //{SectionInvoker} reasonmsg=reason               //{SectionInvoker} is only added server->client
  97.     REASON_KICK_SERVER_BAN                   = 6,  //{SectionInvoker} reasonmsg=reason bantime=time  //{SectionInvoker} is only added server->client
  98.     REASON_SERVERSTOP                        = 7,  //reasonmsg=reason
  99.     REASON_CLIENTDISCONNECT                  = 8,  //reasonmsg=reason
  100.     REASON_CHANNELUPDATE                     = 9,  //no reason data
  101.     REASON_CHANNELEDIT                       = 10, //{SectionInvoker}
  102.     REASON_CLIENTDISCONNECT_SERVER_SHUTDOWN  = 11,  //reasonmsg=reason
  103. };
  104.  
  105. enum ChannelProperties {
  106.     CHANNEL_NAME = 0,                       //Available for all channels that are "in view", always up-to-date
  107.     CHANNEL_TOPIC,                          //Available for all channels that are "in view", always up-to-date
  108.     CHANNEL_DESCRIPTION,                    //Must be requested (=> requestChannelDescription)
  109.     CHANNEL_PASSWORD,                       //not available client side
  110.     CHANNEL_CODEC,                          //Available for all channels that are "in view", always up-to-date
  111.     CHANNEL_CODEC_QUALITY,                  //Available for all channels that are "in view", always up-to-date
  112.     CHANNEL_MAXCLIENTS,                     //Available for all channels that are "in view", always up-to-date
  113.     CHANNEL_MAXFAMILYCLIENTS,               //Available for all channels that are "in view", always up-to-date
  114.     CHANNEL_ORDER,                          //Available for all channels that are "in view", always up-to-date
  115.     CHANNEL_FLAG_PERMANENT,                 //Available for all channels that are "in view", always up-to-date
  116.     CHANNEL_FLAG_SEMI_PERMANENT,            //Available for all channels that are "in view", always up-to-date
  117.     CHANNEL_FLAG_DEFAULT,                   //Available for all channels that are "in view", always up-to-date
  118.     CHANNEL_FLAG_PASSWORD,                  //Available for all channels that are "in view", always up-to-date
  119.     CHANNEL_CODEC_LATENCY_FACTOR,           //Available for all channels that are "in view", always up-to-date
  120.     CHANNEL_CODEC_IS_UNENCRYPTED,           //Available for all channels that are "in view", always up-to-date
  121.     CHANNEL_ENDMARKER,
  122. };
  123.  
  124. enum ClientProperties {
  125.     CLIENT_UNIQUE_IDENTIFIER = 0,           //automatically up-to-date for any client "in view", can be used to identify this particular client installation
  126.     CLIENT_NICKNAME,                        //automatically up-to-date for any client "in view"
  127.     CLIENT_VERSION,                         //for other clients than ourself, this needs to be requested (=> requestClientVariables)
  128.     CLIENT_PLATFORM,                        //for other clients than ourself, this needs to be requested (=> requestClientVariables)
  129.     CLIENT_FLAG_TALKING,                    //automatically up-to-date for any client that can be heard (in room / whisper)
  130.     CLIENT_INPUT_MUTED,                     //automatically up-to-date for any client "in view", this clients microphone mute status
  131.     CLIENT_OUTPUT_MUTED,                    //automatically up-to-date for any client "in view", this clients headphones/speakers/mic combined mute status
  132.     CLIENT_OUTPUTONLY_MUTED,                //automatically up-to-date for any client "in view", this clients headphones/speakers only mute status
  133.     CLIENT_INPUT_HARDWARE,                  //automatically up-to-date for any client "in view", this clients microphone hardware status (is the capture device opened?)
  134.     CLIENT_OUTPUT_HARDWARE,                 //automatically up-to-date for any client "in view", this clients headphone/speakers hardware status (is the playback device opened?)
  135.     CLIENT_INPUT_DEACTIVATED,               //only usable for ourself, not propagated to the network
  136.     CLIENT_IDLE_TIME,                       //internal use
  137.     CLIENT_DEFAULT_CHANNEL,                 //only usable for ourself, the default channel we used to connect on our last connection attempt
  138.     CLIENT_DEFAULT_CHANNEL_PASSWORD,        //internal use
  139.     CLIENT_SERVER_PASSWORD,                 //internal use
  140.     CLIENT_META_DATA,                       //automatically up-to-date for any client "in view", not used by TeamSpeak, free storage for sdk users
  141.     CLIENT_IS_MUTED,                        //only make sense on the client side locally, "1" if this client is currently muted by us, "0" if he is not
  142.     CLIENT_IS_RECORDING,                    //automatically up-to-date for any client "in view"
  143.     CLIENT_VOLUME_MODIFICATOR,              //internal use
  144.     CLIENT_ENDMARKER,
  145. };
  146.  
  147. enum VirtualServerProperties {
  148.     VIRTUALSERVER_UNIQUE_IDENTIFIER = 0,             //available when connected, can be used to identify this particular server installation
  149.     VIRTUALSERVER_NAME,                              //available and always up-to-date when connected
  150.     VIRTUALSERVER_WELCOMEMESSAGE,                    //available when connected,  (=> requestServerVariables)
  151.     VIRTUALSERVER_PLATFORM,                          //available when connected
  152.     VIRTUALSERVER_VERSION,                           //available when connected
  153.     VIRTUALSERVER_MAXCLIENTS,                        //only available on request (=> requestServerVariables), stores the maximum number of clients that may currently join the server
  154.     VIRTUALSERVER_PASSWORD,                          //not available to clients, the server password
  155.     VIRTUALSERVER_CLIENTS_ONLINE,                    //only available on request (=> requestServerVariables),
  156.     VIRTUALSERVER_CHANNELS_ONLINE,                   //only available on request (=> requestServerVariables),
  157.     VIRTUALSERVER_CREATED,                           //available when connected, stores the time when the server was created
  158.     VIRTUALSERVER_UPTIME,                            //only available on request (=> requestServerVariables), the time since the server was started
  159.     VIRTUALSERVER_CODEC_ENCRYPTION_MODE,             //available and always up-to-date when connected
  160.     VIRTUALSERVER_ENDMARKER,
  161. };
  162.  
  163. enum ConnectionProperties {
  164.     CONNECTION_PING = 0,                                        //average latency for a round trip through and back this connection
  165.     CONNECTION_PING_DEVIATION,                                  //standard deviation of the above average latency
  166.     CONNECTION_CONNECTED_TIME,                                  //how long the connection exists already
  167.     CONNECTION_IDLE_TIME,                                       //how long since the last action of this client
  168.     CONNECTION_CLIENT_IP,                                       //IP of this client (as seen from the server side)
  169.     CONNECTION_CLIENT_PORT,                                     //Port of this client (as seen from the server side)
  170.     CONNECTION_SERVER_IP,                                       //IP of the server (seen from the client side) - only available on yourself, not for remote clients, not available server side
  171.     CONNECTION_SERVER_PORT,                                     //Port of the server (seen from the client side) - only available on yourself, not for remote clients, not available server side
  172.     CONNECTION_PACKETS_SENT_SPEECH,                             //how many Speech packets were sent through this connection
  173.     CONNECTION_PACKETS_SENT_KEEPALIVE,
  174.     CONNECTION_PACKETS_SENT_CONTROL,
  175.     CONNECTION_PACKETS_SENT_TOTAL,                              //how many packets were sent totally (this is PACKETS_SENT_SPEECH + PACKETS_SENT_KEEPALIVE + PACKETS_SENT_CONTROL)
  176.     CONNECTION_BYTES_SENT_SPEECH,
  177.     CONNECTION_BYTES_SENT_KEEPALIVE,
  178.     CONNECTION_BYTES_SENT_CONTROL,
  179.     CONNECTION_BYTES_SENT_TOTAL,
  180.     CONNECTION_PACKETS_RECEIVED_SPEECH,
  181.     CONNECTION_PACKETS_RECEIVED_KEEPALIVE,
  182.     CONNECTION_PACKETS_RECEIVED_CONTROL,
  183.     CONNECTION_PACKETS_RECEIVED_TOTAL,
  184.     CONNECTION_BYTES_RECEIVED_SPEECH,
  185.     CONNECTION_BYTES_RECEIVED_KEEPALIVE,
  186.     CONNECTION_BYTES_RECEIVED_CONTROL,
  187.     CONNECTION_BYTES_RECEIVED_TOTAL,
  188.     CONNECTION_PACKETLOSS_SPEECH,
  189.     CONNECTION_PACKETLOSS_KEEPALIVE,
  190.     CONNECTION_PACKETLOSS_CONTROL,
  191.     CONNECTION_PACKETLOSS_TOTAL,                                //the probability with which a packet round trip failed because a packet was lost
  192.     CONNECTION_SERVER2CLIENT_PACKETLOSS_SPEECH,                 //the probability with which a speech packet failed from the server to the client
  193.     CONNECTION_SERVER2CLIENT_PACKETLOSS_KEEPALIVE,
  194.     CONNECTION_SERVER2CLIENT_PACKETLOSS_CONTROL,
  195.     CONNECTION_SERVER2CLIENT_PACKETLOSS_TOTAL,
  196.     CONNECTION_CLIENT2SERVER_PACKETLOSS_SPEECH,
  197.     CONNECTION_CLIENT2SERVER_PACKETLOSS_KEEPALIVE,
  198.     CONNECTION_CLIENT2SERVER_PACKETLOSS_CONTROL,
  199.     CONNECTION_CLIENT2SERVER_PACKETLOSS_TOTAL,
  200.     CONNECTION_BANDWIDTH_SENT_LAST_SECOND_SPEECH,               //howmany bytes of speech packets we sent during the last second
  201.     CONNECTION_BANDWIDTH_SENT_LAST_SECOND_KEEPALIVE,
  202.     CONNECTION_BANDWIDTH_SENT_LAST_SECOND_CONTROL,
  203.     CONNECTION_BANDWIDTH_SENT_LAST_SECOND_TOTAL,
  204.     CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_SPEECH,               //howmany bytes/s of speech packets we sent in average during the last minute
  205.     CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_KEEPALIVE,
  206.     CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_CONTROL,
  207.     CONNECTION_BANDWIDTH_SENT_LAST_MINUTE_TOTAL,
  208.     CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_SPEECH,
  209.     CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_KEEPALIVE,
  210.     CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_CONTROL,
  211.     CONNECTION_BANDWIDTH_RECEIVED_LAST_SECOND_TOTAL,
  212.     CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_SPEECH,
  213.     CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_KEEPALIVE,
  214.     CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_CONTROL,
  215.     CONNECTION_BANDWIDTH_RECEIVED_LAST_MINUTE_TOTAL,
  216.     CONNECTION_ENDMARKER,
  217. };
  218.  
  219. enum LogTypes {
  220.     LogType_NONE          = 0x0000,
  221.     LogType_FILE          = 0x0001,
  222.     LogType_CONSOLE       = 0x0002,
  223.     LogType_USERLOGGING   = 0x0004,
  224.     LogType_NO_NETLOGGING = 0x0008,
  225.     LogType_DATABASE      = 0x0010,
  226. };
  227.  
  228. enum LogLevel {
  229.     LogLevel_CRITICAL = 0, //these messages stop the program
  230.     LogLevel_ERROR,        //everything that is really bad, but not so bad we need to shut down
  231.     LogLevel_WARNING,      //everything that *might* be bad
  232.     LogLevel_DEBUG,        //output that might help find a problem
  233.     LogLevel_INFO,         //informational output, like "starting database version x.y.z"
  234.     LogLevel_DEVEL         //developer only output (will not be displayed in release mode)
  235. };
  236.  
  237. typedef struct {
  238.     float x;        /* X co-ordinate in 3D space. */
  239.     float y;        /* Y co-ordinate in 3D space. */
  240.     float z;        /* Z co-ordinate in 3D space. */
  241. } TS3_VECTOR;
  242.  
  243. enum GroupWhisperType {
  244.     GROUPWHISPERTYPE_SERVERGROUP        = 0,
  245.     GROUPWHISPERTYPE_CHANNELGROUP       = 1,
  246.     GROUPWHISPERTYPE_CHANNELCOMMANDER   = 2,
  247.     GROUPWHISPERTYPE_ALLCLIENTS         = 3,
  248.     GROUPWHISPERTYPE_ENDMARKER,
  249. };
  250.  
  251. enum GroupWhisperTargetMode {
  252.     GROUPWHISPERTARGETMODE_ALL                   = 0,
  253.     GROUPWHISPERTARGETMODE_CURRENTCHANNEL        = 1,
  254.     GROUPWHISPERTARGETMODE_PARENTCHANNEL         = 2,
  255.     GROUPWHISPERTARGETMODE_ALLPARENTCHANNELS     = 3,
  256.     GROUPWHISPERTARGETMODE_CHANNELFAMILY         = 4,
  257.     GROUPWHISPERTARGETMODE_ANCESTORCHANNELFAMILY = 5,
  258.     GROUPWHISPERTARGETMODE_SUBCHANNELS           = 6,
  259.     GROUPWHISPERTARGETMODE_ENDMARKER,
  260. };
  261.  
  262. //defines for speaker locations used by some sound callbacks
  263. #ifndef SPEAKER_FRONT_LEFT
  264. #define SPEAKER_FRONT_LEFT              0x1
  265. #define SPEAKER_FRONT_RIGHT             0x2
  266. #define SPEAKER_FRONT_CENTER            0x4
  267. #define SPEAKER_LOW_FREQUENCY           0x8
  268. #define SPEAKER_BACK_LEFT               0x10
  269. #define SPEAKER_BACK_RIGHT              0x20
  270. #define SPEAKER_FRONT_LEFT_OF_CENTER    0x40
  271. #define SPEAKER_FRONT_RIGHT_OF_CENTER   0x80
  272. #define SPEAKER_BACK_CENTER             0x100
  273. #define SPEAKER_SIDE_LEFT               0x200
  274. #define SPEAKER_SIDE_RIGHT              0x400
  275. #define SPEAKER_TOP_CENTER              0x800
  276. #define SPEAKER_TOP_FRONT_LEFT          0x1000
  277. #define SPEAKER_TOP_FRONT_CENTER        0x2000
  278. #define SPEAKER_TOP_FRONT_RIGHT         0x4000
  279. #define SPEAKER_TOP_BACK_LEFT           0x8000
  280. #define SPEAKER_TOP_BACK_CENTER         0x10000
  281. #define SPEAKER_TOP_BACK_RIGHT          0x20000
  282. #endif
  283.  
  284. #endif //PUBLIC_DEFINITIONS_H
  285.