diff options
author | George Hazan <ghazan@miranda.im> | 2020-03-11 19:50:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-03-11 19:50:57 +0300 |
commit | e8fb7de563970da12871b83c0c5e84775fe71d2d (patch) | |
tree | 6ff2dadfba3045ca646fa903d2fe16ec0bfe32f2 /plugins/ExternalAPI | |
parent | 647b4697b51d8a3cf52b7c0312b6adc89e4cf395 (diff) |
Voice API: code cleaning
Diffstat (limited to 'plugins/ExternalAPI')
-rw-r--r-- | plugins/ExternalAPI/m_voice.h | 75 | ||||
-rw-r--r-- | plugins/ExternalAPI/m_voiceservice.h | 15 |
2 files changed, 33 insertions, 57 deletions
diff --git a/plugins/ExternalAPI/m_voice.h b/plugins/ExternalAPI/m_voice.h index e88eaeb842..046eae5383 100644 --- a/plugins/ExternalAPI/m_voice.h +++ b/plugins/ExternalAPI/m_voice.h @@ -35,18 +35,10 @@ wParam: 0 lParam: 0 return: VOICE_CAPS_* */ -#define PS_VOICE_CAPS "/Voice/Caps" +#define PS_VOICE_CAPS "/Voice/Caps" - - -#define VOICE_SECURE 0x00000001 -#define VOICE_UNICODE 0x80000000 - -#ifdef UNICODE -# define VOICE_TCHAR VOICE_UNICODE -#else -# define VOICE_TCHAR 0 -#endif +#define VOICE_SECURE 0x00000001 +#define VOICE_UNICODE 0x80000000 #define VOICE_STATE_TALKING 0 #define VOICE_STATE_RINGING 1 @@ -55,32 +47,23 @@ return: VOICE_CAPS_* #define VOICE_STATE_ENDED 4 #define VOICE_STATE_BUSY 5 -typedef struct { - int cbSize; // Struct size - const char *moduleName; // The name of the module (the same as VOICE_MODULE.name or the protocol szModule) - char *id; // Protocol especific ID for this call - int flags; // VOICE_UNICODE to say the string is unicode or 0. VOICE_SECURE to say this is a - // encrypted call - - MCONTACT hContact; // Contact associated with the call (can be NULL) - - union { // Number to call (can be NULL) - const TCHAR *ptszNumber;// Or the contact or the number must be != NULL - const char *pszNumber; // If both are != NULL the call will be made to the number - const WCHAR *pwszNumber;// and will be associated with the contact - }; // This fields are only needed in first notification for a call id - - union { // Name of the caller. This makes sense only on incoming calls, - const TCHAR *ptszName; // where no contact is associated and the caller has a name and a number. - const char *pszName; - const WCHAR *pwszName; - }; - +struct VOICE_CALL +{ + int cbSize; // Struct size + const char *moduleName; // The name of the module (the same as VOICE_MODULE.name or the protocol szModule) + char *id; // Protocol especific ID for this call + int flags; // VOICE_UNICODE to say the string is unicode or 0. VOICE_SECURE to say this is an encrypted call - int state; // VOICE_STATE_* - -} VOICE_CALL; + // Either contact or number must be != NULL + // If both are != NULL the call will be made to the number and will be associated with the contact + // This fields are only needed in first notification for a call id + MCONTACT hContact; // Contact associated with the call (can be NULL) + MAllCStrings szNumber; // Number to call (can be NULL) + MAllCStrings szName; // Name of the caller. This makes sense only on incoming calls, + // where no contact is associated and the caller has a name and a number. + int state; // VOICE_STATE_* +}; /* Notifies that a voice call changed state @@ -89,9 +72,7 @@ wParam: const VOICE_CALL * lParam: ignored return: 0 on success */ -#define PE_VOICE_CALL_STATE "/Voice/State" - - +#define PE_VOICE_CALL_STATE "/Voice/State" /* Request the protocol to make a voice call @@ -102,7 +83,7 @@ return: 0 on success Or the contact or the number must be != NULL. If both are != NULL the call will be made to the number and will be associated with the contact. */ -#define PS_VOICE_CALL "/Voice/Call" +#define PS_VOICE_CALL "/Voice/Call" /* Service called to make the protocol answer a call or restore a hold call. @@ -113,7 +94,7 @@ wParam: (const char *) id lParam: ignored return: 0 on success */ -#define PS_VOICE_ANSWERCALL "/Voice/AnswerCall" +#define PS_VOICE_ANSWERCALL "/Voice/AnswerCall" /* Service called to make the protocol answer a call. This can be called if the @@ -125,7 +106,7 @@ wParam: (const char *) id lParam: ignored return: 0 on success */ -#define PS_VOICE_DROPCALL "/Voice/DropCall" +#define PS_VOICE_DROPCALL "/Voice/DropCall" /* Service called to make the protocol hold a call. This means that the call should not @@ -140,7 +121,7 @@ wParam: (const char *) id lParam: ignored return: 0 on success */ -#define PS_VOICE_HOLDCALL "/Voice/HoldCall" +#define PS_VOICE_HOLDCALL "/Voice/HoldCall" /* Send a DTMF (one digit text) to a talking call. @@ -149,7 +130,7 @@ wParam: (const char *) id lParam: (TCHAR) dtmf return: 0 on success */ -#define PS_VOICE_SEND_DTMF "/Voice/SendDTMF" +#define PS_VOICE_SEND_DTMF "/Voice/SendDTMF" /* Used if protocol support VOICE_CALL_STRING. The call string is passed as @@ -159,7 +140,7 @@ wParam: (const TCHAR *) call string lParam: ignored return: 0 if wrong, 1 if correct */ -#define PS_VOICE_CALL_STRING_VALID "/Voice/CallStringValid" +#define PS_VOICE_CALL_STRING_VALID "/Voice/CallStringValid" /* Used if protocol support VOICE_CALL_CONTACT. @@ -171,10 +152,6 @@ wParam: (HANDLE) hContact lParam: (BOOL) TRUE if it is a test for 'can call now?', FALSE if is a test for 'will be possible to call someday?' return: 0 if can't be called, 1 if can */ -#define PS_VOICE_CALL_CONTACT_VALID "/Voice/CallContactValid" - - - - +#define PS_VOICE_CALL_CONTACT_VALID "/Voice/CallContactValid" #endif // __M_VOICE_H__ diff --git a/plugins/ExternalAPI/m_voiceservice.h b/plugins/ExternalAPI/m_voiceservice.h index c70dc8ea3e..a0fd124815 100644 --- a/plugins/ExternalAPI/m_voiceservice.h +++ b/plugins/ExternalAPI/m_voiceservice.h @@ -37,14 +37,13 @@ To get the devices for input/output and some options, query the db directly: struct VOICE_MODULE { - int cbSize; // sizeof(VOICE_MODULE) - TCHAR *description; // The description of the voice provider. This is the name that will be shown - // to the user - char *name; // The internal name of the voice provider. All PS_* serivces - // defined in m_voide.h need to be created based in this name. For example, - // PS_VOICE_CALL (/Voice/Call) need to be created as <name>/Voice/Call - char *icon; // Icon to identify provider (from icolib) - int flags; // or of VOICE_CAPS_*. You don't need to send VOICE_CAPS_VOICE. + int cbSize; // sizeof(VOICE_MODULE) + TCHAR *description; // The description of the voice provider. This is the name that will be shown to the user + char *name; // The internal name of the voice provider. All PS_* serivces + // defined in m_voice.h need to be created based in this name. For example, + // PS_VOICE_CALL (/Voice/Call) need to be created as <name>/Voice/Call + HANDLE icon; // Icon to identify provider (from icolib) + int flags; // or of VOICE_CAPS_*. You don't need to send VOICE_CAPS_VOICE. }; /* Register a new plugin that can make/receive voice calls (a voice provider). |