You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(68) |
Jul
(27) |
Aug
(1) |
Sep
(9) |
Oct
(16) |
Nov
(64) |
Dec
(18) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(11) |
Feb
(5) |
Mar
(20) |
Apr
(9) |
May
(8) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
(11) |
Oct
(34) |
Nov
(23) |
Dec
(34) |
2005 |
Jan
(41) |
Feb
(25) |
Mar
(25) |
Apr
(32) |
May
(27) |
Jun
(9) |
Jul
(36) |
Aug
(6) |
Sep
(3) |
Oct
(11) |
Nov
(2) |
Dec
(21) |
2006 |
Jan
(14) |
Feb
(8) |
Mar
(18) |
Apr
(6) |
May
|
Jun
(17) |
Jul
(14) |
Aug
(26) |
Sep
(34) |
Oct
(24) |
Nov
(48) |
Dec
(64) |
2007 |
Jan
(72) |
Feb
(21) |
Mar
(50) |
Apr
(41) |
May
(35) |
Jun
(50) |
Jul
(33) |
Aug
(32) |
Sep
(50) |
Oct
(85) |
Nov
(43) |
Dec
(33) |
2008 |
Jan
(10) |
Feb
(29) |
Mar
(15) |
Apr
(45) |
May
(5) |
Jun
(2) |
Jul
(14) |
Aug
(3) |
Sep
|
Oct
|
Nov
(3) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(9) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <st...@us...> - 2003-06-13 22:44:45
|
Update of /cvsroot/iaxclient/iaxclient/lib/sox In directory sc8-pr-cvs1:/tmp/cvs-serv6342/sox Modified Files: soxcompat.c Log Message: MSVC doesn't define __STDC__ for some reason? Index: soxcompat.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/sox/soxcompat.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- soxcompat.c 4 Jun 2003 19:26:39 -0000 1.1 +++ soxcompat.c 13 Jun 2003 22:44:42 -0000 1.2 @@ -2,7 +2,7 @@ #include "sox.h" #include <stdio.h> -#ifdef __STDC__ +#if defined(__STDC__) || defined(_MSC_VER) #include <stdarg.h> #else #include <varargs.h> |
From: <st...@us...> - 2003-06-13 22:44:45
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv6342 Modified Files: iaxclient_lib.c Log Message: MSVC doesn't define __STDC__ for some reason? Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- iaxclient_lib.c 13 Jun 2003 18:57:24 -0000 1.18 +++ iaxclient_lib.c 13 Jun 2003 22:44:42 -0000 1.19 @@ -1,6 +1,6 @@ #include "iaxclient_lib.h" -#ifdef __STDC__ +#if defined(__STDC__) || defined(_MSC_VER) #include <stdarg.h> #else #include <varargs.h> |
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv4513 Added Files: ReadMe.txt StdAfx.cpp StdAfx.h WinIAX.cpp WinIAX.dsp WinIAX.dsw resource.h resource.rc winiax.h Log Message: WinIAX contributed to iaxclient by Faizan "Tili" Naqvi <fa...@ti...> --- NEW FILE: ReadMe.txt --- WinIAX contributed to iaxclient by Faizan "Tili" Naqvi <fa...@ti...> ======================================================================== WIN32 APPLICATION : WinIAX ======================================================================== AppWizard has created this WinIAX application for you. This file contains a summary of what you will find in each of the files that make up your WinIAX application. WinIAX.cpp This is the main application source file. WinIAX.dsp This file (the project file) contains information at the project level and is used to build a single project or subproject. Other users can share the project (.dsp) file, but they should export the makefiles locally. ///////////////////////////////////////////////////////////////////////////// Other standard files: StdAfx.h, StdAfx.cpp These files are used to build a precompiled header (PCH) file named WinIAX.pch and a precompiled types file named StdAfx.obj. ///////////////////////////////////////////////////////////////////////////// Other notes: AppWizard uses "TODO:" to indicate parts of the source code you should add to or customize. ///////////////////////////////////////////////////////////////////////////// --- NEW FILE: StdAfx.cpp --- // stdafx.cpp : source file that includes just the standard includes // WinIAX.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h" // TODO: reference any additional headers you need in STDAFX.H // and not in this file --- NEW FILE: StdAfx.h --- // stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) #define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include <windows.h> // TODO: reference additional headers your program requires here //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_) --- NEW FILE: WinIAX.cpp --- // WinIAX.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "winiax.h" #include "resource.h" #include "iaxclient.h" #include "commctrl.h" //#include "stdarg.h" //#include "varargs.h" #define APP_NAME "WinIAX Client" #define LEVEL_MAX -10 #define LEVEL_MIN -50 #define TIMER_PROCESS_CALLS 1001 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { // TODO: Place code here. WNDCLASSEX wnd; wnd.cbSize=sizeof WNDCLASSEX; wnd.lpfnWndProc=(WNDPROC)DialogProc; // wnd.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_ICON1)); // wnd.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_ICON1)); // wnd.hIconSm=(HICON)LoadImage(hInstance ,MAKEINTRESOURCE(IDI_ICON1),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),LR_DEFAULTCOLOR); RegisterClassEx(&wnd); INITCOMMONCONTROLSEX cmtcl; cmtcl.dwSize=sizeof (INITCOMMONCONTROLSEX); cmtcl.dwICC=ICC_WIN95_CLASSES; InitCommonControlsEx(&cmtcl); hBr=CreateSolidBrush(RGB(40,100,150)); // m_hwndMainDlg=CreateDialog(hInstance,MAKEINTRESOURCE(IDD_MAIN_DLG),NULL,(DLGPROC)DialogProc); m_hwndMainDlg=CreateDialog(hInstance,MAKEINTRESOURCE(IDD_MAIN_DLG),NULL,(DLGPROC)DialogProc); if(!m_hwndMainDlg) { // GetLastError(); TMessageBox("Couldnt create main dialog box\nAborting..."); return 0; } ShowWindow(m_hwndMainDlg,SW_SHOW); // PBM_SETRANGE(0,LEVEL_MAX-LEVEL_MIN); MSG msg; while(GetMessage(&msg,NULL,0,0)) { if(!IsDialogMessage(m_hwndMainDlg,&msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } // KillTimer(NULL,m_iTimerId); iaxc_dump_call(); iaxc_process_calls(); for(int i=0;i<10;i++) { iaxc_millisleep(100); iaxc_process_calls(); } iaxc_stop_processing_thread(); iaxc_shutdown(); return 0; } int TMessageBox(char *szMsg,int btn) { return MessageBox(m_hwndMainDlg,szMsg,APP_NAME,btn); } INT_PTR DialogProc( HWND hwndDlg, // handle to dialog box UINT uMsg, // message WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { BOOL bRet=FALSE; switch (uMsg) { case WM_INITDIALOG: bRet=OnInitDialog(); break; case WM_SYSCOMMAND: bRet=OnSysCommand(wParam); break; case WM_DESTROY: EndDialog(m_hwndMainDlg,0); PostQuitMessage(0); bRet=FALSE; break; case WM_TIMER: bRet=OnTimer(wParam); break; case WM_CTLCOLORDLG: return (INT_PTR)hBr; break; case WM_CTLCOLORSTATIC: SetBkColor((HDC)wParam,RGB(40,100,150)); SetTextColor((HDC)wParam,RGB(255,255,255)); return (INT_PTR)hBr; break; case WM_COMMAND: { switch (LOWORD(wParam)) { case IDC_BN_DIAL: OnBnDial(); // TMessageBox("Dial Clicked"); break; case IDC_BN_HANGUP: OnBnHangup(); TMessageBox("Hangup Clicked"); break; case IDC_BN_1: SendDTMF('1'); break; case IDC_BN_2: SendDTMF('2'); break; case IDC_BN_3: SendDTMF('3'); break; case IDC_BN_4: SendDTMF('4'); break; case IDC_BN_5: SendDTMF('5'); break; case IDC_BN_6: SendDTMF('6'); break; case IDC_BN_7: SendDTMF('7'); break; case IDC_BN_8: SendDTMF('8'); break; case IDC_BN_9: SendDTMF('9'); break; case IDC_BN_ASTERISK: SendDTMF('*'); break; case IDC_BN_0: SendDTMF('0'); break; case IDC_BN_HASH: SendDTMF('#'); break; // case IDC_PROG_INPUT: // break; // case IDC_PROG_OUTPUT: // bRet=TRUE; // break; // case IDC_E_IAX_URI: // break; } } // bRet=FALSE; break; } return bRet; } BOOL OnInitDialog() { // TMessageBox("OnInitDialog"); double silence_threshold = -99; iaxc_initialize(AUDIO_INTERNAL_PA); iaxc_set_encode_format(IAXC_FORMAT_GSM); iaxc_set_silence_threshold(silence_threshold); iaxc_set_error_callback(status_callback); iaxc_set_levels_callback(levels_callback); iaxc_start_processing_thread(); PostMessage(GetDlgItem(m_hwndMainDlg,IDC_PROG_OUTPUT),PBM_SETRANGE,0,LEVEL_MIN-LEVEL_MAX); PostMessage(GetDlgItem(m_hwndMainDlg,IDC_PROG_INPUT),PBM_SETRANGE,0,LEVEL_MIN-LEVEL_MAX); // m_iTimerId=SetTimer(NULL,0,500,(TIMERPROC)TimerProc); return TRUE; } BOOL OnSysCommand(UINT uCmd) { BOOL bRet=FALSE; switch (uCmd) { case SC_CLOSE: DestroyWindow(m_hwndMainDlg); bRet=TRUE; break; case SC_MINIMIZE: ShowWindow(m_hwndMainDlg,SW_MINIMIZE); bRet=TRUE; break; } return bRet; } void OnBnDial() { char szString[MAX_PATH]; GetDlgItemText(m_hwndMainDlg,IDC_E_IAX_URI,szString,MAX_PATH); iaxc_call(szString); } void OnBnHangup() { iaxc_dump_call(); } void status_callback(char *msg) { SetDlgItemText(m_hwndMainDlg,IDC_ST_STATUS,msg); } int levels_callback(float input, float output) { int inputLevel,outputLevel; if (input < LEVEL_MIN) input = LEVEL_MIN; else if (input > LEVEL_MAX) input = LEVEL_MAX; inputLevel = (int)input - (LEVEL_MIN); if (output < LEVEL_MIN) output = LEVEL_MIN; else if (input > LEVEL_MAX) output = LEVEL_MAX; outputLevel = (int)output - (LEVEL_MIN); PostMessage(GetDlgItem(m_hwndMainDlg,IDC_PROG_OUTPUT),PBM_SETPOS,outputLevel,0); PostMessage(GetDlgItem(m_hwndMainDlg,IDC_PROG_INPUT),PBM_SETPOS,inputLevel,0); //char szStr[30]; //sprintf(szStr,"Output %d,input %d",output,input); //SetDlgItemText(m_hwndMainDlg,IDC_ST_STATUS,szStr); // Set // theFrame->input->SetValue(inputLevel); // theFrame->output->SetValue(outputLevel); return 0; } void SendDTMF(char num) { iaxc_send_dtmf(num); } BOOL OnTimer(UINT nIDEvent) { BOOL bRet=TRUE; if(nIDEvent==TIMER_PROCESS_CALLS) { iaxc_process_calls(); bRet=FALSE; } return bRet; } VOID CALLBACK TimerProc( HWND hwnd, // handle to window UINT uMsg, // WM_TIMER message UINT_PTR idEvent, // timer identifier DWORD dwTime // current system time ) { // Using thread instead of timer from now on. if(idEvent==m_iTimerId) { iaxc_process_calls(); } } --- NEW FILE: WinIAX.dsp --- # Microsoft Developer Studio Project File - Name="WinIAX" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=WinIAX - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "WinIAX.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "WinIAX.mak" CFG="WinIAX - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "WinIAX - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "WinIAX - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "WinIAX - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\lib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib comctl32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib winmm.lib ..\..\lib\Release\iaxclient_lib.lib ..\..\lib\sox\Release\sox.lib /nologo /subsystem:windows /machine:I386 !ELSEIF "$(CFG)" == "WinIAX - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\lib\sox" /I "../../lib/gsm/src" /I "../../lib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib winmm.lib ws2_32.lib comctl32.lib ..\..\lib\Debug\iaxclient_lib.lib ..\..\lib\sox\Debug\sox.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "WinIAX - Win32 Release" # Name "WinIAX - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\resource.rc # End Source File # Begin Source File SOURCE=.\StdAfx.cpp # ADD CPP /Yc"stdafx.h" # End Source File # Begin Source File SOURCE=.\WinIAX.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\StdAfx.h # End Source File # Begin Source File SOURCE=.\winiax.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # Begin Source File SOURCE=.\ReadMe.txt # End Source File # End Target # End Project --- NEW FILE: WinIAX.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "WinIAX"=.\WinIAX.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### --- NEW FILE: resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by resource.rc // #define IDD_MAIN_DLG 101 #define IDC_BN_DIAL 1000 #define IDC_E_IAX_URI 1001 #define IDC_BN_HANGUP 1002 #define IDC_ST_STATUS 1004 #define IDC_BN_1 1012 #define IDC_BN_2 1013 #define IDC_BN_3 1014 #define IDC_BN_4 1015 #define IDC_BN_5 1016 #define IDC_BN_6 1017 #define IDC_BN_7 1018 #define IDC_BN_8 1019 #define IDC_BN_9 1020 #define IDC_BN_ASTERISK 1021 #define IDC_BN_0 1022 #define IDC_BN_HASH 1023 #define IDC_PROG_OUTPUT 1024 #define IDC_PROG_INPUT 1025 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1026 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE: resource.rc --- //Microsoft Developer Studio generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE DISCARDABLE BEGIN "resource.h\0" END 2 TEXTINCLUDE DISCARDABLE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE DISCARDABLE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Dialog // IDD_MAIN_DLG DIALOG DISCARDABLE 0, 0, 234, 175 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Dialog" FONT 8, "MS Sans Serif" BEGIN PUSHBUTTON "Dial",IDC_BN_DIAL,67,34,50,14 EDITTEXT IDC_E_IAX_URI,50,7,177,14,ES_AUTOHSCROLL LTEXT "IAX URI:",IDC_STATIC,17,10,29,8 PUSHBUTTON "Hangup",IDC_BN_HANGUP,117,34,50,14 LTEXT "Welcome to WinIAX Client",IDC_ST_STATUS,7,143,220,25 PUSHBUTTON "1",IDC_BN_1,90,58,17,14 PUSHBUTTON "2",IDC_BN_2,108,58,17,14 PUSHBUTTON "3",IDC_BN_3,126,58,17,14 PUSHBUTTON "4",IDC_BN_4,90,72,17,14 PUSHBUTTON "5",IDC_BN_5,108,72,17,14 PUSHBUTTON "6",IDC_BN_6,126,72,17,14 PUSHBUTTON "7",IDC_BN_7,90,86,17,14 PUSHBUTTON "8",IDC_BN_8,108,86,17,14 PUSHBUTTON "9",IDC_BN_9,126,86,17,14 PUSHBUTTON "*",IDC_BN_ASTERISK,90,100,17,14 PUSHBUTTON "0",IDC_BN_0,108,100,17,14 PUSHBUTTON "#",IDC_BN_HASH,126,100,17,14 CONTROL "Progress1",IDC_PROG_OUTPUT,"msctls_progress32", PBS_VERTICAL | WS_BORDER,204,49,8,73 CONTROL "Progress2",IDC_PROG_INPUT,"msctls_progress32", PBS_VERTICAL | WS_BORDER,219,49,8,73 END ///////////////////////////////////////////////////////////////////////////// // // DESIGNINFO // #ifdef APSTUDIO_INVOKED GUIDELINES DESIGNINFO DISCARDABLE BEGIN IDD_MAIN_DLG, DIALOG BEGIN LEFTMARGIN, 7 RIGHTMARGIN, 227 TOPMARGIN, 7 BOTTOMMARGIN, 168 END END #endif // APSTUDIO_INVOKED #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE: winiax.h --- #include "gsm\inc\gsm.h" #include "stdio.h" #include "process.h" //#include "sox.h" HWND m_hwndMainDlg; UINT_PTR m_iTimerId; HBRUSH hBr; int TMessageBox(char *szMsg,int btn=MB_OK); BOOL OnInitDialog(); BOOL OnSysCommand(UINT uCmd); INT_PTR DialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); void OnBnDial(); void OnBnHangup(); void status_callback(char *msg); int levels_callback(float input, float output); void SendDTMF(char num); BOOL OnTimer(UINT nIDEvent); VOID CALLBACK TimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime); |
From: <st...@us...> - 2003-06-13 22:26:55
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv3838/WinIAX Log Message: Directory /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX added to the repository |
From: <st...@us...> - 2003-06-13 22:20:52
|
Update of /cvsroot/iaxclient/iaxclient/lib/sox In directory sc8-pr-cvs1:/tmp/cvs-serv2800/sox Modified Files: sox.h Log Message: add declarations for functions. Index: sox.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/sox/sox.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sox.h 4 Jun 2003 19:26:39 -0000 1.1 +++ sox.h 13 Jun 2003 22:20:49 -0000 1.2 @@ -137,3 +137,11 @@ int st_resample_stop(resample_t *rH); +int st_compand_getopts(compand_t l, int n, char **argv); +int st_compand_start(compand_t *lH, char **opts, int nopts); +int st_compand_flow(compand_t l, st_sample_t *ibuf, st_sample_t *obuf, + st_size_t *isamp, st_size_t *osamp); +int st_compand_drain(compand_t l, st_sample_t *obuf, st_size_t *osamp); +int st_compand_stop(compand_t l); + + |
From: <st...@us...> - 2003-06-13 18:57:27
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv557 Modified Files: iaxclient.h iaxclient_lib.c iaxclient_lib.h Log Message: remove last vestiges of FILE *f from library. (some commented out thoughts about event callbacks in iaxclient.h) Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- iaxclient.h 10 Jun 2003 23:19:45 -0000 1.10 +++ iaxclient.h 13 Jun 2003 18:57:24 -0000 1.11 @@ -42,7 +42,36 @@ #define IAXC_FORMAT_H263 (1 << 19) /* H.263 Video */ +#if 0 +/* not yet implemented */ + +#define IAXC_EVENT_BUFSIZ 256 +struct iaxc_ev_levels { + float input; + float output; +}; +struct iaxc_ev_text { + char message[IAXC_EVENT_BUFSIZ]; +}; + +struct iaxc_ev_call { + char callerid[IAXC_EVENT_BUFSIZ]; +} + +typedef struct iaxc_event_struct { + int type; + union { + struct iaxc_ev_levels levels; + struct iaxc_ev_text text; + struct iaxc_ev_call call; + } event; + struct iaxc_event_struct *next; +} iaxc_event; + +typedef int (*iaxc_event_callback_t)(iaxc_event e); +void iaxc_set_event_callback(iaxc_message_callback_t func); +#endif int iaxc_initialize(int audType); void iaxc_shutdown(); Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- iaxclient_lib.c 12 Jun 2003 15:27:11 -0000 1.17 +++ iaxclient_lib.c 13 Jun 2003 18:57:24 -0000 1.18 @@ -14,8 +14,6 @@ int port; int c, i; char rcmd[RBUFSIZE]; -FILE *f; -gsm_frame fo; int iaxc_audio_output_mode = 0; // Normal static int answered_call; @@ -27,7 +25,7 @@ struct timeval lastouttm; static struct peer * find_peer(struct iax_session *session); -static void do_iax_event(FILE *f); +static void do_iax_event(); static THREAD procThread; static THREADID procThreadID; @@ -161,7 +159,7 @@ win_prepare_audio_buffers(); } #endif - iaxc_service_network(netfd,f); + iaxc_service_network(netfd); service_audio(); } @@ -200,7 +198,7 @@ void start_call_processing() { if (!answered_call) { while(1) { - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); if (answered_call) break; } @@ -219,20 +217,20 @@ { switch (iAudioType) { case AUDIO_INTERNAL: - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); #ifdef WIN32 win_process_audio_buffers(&lastouttm, most_recent_answer, iEncodeType); #endif - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); break; case AUDIO_INTERNAL_PA: - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); pa_send_audio(&lastouttm, most_recent_answer, iEncodeType); break; default: - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); iaxc_external_service_audio(); - iaxc_service_network(netfd, f); + iaxc_service_network(netfd); break; } } else { @@ -243,7 +241,7 @@ } -void handle_audio_event(FILE *f, struct iax_event *e, struct peer *p) { +void handle_audio_event(struct iax_event *e, struct peer *p) { int total_consumed = 0; int cur; short fr[160]; @@ -285,7 +283,7 @@ } } -void iaxc_handle_network_event(FILE *f, struct iax_event *e, struct peer *p) +void iaxc_handle_network_event(struct iax_event *e, struct peer *p) { // int len,n; // WHOUT *wh,*wh1; @@ -319,7 +317,7 @@ iaxc_answer_call(); break; case IAX_EVENT_VOICE: - handle_audio_event(f, e, p); + handle_audio_event(e, p); break; // default : //fprintf(f, "Don't know how to handle that format %d\n", e->event.voice.format); @@ -413,7 +411,7 @@ } /* handle all network requests, and a pending scheduled event, if any */ -void iaxc_service_network(int netfd, FILE *f) +void iaxc_service_network(int netfd) { fd_set readfd; struct timeval dumbtimer; @@ -431,15 +429,15 @@ { if (FD_ISSET(netfd,&readfd)) { - do_iax_event(f); + do_iax_event(); (void) iax_time_to_next_event(); } else break; } else break; } - do_iax_event(f); /* do pending event if any */ + do_iax_event(); /* do pending event if any */ } -static void do_iax_event(FILE *f) { +static void do_iax_event() { int sessions = 0; struct iax_event *e = 0; struct peer *peer; @@ -447,7 +445,7 @@ while ( (e = iax_get_event(0))) { peer = find_peer(e->session); if(peer) { - iaxc_handle_network_event(f, e, peer); + iaxc_handle_network_event(e, peer); iax_event_free(e); } else { if(e->etype != IAX_EVENT_CONNECT) { @@ -507,7 +505,7 @@ return answered_call; } -void iaxc_external_audio_event(FILE *f, struct iax_event *e, struct peer *p) +void iaxc_external_audio_event(struct iax_event *e, struct peer *p) { // To be coded in the future return; Index: iaxclient_lib.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- iaxclient_lib.h 10 Jun 2003 13:15:54 -0000 1.14 +++ iaxclient_lib.h 13 Jun 2003 18:57:24 -0000 1.15 @@ -78,8 +78,8 @@ }; long iaxc_usecdiff( struct timeval *timeA, struct timeval *timeB ); -void iaxc_handle_network_event(FILE *f, struct iax_event *e, struct peer *p); -void iaxc_service_network(int netfd, FILE *f); +void iaxc_handle_network_event(struct iax_event *e, struct peer *p); +void iaxc_service_network(int netfd); |
From: <st...@us...> - 2003-06-13 16:12:50
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv20537 Added Files: README Log Message: initial README file for wx client developers. --- NEW FILE: README --- ============================================================= Building In order to build the wxWindows GUI client, you must have the wxwindows library had header files installed on your system. You can get wxWindows from www.wxwindows.org The makefiles are set up to build binaries with wxwindows (and libiaxclient) statically linked. This will make it such that users of the binaries will not need wxwindows (or any iacxclient libraries) installed in order to run the application. For Linux and MacOSX, you should have "wx-config" installed somewhere in your PATH when you build. The default "configure" install of wxwindows will do this for you. You might need to build wxwindows with "--disable-shared" in order to compile the static libraries. For Win32, when compiling with cygwin/mingw, you'll need to have wxwindows compiled to static libraries, and the "WXWIN" environment variable set to the location of your wxwindows installation. ============================================================= Contributions sought: The contribution of Step-by-step build directions, especially for Win32 developers, is encouraged, and will be included here in this README. If you can write such directions, please send them to the iax...@li... mailing list, and we can include them here for the benefit of others. Also, if someone would like to contribute MSVC "project files" (i.e. a .dsp/.dsw file set), and directions for those building with MSVC, those would also be helpful for people afraid of the command-line. ============================================================= |
From: <st...@us...> - 2003-06-13 15:49:36
|
Update of /cvsroot/iaxclient/iaxclient In directory sc8-pr-cvs1:/tmp/cvs-serv9165 Added Files: README Log Message: moved and updated README file --- NEW FILE: README --- ======================================================================= INTRODUCTION This is iaxclient, a portable IAX/IAX2 protocol telephony client library. The library itself is in the directory "lib", located in the same directory as this README file. The library is designed to build for multiple platforms, and currently supports Linux, MacOSX, and Win32 platforms. It is designed to handle the "backend" of IAX telephony operations, including call handling, network protocols, audio encoding/decoding, and audio capture/playback. In it's future, it may be extended to also handle video encode, decode, capture and playback. There are also sample clients, which use the library, included here. Currently, these are all stored under the "simpleclient" directory, and there are two of them: simpleclient/testcall: A simple command-line oriented test program, useful for testing and debugging. It supports all of the same platforms as the library itself. simpleclient/wx: A wxWindows (see wxwindows.org) based GUI client. This client also supports all of the same platforms as the library itself. The home page for iaxclient is "http://iaxclient.sourceforge.net/" Up-to-date versions of iaxclient are available from a sourceforge CVS repository. ======================================================================= LICENSES The iaxclient library itself, is provided under the terms of the LGPL: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The iaxclient library may also include, when compiled, works distributed under other licenses. See those directories and source files for specifics. These include: libiax: (c) 2001 Mark Spencer under the LGPL. libiax2: (c) 2001 Mark Spencer under the LGPL. gsm encoder: Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, Technische Universitaet Berlin (free license, terms in gsm/copyright) portaudio: Copyright (c) 1999-2000 Ross Bencina and Phil Burk Modified BSD style license, in portaudio/LICENSE.txt sox tools: compand.c: Copyright 1999 Chris Bagwell And Nick Bailey resample.c: (not currently used) Copyright 1991 Lance Norskog And Sundry Contributors, free licenses in source files. ======================================================================= CONTRIBUTORS: IAXCLIENT itself was contributed to by: Steve Kann <st...@st...> Shawn Lawrence <sha...@te...> In addition to including libiax, IAXCLIENT is also based in part on code included in test clients within libiax itself. The included sub-libraries, including libiax, libiax2, gsm, portaudio, and the sox-derived filters, were developed by others, as noted in above and in their sources. We couldn't have built IAXCLIENT (or, it would have been much more difficult!) without the great work from these projects. ======================================================================= BUILDING THE LIBRARY: Linux: type "make" using standard gnu make/gcc MacOSX: type "make" using Apple Dev Tools (gnu make/gcc) Win32: type "make" using Cygwin/MinGW (see below) Cygwin/MinGW: The Win32 build has been tested using the Cygwin Environment, and the MinGW port of the GCC compiler suite. See http://www.mingw.org/mingwfaq.shtml#faq-usingwithcygwin for the MinGW FAQ entry on using MinGW with Cygwin. You do need to make sure that you install the Gnu "make" utility when you install cygwin. It should probably also work if you use the MSYS environment and the MinGW compiler, but this configuration is not as well tested. ======================================================================= LIBRARY ORGANIZATION/DESIGN/CODING CONVENTION NOTES The iaxclient library is designed to be a small, simple library that encapsulates all that you need in order to make IAX protocol telephony programs. All exported symbols should be prefixed with "iaxc_", to avoid namespace collisions/pollution in programs using this library. The header file "iaxclient.h" should contain those declarations needed by client programs, but not rely on other headers (i.e. those from included libraries). The "iaxclient-lib.h" header file is the main header file for the library's internal declarations. ======================================================================= SAMPLE CLIENTS The "testcall" sample program, provided in the simpleclient/testcall directory (above this "lib" directory) is a simple client program which should also be portable. The Makefile for "testcall" will automatically build or update the library when it it built, and the requirements for building testcall are the same as for the library itself. See README files in the other sample clients for directions for building these. |
From: <st...@us...> - 2003-06-13 15:49:35
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9165/lib Removed Files: README Log Message: moved and updated README file --- README DELETED --- |
From: <st...@us...> - 2003-06-12 22:47:04
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv22630 Modified Files: wx.cc Log Message: try doing GUILock for callbacks.. but, only if we're not the main thread.. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- wx.cc 12 Jun 2003 20:41:17 -0000 1.26 +++ wx.cc 12 Jun 2003 22:47:01 -0000 1.27 @@ -22,6 +22,8 @@ #define LEVEL_MIN -50 #define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" +#define TRY_GUILOCK + class IAXClient : public wxApp { public: @@ -119,10 +121,12 @@ bool pttState; // is the PTT button pressed? bool silenceMode; // are we in silence suppression mode? +#ifndef TRY_GUILOCK // values set by callbacks int inputLevel; int outputLevel; wxString statusString; +#endif protected: DECLARE_EVENT_TABLE() @@ -136,12 +140,11 @@ void IAXFrame::OnNotify() { +#ifndef TRY_GUILOCK static wxString lastStatus; static int lastInputLevel = 0; static int lastOutputLevel = 0; - if(pttMode) CheckPTT(); - if(statusString != lastStatus) { SetStatusText(statusString); lastStatus = statusString; @@ -156,6 +159,9 @@ output->SetValue(outputLevel); lastOutputLevel = outputLevel; } +#endif + + if(pttMode) CheckPTT(); } void IAXTimer::Notify() @@ -174,9 +180,11 @@ wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *row3sizer = new wxBoxSizer(wxHORIZONTAL); pttMode = false; +#ifndef TRY_GUILOCK inputLevel = 0; outputLevel = 0; statusString = _T("Welcome to IAXClient"); +#endif @@ -409,8 +417,11 @@ IAXFrame::~IAXFrame() { #ifdef __WXGTK__ +#if 0 + // apparently, I'm not supposed to destroy this, cause it's a "root" window gdk_window_destroy(keyStateWindow); #endif +#endif iaxc_stop_processing_thread(); iaxc_shutdown(); } @@ -428,11 +439,11 @@ { if(p.Found(_T("d"))) { optNoDialPad = true; - fprintf(stderr, "-d option found\n"); + //fprintf(stderr, "-d option found\n"); } if(p.GetParamCount() >= 1) { optDestination=p.GetParam(0); - fprintf(stderr, "dest is %s\n", optDestination.c_str()); + //fprintf(stderr, "dest is %s\n", optDestination.c_str()); } return true; @@ -487,22 +498,57 @@ */ void status_callback(char *msg) { +#ifdef TRY_GUILOCK + static wxString lastStatus; + if(lastStatus == msg) return; + + if (!wxThread::IsMain()) wxMutexGuiEnter(); + theFrame->SetStatusText(msg); + lastStatus = msg; + if (!wxThread::IsMain()) wxMutexGuiLeave(); +#else theFrame->statusString = wxString(msg); +#endif + } int levels_callback(float input, float output) { + int inputLevel, outputLevel; if (input < LEVEL_MIN) input = LEVEL_MIN; else if (input > LEVEL_MAX) input = LEVEL_MAX; - theFrame->inputLevel = (int)input - (LEVEL_MIN); + inputLevel = (int)input - (LEVEL_MIN); if (output < LEVEL_MIN) output = LEVEL_MIN; else if (input > LEVEL_MAX) output = LEVEL_MAX; + outputLevel = (int)output - (LEVEL_MIN); + +#ifdef TRY_GUILOCK + static int lastInputLevel = 0; + static int lastOutputLevel = 0; + + if (!wxThread::IsMain()) wxMutexGuiEnter(); + + if(lastInputLevel != inputLevel) { + theFrame->input->SetValue(inputLevel); + lastInputLevel = inputLevel; + } + + if(lastOutputLevel != outputLevel) { + theFrame->output->SetValue(outputLevel); + lastOutputLevel = outputLevel; + } + + if (!wxThread::IsMain()) wxMutexGuiLeave(); +#else + theFrame->inputLevel = (int)input - (LEVEL_MIN); theFrame->outputLevel = (int)output - (LEVEL_MIN); +#endif + return 0; } } |
From: <st...@us...> - 2003-06-12 20:41:21
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv690 Modified Files: wx.cc Log Message: Add 2 command-line options: 1) optional destination: This dest will be called at startup, if specified. 2) disable-dialpad: removed dialpad, and makes level meters go horizontally. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- wx.cc 12 Jun 2003 19:57:12 -0000 1.25 +++ wx.cc 12 Jun 2003 20:41:17 -0000 1.26 @@ -28,6 +28,9 @@ virtual bool OnInit(); virtual bool OnCmdLineParsed(wxCmdLineParser& p); virtual void OnInitCmdLine(wxCmdLineParser& p); + + bool optNoDialPad; + wxString optDestination; }; DECLARE_APP(IAXClient) @@ -169,12 +172,11 @@ wxButton *dialButton; wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL); - wxBoxSizer *row1sizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *row3sizer = new wxBoxSizer(wxHORIZONTAL); pttMode = false; inputLevel = 0; outputLevel = 0; - statusString = wxString("Welcome to IAXClient"); + statusString = _T("Welcome to IAXClient"); @@ -206,36 +208,48 @@ SetMenuBar(menuBar); - - /* DialPad Buttons */ - wxGridSizer *dialpadsizer = new wxGridSizer(3); - for(int i=0; i<12;i++) - { - dialpadsizer->Add( - new wxButton(aPanel, i, wxString(buttonlabels[i]), - wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), - 1, wxEXPAND|wxALL, 3); - } - row1sizer->Add(dialpadsizer,1, wxEXPAND); + wxBoxSizer *row1sizer; + if(wxGetApp().optNoDialPad) { + row1sizer = new wxBoxSizer(wxVERTICAL); - /* volume meters */ - row1sizer->Add(input = new wxGauge(aPanel, -1, LEVEL_MAX-LEVEL_MIN, wxDefaultPosition, wxSize(15,50), - wxGA_VERTICAL, wxDefaultValidator, wxString("input level")),0,wxEXPAND); + /* volume meters */ + row1sizer->Add(input = new wxGauge(aPanel, -1, LEVEL_MAX-LEVEL_MIN, wxDefaultPosition, wxSize(15,15), + wxGA_HORIZONTAL, wxDefaultValidator, _T("input level")),1, wxEXPAND); - row1sizer->Add(output = new wxGauge(aPanel, -1, LEVEL_MAX-LEVEL_MIN, wxDefaultPosition, wxSize(15,50), - wxGA_VERTICAL, wxDefaultValidator, wxString("output level")),0, wxEXPAND); + row1sizer->Add(output = new wxGauge(aPanel, -1, LEVEL_MAX-LEVEL_MIN, wxDefaultPosition, wxSize(15,15), + wxGA_HORIZONTAL, wxDefaultValidator, _T("output level")),1, wxEXPAND); + } else { + row1sizer = new wxBoxSizer(wxHORIZONTAL); + /* DialPad Buttons */ + wxGridSizer *dialpadsizer = new wxGridSizer(3); + for(int i=0; i<12;i++) + { + dialpadsizer->Add( + new wxButton(aPanel, i, wxString(buttonlabels[i]), + wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT), + 1, wxEXPAND|wxALL, 3); + } + row1sizer->Add(dialpadsizer,1, wxEXPAND); + + /* volume meters */ + row1sizer->Add(input = new wxGauge(aPanel, -1, LEVEL_MAX-LEVEL_MIN, wxDefaultPosition, wxSize(15,50), + wxGA_VERTICAL, wxDefaultValidator, _T("input level")),0, wxEXPAND); + + row1sizer->Add(output = new wxGauge(aPanel, -1, LEVEL_MAX-LEVEL_MIN, wxDefaultPosition, wxSize(15,50), + wxGA_VERTICAL, wxDefaultValidator, _T("output level")),0, wxEXPAND); + } topsizer->Add(row1sizer,1,wxEXPAND); /* Destination */ - topsizer->Add(iaxDest = new wxTextCtrl(aPanel, -1, wxString("guest@ast1/8068"), + topsizer->Add(iaxDest = new wxTextCtrl(aPanel, -1, _T("guest@ast1/8068"), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); /* main control buttons */ - row3sizer->Add(dialButton = new wxButton(aPanel, ID_DIAL, wxString("Dial"), + row3sizer->Add(dialButton = new wxButton(aPanel, ID_DIAL, _T("Dial"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT),1, wxEXPAND|wxALL, 3); - row3sizer->Add(new wxButton(aPanel, ID_HANG, wxString("Hang Up"), + row3sizer->Add(new wxButton(aPanel, ID_HANG, _T("Hang Up"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT),1, wxEXPAND|wxALL, 3); /* make dial the default button */ @@ -406,18 +420,28 @@ { // declare our CmdLine options and stuff. p.AddSwitch(_T("d"),_T("disable-dialpad"),_T("Disable Dial Pad")); + p.AddParam(_T("destination"),wxCMD_LINE_VAL_STRING,wxCMD_LINE_PARAM_OPTIONAL); + } bool IAXClient::OnCmdLineParsed(wxCmdLineParser& p) { - if(p.Found(_T("d"))) - fprintf(stderr, "found -d switch\n"); + if(p.Found(_T("d"))) { + optNoDialPad = true; + fprintf(stderr, "-d option found\n"); + } + if(p.GetParamCount() >= 1) { + optDestination=p.GetParam(0); + fprintf(stderr, "dest is %s\n", optDestination.c_str()); + } return true; } bool IAXClient::OnInit() { + optNoDialPad = false; + if(!wxApp::OnInit()) return false; @@ -430,13 +454,16 @@ iaxc_initialize(AUDIO_INTERNAL_PA); iaxc_set_encode_format(IAXC_FORMAT_GSM); - iaxc_set_silence_threshold(0); + iaxc_set_silence_threshold(-99); iaxc_set_levels_callback(levels_callback); iaxc_set_error_callback(status_callback); iaxc_set_status_callback(status_callback); iaxc_start_processing_thread(); + if(!optDestination.IsEmpty()) + iaxc_call((char *)optDestination.c_str()); + return true; } |
From: <st...@us...> - 2003-06-12 19:57:17
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv4757 Modified Files: Makefile wx.cc Removed Files: testcall.c wx.h Log Message: interim commit: 1) remove testcall.c/wx.h. Maybe wx.h might reappear, but testcall.c was just a hacky copy of the cmdline app. wx.h had only about 5 useful lines.. 2) Add cmd-line parsing stuff to the app. Nothing useful yet, but the skeleton is there. Index: Makefile =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile 10 Jun 2003 13:20:53 -0000 1.12 +++ Makefile 12 Jun 2003 19:57:10 -0000 1.13 @@ -3,7 +3,7 @@ #debug CFLAGS:= $(CFLAGS) -g -OBJS= wx.o testcall.o +OBJS= wx.o REZ=echo Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- wx.cc 11 Jun 2003 16:54:49 -0000 1.24 +++ wx.cc 12 Jun 2003 19:57:12 -0000 1.25 @@ -5,8 +5,7 @@ #include "wx/wx.h" #endif -#include "wx.h" - +#include "wx/cmdline.h" #include "iaxclient.h" @@ -23,8 +22,27 @@ #define LEVEL_MIN -50 #define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" +class IAXClient : public wxApp +{ + public: + virtual bool OnInit(); + virtual bool OnCmdLineParsed(wxCmdLineParser& p); + virtual void OnInitCmdLine(wxCmdLineParser& p); +}; + +DECLARE_APP(IAXClient) + IMPLEMENT_APP(IAXClient) +// forward decls for callbacks +extern "C" { + void status_callback(char *msg); + int levels_callback(float input, float output); + int doTestCall(int ac, char **av); +} + + + // event constants enum { @@ -380,21 +398,47 @@ gdk_window_destroy(keyStateWindow); #endif iaxc_stop_processing_thread(); + iaxc_shutdown(); +} + + +void IAXClient::OnInitCmdLine(wxCmdLineParser& p) +{ + // declare our CmdLine options and stuff. + p.AddSwitch(_T("d"),_T("disable-dialpad"),_T("Disable Dial Pad")); +} + +bool IAXClient::OnCmdLineParsed(wxCmdLineParser& p) +{ + if(p.Found(_T("d"))) + fprintf(stderr, "found -d switch\n"); + + return true; } bool IAXClient::OnInit() { + if(!wxApp::OnInit()) + return false; + theFrame = new IAXFrame("IAXTest", 0,0,130,220); + theFrame->Show(TRUE); SetTopWindow(theFrame); - doTestCall(0,NULL); + iaxc_initialize(AUDIO_INTERNAL_PA); + + iaxc_set_encode_format(IAXC_FORMAT_GSM); + iaxc_set_silence_threshold(0); + iaxc_set_levels_callback(levels_callback); iaxc_set_error_callback(status_callback); iaxc_set_status_callback(status_callback); - return true; + iaxc_start_processing_thread(); + + return true; } --- testcall.c DELETED --- --- wx.h DELETED --- |
From: <st...@us...> - 2003-06-12 19:03:35
|
Update of /cvsroot/iaxclient/iaxclient/lib/libiax2/src In directory sc8-pr-cvs1:/tmp/cvs-serv14077 Modified Files: iax.c Log Message: This one explains why all my IAX2 calls went to the "s" extension, regardless of what I asked for.. Index: iax.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/libiax2/src/iax.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- iax.c 12 Jun 2003 14:54:33 -0000 1.5 +++ iax.c 12 Jun 2003 19:03:31 -0000 1.6 @@ -1583,6 +1583,8 @@ } if (username) iax_ie_append_str(&ied, IAX_IE_USERNAME, username); + if (exten && strlen(exten)) + iax_ie_append_str(&ied, IAX_IE_CALLED_NUMBER, exten); if (dnid && strlen(dnid)) iax_ie_append_str(&ied, IAX_IE_DNID, dnid); if (context && strlen(context)) |
From: <st...@us...> - 2003-06-12 15:27:14
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv11381/lib Modified Files: iaxclient_lib.c Log Message: we don't need iax_call to "wait" for the call to be established, and it's not implemented anyway, so shut up libiax2 by not asking for it. Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- iaxclient_lib.c 11 Jun 2003 23:09:00 -0000 1.16 +++ iaxclient_lib.c 12 Jun 2003 15:27:11 -0000 1.17 @@ -360,7 +360,7 @@ most_recent_answer = peer; #ifdef IAXC_IAX2 - iax_call(peer->session, "7001234567", "IAXClient User", num, NULL, 10); + iax_call(peer->session, "7001234567", "IAXClient User", num, NULL, 0); #else iax_call(peer->session, "7001234567", num, NULL, 10); #endif |
From: <st...@us...> - 2003-06-12 14:54:37
|
Update of /cvsroot/iaxclient/iaxclient/lib/libiax2/src In directory sc8-pr-cvs1:/tmp/cvs-serv20484 Modified Files: iax.c Log Message: fix for memory overwriting bug on PPC due to opposite stack direction. Index: iax.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/libiax2/src/iax.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- iax.c 11 Jun 2003 20:13:35 -0000 1.4 +++ iax.c 12 Jun 2003 14:54:33 -0000 1.5 @@ -613,8 +613,7 @@ or delayed, with retransmission */ struct ast_iax2_full_hdr *fh; struct ast_iax2_mini_hdr *mh; - unsigned char buffer[4096]; /* Buffer -- must preceed fr2 */ - struct iax_frame fr2; + double buffer[4096]; /* Buffer -- we use this for a frame later, double might ensure proper alignment? */ struct iax_frame *fr; int res; int sendmini=0; @@ -646,7 +645,7 @@ } /* Allocate an iax_frame */ if (now) { - fr = &fr2; + fr = (struct iax_frame *)&buffer; } else fr = iax_frame_new(DIRECTION_OUTGRESS, f->datalen); if (!fr) { |
From: <st...@us...> - 2003-06-11 23:09:03
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5672 Modified Files: audio_encode.c iaxclient_lib.c Log Message: some IAX2 changes. a relatively trivial change to audio_encode (fixed 40ms worth of noise at the beginning of a call, but most importantly, it makes valgrind happy). Index: audio_encode.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_encode.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- audio_encode.c 11 Jun 2003 16:39:01 -0000 1.6 +++ audio_encode.c 11 Jun 2003 23:09:00 -0000 1.7 @@ -42,7 +42,7 @@ static int input_postprocess(void *audio, int len, void *out) { - int l = len; + unsigned long ilen,olen; double volume; static double lowest_volume = 1; @@ -57,7 +57,15 @@ st_compand_start(&input_compand, argv, 5); } - st_compand_flow(input_compand, audio, out, &l, &l); + + ilen=olen=len; + st_compand_flow(input_compand, audio, out, &ilen, &olen); + + /* until the compander fills it's buffer, it might not put out full + * buffers worth of data. So, clear it unless it's all valid + * (also, this helps shut up valgrind :) */ + if(olen != len) + memset(out,0,len*2); do_level_callback(); Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- iaxclient_lib.c 11 Jun 2003 20:15:54 -0000 1.15 +++ iaxclient_lib.c 11 Jun 2003 23:09:00 -0000 1.16 @@ -295,7 +295,10 @@ switch(e->etype) { case IAX_EVENT_HANGUP: +#ifndef IAXC_IAX2 /* IAX2 barfs from this. Should we do this or not? */ + iax_hangup(most_recent_answer->session, "Byeee!"); +#endif iaxc_usermsg(IAXC_STATUS, "Call disconnected by remote"); free(most_recent_answer); most_recent_answer = 0; |
From: <st...@us...> - 2003-06-11 20:46:45
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv7311 Modified Files: winfuncs.c Log Message: initialize WinSock silliness on Win32, for IAX2 version. Index: winfuncs.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/winfuncs.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- winfuncs.c 6 Jun 2003 22:17:22 -0000 1.4 +++ winfuncs.c 11 Jun 2003 20:46:41 -0000 1.5 @@ -21,9 +21,19 @@ void os_init(void) { time_t t; +#ifdef IAXC_IAX2 + WSADATA wsd; + + if(WSAStartup(0x0101,&wsd)) + { // Error message? + exit(1); + } +#endif + time(&t); startuptime = ((t % 86400) * 1000) - GetTickCount(); } + /* yes, it could have just been a #define, but that makes linking trickier */ void iaxc_millisleep(long ms) |
From: <st...@us...> - 2003-06-11 20:15:59
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv25786 Modified Files: iaxclient_lib.c Log Message: remove hack now that there's a proper bugfix in our libiax2. Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- iaxclient_lib.c 10 Jun 2003 13:15:54 -0000 1.14 +++ iaxclient_lib.c 11 Jun 2003 20:15:54 -0000 1.15 @@ -215,11 +215,7 @@ { /* do audio input stuff for buffers that have received data from audio in device already. Must do them in serial number order (the order in which they were originally queued). */ -#ifdef IAXC_IAX2 - if(1) /* HACK ALERT! calls don't get into answered state with IAX2 FIX ME FAST */ -#else if(answered_call) /* send audio only if call answered */ -#endif { switch (iAudioType) { case AUDIO_INTERNAL: |
From: <st...@us...> - 2003-06-11 20:13:40
|
Update of /cvsroot/iaxclient/iaxclient/lib/libiax2/src In directory sc8-pr-cvs1:/tmp/cvs-serv24940 Modified Files: iax.c Log Message: fix bug #1 in IAX2 support. Index: iax.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/libiax2/src/iax.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- iax.c 6 Jun 2003 19:59:45 -0000 1.3 +++ iax.c 11 Jun 2003 20:13:35 -0000 1.4 @@ -2279,7 +2279,7 @@ struct ast_iax2_mini_hdr *mh = (struct ast_iax2_mini_hdr *)buf; struct iax_session *session; - buf[len - 1] = '\0'; + /* THIS IS BAD: buf[len - 1] = '\0'; */ if (ntohs(fh->scallno) & IAX_FLAG_FULL) { /* Full size header */ if (len < sizeof(struct ast_iax2_full_hdr)) { |
From: <st...@us...> - 2003-06-11 16:54:54
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv29319 Modified Files: wx.cc Log Message: Add separate "silence suppression" menu check-item. Make silence suppression and PTT work together. Get actual check state from event, instead of just toggling. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- wx.cc 11 Jun 2003 16:39:03 -0000 1.23 +++ wx.cc 11 Jun 2003 16:54:49 -0000 1.24 @@ -48,7 +48,7 @@ ID_PTT = 300, ID_MUTE, - ID_SUPPRESS, + ID_SILENCE, CALLBACK_STATUS = 1000, CALLBACK_LEVELS, @@ -80,7 +80,8 @@ void IAXFrame::OnDial(wxEvent &evt); void IAXFrame::OnHangup(wxEvent &evt); void IAXFrame::OnQuit(wxEvent &evt); - void IAXFrame::OnPTTChange(wxEvent &evt); + void IAXFrame::OnPTTChange(wxCommandEvent &evt); + void IAXFrame::OnSilenceChange(wxCommandEvent &evt); void IAXFrame::OnNotify(void); bool IAXFrame::GetPTTState(); @@ -95,6 +96,7 @@ bool pttMode; // are we in PTT mode? bool pttState; // is the PTT button pressed? + bool silenceMode; // are we in silence suppression mode? // values set by callbacks int inputLevel; @@ -174,6 +176,7 @@ wxMenu *optionsMenu = new wxMenu(); optionsMenu->AppendCheckItem(ID_PTT, _T("Enable &Push to Talk\tCtrl-P")); + optionsMenu->AppendCheckItem(ID_SILENCE, _T("Enable &Silence Suppression\tCtrl-S")); wxMenuBar *menuBar = new wxMenuBar(); @@ -317,21 +320,37 @@ exit(0); } -void IAXFrame::OnPTTChange(wxEvent &evt) +void IAXFrame::OnPTTChange(wxCommandEvent &evt) { - // XXX get the actual state! - pttMode = !pttMode; + pttMode = evt.IsChecked(); if(pttMode) { SetPTT(GetPTTState()); } else { SetPTT(true); - iaxc_set_silence_threshold(DEFAULT_SILENCE_THRESHOLD); + if(silenceMode) { + iaxc_set_silence_threshold(DEFAULT_SILENCE_THRESHOLD); + } else { + iaxc_set_silence_threshold(-99); + } iaxc_set_audio_output(0); // unmute output muteState->SetLabel("PTT Disabled"); } } +void IAXFrame::OnSilenceChange(wxCommandEvent &evt) +{ + // XXX get the actual state! + silenceMode = evt.IsChecked(); + + if(pttMode) return; + + if(silenceMode) { + iaxc_set_silence_threshold(DEFAULT_SILENCE_THRESHOLD); + } else { + iaxc_set_silence_threshold(-99); + } +} BEGIN_EVENT_TABLE(IAXFrame, wxFrame) EVT_BUTTON(0,IAXFrame::OnDTMF) @@ -351,8 +370,7 @@ EVT_MENU(ID_QUIT,IAXFrame::OnQuit) EVT_MENU(ID_PTT,IAXFrame::OnPTTChange) - - EVT_MENU(ID_PTT,IAXFrame::OnPTTChange) + EVT_MENU(ID_SILENCE,IAXFrame::OnSilenceChange) END_EVENT_TABLE() |
From: <st...@us...> - 2003-06-11 16:39:08
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv20560/simpleclient/wx Modified Files: wx.cc Log Message: change transfer function a bit for companding. Build an "auto" silence detection mode: This just looks for any audio that is 5dB above the lowest level seen to be considered "non-silent". Also, have companding and silence compression keep a 40ms "delay", so companding and silence detection are predictive, instead of reactive. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- wx.cc 10 Jun 2003 23:19:45 -0000 1.22 +++ wx.cc 11 Jun 2003 16:39:03 -0000 1.23 @@ -21,7 +21,7 @@ #define LEVEL_MAX -10 #define LEVEL_MIN -50 -#define DEFAULT_SILENCE_THRESHOLD -40 +#define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" IMPLEMENT_APP(IAXClient) |
From: <st...@us...> - 2003-06-11 16:39:07
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20560/lib Modified Files: audio_encode.c Log Message: change transfer function a bit for companding. Build an "auto" silence detection mode: This just looks for any audio that is 5dB above the lowest level seen to be considered "non-silent". Also, have companding and silence compression keep a 40ms "delay", so companding and silence detection are predictive, instead of reactive. Index: audio_encode.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_encode.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- audio_encode.c 4 Jun 2003 19:26:38 -0000 1.5 +++ audio_encode.c 11 Jun 2003 16:39:01 -0000 1.6 @@ -40,22 +40,35 @@ iaxc_levels_callback(vol_to_db(ilevel), vol_to_db(olevel)); } -static int input_postprocess(void *audio, int len) +static int input_postprocess(void *audio, int len, void *out) { int l = len; + double volume; + static double lowest_volume = 1; if(!input_compand) { - char *argv[2]; - argv[0] = strdup("0.1,0.3"); /* attack, decay */ - argv[1] = strdup("-90,-90,-60,-60,-50,-15,0,-5"); /* transfer function */ - st_compand_start(&input_compand, argv, 2); + char *argv[5]; + argv[0] = strdup("0.04,0.3"); /* attack, decay */ + argv[1] = strdup("-90,-90,-50,-60,-30,-10,0,-5"); /* transfer function */ + argv[2] = strdup("0"); /* gain */ + argv[3] = strdup("0"); /* init volume */ + argv[4] = strdup("0.04"); /* delay */ + + st_compand_start(&input_compand, argv, 5); } - st_compand_flow(input_compand, audio, audio, &l, &l); + st_compand_flow(input_compand, audio, out, &l, &l); do_level_callback(); - return vol_to_db(*input_compand->volume) < iaxc_silence_threshold; + volume = vol_to_db(*input_compand->volume); + + if(volume < lowest_volume) lowest_volume = volume; + + if(iaxc_silence_threshold > 0) + return volume < lowest_volume + 5; + else + return volume < iaxc_silence_threshold; } static int output_postprocess(void *audio, int len) @@ -64,7 +77,7 @@ if(!output_compand) { char *argv[2]; - argv[0] = strdup("0.1,0.3"); /* attack, decay */ + argv[0] = strdup("0.05,0.1"); /* attack, decay */ argv[1] = strdup("-90,-90,0,0"); /* transfer function */ st_compand_start(&output_compand, argv, 2); } @@ -80,9 +93,10 @@ { gsm_frame fo; int silent; + short processed[160]; /* currently always 20ms */ - silent = input_postprocess(data,160); + silent = input_postprocess(data,160, processed); if(silent) return; /* poof! no encoding! */ @@ -92,7 +106,7 @@ most_recent_answer->gsmout = gsm_create(); // encode the audio from the buffer into GSM format and send - gsm_encode(most_recent_answer->gsmout, (short *) ((char *) data), (void *)&fo); + gsm_encode(most_recent_answer->gsmout, (short *) ((char *) processed), (void *)&fo); break; } if(iax_send_voice(most_recent_answer->session,AST_FORMAT_GSM, |
From: <st...@us...> - 2003-06-10 23:53:07
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv12754 Removed Files: iaxclient_lib.plg Log Message: remove old log file. --- iaxclient_lib.plg DELETED --- |
From: <st...@us...> - 2003-06-10 23:19:50
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv28182/simpleclient/wx Modified Files: testcall.c wx.cc Log Message: lib/iaxclient.h: declare some more API functions wx: Use separate thread for library operations. (whew, ugly to implement) wx: fix PTT state when disabling PTT wx: clean up timer stuff a bit. Index: testcall.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/testcall.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- testcall.c 9 Jun 2003 21:01:14 -0000 1.4 +++ testcall.c 10 Jun 2003 23:19:45 -0000 1.5 @@ -103,6 +103,7 @@ if(do_levels) iaxc_set_levels_callback(levels_callback); + iaxc_start_processing_thread(); #if 0 Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- wx.cc 10 Jun 2003 21:06:19 -0000 1.21 +++ wx.cc 10 Jun 2003 23:19:45 -0000 1.22 @@ -50,11 +50,12 @@ ID_MUTE, ID_SUPPRESS, + CALLBACK_STATUS = 1000, + CALLBACK_LEVELS, + ID_MAX }; -static int inputLevel = 0; -static int outputLevel = 0; static char *buttonlabels[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#" }; @@ -80,6 +81,7 @@ void IAXFrame::OnHangup(wxEvent &evt); void IAXFrame::OnQuit(wxEvent &evt); void IAXFrame::OnPTTChange(wxEvent &evt); + void IAXFrame::OnNotify(void); bool IAXFrame::GetPTTState(); void IAXFrame::CheckPTT(); @@ -94,6 +96,11 @@ bool pttMode; // are we in PTT mode? bool pttState; // is the PTT button pressed? + // values set by callbacks + int inputLevel; + int outputLevel; + wxString statusString; + protected: DECLARE_EVENT_TABLE() @@ -104,13 +111,33 @@ static IAXFrame *theFrame; -void IAXTimer::Notify() +void IAXFrame::OnNotify() { + static wxString lastStatus; + static int lastInputLevel = 0; + static int lastOutputLevel = 0; - iaxc_process_calls(); - // really shouldn't do this so often.. - static int i=0; - if((i++%10==0) && theFrame->pttMode) theFrame->CheckPTT(); + if(pttMode) CheckPTT(); + + if(statusString != lastStatus) { + SetStatusText(statusString); + lastStatus = statusString; + } + + if(lastInputLevel != inputLevel) { + input->SetValue(inputLevel); + lastInputLevel = inputLevel; + } + + if(lastOutputLevel != outputLevel) { + output->SetValue(outputLevel); + lastOutputLevel = outputLevel; + } +} + +void IAXTimer::Notify() +{ + theFrame->OnNotify(); } @@ -125,13 +152,15 @@ wxBoxSizer *row1sizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *row3sizer = new wxBoxSizer(wxHORIZONTAL); pttMode = false; + inputLevel = 0; + outputLevel = 0; + statusString = wxString("Welcome to IAXClient"); /* add status bar first; otherwise, sizer doesn't take it into * account */ CreateStatusBar(); - SetStatusText("Welcome to IAXClient!"); /* Set up Menus */ @@ -215,7 +244,7 @@ #endif timer = new IAXTimer(); - timer->Start(10); + timer->Start(100); //output = new wxGauge(this, -1, 100); } @@ -281,11 +310,10 @@ void IAXFrame::OnQuit(wxEvent &evt) { iaxc_dump_call(); - iaxc_process_calls(); for(int i=0;i<10;i++) { iaxc_millisleep(100); - iaxc_process_calls(); } + iaxc_stop_processing_thread(); exit(0); } @@ -299,6 +327,7 @@ } else { SetPTT(true); iaxc_set_silence_threshold(DEFAULT_SILENCE_THRESHOLD); + iaxc_set_audio_output(0); // unmute output muteState->SetLabel("PTT Disabled"); } } @@ -323,6 +352,8 @@ EVT_MENU(ID_QUIT,IAXFrame::OnQuit) EVT_MENU(ID_PTT,IAXFrame::OnPTTChange) + EVT_MENU(ID_PTT,IAXFrame::OnPTTChange) + END_EVENT_TABLE() IAXFrame::~IAXFrame() @@ -330,6 +361,7 @@ #ifdef __WXGTK__ gdk_window_destroy(keyStateWindow); #endif + iaxc_stop_processing_thread(); } bool IAXClient::OnInit() @@ -350,26 +382,38 @@ extern "C" { + + /* yes, using member variables, and polling for changes + * isn't really a nice way to do callbacks. BUT, I've tried the + * "right" ways, unsuccessfully: + * + * 1) I've tried using wxGuiMutexEnter/Leave, but that deadlocks (and it should, I guess), + * because sometimes these _are_ called in response to GUI events (i.e. the status callback eventually + * gets called when you press hang up. + * + * 2) I've tried using events and ::wxPostEvent, but that also deadlocks (at least on GTK), + * because it calls wxWakeUpIdle, which calls wxGuiMutexEnter, which deadlocks also, for some reason. + * + * So, this isn't ideal, but it works, until I can figure out a better way + */ void status_callback(char *msg) { - theFrame->SetStatusText(msg); + theFrame->statusString = wxString(msg); } int levels_callback(float input, float output) { + if (input < LEVEL_MIN) input = LEVEL_MIN; else if (input > LEVEL_MAX) input = LEVEL_MAX; - inputLevel = (int)input - (LEVEL_MIN); + theFrame->inputLevel = (int)input - (LEVEL_MIN); if (output < LEVEL_MIN) output = LEVEL_MIN; else if (input > LEVEL_MAX) output = LEVEL_MAX; - outputLevel = (int)output - (LEVEL_MIN); - - theFrame->input->SetValue(inputLevel); - theFrame->output->SetValue(outputLevel); + theFrame->outputLevel = (int)output - (LEVEL_MIN); } } |
From: <st...@us...> - 2003-06-10 23:19:50
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv28182/lib Modified Files: iaxclient.h Log Message: lib/iaxclient.h: declare some more API functions wx: Use separate thread for library operations. (whew, ugly to implement) wx: fix PTT state when disabling PTT wx: clean up timer stuff a bit. Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- iaxclient.h 10 Jun 2003 13:15:53 -0000 1.9 +++ iaxclient.h 10 Jun 2003 23:19:45 -0000 1.10 @@ -49,6 +49,8 @@ void iaxc_set_encode_format(int fmt); void iaxc_process_calls(); int iaxc_service_audio(); +int iaxc_start_processing_thread(); +int iaxc_stop_processing_thread(); void iaxc_call(char *num); void iaxc_answer_call(void); void iaxc_dump_call(void); |