From ed224137da84e8e214588f4207f0da2842a47cf4 Mon Sep 17 00:00:00 2001 From: sje Date: Fri, 13 Jul 2007 04:28:21 +0000 Subject: updated dependencies git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@283 4f64403b-2f21-0410-a795-97e2b3489a10 --- iax/dial_dlg.cpp | 21 +++++++++--------- iax/dllmain.cpp | 20 ++++++++--------- iax/iax_8.sln | 9 -------- iax/iax_8.vcproj | 6 +++--- iax/iax_interface.cpp | 60 ++++++++++++++++++++++++++------------------------- iax/private.h | 4 ++-- 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 @@ /> 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 ) -- cgit v1.2.3