summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-13 04:28:21 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-13 04:28:21 +0000
commited224137da84e8e214588f4207f0da2842a47cf4 (patch)
tree396a03edd2827da6b3ecd9c6cfa6bdf65ee18da9
parent8861255967216dc365a9e81b2b4cb6668010ed2e (diff)
updated dependencies
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@283 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r--iax/dial_dlg.cpp21
-rw-r--r--iax/dllmain.cpp20
-rw-r--r--iax/iax_8.sln9
-rw-r--r--iax/iax_8.vcproj6
-rw-r--r--iax/iax_interface.cpp60
-rw-r--r--iax/private.h4
6 files changed, 57 insertions, 63 deletions
diff --git a/iax/dial_dlg.cpp b/iax/dial_dlg.cpp
index 29fcf66..1201806 100644
--- a/iax/dial_dlg.cpp
+++ b/iax/dial_dlg.cpp
@@ -142,8 +142,8 @@ static BOOL CALLBACK DlgProcDial(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
int input = SendDlgItemMessage(hwndDlg, IDC_SLD_IN, TBM_GETPOS, 0, 0),
output = SendDlgItemMessage(hwndDlg, IDC_SLD_OUT, TBM_GETPOS, 0, 0);
- iaxc_input_level_set(input / 100.0);
- iaxc_output_level_set(output / 100.0);
+ iaxc_input_level_set(input / 100.0f);
+ iaxc_output_level_set(output / 100.0f);
}
break;
case WM_COMMAND:
@@ -159,6 +159,7 @@ static BOOL CALLBACK DlgProcDial(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if(buff[0]) {
Call(buff);
SetFocus(GetDlgItem(hwndDlg, IDC_CMB_NUM));
+ SendMessage(hwndDlg, WMU_REFRESHLINEINFO, 0, 0);
}
}
return TRUE;
@@ -295,15 +296,15 @@ void InitDialDialog() {
}
}
- hBrushActive = CreateSolidBrush(RGB(0, 0xff, 0));
- hBrushFree = CreateSolidBrush(RGB(0xD0, 0xD0, 0xD0));
- hBrushActiveSelect = CreateSolidBrush(RGB(0x80, 0xff, 0x80));
- hBrushFreeSelect = CreateSolidBrush(RGB(0xff, 0xff, 0xff));
+ hBrushActive = CreateSolidBrush(RGB(0, 0xff, 0)); // green
+ hBrushFree = CreateSolidBrush(RGB(0xD0, 0xD0, 0xD0)); // grey
+ hBrushActiveSelect = CreateSolidBrush(RGB(0x80, 0xff, 0x80)); // light green
+ hBrushFreeSelect = CreateSolidBrush(RGB(0xff, 0xff, 0xff)); // white
- hBrushRingIn = CreateSolidBrush(RGB(0xff, 0, 0xff));
- hBrushRingOut = CreateSolidBrush(RGB(0, 0, 0xff));
- hBrushRingInSelect = CreateSolidBrush(RGB(0xff, 0x80, 0xff));
- hBrushRingOutSelect = CreateSolidBrush(RGB(0x80, 0x80, 0xff));
+ hBrushRingIn = CreateSolidBrush(RGB(0xff, 0, 0xff)); // purple
+ hBrushRingOut = CreateSolidBrush(RGB(0, 0, 0xff)); // blue
+ hBrushRingInSelect = CreateSolidBrush(RGB(0xff, 0x80, 0xff)); // light-purple
+ hBrushRingOutSelect = CreateSolidBrush(RGB(0x80, 0x80, 0xff)); // light-blue
hkid = GlobalAddAtom("IAX plugin hk id");
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DIAL), 0, DlgProcDial, 0);
diff --git a/iax/dllmain.cpp b/iax/dllmain.cpp
index 957d779..69f5776 100644
--- a/iax/dllmain.cpp
+++ b/iax/dllmain.cpp
@@ -77,8 +77,17 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
}
InitIcons();
- InitMenu();
+ PreInitOptions();
+
+ if(!InitIAXInterface()) {
+ MessageBox(0, Translate("Failed to initialize IAX Client library. Plugin disabled."), Translate("IAX Plugin error"), MB_OK | MB_ICONERROR);
+ return 1;
+ }
+
+ InitOptions();
+ InitMenu();
+
return 0;
}
@@ -98,13 +107,6 @@ extern "C" __declspec (dllexport) int __cdecl Load(PLUGINLINK *link) {
return 1;
}
- PreInitOptions();
-
- if(!InitIAXInterface()) {
- MessageBox(0, Translate("Failed to initialize IAX Client library. Plugin disabled."), Translate("IAX Plugin error"), MB_OK | MB_ICONERROR);
- return 1;
- }
-
if(ServiceExists(MS_DB_SETSETTINGRESIDENT)) { // 0.6+
CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)(MODULE "/Status"));
CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (LPARAM)(MODULE "/LineNo"));
@@ -128,8 +130,6 @@ extern "C" __declspec (dllexport) int __cdecl Load(PLUGINLINK *link) {
// since we can call people when not registered...
SetContactStatus(ID_STATUS_ONLINE);
- InitOptions();
-
// hook modules loaded
hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
hPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
diff --git a/iax/iax_8.sln b/iax/iax_8.sln
index 433ca4d..5a2c126 100644
--- a/iax/iax_8.sln
+++ b/iax/iax_8.sln
@@ -2,11 +2,6 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iax", "iax_8.vcproj", "{7C89CA7D-D98A-43E6-9772-385681506ABF}"
- ProjectSection(ProjectDependencies) = postProject
- {4AF56BD0-9FB7-435B-99F2-8582FEAC8137} = {4AF56BD0-9FB7-435B-99F2-8582FEAC8137}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iaxclient_lib", "iaxclient\lib\win\vs2005\iaxclient_lib.vcproj", "{4AF56BD0-9FB7-435B-99F2-8582FEAC8137}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -18,10 +13,6 @@ Global
{7C89CA7D-D98A-43E6-9772-385681506ABF}.Debug|Win32.Build.0 = Debug|Win32
{7C89CA7D-D98A-43E6-9772-385681506ABF}.Release|Win32.ActiveCfg = Release|Win32
{7C89CA7D-D98A-43E6-9772-385681506ABF}.Release|Win32.Build.0 = Release|Win32
- {4AF56BD0-9FB7-435B-99F2-8582FEAC8137}.Debug|Win32.ActiveCfg = Debug|Win32
- {4AF56BD0-9FB7-435B-99F2-8582FEAC8137}.Debug|Win32.Build.0 = Debug|Win32
- {4AF56BD0-9FB7-435B-99F2-8582FEAC8137}.Release|Win32.ActiveCfg = Release|Win32
- {4AF56BD0-9FB7-435B-99F2-8582FEAC8137}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/iax/iax_8.vcproj b/iax/iax_8.vcproj
index 275b7b4..e74c280 100644
--- a/iax/iax_8.vcproj
+++ b/iax/iax_8.vcproj
@@ -62,7 +62,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib comctl32.lib iaxclient\lib\win\vs2005\DebugLIB\iaxclient1.lib"
+ AdditionalDependencies="comsuppwd.lib ws2_32.lib comctl32.lib iaxclient\contrib\win\vs2005\Debug\libvideolib\libvideolib.lib iaxclient\contrib\win\vs2005\Debug\libportaudio\libportaudio.lib iaxclient\contrib\win\vs2005\Debug\libportmixer\libportmixer.lib iaxclient\contrib\win\vs2005\Debug\libiaxclient\libiaxclient.lib iaxclient\contrib\win\vs2005\Debug\libiax2\libiax2.lib iaxclient\contrib\win\vs2005\Debug\libgsm\libgsm.lib libtheora\win32\VS2005\libtheora\Debug\libtheora.lib speex\win32\VS2005\libspeex\Debug\libspeex.lib PlatformSDK\strmbasd.lib"
OutputFile="..\..\bin\$(ConfigurationName)\plugins\$(ProjectName).dll"
LinkIncremental="2"
GenerateDebugInformation="true"
@@ -129,7 +129,6 @@
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="1"
FloatingPointModel="2"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -148,9 +147,10 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="ws2_32.lib comctl32.lib iaxclient\lib\win\vs2005\ReleaseLIB\iaxclient1.lib"
+ AdditionalDependencies="comsuppw.lib ws2_32.lib comctl32.lib iaxclient\contrib\win\vs2005\Release\libvideolib\libvideolib.lib iaxclient\contrib\win\vs2005\Release\libportaudio\libportaudio.lib iaxclient\contrib\win\vs2005\Release\libportmixer\libportmixer.lib iaxclient\contrib\win\vs2005\Release\libiaxclient\libiaxclient.lib iaxclient\contrib\win\vs2005\Release\libiax2\libiax2.lib iaxclient\contrib\win\vs2005\Release\libgsm\libgsm.lib libtheora\win32\VS2005\libtheora\Release\libtheora.lib speex\win32\VS2005\libspeex\Release\libspeex.lib PlatformSDK\strmbase.lib"
OutputFile="..\..\bin\$(ConfigurationName)\plugins\$(ProjectName).dll"
LinkIncremental="1"
+ IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
diff --git a/iax/iax_interface.cpp b/iax/iax_interface.cpp
index 8004ca0..c03bf23 100644
--- a/iax/iax_interface.cpp
+++ b/iax/iax_interface.cpp
@@ -23,7 +23,7 @@ typedef struct {
LineInfo line_info[NUM_LINES] = {0};
int reg_id = 0;
-double silence_threshold = -99;
+float silence_threshold = -99;
//double silence_threshold = 0;
void SendDTMF(char c) {
@@ -59,6 +59,7 @@ int GetLineState(int line) {
void AnswerCall(int callNo) {
WMPPause();
iaxc_answer_call(callNo);
+ iaxc_select_call(callNo);
}
char *GetLineCIDNum(int callNo) {
@@ -72,7 +73,7 @@ char *GetLineCIDName(int callNo) {
int text_event_callback(iaxc_ev_text text) {
switch(text.type) {
case IAXC_TEXT_TYPE_STATUS:
- //ShowInfo(Translate("Status: %s"), Translate(text.message));
+ ShowInfo(Translate("Status: %s"), Translate(text.message));
break;
case IAXC_TEXT_TYPE_NOTICE:
ShowInfo(Translate("Notice: %s"), Translate(text.message));
@@ -187,39 +188,38 @@ int state_event_callback(iaxc_ev_call_state call){
bool ringing = (call.state & IAXC_CALL_STATE_RINGING) != 0;
bool outgoing = (call.state & IAXC_CALL_STATE_OUTGOING) != 0;
- if(ringing) {
-
- if(!line_info[call.callNo].ring_thread) {
- CloseHandle((HANDLE)_beginthreadex(0, 0, RingThread, (void *)call.callNo, 0, 0));
- line_info[call.callNo].ring_thread = true;
+ if(!active) {
+ DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_ONLINE);
+ DWORD current_time = (DWORD)time(0), last_call = DBGetContactSettingDword(hContact, MODULE, "LastCall", current_time);
+ if(current_time - last_call > 0) {
+ DBWriteContactSettingDword(hContact, MODULE, "LastCallDuration", current_time - last_call);
}
+ DBWriteContactSettingByte(hContact, MODULE, "LineNo", 0xff);
+ } else {
+ if(ringing) {
- if(!hContact) hContact = CreateContact(call.remote, call.remote, true); //call.remote_name);
- DBWriteContactSettingByte(hContact, MODULE, "LineNo", call.callNo);
- if(outgoing) {
- DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_NA);
- if(options.pop_dial_out) ShowDialDialog(false);
- } else {
- DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_FREECHAT);
- if(options.pop_dial_in) ShowDialDialog(false);
- }
+ if(!line_info[call.callNo].ring_thread) {
+ CloseHandle((HANDLE)_beginthreadex(0, 0, RingThread, (void *)call.callNo, 0, 0));
+ line_info[call.callNo].ring_thread = true;
+ }
+
+ if(!hContact) hContact = CreateContact(call.remote, call.remote, true); //call.remote_name);
+ DBWriteContactSettingByte(hContact, MODULE, "LineNo", call.callNo);
+ if(outgoing) {
+ DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_NA);
+ if(options.pop_dial_out) ShowDialDialog(false);
+ } else {
+ DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_FREECHAT);
+ if(options.pop_dial_in) ShowDialDialog(false);
+ }
- } else if(hContact) {
- if(active) {
+ } else if(hContact) {
DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_ONTHEPHONE);
DBWriteContactSettingDword(hContact, MODULE, "LastCall", (DWORD)time(0));
DBWriteContactSettingByte(hContact, MODULE, "LineNo", call.callNo);
- } else {
- DBWriteContactSettingWord(hContact, MODULE, "Status", ID_STATUS_ONLINE);
- DWORD current_time = (DWORD)time(0), last_call = DBGetContactSettingDword(hContact, MODULE, "LastCall", current_time);
- if(current_time - last_call > 0) {
- DBWriteContactSettingDword(hContact, MODULE, "LastCallDuration", current_time - last_call);
- }
- DBWriteContactSettingByte(hContact, MODULE, "LineNo", 0xff);
}
}
-
return 0;
}
@@ -227,7 +227,6 @@ int registration_event_callback(iaxc_ev_registration reg) {
if(reg.reply == IAXC_REGISTRATION_REPLY_ACK) {
SetStatusAndACK(ID_STATUS_ONLINE);
if(reg.msgcount > 0) ShowInfo(Translate("You have %d messages."), reg.msgcount);
- SetLineNo(0);
SetContactStatus(ID_STATUS_ONLINE);
} else if(reg.reply == IAXC_REGISTRATION_REPLY_REJ) {
if(reg_id) ShowError(Translate("Registration rejected"));
@@ -260,6 +259,8 @@ int iaxc_callback(iaxc_event e)
return state_event_callback(e.ev.call);
case IAXC_EVENT_REGISTRATION:
return registration_event_callback(e.ev.reg);
+ case IAXC_EVENT_VIDEO:
+ return 0;
default:
return 0; // not handled
}
@@ -295,10 +296,11 @@ bool InitIAXInterface() {
hServiceIconClist = CreateServiceFunction(MODULE "/ClistIconClick", ClistIconClick);
iaxc_set_preferred_source_udp_port(DBGetContactSettingDword(0, MODULE, "Port", 4569));
- if(iaxc_initialize(AUDIO_INTERNAL_PA, NUM_LINES)) return false;
+ if(iaxc_initialize(NUM_LINES)) return false;
iaxc_set_formats(options.codecs_preferred, options.codecs_allowed);
-
+ //iaxc_video_format_set_cap(IAXC_FORMAT_THEORA, IAXC_FORMAT_THEORA);
+ iaxc_video_format_set(IAXC_FORMAT_THEORA, IAXC_FORMAT_THEORA, 10, 16 * 1024 * 8, 320, 240, 8000);
//iaxc_set_filters(IAXC_FILTER_CN);
iaxc_set_speex_settings(1,-1,-1,0,8000,3);
diff --git a/iax/private.h b/iax/private.h
index ca5f285..6f58a4e 100644
--- a/iax/private.h
+++ b/iax/private.h
@@ -3,9 +3,9 @@
/* VERSION DEFINITIONS */
#define VER_MAJOR 0
-#define VER_MINOR 1
+#define VER_MINOR 2
#define VER_RELEASE 0
-#define VER_BUILD 5
+#define VER_BUILD 0
#define __STRINGIZE(x) #x
#define VER_STRING __STRINGIZE( VER_MAJOR.VER_MINOR.VER_RELEASE.VER_BUILD )