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-09-15 22:07:38
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/iaxcomm In directory sc8-pr-cvs1:/tmp/cvs-serv16306 Added Files: Makefile README app.h calls.cc calls.h dial.cc dial.h directory.cc directory.h frame.cc frame.h iaxcomm.exe.manifest iaxcomm.rc main.cc main.h prefs.cc prefs.h Log Message: iaxcomm: a wx-derived client, from Michael Van Donselaar --- NEW FILE: Makefile --- CFLAGS=-I../../lib -I../../lib/libiax/src -I../../lib/gsm/inc -I../../lib/portaudio/pa_common -I../../lib/portaudio/pablio -Iinclude -I$(WXWIN)/contrib/include #debug CFLAGS:= $(CFLAGS) -g OBJS = main.o prefs.o calls.o directory.o dial.o frame.o REZ=echo LIBS= ../../lib/libiaxclient.a EXEEXT= # glean the platform # We will define this as either Linux, Win32, or MacOSX ifneq (,$(findstring Linux,$(shell uname))) OSTYPE=LINUX else ifneq (,$(findstring Darwin,$(shell uname))) OSTYPE=MACOSX else # CYGWIN reports CYGWIN_NT-5.0 under Win2K ifneq (,$(findstring WIN,$(shell uname))) OSTYPE=WIN32 else $(warning OSTYPE cannot be detected, assuming Linux) OSTYPE=LINUX endif endif endif ifeq ($(OSTYPE),WIN32) #include $(WXWIN)/src/makeg95.env #include $(WXWIN)/src/makeprog.g95 PROG=iaxcomm.exe TARGET=iaxcomm.exe CFLAGS:= $(CFLAGS) -I$(WXWIN)/include -I$(WXWIN)/lib/mswd -fno-rtti -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -DWINVER=0x400 -D__WIN95__ -DSTRICT -D__WXDEBUG__ WINSYSFLAGS=-Wl,--subsystem,windows -mwindows #WINSYSFLAGS= EXTRALIBS = -lwxxrc SYSLIBS=$(EXTRALIBS) $(WINSYSFLAGS) -lwinmm -lwsock32 -lwxmswd -lcomdlg32 -luser32 -lgdi32 -lole32 -lwsock32 -lcomctl32 -lctl3d32 -lgcc -lstdc++ -lshell32 -loleaut32 -ladvapi32 -luuid -L$(WXWIN)/lib OBJS=main.o prefs.o calls.o directory.o dial.o frame.o iaxcomm_resources.o endif ifeq ($(OSTYPE),LINUX) PROG=iaxcomm TARGET=iaxcomm CFLAGS:= $(CFLAGS) -DPOSIXSLEEP `wx-config --cflags` `gtk-config --cflags` EXTRALIBS = -lwx_gtk_xrc-2.4 SYSLIBS=$(EXTRALIBS) -lpthread -lm `wx-config --static --libs` endif ifeq ($(OSTYPE),MACOSX) PROG=iaxcomm TARGET=iaxcomm.app CFLAGS:= $(CFLAGS) -DPOSIXSLEEP `wx-config --cflags` SYSLIBS=$(EXTRALIBS) -framework CoreAudio -framework AudioToolbox `wx-config --libs` CXX=`wx-config --cxx` REZ=`wx-config --rezflags` endif CPPFLAGS = $(CFLAGS) all: makelib $(TARGET) clean: rm -f $(OBJS) $(PROG) makelib: (cd ../../lib; make libiaxclient.a) ../../lib/libiaxclient.a: (cd ../../lib; make libiaxclient.a) iaxcomm_resources.o: iaxcomm.rc windres --use-temp-file -i iaxcomm.rc -o iaxcomm_resources.o --include-dir $(WXWIN)/include --define __WIN32__ --define __WIN95__ --define __GNUWIN32__ $(PROG): $(OBJS) $(LIBS) $(CXX) $(OBJS) $(LIBS) $(SYSLIBS) -o $(PROG) $(PROG).app: $(OBJS) $(LIBS) mkdir -p $(PROG).app/Contents/MacOS $(PROG).app/Contents/Resources cp `wx-config --prefix`/lib/libwx_mac*.rsrc $(PROG).app/Contents/Resources/$(PROG).rsrc echo -n "APPL????" > $(PROG).app/Contents/PkgInfo cp Info.plist $(PROG).app/Contents/Info.plist $(CXX) $(OBJS) $(LIBS) $(SYSLIBS) -o $(PROG).app/Contents/MacOS/$(PROG) --- NEW FILE: README --- ======================================================================= INTRODUCTION This is iaxComm, a portable IAX/IAX2 protocol telephony client. I had made some minor UI changes to Steve's wx client and renamed it iaxPhone without realizing there was already another project called iaxphone. When I renamed the app to iaxComm, I added minimize to systray functionality for the Win32 platform, and One Touch keys. Then I discovered wxWindows' XRC feature, which allows dialog boxen to be edited without recompiling. Changing dialog box layout or languages can now be done without a recompile. The home page for iaxclient is "http://iaxclient.sourceforge.net/" ======================================================================= LICENSES Like the iaxclient library, iaxComm 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. ======================================================================= CONTRIBUTORS: iaxComm is based upon Steve Kann's wx client. ======================================================================= BUILDING THE APPLICATION: NOTE: First you must make sure you have XRC support installed. (Check with wx Documentation for your platform) Developed/Tested on WinXP with MinGW Win32 MinGW: type "make" Untested: Linux: type "make" using standard gnu make/gcc FreeBSD: type "gmake" using standard gnu make/gcc MacOSX: type "make" using Apple Dev Tools (gnu make/gcc) --- NEW FILE: app.h --- //---------------------------------------------------------------------------------------- // Name: app.h // Purpose: Core application includes // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // Begin single inclusion of this .h file condition //---------------------------------------------------------------------------------------- #ifndef _APP_H_ #define _APP_H_ //---------------------------------------------------------------------------------------- // Shared defines //---------------------------------------------------------------------------------------- #define MAX_CALLS 2 //---------------------------------------------------------------------------------------- // Shared headers //---------------------------------------------------------------------------------------- #include "wx/app.h" #include "wx/checkbox.h" #include "wx/choice.h" #include "wx/combobox.h" #include "wx/config.h" #include "wx/dialog.h" #include "wx/frame.h" #include "wx/gauge.h" #include "wx/listctrl.h" #include "wx/notebook.h" #include "wx/snglinst.h" #include "wx/spinctrl.h" #include "wx/taskbar.h" #include "wx/textctrl.h" #include "wx/xrc/xmlres.h" #include "iaxclient.h" #ifdef __WXMSW__ #include <wx/msw/winundef.h> // needed for xmlres #endif /* for the silly key state stuff :( */ #ifdef __WXGTK__ #include <gdk/gdk.h> #endif #ifdef __WXMAC__ #include <Carbon/Carbon.h> #endif #endif // _APP_H_ --- NEW FILE: calls.cc --- //---------------------------------------------------------------------------------------- // Name: calls.cpp // Purpose: Call appearances listctrl // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // GCC implementation //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma implementation "MyFrame.h" #endif //---------------------------------------------------------------------------------------- // Standard wxWindows headers //---------------------------------------------------------------------------------------- // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif // For all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers) #ifndef WX_PRECOMP #include "wx/wx.h" #endif //---------------------------------------------------------------------------------------- // Header of this .cpp file //---------------------------------------------------------------------------------------- #include "calls.h" //---------------------------------------------------------------------------------------- // Remaining headers // --------------------------------------------------------------------------------------- #include "app.h" #include "main.h" #include "prefs.h" #include "frame.h" //---------------------------------------------------------------------------------------- // Event table: connect the events to the handler functions to process them //---------------------------------------------------------------------------------------- BEGIN_EVENT_TABLE(CallList, wxListCtrl) EVT_SIZE ( CallList::OnSize) EVT_LIST_ITEM_SELECTED (XRCID("Calls"), CallList::OnSelect) EVT_LIST_ITEM_ACTIVATED(XRCID("Calls"), CallList::OnDClick) END_EVENT_TABLE() //---------------------------------------------------------------------------------------- // Public methods //---------------------------------------------------------------------------------------- CallList::CallList(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxListCtrl( parent, id, pos, size, style) { long i; wxListItem item; m_parent = parent; // Column Headings InsertColumn( 0, _(""), wxLIST_FORMAT_CENTER, (16)); InsertColumn( 1, _("State"), wxLIST_FORMAT_CENTER, (48)); InsertColumn( 2, _("Remote"), wxLIST_FORMAT_LEFT, (200)); Hide(); for(i=0;i<MAX_CALLS;i++) { InsertItem(i,wxString::Format("%ld", i+1), 0); SetItem(i, 2, _T("No call")); item.m_itemId=i; item.m_mask = 0; item.SetTextColour(*wxLIGHT_GREY); item.SetBackgroundColour(*wxWHITE); SetItem(item); } Refresh(); Show(); AutoSize(); } void CallList::AutoSize() { SetColumnWidth(2, GetClientSize().x - 65); // Stupid boundary condition. Avoid unwanted HScroller SetColumnWidth(2, GetClientSize().x - 64); } void CallList::OnSize(wxSizeEvent &event) { event.Skip(); AutoSize(); } void CallList::OnSelect(wxListEvent &event) { int selected = event.m_itemIndex; iaxc_select_call(selected); } void CallList::OnDClick(wxListEvent &event) { // Don't need to select, because single click should have done it // int selected = event.m_itemIndex; // iaxc_select_call(selected); iaxc_dump_call(); } int CallList::HandleStateEvent(struct iaxc_ev_call_state c) { wxListItem stateItem; // for all the state color stateItem.m_itemId = c.callNo; if(c.state & IAXC_CALL_STATE_RINGING) { wxGetApp().theFrame->Show(); wxGetApp().theFrame->Raise(); } // first, handle inactive calls if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { //fprintf(stderr, "state for item %d is free\n", c.callNo); SetItem(c.callNo, 2, _T("No call") ); SetItem(c.callNo, 1, _T("") ); stateItem.SetTextColour(*wxLIGHT_GREY); stateItem.SetBackgroundColour(*wxWHITE); } else { // set remote SetItem(c.callNo, 2, c.remote ); bool outgoing = c.state & IAXC_CALL_STATE_OUTGOING; bool ringing = c.state & IAXC_CALL_STATE_RINGING; bool complete = c.state & IAXC_CALL_STATE_COMPLETE; if( ringing && !outgoing ) { stateItem.SetTextColour(*wxBLACK); stateItem.SetBackgroundColour(*wxRED); } else { stateItem.SetTextColour(*wxBLUE); stateItem.SetBackgroundColour(*wxWHITE); } if(outgoing) { if(ringing) SetItem(c.callNo, 1, _T("<r>") ); else if(complete) SetItem(c.callNo, 1, _T("<->") ); else // not accepted yet.. SetItem(c.callNo, 1, _T("< >") ); } else { if(ringing) SetItem(c.callNo, 1, _T(">R<") ); else if(complete) SetItem(c.callNo, 1, _T(">-<") ); else // not accepted yet.. shouldn't happen! SetItem(c.callNo, 1, _T("> <") ); } // XXX do something more noticable if it's incoming, ringing! } SetItem( stateItem ); // select if necessary if((c.state & IAXC_CALL_STATE_SELECTED) && !(GetItemState(c.callNo,wxLIST_STATE_SELECTED|wxLIST_STATE_SELECTED))) { //fprintf(stderr, "setting call %d to selected\n", c.callNo); SetItemState(c.callNo,wxLIST_STATE_SELECTED,wxLIST_STATE_SELECTED); } AutoSize(); Refresh(); return 0; } //---------------------------------------------------------------------------------------- // Private methods //---------------------------------------------------------------------------------------- --- NEW FILE: calls.h --- //---------------------------------------------------------------------------------------- // Name: calls,h // Purpose: Describes call appearances listctrl // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // Begin single inclusion of this .h file condition //---------------------------------------------------------------------------------------- #ifndef _CALLS_H_ #define _CALLS_H_ //---------------------------------------------------------------------------------------- // GCC interface //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma interface "calls.h" #endif //---------------------------------------------------------------------------------------- // Headers //---------------------------------------------------------------------------------------- #include "app.h" //---------------------------------------------------------------------------------------- // Class definition: MyFrame //---------------------------------------------------------------------------------------- class CallList : public wxListCtrl { public: CallList ( wxWindow *parent, wxWindowID id = -1, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_HRULES); void OnSize( wxSizeEvent &event); void AutoSize(); void OnSelect(wxListEvent &event); void OnDClick(wxListEvent &event); int HandleStateEvent(struct iaxc_ev_call_state e); private: wxWindow* m_parent; DECLARE_EVENT_TABLE() }; //---------------------------------------------------------------------------------------- // End single inclusion of this .h file condition //---------------------------------------------------------------------------------------- #endif // _CALLS_H_ --- NEW FILE: dial.cc --- //---------------------------------------------------------------------------------------- // Name: dial.cc // Purpose: dial class // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // GCC implementation //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma implementation "dial.h" #endif //---------------------------------------------------------------------------------------- // Standard wxWindows headers //---------------------------------------------------------------------------------------- // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif // For all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers) #ifndef WX_PRECOMP #include "wx/wx.h" #endif //---------------------------------------------------------------------------------------- // Header of this .cpp file //---------------------------------------------------------------------------------------- #include "dial.h" //---------------------------------------------------------------------------------------- // Remaining headers // --------------------------------------------------------------------------------------- #include "app.h" #include "frame.h" #include "main.h" void DialEntry( wxString& EntryName ) { wxString Msg; wxString FQIN; wxConfig *config = new wxConfig("iaxComm"); wxString val; wxString KeyPath; KeyPath = "/Entries/" + EntryName; config->SetPath(KeyPath); if(!config->Exists(KeyPath)) { EntryName << " unknown"; wxMessageBox(KeyPath, EntryName); return; } wxString ServerName = config->Read("Server", ""); wxString Extension = config->Read("Extension", "s"); DialDirect(ServerName, Extension); } void DialDirect( wxString& ServerName, wxString& Extension ) { wxString Msg; wxString FQIN; wxConfig *config = new wxConfig("iaxComm"); wxString val; wxString KeyPath; if(Extension.IsEmpty()) { Extension = "s"; } KeyPath = "/Servers/" + ServerName; config->SetPath(KeyPath); if(!config->Exists(KeyPath)) { ServerName << " unknown"; wxMessageBox(KeyPath, ServerName); return; } wxString HostName = config->Read("Host", ""); wxString UserName = config->Read("Username", ""); wxString Password = config->Read("Password", ""); Msg.Printf("User:\t%s\nPassword:\t%s\nHost:\t%s\nExt:\t%s", UserName.c_str(), Password.c_str(), HostName.c_str(), Extension.c_str()); FQIN.Printf("%s:%s@%s/%s", UserName.c_str(), Password.c_str(), HostName.c_str(), Extension.c_str()); Msg << "\n\n"<<FQIN; // wxMessageBox(Msg, _("Dialing")); iaxc_call((char *)FQIN.c_str()); } --- NEW FILE: dial.h --- //---------------------------------------------------------------------------------------- // Name: dial.h // Purpose: Describes dial class // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // Begin single inclusion of this .h file condition //---------------------------------------------------------------------------------------- #ifndef _DIAL_H_ #define _DIAL_H_ //---------------------------------------------------------------------------------------- // GCC interface //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma interface "directory.h" #endif //---------------------------------------------------------------------------------------- // Headers //---------------------------------------------------------------------------------------- #include "app.h" #include "frame.h" void DialEntry( wxString& name ); void DialDirect( wxString& server, wxString& ext ); #endif //_DIAL_H_ --- NEW FILE: directory.cc --- //---------------------------------------------------------------------------------------- // Name: directory.cc // Purpose: dialog box to manage directory // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // GCC implementation //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma implementation "MyFrame.h" #endif //---------------------------------------------------------------------------------------- // Standard wxWindows headers //---------------------------------------------------------------------------------------- // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif // For all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers) #ifndef WX_PRECOMP #include "wx/wx.h" #endif //---------------------------------------------------------------------------------------- // Header of this .cpp file //---------------------------------------------------------------------------------------- #include "directory.h" //---------------------------------------------------------------------------------------- // Remaining headers // --------------------------------------------------------------------------------------- #include "app.h" #include "frame.h" #include "main.h" #include "dial.h" //---------------------------------------------------------------------------------------- // Event table: connect the events to the handler functions to process them //---------------------------------------------------------------------------------------- BEGIN_EVENT_TABLE(DirectoryDialog, wxDialog) EVT_BUTTON( wxID_OK, DirectoryDialog::OnDone) EVT_BUTTON( wxID_SAVE, DirectoryDialog::OnSave) EVT_BUTTON( wxID_RESET, DirectoryDialog::OnRemove) EVT_BUTTON(XRCID("Dial"), DirectoryDialog::OnDial) EVT_COMBOBOX(XRCID("ServerName"), DirectoryDialog::OnServerName) EVT_COMBOBOX(XRCID("EntryName"), DirectoryDialog::OnEntryName) EVT_SPINCTRL(XRCID("OTNo"), DirectoryDialog::OnOTNo) END_EVENT_TABLE() //---------------------------------------------------------------------------------------- // Public methods //---------------------------------------------------------------------------------------- DirectoryDialog::DirectoryDialog( wxWindow* parent ) { wxConfig *config = new wxConfig("iaxComm"); wxString str; long dummy; bool bCont; wxXmlResource::Get()->LoadDialog(this, parent, wxT("Directory")); //----Reach in for our controls----------------------------------------------------- DirectoryNotebook = XRCCTRL(*this, "DirectoryNotebook", wxNotebook); // Server tab ServerName = XRCCTRL(*this, "ServerName", wxComboBox); HostName = XRCCTRL(*this, "HostName", wxTextCtrl); UserName = XRCCTRL(*this, "UserName", wxTextCtrl); Password = XRCCTRL(*this, "Password", wxTextCtrl); Confirm = XRCCTRL(*this, "Confirm", wxTextCtrl); // Entries tab EntryName = XRCCTRL(*this, "EntryName", wxComboBox); ChooseServer = XRCCTRL(*this, "ChooseServer", wxChoice); Extension = XRCCTRL(*this, "Extension", wxTextCtrl); // One Touch tab OTNo = XRCCTRL(*this, "OTNo", wxSpinCtrl); ShortName = XRCCTRL(*this, "ShortName", wxTextCtrl); ChooseEntry = XRCCTRL(*this, "ChooseEntry", wxChoice); SaveButton = XRCCTRL(*this, "wxID_SAVE", wxButton); ApplyButton = XRCCTRL(*this, "wxID_APPLY", wxButton); //----Populate Servers choice controls---------------------------------------------- config->SetPath("/Servers"); bCont = config->GetFirstGroup(str, dummy); while ( bCont ) { ServerName->Append(str); ChooseServer->Append(str); bCont = config->GetNextGroup(str, dummy); } //----Populate Entry choice controls------------------------------------------------ config->SetPath("/Entries"); bCont = config->GetFirstGroup(str, dummy); while ( bCont ) { EntryName->Append(str); ChooseEntry->Append(str); bCont = config->GetNextGroup(str, dummy); } // Needed so we can appear to clear it ChooseServer->Append(" "); ChooseEntry->Append(" "); } //---------------------------------------------------------------------------------------- // Private methods //---------------------------------------------------------------------------------------- void DirectoryDialog::OnServerName(wxCommandEvent &event) { wxConfig *config = new wxConfig("iaxComm"); wxString val; wxString KeyPath; // Update the Host/Username/Password boxes KeyPath = "/Servers/" + ServerName->GetStringSelection(); config->SetPath(KeyPath); if(config->Exists(KeyPath)) { HostName->SetValue(config->Read("Host", "")); UserName->SetValue(config->Read("Username", "")); Password->SetValue(config->Read("Password", "")); Confirm->SetValue(Password->GetValue()); } } void DirectoryDialog::OnEntryName(wxCommandEvent &event) { wxConfig *config = new wxConfig("iaxComm"); wxString val; wxString KeyPath; KeyPath = "/Entries/" + EntryName->GetStringSelection(); config->SetPath(KeyPath); if(config->Exists(KeyPath)) { ChooseServer->SetStringSelection(config->Read("Server", "")); Extension->SetValue(config->Read("Extension", "")); } } void DirectoryDialog::OnOTNo(wxCommandEvent &event) { wxConfig *config = new wxConfig("iaxComm"); wxString val; wxString KeyPath; KeyPath.Printf("/OneTouch/OT%d", OTNo->GetValue()); config->SetPath(KeyPath); if(config->Exists(KeyPath)) { ChooseEntry->SetStringSelection(config->Read("EntryName", "")); ShortName->SetValue(config->Read("ShortName", "")); } else { // *looks* empty ChooseEntry->SetStringSelection(" "); ShortName->SetValue(""); } } void DirectoryDialog::OnDone(wxCommandEvent &event) { Close(); } void DirectoryDialog::OnSave(wxCommandEvent &event) { wxConfig *config = new wxConfig("iaxComm"); wxString val; wxString KeyPath; switch(DirectoryNotebook->GetSelection()) { case 0: //--Server Tab ---------------------------------------------------------------- if(!IsEmpty(ServerName->GetValue())) { KeyPath = "/Servers/" + ServerName->GetValue(); config->SetPath(KeyPath); if(!Password->GetValue().IsSameAs(Confirm->GetValue())) { wxMessageBox(_("Try Again"), _("Password Mismatch"), wxICON_INFORMATION); } else { if(IsEmpty(HostName->GetValue())) { wxMessageBox(_("Please Specify a Hostname"), _("Empty Hostname"), wxICON_INFORMATION); } else { config->Write("Host", HostName->GetValue()); config->Write("Username", UserName->GetValue()); config->Write("Password", Password->GetValue()); wxGetApp().theFrame->Server->Append(ServerName->GetValue()); } } } break; case 1: //--Entries Tab --------------------------------------------------------------- if(!IsEmpty(EntryName->GetValue())) { KeyPath = "/Entries/" + EntryName->GetValue(); config->SetPath(KeyPath); if(IsEmpty(ChooseServer->GetStringSelection())) { wxMessageBox(_("Please Specify a server"), _("Empty Server Name"), wxICON_INFORMATION); } else { // Empty Extension is OK. (Dialler will substitute s) config->Write("Server", ChooseServer->GetStringSelection()); config->Write("Extension", Extension->GetValue()); } } break; case 2: //--One Touch Tab ------------------------------------------------------------- if((OTNo->GetValue() >= OTNo->GetMin()) && (OTNo->GetValue() <= OTNo->GetMax())) { KeyPath.Printf("/OneTouch/OT%d", OTNo->GetValue()); config->SetPath(KeyPath); if(IsEmpty(ShortName->GetValue())) { wxMessageBox(_("Please Specify a short name"), _("Empty Short Name"), wxICON_INFORMATION); } else { if(IsEmpty(ChooseEntry->GetStringSelection())) { wxMessageBox(_("Please Specify an entry"), _("Empty Entry Name"), wxICON_INFORMATION); } else { config->Write("EntryName", ChooseEntry->GetStringSelection()); config->Write("ShortName", ShortName->GetValue()); wxButton *OT; wxString OTName; OTName.Printf("OT%d", OTNo->GetValue()); OT = XRCCTRL(*wxGetApp().theFrame, OTName, wxButton); OT->SetLabel(ShortName->GetValue()); } } } break; } delete config; } void DirectoryDialog::OnRemove(wxCommandEvent &event) { wxConfig *config = new wxConfig("iaxComm"); wxString val; wxString KeyPath; switch(DirectoryNotebook->GetSelection()) { case 0: //--Server Tab ---------------------------------------------------------------- if(!IsEmpty(ServerName->GetValue())) { KeyPath = "/Servers/" + ServerName->GetValue(); if(IsEmpty(HostName->GetValue())) { wxMessageBox(_("Please Specify a Hostname"), _("Empty Hostname"), wxICON_INFORMATION); } else { wxGetApp().theFrame->Server->Delete(wxGetApp().theFrame->Server-> FindString(ServerName->GetStringSelection())); config->DeleteGroup(KeyPath); ServerName->Delete(ServerName->GetSelection()); HostName->SetValue(""); UserName->SetValue(""); Password->SetValue(""); Confirm->SetValue(""); } } break; case 1: //--Entries Tab --------------------------------------------------------------- if(!IsEmpty(EntryName->GetValue())) { KeyPath = "/Entries/" + EntryName->GetValue(); if(IsEmpty(ChooseServer->GetStringSelection())) { wxMessageBox(_("Please Specify a server"), _("Empty Server Name"), wxICON_INFORMATION); } else { config->DeleteGroup(KeyPath); EntryName->Delete(EntryName->GetSelection()); ChooseServer->SetStringSelection(" "); Extension->SetValue(""); } } break; case 2: //--One Touch Tab ------------------------------------------------------------- if((OTNo->GetValue() >= OTNo->GetMin()) && (OTNo->GetValue() <= OTNo->GetMax())) { KeyPath.Printf("/OneTouch/OT%d", OTNo->GetValue()); if(IsEmpty(ChooseEntry->GetStringSelection())) { wxMessageBox(_("Please Specify an entry"), _("Empty Entry Name"), wxICON_INFORMATION); } else { config->DeleteGroup(KeyPath); ChooseEntry->SetStringSelection(" "); ShortName->SetValue(""); wxButton *OT; wxString OTName; OTName.Printf("OT%d", OTNo->GetValue()); OT = XRCCTRL(*wxGetApp().theFrame, OTName, wxButton); if(OT != NULL) { OT->SetLabel(""); //OT->Destroy(); } } } break; } delete config; } void DirectoryDialog::OnDial(wxCommandEvent &event) { wxString Name; Name = EntryName->GetValue(); DialEntry(Name); } --- NEW FILE: directory.h --- //---------------------------------------------------------------------------------------- // Name: directory.h // Purpose: Describes directory dialog // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // Begin single inclusion of this .h file condition //---------------------------------------------------------------------------------------- #ifndef _DIRECTORY_H_ #define _DIRECTORY_H_ //---------------------------------------------------------------------------------------- // GCC interface //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma interface "directory.h" #endif //---------------------------------------------------------------------------------------- // Headers //---------------------------------------------------------------------------------------- #include "app.h" class DirectoryDialog : public wxDialog { public: DirectoryDialog( wxWindow* parent ); wxComboBox *ServerName; wxTextCtrl *HostName; wxTextCtrl *UserName; wxTextCtrl *Password; wxTextCtrl *Confirm; wxComboBox *EntryName; wxChoice *ChooseServer; wxTextCtrl *Extension; wxSpinCtrl *OTNo; wxTextCtrl *ShortName; wxChoice *ChooseEntry; wxButton *SaveButton; wxButton *ApplyButton; private: wxNotebook *DirectoryNotebook; void OnServerName(wxCommandEvent &event); void OnEntryName(wxCommandEvent &event); void OnOTNo(wxCommandEvent &event); void OnDone(wxCommandEvent &event); void OnSave(wxCommandEvent &event); void OnRemove(wxCommandEvent &event); void OnDial(wxCommandEvent &event); DECLARE_EVENT_TABLE() }; #endif //_DIRECTORY_H_ --- NEW FILE: frame.cc --- //---------------------------------------------------------------------------------------- // Name: frame.cpp // Purpose: Main frame // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // GCC implementation //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma implementation "MyFrame.h" #endif //---------------------------------------------------------------------------------------- // Standard wxWindows headers //---------------------------------------------------------------------------------------- // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif // For all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers) #ifndef WX_PRECOMP #include "wx/wx.h" #endif //---------------------------------------------------------------------------------------- // Header of this .cpp file //---------------------------------------------------------------------------------------- #include "frame.h" //---------------------------------------------------------------------------------------- // Remaining headers // --------------------------------------------------------------------------------------- #include "app.h" #include "main.h" #include "prefs.h" #include "directory.h" #include "calls.h" #include "dial.h" static bool pttMode; // are we in PTT mode? static bool pttState; // is the PTT button pressed? static bool silenceMode; // are we in silence suppression mode? //---------------------------------------------------------------------------------------- // Event table: connect the events to the handler functions to process them //---------------------------------------------------------------------------------------- BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU (IAXCLIENT_EVENT, MyFrame::HandleEvent) EVT_MENU (XRCID("PTT"), MyFrame::OnPTTChange) EVT_MENU (XRCID("Silence"), MyFrame::OnSilenceChange) EVT_MENU (XRCID("Prefs"), MyFrame::OnPrefs) EVT_MENU (XRCID("Directory"), MyFrame::OnDirectory) EVT_MENU (XRCID("Exit"), MyFrame::OnExit) EVT_SIZE ( CallList::OnSize) #ifdef __WXMSW__ EVT_ICONIZE ( MyTaskBarIcon::OnHide) #endif EVT_BUTTON (XRCID("OT0"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT1"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT2"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT3"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT4"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT5"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT6"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT7"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT8"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT9"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT10"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("OT11"), MyFrame::OnOneTouch) EVT_BUTTON (XRCID("KP0"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP1"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP2"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP3"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP4"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP5"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP6"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP7"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP8"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KP9"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KPSTAR"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("KPPOUND"), MyFrame::OnKeyPad) EVT_BUTTON (XRCID("Dial"), MyFrame::OnDialDirect) EVT_BUTTON (XRCID("Hangup"), MyFrame::OnHangup) END_EVENT_TABLE() //---------------------------------------------------------------------------------------- // Public methods //---------------------------------------------------------------------------------------- MyFrame::MyFrame( wxWindow* parent ) { wxBoxSizer *panelSizer; wxPanel *aPanel; wxConfig *config = new wxConfig("iaxComm"); wxButton *ot; wxString OTName; wxString EntryName; wxString ShortName; wxString Label; long dummy; bool bCont; MyTimer *timer; // Load up this frame from XRC. [Note, instead of making a class's // constructor take a wxWindow* parent with a default value of NULL, // we could have just had designed MyFrame class with an empty // constructor and then written here: // wxXmlResource::Get()->LoadFrame(this, (wxWindow* )NULL, "MyFrame"); // since this frame will always be the top window, and thus parentless. // However, the current approach has source code that can be recycled // in case code to moves to having an invisible frame as the top level window. wxXmlResource::Get()->LoadFrame( this, parent, "MyFrame" ); //----Set the icon------------------------------------------------------------------ #ifdef __WXMSW__ // XXX under linux, I got "`application_xpm' undeclared (first use this function)" here. SetIcon(wxICON(application)); #endif //----Add the menu------------------------------------------------------------------ SetMenuBar( wxXmlResource::Get()->LoadMenuBar( "main_menubar" ) ); //----Add the statusbar------------------------------------------------------------- const int widths[] = {-1, 60}; CreateStatusBar( 2 ); SetStatusWidths(2, widths); //----Add the panel----------------------------------------------------------------- aPanel = new wxPanel(this); if(config->Read("/ShowKeyPad", 0l) == 0) { aPanel = wxXmlResource::Get()->LoadPanel(this, wxT("Panel")); } else { aPanel = wxXmlResource::Get()->LoadPanel(this, wxT("FullPanel")); } //----Reach in for our controls----------------------------------------------------- Input = XRCCTRL(*aPanel, "Input", wxGauge); Output = XRCCTRL(*aPanel, "Output", wxGauge); Server = XRCCTRL(*aPanel, "Server", wxChoice); Extension = XRCCTRL(*aPanel, "Extension", wxTextCtrl); //----Insert the Calls listctrl into it's "unknown" placeholder--------------------- Calls = new CallList(aPanel); wxXmlResource::Get()->AttachUnknownControl("Calls", Calls); //----Add Servers------------------------------------------------------------------- config->SetPath("/Servers"); bCont = config->GetFirstGroup(EntryName, dummy); while ( bCont ) { Server->Append(EntryName); bCont = config->GetNextGroup(EntryName, dummy); } Server->SetSelection(0); //----Load up One Touch Keys-------------------------------------------------------- config->SetPath("/OneTouch"); bCont = config->GetFirstGroup(OTName, dummy); while ( bCont ) { ot = XRCCTRL(*aPanel, OTName, wxButton); if(ot != NULL) { ShortName = OTName + "/ShortName"; Label = config->Read(ShortName, ""); if(!Label.IsEmpty()) { ot->SetLabel(Label); } else { ot->SetLabel(OTName); } EntryName = OTName + "/EntryName"; Label = config->Read(EntryName, ""); if(!Label.IsEmpty()) { ot->SetToolTip(Label); } } bCont = config->GetNextGroup(OTName, dummy); } panelSizer = new wxBoxSizer(wxVERTICAL); panelSizer->Add(aPanel,1,wxEXPAND); SetSizer(panelSizer); panelSizer->SetSizeHints(this); pttMode = false; #ifdef __WXGTK__ // window used for getting keyboard state GdkWindowAttr attr; keyStateWindow = gdk_window_new(NULL, &attr, 0); #endif timer = new MyTimer(); timer->Start(100); } MyFrame::~MyFrame() { iaxc_dump_all_calls(); for(int i=0;i<10;i++) { iaxc_millisleep(100); } iaxc_stop_processing_thread(); // exit(0); iaxc_shutdown(); } void MyFrame::OnNotify() { if(pttMode) CheckPTT(); } void MyFrame::OnShow() { Show(TRUE); } void MyFrame::OnHangup(wxEvent &event) { iaxc_dump_call(); } void MyFrame::OnQuit(wxEvent &event) { Close(TRUE); } void MyFrame::OnPTTChange(wxCommandEvent &event) { pttMode = event.IsChecked(); if(pttMode) { SetPTT(GetPTTState()); } else { SetPTT(true); if(silenceMode) { iaxc_set_silence_threshold(DEFAULT_SILENCE_THRESHOLD); SetStatusText(_("VOX"),1); } else { iaxc_set_silence_threshold(-99); SetStatusText(_(""),1); } iaxc_set_audio_output(0); // unmute output } } void MyFrame::OnSilenceChange(wxCommandEvent &event) { // XXX get the actual state! silenceMode = event.IsChecked(); if(pttMode) return; if(silenceMode) { iaxc_set_silence_threshold(DEFAULT_SILENCE_THRESHOLD); SetStatusText(_("VOX"),1); } else { iaxc_set_silence_threshold(-99); SetStatusText(_(""),1); } } bool MyFrame::GetPTTState() { bool pressed; #ifdef __WXMAC__ KeyMap theKeys; GetKeys(theKeys); // that's the Control Key (by experimentation!) pressed = theKeys[1] & 0x08; //fprintf(stderr, "%p %p %p %p\n", theKeys[0], theKeys[1], theKeys[2], theKeys[3]); #else #ifdef __WXMSW__ pressed = GetAsyncKeyState(VK_CONTROL)&0x8000; #else int x, y; GdkModifierType modifiers; gdk_window_get_pointer(keyStateWindow, &x, &y, &modifiers); pressed = modifiers & GDK_CONTROL_MASK; #endif #endif return pressed; } void MyFrame::CheckPTT() { bool newState = GetPTTState(); if(newState == pttState) return; SetPTT(newState); } void MyFrame::SetPTT(bool state) { pttState = state; if(pttState) { iaxc_set_silence_threshold(-99); //unmute input iaxc_set_audio_output(1); // unmute output SetStatusText(_("TALK"),1); } else { iaxc_set_silence_threshold(0); // mute input iaxc_set_audio_output(0); // mute output SetStatusText(_("MUTE"),1); } } void MyFrame::HandleEvent(wxCommandEvent &evt) { iaxc_event *e = (iaxc_event *)evt.GetClientData(); HandleIAXEvent(e); free (e); } int MyFrame:: HandleIAXEvent(iaxc_event *e) { int ret = 0; switch(e->type) { case IAXC_EVENT_LEVELS: ret = HandleLevelEvent(e->ev.levels.input, e->ev.levels.output); break; case IAXC_EVENT_TEXT: ret = HandleStatusEvent(e->ev.text.message); break; case IAXC_EVENT_STATE: ret = wxGetApp().theFrame->Calls->HandleStateEvent(e->ev.call); break; default: break; // not handled } return ret; } int MyFrame:: HandleStatusEvent(char *msg) { wxGetApp().theFrame->SetStatusText(msg); return 1; } int MyFrame:: HandleLevelEvent(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); static int lastInputLevel = 0; static int lastOutputLevel = 0; if(lastInputLevel != inputLevel) { wxGetApp().theFrame->Input->SetValue(inputLevel); lastInputLevel = inputLevel; } if(lastOutputLevel != outputLevel) { wxGetApp().theFrame->Output->SetValue(outputLevel); lastOutputLevel = outputLevel; } return 1; } //---------------------------------------------------------------------------------------- // Private methods //---------------------------------------------------------------------------------------- void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; msg.Printf( _T("CVS Version")); wxMessageBox(msg, _("iax Phone Application"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnPrefs(wxCommandEvent& WXUNUSED(event)) { PrefsDialog dialog(this); dialog.ShowModal(); } void MyFrame::OnDirectory(wxCommandEvent& WXUNUSED(event)) { DirectoryDialog dialog(this); dialog.ShowModal(); } void MyFrame::OnOneTouch(wxCommandEvent &event) { wxConfig *config = new wxConfig("iaxComm"); wxString Message; int OTNo; wxString PathName; wxString EntryName; OTNo = event.GetId() - XRCID("OT0"); PathName.Printf("/OneTouch/OT%d", OTNo); config->SetPath(PathName); EntryName = config->Read("EntryName", ""); if(!EntryName.IsEmpty()) { DialEntry(EntryName); } } void MyFrame::OnKeyPad(wxCommandEvent &event) { wxString Message; char digit; int OTNo; OTNo = event.GetId() - XRCID("KP0"); digit = '0' + (char)OTNo; if(OTNo == 10) digit = '*'; if(OTNo == 11) digit = '#'; iaxc_send_dtmf(digit); } void MyFrame::OnDialDirect(wxCommandEvent &event) { if(IsEmpty(Server->GetStringSelection())) { // Shouldn't ever get here: we selected Server[0] SetStatusText(_T("Please select a server")); return; } wxString S = Server->GetStringSelection(); wxString E = Extension->GetValue(); DialDirect(S, E); } void MyTimer::Notify() { wxGetApp().theFrame->OnNotify(); } --- NEW FILE: frame.h --- //---------------------------------------------------------------------------------------- // Name: frame,h // Purpose: Describes main dialog // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // Begin single inclusion of this .h file condition //---------------------------------------------------------------------------------------- #ifndef _FRAME_H_ #define _FRAME_H_ //---------------------------------------------------------------------------------------- // GCC interface //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma interface "frame.h" #endif //---------------------------------------------------------------------------------------- // Headers //---------------------------------------------------------------------------------------- #include "app.h" #include "calls.h" #include "directory.h" #define LEVEL_MAX -10 #define LEVEL_MIN -50 #define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" //---------------------------------------------------------------------------------------- // Class definition: MyTimer //---------------------------------------------------------------------------------------- class MyTimer : public wxTimer { public: void Notify(); }; //---------------------------------------------------------------------------------------- // Class definition: MyFrame //---------------------------------------------------------------------------------------- class MyFrame : public wxFrame { public: MyFrame( wxWindow* parent=(wxWindow *)NULL); ~MyFrame(); void OnShow(); void OnNotify(); void OnHangup(wxEvent &event); void OnQuit(wxEvent &event); void OnPTTChange(wxCommandEvent &event); void OnSilenceChange(wxCommandEvent &event); bool GetPTTState(); void CheckPTT(); void SetPTT(bool state); // Handlers for library-initiated events void HandleEvent(wxCommandEvent &evt); int HandleIAXEvent(iaxc_event *e); int HandleStatusEvent(char *msg); int HandleLevelEvent(float input, float output); wxGauge *Input; wxGauge *Output; wxChoice *Server; wxTextCtrl *Extension; CallList *Calls; private: // An icon for the corner of dialog and application's taskbar button wxIcon m_icon; void OnPrefs(wxCommandEvent& event); void OnDirectory(wxCommandEvent& event); void OnExit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); void OnOneTouch(wxCommandEvent& event); void OnKeyPad(wxCommandEvent& event); void OnDialDirect(wxCommandEvent& event); #ifdef __WXGTK__ GdkWindow *keyStateWindow; #endif DECLARE_EVENT_TABLE() }; //---------------------------------------------------------------------------------------- // End single inclusion of this .h file condition //---------------------------------------------------------------------------------------- #endif // _FRAME_H_ --- NEW FILE: iaxcomm.exe.manifest --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="0.64.1.0" processorArchitecture="x86" name="Controls" type="win32" /> <description>main - a basic wxWin xrc app</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly> --- NEW FILE: iaxcomm.rc --- //---------------------------------------------------------------------------------------- // Name: iaxcomm.rc // Purpose: wxWindows resource includes for the applicaton to compile for MSW. // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------- // The program icon for the application // --------------------------------------------------------------------------------------- // NOTE: To fulfill the MSW API, the program icon declaration needs // to be the first one, before the icons and resources in the included "wx/msw/wx.rc" // (declared later down). // Best to call the icon file the same as the application, so that the .xpm can be // also be dropped into directories of icons for use on some desktops. // If we weren't loading the full icon bundle at rutime, and instead used the // ICON macro in SetIcon, then the name 'main' would have to match the // variable name in "SetIcon()" in the file main_frame.cpp/h. // But since we aren't, the name doesn't matter. Just put the icon in first in the // application so that the .exe has an icon. application ICON "rc/application.ico" // --------------------------------------------------------------------------------------- // The generic resources for MSW programs (cursors, error icons, etc). // Required for all wxWindows apps. // --------------------------------------------------------------------------------------- #include "wx/msw/wx.rc" --- NEW FILE: main.cc --- //---------------------------------------------------------------------------------------- // Name: main.cpp // Purpose: Core application // Author: Michael Van Donselaar // Modified by: // Created: 2003 // Copyright: (c) Michael Van Donselaar ( mi...@va... ) // Licence: GPL //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // GCC implementation //---------------------------------------------------------------------------------------- #if defined(__GNUG__) && ! defined(__APPLE__) #pragma implementation "main.h" #endif //---------------------------------------------------------------------------------------- // Standard wxWindows headers //---------------------------------------------------------------------------------------- // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif // For all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers) #ifndef WX_PRECOMP #include "wx/wx.h" #endif //---------------------------------------------------------------------------------------- // Header of this .cpp file //---------------------------------------------------------------------------------------- #include "main.h" #include "prefs.h" #include "wx/tokenzr.h" //---------------------------------------------------------------------------------------- // Remaining headers //---------------------------------------------------------------------------------------- #include "app.h" #include "frame.h" //---------------------------------------------------------------------------------------- // forward decls for callbacks //---------------------------------------------------------------------------------------- extern "C" { static int iaxc_callback(iaxc_event e); int doTestCall(int ac, char **av); } //---------------------------------------------------------------------------------------- // Static variables //---------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------- // wxWindows macro: Declare the application. //---------------------------------------------------------------------------------------- // Create a new application object: this macro will allow wxWindows to create // the application object during program execution (it's better than using a // static object for many reasons) and also declares the accessor function // wxGetApp() which will return the reference of the right type (i.e. theApp and // not wxApp). IMPLEMENT_APP( theApp ) //---------------------------------------------------------------------------------------- // Public methods //---------------------------------------------------------------------------------------- bool theApp::OnInit() { wxConfig *config = new wxConfig("iaxComm"); wxString str; wxString reginfo; long dummy; bool bCont; m_single_instance_checker = new wxSingleInstanceChecker( GetAppName() ); // And if a copy is alreay running, then abort... if ( m_single_instance_checker->IsAnotherRunning() ) { wxMessageDialog second_instance_messagedialog( (wxWindow*)NULL, _( "Another instance is already running." ), _( "Startup Error" ), wxOK | wxICON_INFORMATION ); second_instance_messagedialog.ShowModal(); // Returning FALSE from within wxApp::OnInit() will terminate the application. return FALSE; } // Load up the XML Resource handler, to be able to load XML resources.. wxXmlResource::Get()->InitAllHandlers(); // Load up enough XML resources to construct a main frame load_xrc_resource( "frame.xrc" ); load_xrc_resource( "menubar.xrc" ); load_xrc_resource( "panel.xrc" ); load_xrc_resource( "prefs.xrc" ); load_xrc_resource( "directory.xrc" ); // Create an instance of the main frame. // Using a pointer since behaviour will be when close the frame, it will // Destroy() itself, which will safely call "delete" when the time is right. // [The constructor is empty, since using the default value for parent, which is // NULL]. theFrame = new MyFrame(); // This is of dubious usefulness unless an app is a dialog-only app. This // is the first created frame, so it is the top window already. SetTopWindow( theFrame ); // Load up the rest of the XML resources ... [truncated message content] |
Update of /cvsroot/iaxclient/iaxclient/simpleclient/iaxcomm/rc In directory sc8-pr-cvs1:/tmp/cvs-serv16306/rc Added Files: application.ico directory.xrc frame.xrc menubar.xrc panel.xrc prefs.xrc Log Message: iaxcomm: a wx-derived client, from Michael Van Donselaar --- NEW FILE: application.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: directory.xrc --- <?xml version="1.0" ?> <resource version="2.3.0.1" xmlns="http://www.wxwindows.org/wxxrc"> <object class="wxDialog" name="Directory"> <title>Dialing Directory</title> <centered>1</centered> <object class="wxFlexGridSizer"> <cols>1</cols> <rows>0</rows> <vgap>0</vgap> <hgap>0</hgap> <growablecols>0</growablecols> <growablerows>0</growablerows> <object class="sizeritem"> <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxALL</flag> <border>5</border> <object class="wxNotebook" name="DirectoryNotebook"> <usenotebooksizer>1</usenotebooksizer> <size>200,160</size> <object class="notebookpage"> <label>Servers</label> <object class="wxPanel" name="ServerTab"> <object class="wxFlexGridSizer"> <cols>1</cols> <object class="spacer"> <size>5,5</size> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Server Name: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxComboBox" name="ServerName"> <content/> </object> <minsize>260,24</minsize> <flag>wxALIGN_RIGHT</flag> <border>10</border> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Host: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="HostName"/> <minsize>260,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Username: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="UserName"/> <minsize>260,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Password: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="Password"> <style>wxTE_PASSWORD</style> </object> <minsize>260,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Confirm: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="Confirm"> <style>wxTE_PASSWORD</style> </object> <minsize>260,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <vgap>8</vgap> </object> </object> </object> <object class="notebookpage"> <label>Entries</label> <object class="wxPanel" name="EntriesTab"> <object class="wxFlexGridSizer"> <cols>1</cols> <object class="spacer"> <size>5,5</size> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Entry Name: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxComboBox" name="EntryName"> <content/> </object> <minsize>260,24</minsize> <flag>wxALIGN_RIGHT</flag> <border>10</border> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Server: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxChoice" name="ChooseServer"> <content/> </object> <minsize>260,24</minsize> <border>10</border> <flag>wxALIGN_RIGHT</flag> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Extension: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="Extension"/> <minsize>260,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <vgap>8</vgap> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="Dial"> <label>Dial</label> </object> </object> <orient></orient> </object> <border></border> <minsize></minsize> <flag>wxALL|wxALIGN_CENTER</flag> </object> </object> </object> </object> <object class="notebookpage"> <label>One Touch</label> <object class="wxPanel" name="OneTouchTab"> <object class="wxFlexGridSizer"> <cols>1</cols> <object class="spacer"> <size>5,5</size> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Key No: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxSpinCtrl" name="OTNo"> <min>0</min> <max>11</max> </object> <minsize>48,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Short Name: </label> <tooltip></tooltip> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="ShortName"> <tooltip>Short Name to appear on a One Touch button</tooltip> </object> <minsize>72,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Entry Name: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT</flag> </object> <object class="sizeritem"> <object class="wxChoice" name="ChooseEntry"> <content/> </object> <minsize>260,24</minsize> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <vgap>8</vgap> </object> </object> </object> </object> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_SAVE"> <label>Save</label> </object> </object> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_RESET"> <label>Remove</label> </object> </object> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_OK"> <label>Done</label> </object> </object> <orient></orient> </object> <border></border> <minsize></minsize> <flag>wxALL|wxALIGN_CENTER</flag> </object> </object> </object> </resource> --- NEW FILE: frame.xrc --- <?xml version="1.0" ?> <resource version="2.3.0.1" xmlns="http://www.wxwindows.org/wxxrc"> <object class="wxFrame" name="MyFrame"> <title>iaxComm</title> </object> </resource> --- NEW FILE: menubar.xrc --- <?xml version="1.0" ?> <resource version="2.3.0.1" xmlns="http://www.wxwindows.org/wxxrc"> <object class="wxMenuBar" name="main_menubar"> <style>wxMB_DOCKABLE</style> <object class="wxMenu"> <label>_File</label> <style>wxMENU_TEAROFF</style> <object class="wxMenuItem" name="Exit"> <label>E_xit</label> <accel>Alt-F4</accel> <help>Exit the application</help> </object> </object> <object class="wxMenu"> <label>_Options</label> <style>wxMENU_TEAROFF</style> <object class="wxMenuItem" name="PTT"> <label>Push to Talk</label> <accel>Ctrl-P</accel> <help>Toggle PTT with Ctrl Key</help> <checkable>1</checkable> </object> <object class="wxMenuItem" name="Silence"> <label>Silence Suppression</label> <accel>Ctrl-S</accel> <help>Suppress Silence</help> <checkable>1</checkable> </object> <object class="separator"/> <object class="wxMenuItem" name="Prefs"> <label>_Preferences ...</label> <help>Configure audio options, etc.</help> </object> <object class="wxMenuItem" name="Directory"> <label>_Directory ...</label> <help>Manage directory</help> </object> </object> <object class="wxMenu"> <label>_Help</label> <style>wxMENU_TEAROFF</style> <object class="wxMenuItem" name="About"> <label>_About</label> <help>Display version number and copyright notice</help> </object> </object> </object> </resource> --- NEW FILE: panel.xrc --- <?xml version="1.0" ?> <resource version="2.3.0.1" xmlns="http://www.wxwindows.org/wxxrc"> <object class="wxPanel" name="FullPanel"> <pos></pos> <object class="wxFlexGridSizer"> <cols>1</cols> <rows>0</rows> <growablecols>0</growablecols> <object class="sizeritem"> <flag>wxEXPAND|wxALL|wxALIGN_LEFT</flag> <border>5</border> <object class="wxBoxSizer"> <orient>wxVERTICAL</orient> <object class="spacer"> <size>05</size> <flag>wxEXPAND|wxGROW</flag> </object> <object class="sizeritem"> <object class="wxGauge" name="Input"> <style></style> <tooltip>Input Audio meter</tooltip> </object> <minsize>100,13</minsize> <flag>wxEXPAND</flag> </object> <object class="sizeritem"> <object class="wxGauge" name="Output"> <tooltip>Output Audio meter</tooltip> </object> <minsize>100,13</minsize> <flag>wxEXPAND</flag> </object> </object> <minsize></minsize> </object> <object class="sizeritem"> <flag>wxALL|wxEXPAND|wxGROW|wxALIGN_LEFT</flag> <border>5</border> <object class="wxFlexGridSizer"> <object class="sizeritem"> <object class="unknown" name="Calls"> <style>wxLC_REPORT|wxLC_SINGLE_SEL</style> </object> <minsize>100,72</minsize> <flag>wxEXPAND|wxGROW</flag> </object> <cols>1</cols> <rows>1</rows> <growablecols>0</growablecols> <growablerows>0</growablerows> </object> </object> <object class="sizeritem"> <flag>wxEXPAND|wxALIGN_CENTRE</flag> <object class="wxFlexGridSizer"> <object class="spacer"> <size>5,1</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Server:</label> <style>wxALIGN_RIGHT</style> </object> </object> <object class="sizeritem"> <object class="wxChoice" name="Server"> <content/> <tooltip>Default server for Direct Dialling</tooltip> </object> <flag>wxEXPAND</flag> </object> <object class="spacer"> <size>1,1</size> </object> <object class="spacer"> <size>1,1</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Direct Dial:</label> <style>wxALIGN_RIGHT</style> </object> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="Extension"> <tooltip>Dial this number @ selected server</tooltip> </object> <minsize>180,24</minsize> <flag>wxEXPAND</flag> </object> <cols>4</cols> <rows>2</rows> <vgap>5</vgap> <hgap>5</hgap> <growablecols>2</growablecols> <object class="spacer"> <size>1,1</size> </object> <object class="spacer"> <size>1,1</size> </object> </object> <border>5</border> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="sizeritem"> <flag>wxALIGN_CENTER</flag> <border>7</border> <object class="wxGridSizer"> <object class="sizeritem"> <object class="wxButton" name="KP1"> <label>1</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP2"> <label>2</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP3"> <label>3</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP4"> <label>4</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP5"> <label>5</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP6"> <label>6</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP7"> <label>7</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP8"> <label>8</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP9"> <label>9</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KPSTAR"> <label>*</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KP0"> <label>0</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="KPPOUND"> <label>#</label> <size>28,28</size> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <cols>3</cols> </object> </object> <orient>wxHORIZONTAL</orient> <object class="sizeritem"> <flag>wxALIGN_CENTER</flag> <border>7</border> <object class="wxGridSizer"> <object class="sizeritem"> <object class="wxButton" name="OT0"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT1"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT2"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT3"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <cols>3</cols> <object class="sizeritem"> <object class="wxButton" name="OT4"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT5"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT6"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT7"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT8"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT9"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT10"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT11"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> </object> </object> </object> <border>50</border> <flag>wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxFlexGridSizer"> <cols>1</cols> <rows>0</rows> <vgap>0</vgap> <hgap>0</hgap> <growablecols>0</growablecols> <growablerows>0</growablerows> <object class="sizeritem"> <flag>wxALL|wxALIGN_CENTER</flag> <object class="wxBoxSizer"> <orient>wxHORIZONTAL</orient> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="Dial"> <label>Dial</label> <size></size> <tooltip>Server/Direct Dial</tooltip> </object> </object> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>0</border> <object class="wxButton" name="Hangup"> <label>Hangup</label> </object> </object> </object> </object> </object> <flag>wxEXPAND|wxALL|wxALIGN_CENTER</flag> </object> <minsize/> <growablerows>1</growablerows> </object> </object> <object class="wxPanel" name="Panel"> <pos></pos> <object class="wxFlexGridSizer"> <cols>1</cols> <rows>0</rows> <growablecols>0</growablecols> <object class="sizeritem"> <flag>wxEXPAND|wxALL|wxALIGN_LEFT</flag> <border>5</border> <object class="wxBoxSizer"> <orient>wxVERTICAL</orient> <object class="spacer"> <size>05</size> <flag>wxEXPAND|wxGROW</flag> </object> <object class="sizeritem"> <object class="wxGauge" name="Input"> <style></style> <tooltip>Input Audio meter</tooltip> </object> <minsize>100,13</minsize> <flag>wxEXPAND</flag> </object> <object class="sizeritem"> <object class="wxGauge" name="Output"> <tooltip>Output Audio meter</tooltip> </object> <minsize>100,13</minsize> <flag>wxEXPAND</flag> </object> </object> <minsize></minsize> </object> <object class="sizeritem"> <flag>wxALL|wxEXPAND|wxGROW|wxALIGN_LEFT</flag> <border>5</border> <object class="wxFlexGridSizer"> <object class="sizeritem"> <object class="unknown" name="Calls"> <style>wxLC_REPORT|wxLC_SINGLE_SEL</style> </object> <minsize>100,72</minsize> <flag>wxEXPAND|wxGROW</flag> </object> <cols>1</cols> <rows>1</rows> <growablecols>0</growablecols> <growablerows>0</growablerows> </object> </object> <object class="sizeritem"> <flag>wxEXPAND|wxALIGN_CENTRE</flag> <object class="wxFlexGridSizer"> <object class="spacer"> <size>5,1</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Server:</label> <style>wxALIGN_RIGHT</style> </object> </object> <object class="sizeritem"> <object class="wxChoice" name="Server"> <content/> <tooltip>Default server for Direct Dialling</tooltip> </object> <flag>wxEXPAND</flag> </object> <object class="spacer"> <size>1,1</size> </object> <object class="spacer"> <size>1,1</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Direct Dial:</label> <style>wxALIGN_RIGHT</style> </object> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxTextCtrl" name="Extension"> <tooltip>Dial this number @ selected server</tooltip> </object> <minsize>180,24</minsize> <flag>wxEXPAND</flag> </object> <cols>4</cols> <rows>2</rows> <vgap>5</vgap> <hgap>5</hgap> <growablecols>2</growablecols> <object class="spacer"> <size>1,1</size> </object> <object class="spacer"> <size>1,1</size> </object> </object> <border>5</border> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <orient>wxHORIZONTAL</orient> <object class="sizeritem"> <flag>wxALIGN_CENTER</flag> <border>7</border> <object class="wxGridSizer"> <object class="sizeritem"> <object class="wxButton" name="OT0"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT1"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT2"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT3"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <cols>3</cols> <object class="sizeritem"> <object class="wxButton" name="OT4"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT5"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT6"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT7"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT8"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT9"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT10"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxButton" name="OT11"> <label></label> </object> <border>2</border> <flag>wxALL|wxALIGN_CENTER</flag> </object> </object> </object> </object> <border>50</border> <flag>wxALIGN_CENTER</flag> </object> <object class="sizeritem"> <object class="wxFlexGridSizer"> <cols>1</cols> <rows>0</rows> <vgap>0</vgap> <hgap>0</hgap> <growablecols>0</growablecols> <growablerows>0</growablerows> <object class="sizeritem"> <flag>wxALL|wxALIGN_CENTER</flag> <object class="wxBoxSizer"> <orient>wxHORIZONTAL</orient> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="Dial"> <label>Dial</label> <size></size> <tooltip>Server/Direct Dial</tooltip> </object> </object> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>0</border> <object class="wxButton" name="Hangup"> <label>Hangup</label> </object> </object> </object> </object> </object> <flag>wxEXPAND|wxALL|wxALIGN_CENTER</flag> </object> <minsize/> <growablerows>1</growablerows> </object> </object> </resource> --- NEW FILE: prefs.xrc --- <?xml version="1.0" ?> <resource version="2.3.0.1" xmlns="http://www.wxwindows.org/wxxrc"> <object class="wxDialog" name="Prefs"> <title>Preferences</title> <centered>1</centered> <object class="wxFlexGridSizer"> <cols>1</cols> <rows>0</rows> <vgap>0</vgap> <hgap>0</hgap> <growablecols>0</growablecols> <growablerows>0</growablerows> <object class="sizeritem"> <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxALL</flag> <border>5</border> <object class="wxNotebook" name="PrefsNotebook"> <usenotebooksizer>1</usenotebooksizer> <size>200,160</size> <object class="notebookpage"> <label>Audio</label> <object class="wxPanel" name="AudioTab"> <object class="wxFlexGridSizer"> <cols>1</cols> <object class="spacer"> <size>5,5</size> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Input Device: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT|wxALIGN_BOTTOM</flag> </object> <object class="sizeritem"> <object class="wxChoice" name="InputDevice"> <content/> </object> <minsize>260,24</minsize> <border>10</border> <flag>wxALIGN_RIGHT</flag> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Output Device: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT|wxALIGN_BOTTOM</flag> </object> <object class="sizeritem"> <object class="wxChoice" name="OutputDevice"> <content/> </object> <minsize>260,24</minsize> <border>10</border> <flag>wxALIGN_RIGHT</flag> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Ring Device: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT|wxALIGN_BOTTOM</flag> </object> <object class="sizeritem"> <object class="wxChoice" name="RingDevice"> <content/> </object> <minsize>260,24</minsize> <border>10</border> <flag>wxALIGN_RIGHT</flag> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <vgap>8</vgap> </object> </object> </object> <object class="notebookpage"> <label>Appearance</label> <object class="wxPanel" name="Appearance"> <object class="wxFlexGridSizer"> <cols>1</cols> <object class="spacer"> <size>5,5</size> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="spacer"> <size>10,10</size> </object> <object class="sizeritem"> <object class="wxStaticText"> <label>Show Keypad: </label> </object> <minsize>100,20</minsize> <flag>wxALIGN_RIGHT|wxALIGN_BOTTOM</flag> </object> <object class="sizeritem"> <object class="wxCheckBox" name="ShowKeyPad"> <label>(Requires Restart)</label> </object> <minsize>260,24</minsize> <border>10</border> <flag>wxALIGN_RIGHT</flag> </object> <orient></orient> </object> <border>10</border> <minsize></minsize> </object> <vgap>8</vgap> </object> </object> </object> </object> </object> <object class="sizeritem"> <object class="wxBoxSizer"> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_SAVE"> <label>Save</label> <enabled>0</enabled> </object> </object> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_APPLY"> <label>Apply</label> <enabled>0</enabled> </object> </object> <object class="sizeritem"> <flag>wxALIGN_CENTRE|wxALL</flag> <border>5</border> <object class="wxButton" name="wxID_CANCEL"> <label>Cancel</label> </object> </object> <orient></orient> </object> <border></border> <minsize></minsize> <flag>wxALL|wxALIGN_CENTER</flag> </object> </object> </object> </resource> |
From: <st...@us...> - 2003-09-15 22:04:22
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/iaxcomm/rc In directory sc8-pr-cvs1:/tmp/cvs-serv15672/rc Log Message: Directory /cvsroot/iaxclient/iaxclient/simpleclient/iaxcomm/rc added to the repository |
From: <st...@us...> - 2003-09-15 22:03:45
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/iaxcomm In directory sc8-pr-cvs1:/tmp/cvs-serv15526/iaxcomm Log Message: Directory /cvsroot/iaxclient/iaxclient/simpleclient/iaxcomm added to the repository |
From: <st...@us...> - 2003-09-09 14:43:48
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv24151 Modified Files: wx.cc Log Message: make some defaults configurable at build-time via DEFINES fix problem where numCalls=1 and no callbox used. Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- wx.cc 11 Jul 2003 17:40:26 -0000 1.41 +++ wx.cc 9 Sep 2003 14:43:45 -0000 1.42 @@ -27,6 +27,17 @@ #define LEVEL_MIN -50 #define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" +#ifndef DEFAULT_NUM_CALLS +#define DEFAULT_NUM_CALLS 4 +#endif + +#ifndef DEFAULT_DESTSERV +#define DEFAULT_DESTSERV "gu...@mi..." +#endif + +#ifndef DEFAULT_DESTEXT +#define DEFAULT_DESTEXT "s@default" +#endif class IAXClient : public wxApp { @@ -339,7 +350,7 @@ IAXFrame::IAXFrame(const wxChar *title, int xpos, int ypos, int width, int height) - : wxFrame((wxFrame *) NULL, -1, title, wxPoint(xpos, ypos), wxSize(width, height)) + : wxFrame((wxFrame *) NULL, -1, title, wxPoint(xpos, ypos), wxSize(width, height)), calls(NULL) { wxBoxSizer *panelSizer = new wxBoxSizer(wxVERTICAL); wxPanel *aPanel = new wxPanel(this); @@ -428,19 +439,19 @@ /* Server */ topsizer->Add(iaxServLabel = new wxStaticText(aPanel, -1, _T("Server:"))); - topsizer->Add(iaxServ = new wxComboBox(aPanel, -1, _T("gu...@mi..."), + topsizer->Add(iaxServ = new wxComboBox(aPanel, -1, _T(DEFAULT_DESTSERV), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); - iaxServ->Append("gu...@mi..."); + iaxServ->Append(DEFAULT_DESTSERV); iaxServ->Append("guest@ast1"); iaxServ->Append("guest@asterisk"); /* Destination */ topsizer->Add(iaxDestLabel = new wxStaticText(aPanel, -1, _T("Number:"))); - topsizer->Add(iaxDest = new wxComboBox(aPanel, -1, _T("s@default"), + topsizer->Add(iaxDest = new wxComboBox(aPanel, -1, _T(DEFAULT_DESTEXT), wxDefaultPosition, wxDefaultSize),0,wxEXPAND); - iaxDest->Append("s@default"); + iaxDest->Append(DEFAULT_DESTEXT); iaxDest->Append("8068"); iaxDest->Append("208"); iaxDest->Append("600"); @@ -670,7 +681,8 @@ ret = HandleStatusEvent(e->ev.text.message); break; case IAXC_EVENT_STATE: - ret = theFrame->calls->HandleStateEvent(e->ev.call); + if(calls) + ret = theFrame->calls->HandleStateEvent(e->ev.call); break; default: break; // not handled @@ -759,7 +771,7 @@ bool IAXClient::OnInit() { optNoDialPad = false; - optNumCalls = 4; + optNumCalls = DEFAULT_NUM_CALLS; if(!wxApp::OnInit()) return false; |
From: <st...@us...> - 2003-09-09 14:41:52
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv23778 Modified Files: iaxclient.h Log Message: add comment. Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- iaxclient.h 10 Jul 2003 21:59:32 -0000 1.17 +++ iaxclient.h 9 Sep 2003 14:41:47 -0000 1.18 @@ -123,7 +123,18 @@ int devID; /* driver-specific ID */ }; -int iaxc_audio_devices_get(struct iaxc_audio_device **devs, int *nDevs, int *input, int *output, int *ring); +/* Get audio device information: + * **devs: a pointer to an array of device structures, as declared above. function + * will give you a pointer to the proper array, which will be valid as long as iaxc is + * initialized. + * + * *nDevs: a pointer to an int, to which the count of devices in the array devs will be + * written + * + * *input, *output, *ring: the currently selected devices for input, output, ring will + * be written to the int pointed to by these pointers. + */ +int iaxc_audio_devices_get(struct iaxc_audio_device **devs, int *nDevs, int *input, int *output, int *ring); int iaxc_audio_devices_set(int input, int output, int ring); |
From: <st...@us...> - 2003-08-05 13:38:08
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv10237 Modified Files: winiax.h Log Message: new winiax.h from tili Index: winiax.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX/winiax.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- winiax.h 13 Jun 2003 22:32:00 -0000 1.1 +++ winiax.h 5 Aug 2003 13:38:05 -0000 1.2 @@ -1,28 +1,52 @@ -#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); +#include "gsm\inc\gsm.h" +#include "stdio.h" +#include "process.h" +//#include "sox.h" + + +HWND m_hwndMainDlg; +UINT_PTR m_iTimerId; +HBRUSH hBr; +HMENU hMenu; +int iSelLine; +int iTotCalls; +int piLines[3]; +char szRegUser[50]; +char szRegPass[50]; +char szRegServer[60]; +BOOL bPTT; +BOOL bSilence; +HWND hStBgClr; +HWND hStTxtClr; +COLORREF clrBg; +COLORREF clrTxt; +COLORREF clrTmpBg; +COLORREF clrTmpTxt; + + +void SelectLine(int line); + + +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(); +int 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); +void OnRegister(); +INT_PTR RegDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +INT_PTR PrefDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); +int HandleStateEvent(struct iaxc_ev_call_state c); +void ShowSoundSettings(); +void ShowPreferences(); +void SaveAudioSettings(char *szPlayback,char *szRecord,char *szRing); +BOOL RestoreAudioSettings(char *szPlayback,char* szRecord,char *szRing); +void SavePreferences(int iPTT,int iSilence); +BOOL RestorePreferences(int *iPTT,int *iSilence); +void TogglePTT(int iPTT); +void SelectColor(COLORREF *clr); \ No newline at end of file |
From: <st...@us...> - 2003-07-26 01:45:20
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv13293 Modified Files: WinIAX.cpp resource.h resource.rc Log Message: More changes from Tili. Index: WinIAX.cpp =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX/WinIAX.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- WinIAX.cpp 16 Jul 2003 14:41:48 -0000 1.3 +++ WinIAX.cpp 25 Jul 2003 23:02:18 -0000 1.4 @@ -2,12 +2,12 @@ // #include "stdafx.h" -#include "mmsystem.h" +#include "mmsystem.h" #include "winiax.h" #include "resource.h" #include "iaxclient.h" #include "commctrl.h" -#include "Commdlg.h" +#include "Commdlg.h" [...1344 lines suppressed...] + iaxc_set_audio_output(0); // unmute output + } +} + +void SelectColor(COLORREF *clr) +{ + CHOOSECOLOR chlr; + static COLORREF clrCust[16]; + ZeroMemory(&chlr,sizeof(CHOOSECOLOR)); + chlr.lStructSize=sizeof(CHOOSECOLOR); + chlr.Flags=CC_FULLOPEN|CC_RGBINIT; + chlr.lpCustColors=clrCust; + +// chlr.rgbResult=*clr; + if(ChooseColor(&chlr)) + { + *clr=chlr.rgbResult; + } +} + Index: resource.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX/resource.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- resource.h 13 Jun 2003 22:32:00 -0000 1.1 +++ resource.h 25 Jul 2003 23:02:18 -0000 1.2 @@ -3,6 +3,13 @@ // Used by resource.rc // #define IDD_MAIN_DLG 101 +#define IDD_DLG_REGISTER 102 +#define IDR_MENU1 103 +#define IDR_RING 104 +#define IDI_ICON2 108 +#define IDI_ICON1 108 +#define IDD_DLG_SOUND 109 +#define IDD_DLG_PREFERENCES 112 #define IDC_BN_DIAL 1000 #define IDC_E_IAX_URI 1001 #define IDC_BN_HANGUP 1002 @@ -21,14 +28,37 @@ #define IDC_BN_HASH 1023 #define IDC_PROG_OUTPUT 1024 #define IDC_PROG_INPUT 1025 +#define IDC_E_GATEWAY 1026 +#define IDC_E_USER 1027 +#define IDC_E_PASS 1028 +#define IDC_ST_GATEWAY 1029 +#define IDC_ST_USER_NAME 1030 +#define IDC_ST_PASSWORD 1031 +#define IDC_RD_LINE_1 1032 +#define IDC_RD_LINE_2 1033 +#define IDC_RD_LINE_3 1034 +#define IDC_ST_STATE 1035 +#define IDC_CMB_PLAYBACK 1036 +#define IDC_CMB_RECORDING 1037 +#define IDC_CMB_RINGTONE 1038 +#define IDC_CHK_PTT 1040 +#define IDC_CHK_SILENCE 1042 +#define IDC_BN_BG 1044 +#define IDC_BN_TEXT 1045 +#define IDC_ST_TXTCLR 1046 +#define IDC_ST_BGCLR 1047 +#define ID_FILE_REGISTER 40001 +#define ID_FILE_EXIT 40002 +#define ID_TOOLS_SOUNDSETTINGS 40003 +#define ID_TOOLS_PREFERENCES 40004 // 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_RESOURCE_VALUE 113 +#define _APS_NEXT_COMMAND_VALUE 40006 +#define _APS_NEXT_CONTROL_VALUE 1048 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif Index: resource.rc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX/resource.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- resource.rc 13 Jun 2003 22:32:00 -0000 1.1 +++ resource.rc 25 Jul 2003 23:02:18 -0000 1.2 @@ -54,30 +54,52 @@ IDD_MAIN_DLG DIALOG DISCARDABLE 0, 0, 234, 175 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dialog" +CAPTION "WinIAX Client" FONT 8, "MS Sans Serif" BEGIN - PUSHBUTTON "Dial",IDC_BN_DIAL,67,34,50,14 + DEFPUSHBUTTON "Dial",IDC_BN_DIAL,56,103,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 + PUSHBUTTON "Hangup",IDC_BN_HANGUP,126,104,50,14 + LTEXT "Welcome to WinIAX Client",IDC_ST_STATUS,7,124,220,9 + PUSHBUTTON "1",IDC_BN_1,90,45,17,14 + PUSHBUTTON "2",IDC_BN_2,108,45,17,14 + PUSHBUTTON "3",IDC_BN_3,126,45,17,14 + PUSHBUTTON "4",IDC_BN_4,90,59,17,14 + PUSHBUTTON "5",IDC_BN_5,108,59,17,14 + PUSHBUTTON "6",IDC_BN_6,126,59,17,14 + PUSHBUTTON "7",IDC_BN_7,90,73,17,14 + PUSHBUTTON "8",IDC_BN_8,108,73,17,14 + PUSHBUTTON "9",IDC_BN_9,126,73,17,14 + PUSHBUTTON "*",IDC_BN_ASTERISK,90,87,17,14 + PUSHBUTTON "0",IDC_BN_0,108,87,17,14 + PUSHBUTTON "#",IDC_BN_HASH,126,87,17,14 CONTROL "Progress1",IDC_PROG_OUTPUT,"msctls_progress32", - PBS_VERTICAL | WS_BORDER,204,49,8,73 + PBS_VERTICAL | WS_BORDER,204,30,8,73 CONTROL "Progress2",IDC_PROG_INPUT,"msctls_progress32", - PBS_VERTICAL | WS_BORDER,219,49,8,73 + PBS_VERTICAL | WS_BORDER,219,30,8,73 + CONTROL "Line 1",IDC_RD_LINE_1,"Button",BS_AUTORADIOBUTTON,47,31, + 35,10 + CONTROL "Line 2",IDC_RD_LINE_2,"Button",BS_AUTORADIOBUTTON,99,31, + 35,10 + CONTROL "Line 3",IDC_RD_LINE_3,"Button",BS_AUTORADIOBUTTON,151, + 31,35,10 + LTEXT "State",IDC_ST_STATE,7,151,175,17 +END + +IDD_DLG_REGISTER DIALOG DISCARDABLE 0, 0, 286, 98 +STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Registration info" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "OK",IDOK,65,77,50,14 + PUSHBUTTON "Cancel",IDCANCEL,149,77,50,14 + EDITTEXT IDC_E_GATEWAY,59,52,210,14,ES_AUTOHSCROLL + LTEXT "IAX Server",IDC_ST_GATEWAY,21,54,35,8 + EDITTEXT IDC_E_USER,59,10,111,14,ES_AUTOHSCROLL + EDITTEXT IDC_E_PASS,59,31,111,14,ES_AUTOHSCROLL + LTEXT "Password",IDC_ST_PASSWORD,24,37,32,8 + LTEXT "User",IDC_ST_USER_NAME,40,16,16,8 END @@ -96,10 +118,152 @@ TOPMARGIN, 7 BOTTOMMARGIN, 168 END + + IDD_DLG_REGISTER, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 279 + TOPMARGIN, 7 + BOTTOMMARGIN, 91 + END END #endif // APSTUDIO_INVOKED #endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// Dutch (Netherlands) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLD) +#ifdef _WIN32 +LANGUAGE LANG_DUTCH, SUBLANG_DUTCH +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_MENU1 MENU DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Register", ID_FILE_REGISTER + MENUITEM "E&xit", ID_FILE_EXIT + END + POPUP "&Tools" + BEGIN + MENUITEM "Sound Settings", ID_TOOLS_SOUNDSETTINGS + MENUITEM "Preferences", ID_TOOLS_PREFERENCES + END +END + +#endif // Dutch (Netherlands) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DLG_SOUND DIALOG DISCARDABLE 0, 0, 249, 129 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Sound Device Configuration" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Save",IDOK,72,108,50,14 + PUSHBUTTON "Cancel",IDCANCEL,127,108,50,14 + LTEXT "Sound Playback:",IDC_STATIC,7,27,55,8 + LTEXT "Sound Recording:",IDC_STATIC,7,52,58,8 + LTEXT "Ring Tone Device:",IDC_STATIC,7,77,61,8 + COMBOBOX IDC_CMB_PLAYBACK,71,28,171,38,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + COMBOBOX IDC_CMB_RECORDING,71,51,171,42,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP + COMBOBOX IDC_CMB_RINGTONE,71,74,171,38,CBS_DROPDOWN | WS_VSCROLL | + WS_TABSTOP +END + +IDD_DLG_PREFERENCES DIALOG DISCARDABLE 0, 0, 261, 135 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dialog" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "&Save",IDOK,74,114,50,14 + PUSHBUTTON "Cancel",IDCANCEL,134,114,50,14 + CONTROL "Enable push to talk.",IDC_CHK_PTT,"Button", + BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,7,247,10 + LTEXT "Your voice will be recorded and sent over network when you have \n Ctrl key pressed. ", + IDC_STATIC,7,17,264,17 + CONTROL "Enable Silence Filter",IDC_CHK_SILENCE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,40,80,10 + LTEXT "This will automatically recognize when you are silent and will send voice data \nover internet according to that.", + IDC_STATIC,7,51,247,18 + LTEXT "",IDC_ST_BGCLR,80,83,22,14,NOT WS_VISIBLE + PUSHBUTTON "Background",IDC_BN_BG,21,83,50,14,NOT WS_VISIBLE + PUSHBUTTON "Text",IDC_BN_TEXT,135,83,50,14,NOT WS_VISIBLE + LTEXT "",IDC_ST_TXTCLR,195,83,22,14,NOT WS_VISIBLE + GROUPBOX "Window Color Settings",IDC_STATIC,7,74,247,36,NOT + WS_VISIBLE +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + IDD_DLG_SOUND, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 242 + TOPMARGIN, 7 + BOTTOMMARGIN, 122 + END + + IDD_DLG_PREFERENCES, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 254 + TOPMARGIN, 7 + BOTTOMMARGIN, 128 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_ICON1 ICON DISCARDABLE "icon1.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// 24 +// + +1 24 DISCARDABLE "default1.bin" +#endif // English (U.K.) resources ///////////////////////////////////////////////////////////////////////////// |
From: <st...@us...> - 2003-07-26 01:45:19
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv13360 Added Files: icon1.ico Log Message: Icon from Tili --- NEW FILE: icon1.ico --- (This appears to be a binary file; contents omitted.) |
From: <st...@us...> - 2003-07-21 22:23:06
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/iaxphone In directory sc8-pr-cvs1:/tmp/cvs-serv22017 Added Files: Info.plist Log Message: Initial hacked up Info.plist file for MacOSX. --- NEW FILE: Info.plist --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>English</string> <key>CFBundleExecutable</key> <string>iaxphone</string> <key>CFBundleGetInfoString</key> <string>iaxphone</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>wx</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>wx</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.1.1</string> <key>CSResourcesFileMapped</key> <true/> </dict> </plist> |
From: <st...@us...> - 2003-07-21 22:17:31
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/iaxphone In directory sc8-pr-cvs1:/tmp/cvs-serv21032 Added Files: Makefile iaxphone.cc iaxphone.h Log Message: IAXPhone: A new client based on "wx" by Michael Van Donselaar <mv...@va...> --- NEW FILE: Makefile --- CFLAGS=-I../../lib -I../../lib/libiax/src -I../../lib/gsm/inc -I../../lib/portaudio/pa_common -I../../lib/portaudio/pablio -Iinclude #debug CFLAGS:= $(CFLAGS) -g OBJS= iaxphone.o REZ=echo LIBS= ../../lib/libiaxclient.a EXEEXT= # glean the platform # We will define this as either Linux, Win32, or MacOSX ifneq (,$(findstring Linux,$(shell uname))) OSTYPE=LINUX else ifneq (,$(findstring Darwin,$(shell uname))) OSTYPE=MACOSX else # CYGWIN reports CYGWIN_NT-5.0 under Win2K ifneq (,$(findstring WIN,$(shell uname))) OSTYPE=WIN32 else $(warning OSTYPE cannot be detected, assuming Linux) OSTYPE=LINUX endif endif endif ifeq ($(OSTYPE),WIN32) #include $(WXWIN)/src/makeg95.env #include $(WXWIN)/src/makeprog.g95 PROG=iaxphone.exe TARGET=iaxphone.exe CFLAGS:= $(CFLAGS) -I$(WXWIN)/include -I$(WXWIN)/lib/mswd -fno-rtti -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -DWINVER=0x400 -D__WIN95__ -DSTRICT -D__WXDEBUG__ WINSYSFLAGS=-Wl,--subsystem,windows -mwindows #WINSYSFLAGS= SYSLIBS=$(WINSYSFLAGS) -lwinmm -lwsock32 -lwxmswd -lcomdlg32 -luser32 -lgdi32 -lole32 -lwsock32 -lcomctl32 -lctl3d32 -lgcc -lstdc++ -lshell32 -loleaut32 -ladvapi32 -luuid -L$(WXWIN)/lib endif ifeq ($(OSTYPE),LINUX) PROG=iaxphone TARGET=iaxphone CFLAGS:= $(CFLAGS) -DPOSIXSLEEP `wx-config --cflags` `gtk-config --cflags` SYSLIBS=-lpthread -lm `wx-config --static --libs` endif ifeq ($(OSTYPE),MACOSX) PROG=iaxphone TARGET=iaxphone.app CFLAGS:= $(CFLAGS) -DPOSIXSLEEP `wx-config --cflags` SYSLIBS=-framework CoreAudio -framework AudioToolbox `wx-config --libs` CXX=`wx-config --cxx` REZ=`wx-config --rezflags` endif CPPFLAGS = $(CFLAGS) all: makelib $(TARGET) clean: rm -f $(OBJS) $(PROG) makelib: (cd ../../lib; make libiaxclient.a) ../../lib/libiaxclient.a: (cd ../../lib; make libiaxclient.a) $(PROG): $(OBJS) $(LIBS) $(CXX) $(OBJS) $(LIBS) $(SYSLIBS) -o $(PROG) $(PROG).app: $(OBJS) $(LIBS) mkdir -p $(PROG).app/Contents/MacOS $(PROG).app/Contents/Resources cp `wx-config --prefix`/lib/libwx_mac*.rsrc $(PROG).app/Contents/Resources/$(PROG).rsrc echo -n "APPL????" > $(PROG).app/Contents/PkgInfo cp Info.plist $(PROG).app/Contents/Info.plist $(CXX) $(OBJS) $(LIBS) $(SYSLIBS) -o $(PROG).app/Contents/MacOS/$(PROG) --- NEW FILE: iaxphone.cc --- // For compilers that supports precompilation , includes wx/wx.h include #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "wx/cmdline.h" #include "wx/listctrl.h" #include "wx/combobox.h" #include "wx/tokenzr.h" #include "wx/stattext.h" #include "wx/string.h" #include "wx/config.h" #include "wx/confbase.h" #include "iaxclient.h" #include "iaxphone.h" static IAXFrame *theFrame; [...1183 lines suppressed...] config->DeleteGroup(KeyPath); // Remove it from the combobox, as well SpeedDial->Delete(SpeedDial->FindString(SpeedDialVal)); Server->SetValue(""); Extension->Clear(); break; case ID_DIAL: theFrame->DialBySpeedDialName(SpeedDial->GetValue()); } // Write out changes delete config; } BEGIN_EVENT_TABLE(DialDialog, wxDialog) EVT_COMBOBOX(ID_SPEEDDIAL, DialDialog::OnComboBox) EVT_BUTTON(ID_ADD, DialDialog::OnButton) EVT_BUTTON(ID_REMOVE, DialDialog::OnButton) EVT_BUTTON(ID_DIAL, DialDialog::OnButton) END_EVENT_TABLE() --- NEW FILE: iaxphone.h --- /* for the silly key state stuff :( */ #ifdef __WXGTK__ #include <gdk/gdk.h> #endif #ifdef __WXMAC__ #include <Carbon/Carbon.h> #endif #define LEVEL_MAX -10 #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); bool optNoDialPad; wxString optDestination; long optNumCalls; wxString optRegistration; }; DECLARE_APP(IAXClient) IMPLEMENT_APP(IAXClient) // forward decls for callbacks extern "C" { static int iaxc_callback(iaxc_event e); int doTestCall(int ac, char **av); } // event constants enum { // DTMF events ID_DTMF_1 = 0, ID_DTMF_2, ID_DTMF_3, ID_DTMF_4, ID_DTMF_5, ID_DTMF_6, ID_DTMF_7, ID_DTMF_8, ID_DTMF_9, ID_DTMF_STAR, ID_DTMF_O, ID_DTMF_POUND, ID_SPEEDDIAL, // IAXFrame Buttons ID_DIAL = 100, ID_HANG, // File Menu items ID_QUIT = 200, // Options Menu items ID_PTT = 300, ID_MUTE, ID_SILENCE, ID_REGISTER, ID_AUDIO, ID_SERVER, ID_SPEED, ID_CALLS = 400, ID_REG, IAXCLIENT_EVENT = 500, ID_MAX }; static char *buttonlabels[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "*", "0", "#" }; class IAXTimer : public wxTimer { public: void IAXTimer::Notify(); }; class RegList : public wxListCtrl { public: RegList(wxWindow *parent, int regcount); void RegList::OnSelect(wxListEvent &evt); void RegList::OnSize(wxSizeEvent& evt); void RegList::AutoSize(); int regcount; protected: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(RegList, wxListCtrl) EVT_LIST_ITEM_SELECTED(ID_REG, RegList::OnSelect) EVT_SIZE(RegList::OnSize) END_EVENT_TABLE() class IAXCalls : public wxListCtrl { public: IAXCalls(wxWindow *parent, int nCalls); void IAXCalls::OnSelect(wxListEvent &evt); int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c); void IAXCalls::OnSize(wxSizeEvent& evt); void IAXCalls::AutoSize(); int IAXCalls::GetTotalHeight(); int nCalls; protected: DECLARE_EVENT_TABLE() }; BEGIN_EVENT_TABLE(IAXCalls, wxListCtrl) EVT_LIST_ITEM_SELECTED(ID_CALLS, IAXCalls::OnSelect) EVT_SIZE(IAXCalls::OnSize) END_EVENT_TABLE() class AudioDialog : public wxDialog { public: AudioDialog(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style = wxDEFAULT_DIALOG_STYLE); protected: void OnButton(wxCommandEvent &event); DECLARE_EVENT_TABLE() private: enum { ID_INDEVICE = 201, ID_OUTDEVICE, ID_RINGDEVICE, ID_ECHOCANCEL, ID_SAVE }; wxChoice *InDevice; wxChoice *OutDevice; wxChoice *RingDevice; wxCheckBox *EchoCancel; wxButton *Save; }; class ServerDialog : public wxDialog { public: ServerDialog(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style = wxDEFAULT_DIALOG_STYLE); protected: void OnComboBox(wxCommandEvent &event); void OnButton(wxCommandEvent &event); DECLARE_EVENT_TABLE() private: enum { ID_SERVER = 201, ID_HOST, ID_USERNAME, ID_PASSWORD, ID_AUTOREGISTER, ID_ADD, ID_REMOVE }; wxComboBox *Server; wxTextCtrl *Host; wxTextCtrl *Username; wxTextCtrl *Password; wxCheckBox *AutoRegister; wxButton *Add; wxButton *Remove; }; class DialDialog : public wxDialog { public: DialDialog(wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style = wxDEFAULT_DIALOG_STYLE); protected: void OnComboBox(wxCommandEvent &event); void OnButton(wxCommandEvent &event); DECLARE_EVENT_TABLE() private: enum { ID_SPEEDDIAL = 201, ID_SERVER, ID_EXTENSION, ID_ADD, ID_REMOVE, ID_DIAL }; wxComboBox *SpeedDial; wxComboBox *Server; wxTextCtrl *Extension; wxButton *Save; wxButton *Remove; }; class IAXFrame : public wxFrame { public: IAXFrame(const wxChar *title, int xpos, int ypos, int width, int height); ~IAXFrame(); void IAXFrame::OnDTMF(wxEvent &evt); void IAXFrame::OnDial(wxEvent &evt); void IAXFrame::OnHangup(wxEvent &evt); void IAXFrame::OnQuit(wxEvent &evt); void IAXFrame::OnPTTChange(wxCommandEvent &evt); void IAXFrame::OnSilenceChange(wxCommandEvent &evt); void IAXFrame::OnNotify(void); void IAXFrame::OnAudioDialog(wxCommandEvent &evt); void IAXFrame::OnServerDialog(wxCommandEvent &evt); void IAXFrame::OnDialDialog(wxCommandEvent &evt); // utility methods void IAXFrame::RegisterByName(wxString RegName); void IAXFrame::DialBySpeedDialName(wxString name); void IAXFrame::SetAudioDeviceByName(wxString in, wxString out, wxString ring); // Handlers for library-initiated events void IAXFrame::HandleEvent(wxCommandEvent &evt); int IAXFrame::HandleIAXEvent(iaxc_event *e); int IAXFrame::HandleStatusEvent(char *msg); int IAXFrame::HandleLevelEvent(float input, float output); bool IAXFrame::GetPTTState(); void IAXFrame::CheckPTT(); void IAXFrame::SetPTT(bool state); wxGauge *input; wxGauge *output; IAXTimer *timer; wxComboBox *iaxServ; wxComboBox *iaxDest; wxComboBox *SpeedDial; wxStaticText *muteState; RegList *registrations; IAXCalls *calls; bool pttMode; // are we in PTT mode? bool pttState; // is the PTT button pressed? bool silenceMode; // are we in silence suppression mode? protected: DECLARE_EVENT_TABLE() #ifdef __WXGTK__ GdkWindow *keyStateWindow; #endif }; |
From: <st...@us...> - 2003-07-21 22:16:30
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/iaxphone In directory sc8-pr-cvs1:/tmp/cvs-serv21011/iaxphone Log Message: Directory /cvsroot/iaxclient/iaxclient/simpleclient/iaxphone added to the repository |
From: <st...@us...> - 2003-07-21 17:44:31
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/testcall In directory sc8-pr-cvs1:/tmp/cvs-serv30176 Modified Files: testcall.c Log Message: test result from initialization, bail if it can't initialize. Index: testcall.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/testcall/testcall.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- testcall.c 16 Jun 2003 23:01:29 -0000 1.9 +++ testcall.c 21 Jul 2003 17:44:29 -0000 1.10 @@ -34,6 +34,11 @@ return; } +void fatal_error(char *err) { + killem(); + fprintf(stderr, "FATAL ERROR: %s\n", err); + exit(1); +} void mysleep(void) { @@ -58,6 +63,17 @@ } } +void list_devices() +{ + struct iaxc_audio_device *devs; + int nDevs, input, output, ring; + int i; + + iaxc_audio_devices_get(&devs,&nDevs, &input, &output, &ring); + for(i=0;i<nDevs;i++) { + fprintf(stderr, "DEVICE ID=%d NAME=%s CAPS=%x\n", devs[i].devID, devs[i].name, devs[i].capabilities); + } +} void usage() { @@ -105,9 +121,13 @@ /* activate the exit handler */ atexit(killem); - iaxc_initialize(AUDIO_INTERNAL_PA,1); + if(iaxc_initialize(AUDIO_INTERNAL_PA,1)) + fatal_error("cannot initialize iaxclient!"); + iaxc_set_encode_format(IAXC_FORMAT_GSM); iaxc_set_silence_threshold(silence_threshold); + + list_devices(); if(do_levels) iaxc_set_event_callback(iaxc_callback); |
From: <st...@us...> - 2003-07-16 18:25:00
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv21741 Added Files: default1.bin Log Message: From: fa...@ti... To: Steve Kann <st...@st...> Subject: WinXP resource Date: Wed, 16 Jul 2003 10:39:22 -0700 Hi. You might also need this bin file to be included in resources to give it a windows XP look on WIndowsXP. Thank you. Quoting Steve Kann <st...@st...>: > > What should I do with this file? Put it in the WinIAX directory? > Yes yess. if u try to compile it it would have given an error. --- NEW FILE: default1.bin --- <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity processorArchitecture="x86" version="5.1.0.0" type="win32" name="test.exe"/> <description>Test Application</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="x86"/> </dependentAssembly> </dependency> </assembly> |
From: <st...@us...> - 2003-07-16 14:41:52
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX In directory sc8-pr-cvs1:/tmp/cvs-serv8664 Modified Files: WinIAX.cpp Log Message: Tili's latest changes: From: fa...@ti... To: iaxclient devel <iax...@li...> Cc: st...@st... Subject: WinIAX Update. Date: Wed, 16 Jul 2003 07:33:34 -0700 Hi. Sorry for my lazyness. But finally I have made changes to make it work with steve' new iax1 library wrapping. It also stores the settings in registry. Except the Registration user name etc. That i will do in a day or so later, because i just realised that. :) Steve do something about CRLF for windows. Because the CVS version gives 2 lines in VC. VC gives error telling Carriage Return will be converted to new line. Hey .Bug me if you find any bug. Index: WinIAX.cpp =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/WinIAX/WinIAX.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- WinIAX.cpp 16 Jun 2003 23:01:29 -0000 1.2 +++ WinIAX.cpp 16 Jul 2003 14:41:48 -0000 1.3 @@ -2,10 +2,12 @@ // #include "stdafx.h" +#include "mmsystem.h" #include "winiax.h" #include "resource.h" #include "iaxclient.h" #include "commctrl.h" +#include "Commdlg.h" //#include "stdarg.h" //#include "varargs.h" @@ -13,6 +15,7 @@ #define LEVEL_MAX -10 #define LEVEL_MIN -50 #define TIMER_PROCESS_CALLS 1001 +#define CALLER_ID "Vocalis IAX Client" int iaxc_callback(iaxc_event e); @@ -25,16 +28,22 @@ WNDCLASSEX wnd; wnd.cbSize=sizeof WNDCLASSEX; wnd.lpfnWndProc=(WNDPROC)DialogProc; + wnd.lpszMenuName=MAKEINTRESOURCE(IDR_MENU1); + wnd.hInstance=hInstance; + int isz=sizeof(char); // 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); +// memset(piActiveLines,-1,sizeof(int)*3); +// iTotCalls=0; RegisterClassEx(&wnd); INITCOMMONCONTROLSEX cmtcl; cmtcl.dwSize=sizeof (INITCOMMONCONTROLSEX); cmtcl.dwICC=ICC_WIN95_CLASSES; InitCommonControlsEx(&cmtcl); hBr=CreateSolidBrush(RGB(40,100,150)); + bPTT=FALSE; // 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) @@ -43,6 +52,9 @@ TMessageBox("Couldnt create main dialog box\nAborting..."); return 0; } + hMenu=LoadMenu(NULL,MAKEINTRESOURCE(IDR_MENU1)); + SetMenu(m_hwndMainDlg,hMenu); + ShowWindow(m_hwndMainDlg,SW_SHOW); // PBM_SETRANGE(0,LEVEL_MAX-LEVEL_MIN); @@ -51,6 +63,22 @@ MSG msg; while(GetMessage(&msg,NULL,0,0)) { + if(bPTT) // if the user wants PTT option. + { + // we toggle the PTT like this + if(msg.message == WM_KEYDOWN) // when ctrl key is pressed + { + if(msg.wParam==VK_CONTROL) + TogglePTT(1); + } + if(msg.message==WM_KEYUP) // when ctrl key goesup + { + if(msg.wParam==VK_CONTROL) + TogglePTT(0); + } + } + // Normal message processing. + // IsDialogMessage for Dialogs to give tab stuff. if(!IsDialogMessage(m_hwndMainDlg,&msg)) { TranslateMessage(&msg); @@ -58,6 +86,7 @@ } } // KillTimer(NULL,m_iTimerId); + DestroyMenu(hMenu); iaxc_dump_call(); iaxc_process_calls(); for(int i=0;i<10;i++) { @@ -85,6 +114,10 @@ BOOL bRet=FALSE; switch (uMsg) { + case WM_CHAR: +// if((char)wParam=='F') + TMessageBox("F Pressed"); + break; case WM_INITDIALOG: bRet=OnInitDialog(); break; @@ -117,7 +150,7 @@ break; case IDC_BN_HANGUP: OnBnHangup(); - TMessageBox("Hangup Clicked"); +// TMessageBox("Hangup Clicked"); break; case IDC_BN_1: SendDTMF('1'); @@ -155,6 +188,26 @@ case IDC_BN_HASH: SendDTMF('#'); break; + case ID_FILE_REGISTER: + OnRegister(); + break; + case ID_FILE_EXIT: + DestroyWindow(m_hwndMainDlg); + break; + case ID_TOOLS_SOUNDSETTINGS: + ShowSoundSettings(); + break; + case ID_TOOLS_PREFERENCES: + ShowPreferences(); + case IDC_RD_LINE_1: + SelectLine(0); + break; + case IDC_RD_LINE_2: + SelectLine(1); + break; + case IDC_RD_LINE_3: + SelectLine(2); + break; // case IDC_PROG_INPUT: // break; @@ -172,18 +225,284 @@ return bRet; } +INT_PTR PrefDialogProc( 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_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_INITDIALOG: + { + int iPTT=0; + int iSilence=-99; + RestorePreferences(&iPTT,&iSilence); + SendMessage(GetDlgItem(hwndDlg,IDC_CHK_PTT),BM_SETCHECK,iPTT,0); + if(iSilence>0) + SendMessage(GetDlgItem(hwndDlg,IDC_CHK_SILENCE),BM_SETCHECK,iSilence,0); + } + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + { + int iPTT=0; + if(SendMessage(GetDlgItem(hwndDlg,IDC_CHK_PTT),BM_GETCHECK,0,0)==BST_CHECKED) + iPTT=1; + int iSilence=0; + if(SendMessage(GetDlgItem(hwndDlg,IDC_CHK_SILENCE),BM_GETCHECK,0,0)==BST_CHECKED) + iSilence=1; + SavePreferences(iPTT,iSilence); + EndDialog(hwndDlg,wParam); + bRet=TRUE; + } + break; + case IDCANCEL: + EndDialog(hwndDlg,wParam); + bRet=TRUE; + break; + case IDC_BN_TEXT: + SelectColor(&clrTmpTxt); + break; + case IDC_BN_BG: + SelectColor(&clrTmpBg); + break; + } + + } + } + return bRet; +} + +INT_PTR SoundDialogProc( 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_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_INITDIALOG: + { + char szOut[MAX_PATH]; + char szIn[MAX_PATH]; + char szRing[MAX_PATH]; + ZeroMemory(szOut,MAX_PATH); + ZeroMemory(szIn,MAX_PATH); + ZeroMemory(szRing,MAX_PATH); + // Get settings saved in Registry + BOOL bReg=RestoreAudioSettings(szOut,szIn,szRing); + + // our comboboxes + HWND hOut=GetDlgItem(hwndDlg,IDC_CMB_PLAYBACK); + HWND hIn=GetDlgItem(hwndDlg,IDC_CMB_RECORDING); + HWND hRing=GetDlgItem(hwndDlg,IDC_CMB_RINGTONE); + struct iaxc_audio_device *devices; // we wont have tht many devices + int nDevs=0; + int in=0,out=0,ring=0; + iaxc_audio_devices_get((struct iaxc_audio_device**)&devices,&nDevs,&in,&out,&ring); + // first lets go thru out devices. + for(int i=0;i<nDevs;i++) + { + if(devices[i].capabilities & IAXC_AD_OUTPUT) + { + SendMessage(hOut,CB_ADDSTRING,0,(LPARAM)devices[i].name); + if(!strcmp(szOut,devices[i].name)) + { + SetWindowText(hOut,devices[i].name); + } + else if(devices[i].capabilities & IAXC_AD_OUTPUT_DEFAULT && !bReg) + SetWindowText(hOut,devices[i].name); + + } + if(devices[i].capabilities & IAXC_AD_INPUT) + { + SendMessage(hIn,CB_ADDSTRING,0,(LPARAM)devices[i].name); + if(!strcmp(szIn,devices[i].name)) + { + SetWindowText(hIn,devices[i].name); + } + else if(devices[i].capabilities & IAXC_AD_INPUT_DEFAULT) + SetWindowText(hIn,devices[i].name); + } + if(devices[i].capabilities & IAXC_AD_RING) + { + SendMessage(hRing,CB_ADDSTRING,0,(LPARAM)devices[i].name); + if(!strcmp(szRing,devices[i].name)) + { + SetWindowText(hRing,devices[i].name); + } + else if(devices[i].capabilities & IAXC_AD_RING_DEFAULT) + SetWindowText(hRing,devices[i].name); + } + } + } + break; + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDOK: + { + + char szOut[MAX_PATH]; + char szIn[MAX_PATH]; + char szRing[MAX_PATH]; + // Select devices user has selected. + int iOut=SendMessage(GetDlgItem(hwndDlg,IDC_CMB_PLAYBACK),CB_GETCURSEL,0,0); + int iIn=SendMessage(GetDlgItem(hwndDlg,IDC_CMB_RECORDING),CB_GETCURSEL,0,0); + int iRing=SendMessage(GetDlgItem(hwndDlg,IDC_CMB_RINGTONE),CB_GETCURSEL,0,0); + + GetWindowText(GetDlgItem(hwndDlg,IDC_CMB_PLAYBACK),szOut,MAX_PATH); +// SendMessage(GetDlgItem(hwndDlg,IDC_CMB_PLAYBACK),CB_GETLBTEXT,iOut,(LPARAM)szOut); +// SendMessage(GetDlgItem(hwndDlg,IDC_CMB_RECORDING),CB_GETLBTEXT,iOut,(LPARAM)szIn); + GetWindowText(GetDlgItem(hwndDlg,IDC_CMB_RECORDING),szIn,MAX_PATH); +// SendMessage(GetDlgItem(hwndDlg,IDC_CMB_RINGTONE),CB_GETLBTEXT,iOut,(LPARAM)szRing); + GetWindowText(GetDlgItem(hwndDlg,IDC_CMB_RINGTONE),szRing,MAX_PATH); + iaxc_audio_devices_set(iIn,iOut,iRing); + SaveAudioSettings(szOut,szIn,szRing); + EndDialog(hwndDlg,wParam); + bRet=TRUE; + } + break; + case IDCANCEL: + EndDialog(hwndDlg,wParam); + bRet=TRUE; + break; + } + } + break; + } + return bRet; +} + +INT_PTR RegDialogProc( 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_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 IDOK: + GetDlgItemText(hwndDlg,IDC_E_USER,szRegUser,50); + GetDlgItemText(hwndDlg,IDC_E_PASS,szRegPass,50); + GetDlgItemText(hwndDlg,IDC_E_GATEWAY,szRegServer,60); + EndDialog(hwndDlg,wParam); + bRet=TRUE; + break; + case IDCANCEL: + EndDialog(hwndDlg,wParam); + bRet=TRUE; + break; + } + } + } + return bRet; +} + BOOL OnInitDialog() { // TMessageBox("OnInitDialog"); + // menu stuff double silence_threshold = -99; - - iaxc_initialize(AUDIO_INTERNAL_PA,1); +// if(!PlaySound("c:\\faizan\\iaxclient\\ring.wav",NULL,SND_FILENAME|SND_ASYNC)) +// TMessageBox("Ünable to play sound"); +// Sleep(3000); +// PlaySound(NULL,NULL,NULL); + iaxc_initialize(AUDIO_INTERNAL_PA,3); iaxc_set_encode_format(IAXC_FORMAT_GSM); iaxc_set_silence_threshold(silence_threshold); iaxc_set_event_callback(iaxc_callback); iaxc_start_processing_thread(); + + char szOut[MAX_PATH],szIn[MAX_PATH],szRing[MAX_PATH]; + if(RestoreAudioSettings(szOut,szIn,szRing)) + { + struct iaxc_audio_device *devices; // we wont have tht many devices + int nDevs=0; + int in=0,out=0,ring=0; + iaxc_audio_devices_get((struct iaxc_audio_device**)&devices,&nDevs,&in,&out,&ring); + in=0,out=0,ring=0; + int ins=0,outs=0,rings=0; + // first lets go thru out devices. + for(int i=0;i<nDevs;i++) + { + if(devices[i].capabilities & IAXC_AD_OUTPUT) + { + if(!strcmp(szOut,devices[i].name)) + { + outs=out; + } + out++; + } + if(devices[i].capabilities & IAXC_AD_INPUT) + { + if(!strcmp(szIn,devices[i].name)) + { + ins=in; + } + in++; + } + if(devices[i].capabilities & IAXC_AD_RING) + { + if(!strcmp(szRing,devices[i].name)) + { + rings=ring; + } + ring++; + } + } + iaxc_audio_devices_set(ins,outs,rings); + } + int iPTT=0,iSilence=0; + if(RestorePreferences(&iPTT,&iSilence)) + { + bPTT=iPTT; + bSilence=iSilence; + if(bSilence) + iaxc_set_silence_threshold(1);// auto silence + else + iaxc_set_silence_threshold(-99); + } 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); @@ -212,17 +531,30 @@ { char szString[MAX_PATH]; GetDlgItemText(m_hwndMainDlg,IDC_E_IAX_URI,szString,MAX_PATH); - iaxc_call(szString); +// if(iTotCalls>0 && iTotCalls<3) // We do have a call so make another i guess + iaxc_call(szString,CALLER_ID); +// else if(iTotCalls>3) +// return; +// else +// { +// sprintf(szString,"%s@%s",szString,szRegServer); +// iaxc_call(szString,CALLER_ID); +// } + iTotCalls++; } void OnBnHangup() { + if(iTotCalls<1) + return; iaxc_dump_call(); + iTotCalls--; } int status_callback(char *msg) { SetDlgItemText(m_hwndMainDlg,IDC_ST_STATUS,msg); - return 1 +// if(strstr(msg,"Hangup" + return 1; } int levels_callback(float input, float output) @@ -260,8 +592,12 @@ return levels_callback(e.ev.levels.input, e.ev.levels.output); case IAXC_EVENT_TEXT: return status_callback(e.ev.text.message); + case IAXC_EVENT_STATE: + return HandleStateEvent(e.ev.call); // case IAXC_EVENT_STATE: -// return state_callback(e.ev.call); +// ret = status_callback(e->ev.call); +// break; + default: return 0; // not handled } @@ -270,7 +606,15 @@ void SendDTMF(char num) { + if(iTotCalls>0) // We do have a call so just send DTMF there iaxc_send_dtmf(num); + else + { + char szDialStr[100]; + GetDlgItemText(m_hwndMainDlg,IDC_E_IAX_URI,szDialStr,100); + sprintf(szDialStr,"%s%c",szDialStr,num); + SetDlgItemText(m_hwndMainDlg,IDC_E_IAX_URI,szDialStr); + } } BOOL OnTimer(UINT nIDEvent) @@ -297,3 +641,272 @@ iaxc_process_calls(); } } + +void OnRegister() +{ + if(DialogBox(NULL,MAKEINTRESOURCE(IDD_DLG_REGISTER),m_hwndMainDlg,(DLGPROC)RegDialogProc)==IDOK) + { +// TMessageBox("ÖK clicked"); + iaxc_register(szRegUser,szRegPass,szRegServer); + } +} + +int HandleStateEvent(struct iaxc_ev_call_state c) +{ +// wxListItem stateItem; // for all the state color + +// stateItem.m_itemId = c.callNo; + + // first, handle inactive calls + char stStr[100]; + if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { + //fprintf(stderr, "state for item %d is free\n", c.callNo); +// SetItem(c.callNo, 2, _T("No call") ); +// SetItem(c.callNo, 1, _T("") ); +// stateItem.SetTextColour(*wxLIGHT_GREY); +// stateItem.SetBackgroundColour(*wxWHITE); + sprintf(stStr,"Call No %d: Hungup by remote",c.callNo); + SetDlgItemText(m_hwndMainDlg,IDC_ST_STATE,stStr); + } + else + { + // set remote +// SetItem(c.callNo, 2, c.remote ); + + BOOL outgoing = c.state & IAXC_CALL_STATE_OUTGOING; + BOOL ringing = c.state & IAXC_CALL_STATE_RINGING; + BOOL complete = c.state & IAXC_CALL_STATE_COMPLETE; + BOOL rejected = c.state & IAXC_CALL_STATE_REJECTED; + + if( ringing && !outgoing ) { +// stateItem.SetTextColour(*wxBLACK); +// stateItem.SetBackgroundColour(*wxRED); + } + else + { +// stateItem.SetTextColour(*wxBLUE); +// stateItem.SetBackgroundColour(*wxWHITE); + } + if(outgoing) + { + if((c.state & IAXC_CALL_STATE_AUTHREQ)) + { + sprintf(stStr,"call no %d: Authentication required"); + TMessageBox(stStr); + } + if(ringing) + { + sprintf(stStr,"Ringing outbound call no %d",c.callNo); + } +// SetItem(c.callNo, 1, _T("r") ); + else if(complete) + sprintf(stStr,"Call No %d: Answered",c.callNo); +// SetDlgItemText(m_hwndMainDlg,IDC_ST_STATE,"Call answered"); + else if(rejected) + sprintf(stStr,"Call No %d: Rejected",c.callNo); +// else if((c.state & IAXC_CALL_STATE_DISCONNECTED)) +// sprintf(stStr,"Call No %d: Disconnected",c.callNo); +// SetDlgItemText(m_hwndMainDlg,IDC_ST_STATE,"Call rejected"); +// SetItem(c.callNo, 1, _T("o") ); + else // not accepted yet.. + sprintf(stStr,"Call no %d: Waiting for pickup"); + SetDlgItemText(m_hwndMainDlg,IDC_ST_STATE,stStr); +// SetDlgItemText(m_hwndMainDlg,IDC_ST_STATE,"Waiting for pickup"); +// SetItem(c.callNo, 1, _T("c") ); + } + else + { + if(ringing) + { +// if(!PlaySound("ring.wav",NULL,SND_FILENAME|SND_LOOP|SND_ASYNC|SND_NODEFAULT)) +// TMessageBox("Ünable to play sound"); +// Sleep(3000); +// PlaySound(NULL,NULL,NULL); + SetDlgItemText(m_hwndMainDlg,IDC_ST_STATUS,"Incoming Call"); + + char szMsg[100]; + sprintf(szMsg,"RING RING. Press OK to accept. CANCEL to reject.\nCallerid %s",c.remote); + + if(TMessageBox(szMsg,MB_OKCANCEL)==IDOK) + { + iaxc_answer_call(c.callNo); + iaxc_select_call(c.callNo); + SetDlgItemText(m_hwndMainDlg,IDC_ST_STATUS,"Call Answered"); + iTotCalls++; + } + else + { + iaxc_select_call(c.callNo); + iaxc_reject_call(); + } + } +// else if((c.state & IAXC_CALL_STATE_DISCONNECTED)) +// sprintf(stStr,"Call No %d: Disconnected",c.callNo); +// SetItem(c.callNo, 1, _T("R") ); + else if(complete) + SetDlgItemText(m_hwndMainDlg,IDC_ST_STATE,"Call answered"); +// SetItem(c.callNo, 1, _T("I") ); + else // not accepted yet.. shouldn't happen! + ; +// SetItem(c.callNo, 1, _T("C") ); + } + // XXX do something more noticable if it's incoming, ringing! + } + + // SetItem( stateItem ); + + // select if necessary +/* if((c.state & IAXC_CALL_STATE_SELECTED) && + !(GetItemState(c.callNo,wxLIST_STATE_SELECTED|wxLIST_STATE_SELECTED))) + { + //fprintf(stderr, "setting call %d to selected\n", c.callNo); + SetItemState(c.callNo,wxLIST_STATE_SELECTED,wxLIST_STATE_SELECTED); + } +*/ + //AutoSize(); + //Refresh(); + + return 0; +} + +void SelectLine(int line) +{ + iaxc_select_call(line); +// iaxc_select_call(line); +// iSelLine=line; +} + +void ShowSoundSettings() +{ + DialogBox(NULL,MAKEINTRESOURCE(IDD_DLG_SOUND),m_hwndMainDlg,(DLGPROC)SoundDialogProc); + +} + +void ShowPreferences() +{ + DialogBox(NULL,MAKEINTRESOURCE(IDD_DLG_PREFERENCES),m_hwndMainDlg,(DLGPROC)PrefDialogProc); +} + +void SaveAudioSettings(char *szPlayback,char *szRecord,char *szRing) +{ + HKEY hKey=NULL; + DWORD dwDisp=0; + if(RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\WinIAX",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)!=ERROR_SUCCESS) + { + TMessageBox("Couldn't save settings in Registry"); + return; + } + if(RegSetValueEx(hKey,"Playback Device",0,REG_SZ,(BYTE*)szPlayback,strlen(szPlayback))!=ERROR_SUCCESS) + { + TMessageBox("Couldn't save settings in Registry"); + goto CLEANUP; + } + if(RegSetValueEx(hKey,"Recording Device",0,REG_SZ,(BYTE*)szRecord,strlen(szRecord))!=ERROR_SUCCESS) + { + TMessageBox("Couldn't save settings in Registry"); + goto CLEANUP; + } + if(RegSetValueEx(hKey,"Ringtone Device",0,REG_SZ,(BYTE*)szRing,strlen(szRing))!=ERROR_SUCCESS) + { + TMessageBox("Couldn't save settings in Registry"); + goto CLEANUP; + } +CLEANUP: + RegCloseKey(hKey); +} + +BOOL RestoreAudioSettings(char *szPlayback,char* szRecord,char *szRing) +{ + HKEY hKey=NULL; + DWORD dwType=0,dwLen=MAX_PATH; + BOOL bRet=TRUE; + if(RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\WinIAX",0,NULL,REG_OPTION_NON_VOLATILE,KEY_READ,NULL,&hKey,&dwType)!=ERROR_SUCCESS) + { +// TMessageBox("Couldn't save settings in Registry"); + return FALSE; + } + RegQueryValueEx(hKey,"Playback Device",0,&dwType,(BYTE*)szPlayback,&dwLen); + dwLen=MAX_PATH; + RegQueryValueEx(hKey,"Recording Device",0,&dwType,(BYTE*)szRecord,&dwLen); + dwLen=MAX_PATH; + RegQueryValueEx(hKey,"Ringtone Device",0,&dwType,(BYTE*)szRing,&dwLen); +//CLEANUP: + RegCloseKey(hKey); + return bRet; +} + +void SavePreferences(int iPTT,int iSilence) +{ + HKEY hKey=NULL; + DWORD dwDisp=0; + bPTT=iPTT; + bSilence=iSilence; + if(bSilence) + iaxc_set_silence_threshold(1); + else + iaxc_set_silence_threshold(-99); + if(RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\WinIAX",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&dwDisp)!=ERROR_SUCCESS) + { + return; + } + RegSetValueEx(hKey,"PTT",0,REG_DWORD,(BYTE*)&iPTT,sizeof(int)); + RegSetValueEx(hKey,"Silence Filter",0,REG_DWORD,(BYTE*)&iSilence,sizeof(int)); + RegCloseKey(hKey); +} + +BOOL RestorePreferences(int *iPTT,int *iSilence) +{ + HKEY hKey=NULL; + DWORD dwType; + DWORD dwLen=0; + BOOL bRet=TRUE; + if(RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\\WinIAX",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,&dwLen)!=ERROR_SUCCESS) + { + return FALSE; + } + dwLen=sizeof(DWORD); + if(RegQueryValueEx(hKey,"PTT",0,&dwType,(BYTE*)iPTT,&dwLen)!=ERROR_SUCCESS) + { + bRet=FALSE; + goto CLEANUP; + } + if(RegQueryValueEx(hKey,"Silence Filter",0,&dwType,(BYTE*)iSilence,&dwLen)!=ERROR_SUCCESS) + { + bRet=FALSE; + goto CLEANUP; + } +CLEANUP: + RegCloseKey(hKey); + return bRet; +} + +void TogglePTT(int iPTT) +{ + if(iPTT) + { + iaxc_set_silence_threshold(-99); + iaxc_set_audio_output(1); + } + else + { + iaxc_set_silence_threshold(0); // mute input + iaxc_set_audio_output(0); // unmute output + } +} + +void SelectColor(COLORREF *clr) +{ + CHOOSECOLOR chlr; + static COLORREF clrCust[16]; + ZeroMemory(&chlr,sizeof(CHOOSECOLOR)); + chlr.lStructSize=sizeof(CHOOSECOLOR); + chlr.Flags=CC_FULLOPEN|CC_RGBINIT; + chlr.lpCustColors=clrCust; + +// chlr.rgbResult=*clr; + if(ChooseColor(&chlr)) + { + *clr=chlr.rgbResult; + } +} + |
From: <st...@us...> - 2003-07-15 13:50:15
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv29076 Modified Files: README Added Files: wxVC.dsp Log Message: README and project file for building wx with MSVC 6 on Win32 (by Babar Shafiq <bab...@ya...>) --- NEW FILE: wxVC.dsp --- # Microsoft Developer Studio Project File - Name="wxVC" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=wxVC - 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 "wxVC.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 "wxVC.mak" CFG="wxVC - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "wxVC - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "wxVC - 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)" == "wxVC - 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" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /FD /c # SUBTRACT CPP /YX # 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 advapi32.lib winspool.lib comdlg32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib zlib.lib regex.lib png.lib jpeg.lib tiff.lib wxmsw.lib winmm.lib ws2_32.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"LIBCMT.lib" !ELSEIF "$(CFG)" == "wxVC - 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 Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D "_MT" /D wxUSE_GUI=1 /D "__WXDEBUG__" /D WXDEBUG=1 /YX /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 odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept !ENDIF # Begin Target # Name "wxVC - Win32 Release" # Name "wxVC - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=..\..\..\lib\iaxclient.h # End Source File # Begin Source File SOURCE=..\wx.cpp # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # Begin Source File SOURCE=.\libiaxclient.lib # End Source File # End Group # End Target # End Project Index: README =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 2 Jul 2003 18:41:03 -0000 1.2 +++ README 15 Jul 2003 13:50:12 -0000 1.3 @@ -94,7 +94,86 @@ make strip wx ./wx.exe + ========================================================= +Building wx with MSVC 6 on Win32 (by Babar Shafiq <bab...@ya...>) + +Builing wx on MSVC is easy, + +Here is step by step procedure how to build wx on MSVC 6. + +First we make libraries and DLLs for wxWindows +1) Download wxWindows from http://wxwindows.org for VC we will have latest release: +http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.4.1-setup.zip (approx 12MB) + +2) After running the setup it will install and create a directory for us such as +wxWindows-2.4.1 +if we install on D: Drive to we will have D:\wxWindows-2.4.1\ + +3) Now we have to compile wxWindows for VC we have wxWindows.dsw in d:\wxWindows-2.4.1\src +directory. + +4) Setup include directories from VC->Tools->Options->Include directories +(This is Global settings for all wxWindows projects) + +add D:\wxWindows-2.4.1\CONTRIB\INCLUDE +and D:\wxWindows-2.4.1\INCLUDE + +Setup Lib directories from VC->Tools->Options->Lib directories +add D:\wxWindows-2.4.1\CONTRIB\LIB +and D:\wxWindows-2.4.1\LIB + +5) Now from Build->Batch Build use Build to build all libraries and DLLs for us.(on my P3 +667 MHz +256 MB Ram it tooks more then an hour :) ). + +6) After the build process we will have all the libraires and DLLs in the lib folder it mean +we +are done. + + +http://www.geocities.com/babarnazmi/wxVC.zip ( unzip project files in wx folder) +[ These are now included in the CVS sources as well - SteveK ] + +or + +for wx we need to set up a new project + +1) Create a new empty project Win32 Application. + +2) I just renamed the wx.cc file from the iaxclient distribution to wx.cpp and then added +iaxclient.h in this new project. + +3) For Win32 Release. +update Project->Settings->C/C++->General(Category) update the Preprocessor Defination to +NDEBUG,WIN32,_WINDOWS,WINVER=0x400,_MT,wxUSE_GUI=1 +select Category Code Generation to "Multithreaded DLL" + + For Win32 Debug +update Project->Settings->C/C++->General(Category) update the Preprocessor Defination to +_DEBUG,WIN32,_WINDOWS,WINVER=0x400,_MT,wxUSE_GUI=1,__WXDEBUG__,WXDEBUG=1 +select Category Code Generation to "Debug Multithreaded DLL" + +4) Now in Link Tab + +for Win32 Release add +zlib.lib regex.lib png.lib jpeg.lib tiff.lib wxmsw.lib (for wxWidnows support) +winmm.lib ws2_32.lib (for iaxcleint support) +libiaxclient.lib (Win32 iaxlib must be Release version) +(other then default libs) + +for Win32 Debug add +zlibd.lib regexd.lib pngd.lib jpegd.lib tiffd.lib wxmswd.lib ( fow wxWindows support) +winmm.lib ws2_32.lib (for iaxcleint support) +libiaxclient.lib (Win32 iaxlib must be Debug version) +(other then default libs) + +update the #include "iaxclient.h" to #include "..\..\..\lib\iaxclient.h" +(or copy iaxclient.h to the souce directory) + +Build the new project and we are done. + +=========================================================== |
From: <st...@us...> - 2003-07-11 17:40:29
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv23556 Modified Files: wx.cc Log Message: Raise main window when a call is ringing. (diff is kinda large, because I needed to move the method after the declaration of IAXFrame.. -- the real change is just 4 lines). Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- wx.cc 7 Jul 2003 19:18:19 -0000 1.40 +++ wx.cc 11 Jul 2003 17:40:26 -0000 1.41 @@ -198,12 +198,78 @@ AutoSize(); } + +void IAXCalls::OnSelect(wxListEvent &evt) { + int selected = evt.m_itemIndex; //GetSelection(); + iaxc_select_call(selected); +} + + +class IAXFrame : public wxFrame +{ +public: + IAXFrame(const wxChar *title, int xpos, int ypos, int width, int height); + + ~IAXFrame(); + + void IAXFrame::OnDTMF(wxEvent &evt); + void IAXFrame::OnDial(wxEvent &evt); + void IAXFrame::OnHangup(wxEvent &evt); + void IAXFrame::OnQuit(wxEvent &evt); + void IAXFrame::OnPTTChange(wxCommandEvent &evt); + void IAXFrame::OnSilenceChange(wxCommandEvent &evt); + void IAXFrame::OnNotify(void); + void IAXFrame::OnRegisterMenu(wxCommandEvent &evt); + + // utility method + void IAXFrame::RegisterFromString(wxString value); + + // Handlers for library-initiated events + void IAXFrame::HandleEvent(wxCommandEvent &evt); + int IAXFrame::HandleIAXEvent(iaxc_event *e); + int IAXFrame::HandleStatusEvent(char *msg); + int IAXFrame::HandleLevelEvent(float input, float output); + + bool IAXFrame::GetPTTState(); + void IAXFrame::CheckPTT(); + void IAXFrame::SetPTT(bool state); + + wxGauge *input; + wxGauge *output; + IAXTimer *timer; + wxStaticText *iaxServLabel; + wxComboBox *iaxServ; + wxStaticText *iaxDestLabel; + wxComboBox *iaxDest; + wxStaticText *muteState; + + IAXCalls *calls; + + bool pttMode; // are we in PTT mode? + bool pttState; // is the PTT button pressed? + bool silenceMode; // are we in silence suppression mode? + + +protected: + DECLARE_EVENT_TABLE() + +#ifdef __WXGTK__ + GdkWindow *keyStateWindow; +#endif +}; + +static IAXFrame *theFrame; + int IAXCalls::HandleStateEvent(struct iaxc_ev_call_state c) { wxListItem stateItem; // for all the state color stateItem.m_itemId = c.callNo; + if(c.state & IAXC_CALL_STATE_RINGING) { + theFrame->Raise(); + } + // first, handle inactive calls if(!(c.state & IAXC_CALL_STATE_ACTIVE)) { //fprintf(stderr, "state for item %d is free\n", c.callNo); @@ -260,67 +326,6 @@ return 0; } - -void IAXCalls::OnSelect(wxListEvent &evt) { - int selected = evt.m_itemIndex; //GetSelection(); - iaxc_select_call(selected); -} - - -class IAXFrame : public wxFrame -{ -public: - IAXFrame(const wxChar *title, int xpos, int ypos, int width, int height); - - ~IAXFrame(); - - void IAXFrame::OnDTMF(wxEvent &evt); - void IAXFrame::OnDial(wxEvent &evt); - void IAXFrame::OnHangup(wxEvent &evt); - void IAXFrame::OnQuit(wxEvent &evt); - void IAXFrame::OnPTTChange(wxCommandEvent &evt); - void IAXFrame::OnSilenceChange(wxCommandEvent &evt); - void IAXFrame::OnNotify(void); - void IAXFrame::OnRegisterMenu(wxCommandEvent &evt); - - // utility method - void IAXFrame::RegisterFromString(wxString value); - - // Handlers for library-initiated events - void IAXFrame::HandleEvent(wxCommandEvent &evt); - int IAXFrame::HandleIAXEvent(iaxc_event *e); - int IAXFrame::HandleStatusEvent(char *msg); - int IAXFrame::HandleLevelEvent(float input, float output); - - bool IAXFrame::GetPTTState(); - void IAXFrame::CheckPTT(); - void IAXFrame::SetPTT(bool state); - - wxGauge *input; - wxGauge *output; - IAXTimer *timer; - wxStaticText *iaxServLabel; - wxComboBox *iaxServ; - wxStaticText *iaxDestLabel; - wxComboBox *iaxDest; - wxStaticText *muteState; - - IAXCalls *calls; - - bool pttMode; // are we in PTT mode? - bool pttState; // is the PTT button pressed? - bool silenceMode; // are we in silence suppression mode? - - -protected: - DECLARE_EVENT_TABLE() - -#ifdef __WXGTK__ - GdkWindow *keyStateWindow; -#endif -}; - -static IAXFrame *theFrame; void IAXFrame::OnNotify() { |
From: <st...@us...> - 2003-07-10 23:33:17
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv8612 Modified Files: audio_portaudio.c Log Message: experimental code to plug-in MEC2 at the audio driver level (it's easiest here, at least when we have a single I/O stream). To use this, you need to drop mec2.h mec2_const.h and arith.h from zaptel in here somewhere, and then define USE_MEC2. Note: mec2.h currently is listed as GPL, and therefore is not included here (because this library wants to be LGPL). Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- audio_portaudio.c 10 Jul 2003 19:18:51 -0000 1.17 +++ audio_portaudio.c 10 Jul 2003 23:33:14 -0000 1.18 @@ -21,6 +21,11 @@ #include "iaxclient_lib.h" +#ifdef USE_MEC2 +#include "mec2.h" +static echo_can_state_t *ec; +#endif + static PortAudioStream *iStream, *oStream; static selectedInput, selectedOutput, selectedRing; @@ -102,31 +107,24 @@ int pa_callback(void *inputBuffer, void *outputBuffer, unsigned long framesPerBuffer, PaTimestamp outTime, void *userData ) { + int totBytes = framesPerBuffer * sizeof(SAMPLE); - short virtualBuffer[FRAMES_PER_BUFFER * 2]; + short virtualInBuffer[FRAMES_PER_BUFFER * 2]; + short virtualOutBuffer[FRAMES_PER_BUFFER * 2]; if(virtualMono && framesPerBuffer > FRAMES_PER_BUFFER) { fprintf(stderr, "ERROR: buffer in callback is too big!\n"); exit(1); } - if(inputBuffer) { - /* input overflow might happen here */ - if(virtualMono) { - stereo2mono(virtualBuffer, inputBuffer, framesPerBuffer); - RingBuffer_Write(&inRing, virtualBuffer, totBytes); - } else { - RingBuffer_Write(&inRing, inputBuffer, totBytes); - } - } if(outputBuffer) { int bWritten; /* output underflow might happen here */ if(virtualMono) { - bWritten = RingBuffer_Read(&outRing, virtualBuffer, totBytes); - mono2stereo(outputBuffer, virtualBuffer, bWritten/2); + bWritten = RingBuffer_Read(&outRing, virtualOutBuffer, totBytes); + mono2stereo(outputBuffer, virtualOutBuffer, bWritten/2); bWritten *=2; } else { bWritten = RingBuffer_Read(&outRing, outputBuffer, totBytes); @@ -136,6 +134,32 @@ if(bWritten < totBytes) memset((char *)outputBuffer + bWritten, 0, totBytes - bWritten); } + + + if(inputBuffer) { + /* input overflow might happen here */ + if(virtualMono) { + stereo2mono(virtualInBuffer, inputBuffer, framesPerBuffer); +#ifdef USE_MEC2 + { /* Echo Can, for virtualMono */ + int i; + for(i=0;i<framesPerBuffer;i++) + virtualInBuffer[i] = echo_can_update(ec, virtualOutBuffer[i], virtualInBuffer[i]); + } +#endif + RingBuffer_Write(&inRing, virtualInBuffer, totBytes); + } else { +#ifdef USE_MEC2 + { /* Echo Can, for mono */ + int i; + for(i=0;i<framesPerBuffer;i++) + ((short *)inputBuffer)[i] = echo_can_update(ec, ((short *)outputBuffer)[i], ((short *)inputBuffer)[i]); + } +#endif + RingBuffer_Write(&inRing, inputBuffer, totBytes); + } + } + return 0; } @@ -373,6 +397,10 @@ RingBuffer_Init(&inRing, RBSZ, inRingBuf); RingBuffer_Init(&outRing, RBSZ, outRingBuf); + +#ifdef USE_MEC2 + ec = echo_can_create(256, 0); +#endif running = 0; |
From: <st...@us...> - 2003-07-10 21:59:35
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26522 Modified Files: iaxclient.h Log Message: typo in constant definition. Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- iaxclient.h 10 Jul 2003 19:18:51 -0000 1.16 +++ iaxclient.h 10 Jul 2003 21:59:32 -0000 1.17 @@ -115,7 +115,7 @@ #define IAXC_AD_RING (1<<2) #define IAXC_AD_INPUT_DEFAULT (1<<3) #define IAXC_AD_OUTPUT_DEFAULT (1<<4) -#define IAXC_AD_RING_DEFAULT (1<<4) +#define IAXC_AD_RING_DEFAULT (1<<5) struct iaxc_audio_device { char *name; /* name of the device */ |
From: <st...@us...> - 2003-07-10 21:21:53
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv31679 Modified Files: audio_portaudio.c iaxclient.h Log Message: add RING capabilities. Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- audio_portaudio.c 10 Jul 2003 18:54:50 -0000 1.16 +++ audio_portaudio.c 10 Jul 2003 19:18:51 -0000 1.17 @@ -65,14 +65,18 @@ if(pa->maxInputChannels > 0) dev->capabilities |= IAXC_AD_INPUT; - if(pa->maxOutputChannels > 0) + if(pa->maxOutputChannels > 0) { dev->capabilities |= IAXC_AD_OUTPUT; + dev->capabilities |= IAXC_AD_RING; + } if(i == Pa_GetDefaultInputDeviceID()) dev->capabilities |= IAXC_AD_INPUT_DEFAULT; - if(i == Pa_GetDefaultOutputDeviceID()) + if(i == Pa_GetDefaultOutputDeviceID()) { dev->capabilities |= IAXC_AD_OUTPUT_DEFAULT; + dev->capabilities |= IAXC_AD_RING_DEFAULT; + } } return 0; } Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- iaxclient.h 10 Jul 2003 15:03:46 -0000 1.15 +++ iaxclient.h 10 Jul 2003 19:18:51 -0000 1.16 @@ -112,8 +112,10 @@ #define IAXC_AD_INPUT (1<<0) #define IAXC_AD_OUTPUT (1<<1) -#define IAXC_AD_INPUT_DEFAULT (1<<2) -#define IAXC_AD_OUTPUT_DEFAULT (1<<3) +#define IAXC_AD_RING (1<<2) +#define IAXC_AD_INPUT_DEFAULT (1<<3) +#define IAXC_AD_OUTPUT_DEFAULT (1<<4) +#define IAXC_AD_RING_DEFAULT (1<<4) struct iaxc_audio_device { char *name; /* name of the device */ |
From: <st...@us...> - 2003-07-10 19:53:55
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27616 Modified Files: audio_portaudio.c Log Message: return 0.. Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- audio_portaudio.c 10 Jul 2003 18:51:46 -0000 1.15 +++ audio_portaudio.c 10 Jul 2003 18:54:50 -0000 1.16 @@ -74,6 +74,7 @@ if(i == Pa_GetDefaultOutputDeviceID()) dev->capabilities |= IAXC_AD_OUTPUT_DEFAULT; } + return 0; } void mono2stereo(SAMPLE *out, SAMPLE *in, int nSamples) { @@ -295,7 +296,6 @@ int bytestoread; bytestoread = *nSamples * sizeof(SAMPLE); - /* we don't return partial buffers */ if(RingBuffer_GetReadAvailable(&inRing) < bytestoread) { @@ -304,6 +304,8 @@ } RingBuffer_Read(&inRing, samples, bytestoread); + + return 0; } int pa_output(struct iaxc_audio_driver *d, void *samples, int nSamples) { |
From: <st...@us...> - 2003-07-10 18:51:54
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv27184 Modified Files: audio_portaudio.c Log Message: VC++ doesn't like doing pointer arithmetic on void * pointers, although GCC seems to assume it's like char *. Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- audio_portaudio.c 10 Jul 2003 15:03:46 -0000 1.14 +++ audio_portaudio.c 10 Jul 2003 18:51:46 -0000 1.15 @@ -129,7 +129,7 @@ /* zero underflowed space [ silence might be more golden than garbage? ] */ if(bWritten < totBytes) - memset(outputBuffer + bWritten, 0, totBytes - bWritten); + memset((char *)outputBuffer + bWritten, 0, totBytes - bWritten); } return 0; } |
From: <st...@us...> - 2003-07-10 15:03:50
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv30429/lib Modified Files: audio_portaudio.c iaxclient.h iaxclient_lib.c iaxclient_lib.h Log Message: Add APIs for getting audio device info, and selecting devices. Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- audio_portaudio.c 10 Jul 2003 14:19:53 -0000 1.13 +++ audio_portaudio.c 10 Jul 2003 15:03:46 -0000 1.14 @@ -23,7 +23,7 @@ static PortAudioStream *iStream, *oStream; -static selectedInput, selectedOutput; +static selectedInput, selectedOutput, selectedRing; #define FRAMES_PER_BUFFER 80 /* 80 frames == 10ms */ @@ -316,20 +316,22 @@ return 0; } -int pa_select_input (struct iaxc_audio_driver *d, int input) { +int pa_select_devices (struct iaxc_audio_driver *d, int input, int output, int ring) { selectedInput = input; + selectedOutput = output; + selectedRing = ring; if(running) { pa_stop(d); pa_start(d); } + return 0; } -int pa_select_output (struct iaxc_audio_driver *d, int output) { - selectedOutput = output; - if(running) { - pa_stop(d); - pa_start(d); - } +int pa_selected_devices (struct iaxc_audio_driver *d, int *input, int *output, int *ring) { + *input = selectedInput; + *output = selectedOutput; + *ring = selectedRing; + return 0; } int pa_destroy (struct iaxc_audio_driver *d ) { @@ -351,8 +353,8 @@ /* setup methods */ d->initialize = pa_initialize; d->destroy = pa_destroy; - d->select_input = pa_select_input; - d->select_output = pa_select_output; + d->select_devices = pa_select_devices; + d->selected_devices = pa_selected_devices; d->start = pa_start; d->stop = pa_stop; d->output = pa_output; @@ -361,6 +363,7 @@ /* setup private data stuff */ selectedInput = Pa_GetDefaultInputDeviceID(); selectedOutput = Pa_GetDefaultOutputDeviceID(); + selectedRing = Pa_GetDefaultOutputDeviceID(); RingBuffer_Init(&inRing, RBSZ, inRingBuf); RingBuffer_Init(&outRing, RBSZ, outRingBuf); Index: iaxclient.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- iaxclient.h 19 Jun 2003 19:09:52 -0000 1.14 +++ iaxclient.h 10 Jul 2003 15:03:46 -0000 1.15 @@ -110,6 +110,21 @@ void iaxc_set_audio_output(int mode); int iaxc_select_call(int callNo); +#define IAXC_AD_INPUT (1<<0) +#define IAXC_AD_OUTPUT (1<<1) +#define IAXC_AD_INPUT_DEFAULT (1<<2) +#define IAXC_AD_OUTPUT_DEFAULT (1<<3) + +struct iaxc_audio_device { + char *name; /* name of the device */ + long capabilities; /* flags, defined above */ + int devID; /* driver-specific ID */ +}; + +int iaxc_audio_devices_get(struct iaxc_audio_device **devs, int *nDevs, int *input, int *output, int *ring); +int iaxc_audio_devices_set(int input, int output, int ring); + + #ifdef __cplusplus } #endif Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- iaxclient_lib.c 10 Jul 2003 14:19:53 -0000 1.30 +++ iaxclient_lib.c 10 Jul 2003 15:03:46 -0000 1.31 @@ -770,3 +770,15 @@ // To be coded in the future return; } + +int iaxc_audio_devices_get(struct iaxc_audio_device **devs, int *nDevs, int *input, int *output, int *ring) { + *devs = audio.devices; + *nDevs = audio.nDevices; + audio.selected_devices(&audio,input,output,ring); + return 0; +} + +int iaxc_audio_devices_set(int input, int output, int ring) { + return audio.select_devices(&audio, input, output, ring); +} + Index: iaxclient_lib.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- iaxclient_lib.h 10 Jul 2003 14:19:53 -0000 1.19 +++ iaxclient_lib.h 10 Jul 2003 15:03:46 -0000 1.20 @@ -74,17 +74,7 @@ void iaxc_service_network(int netfd); void iaxc_do_levels_callback(float input, float output); - -#define IAXC_AD_INPUT (1<<0) -#define IAXC_AD_OUTPUT (1<<1) -#define IAXC_AD_INPUT_DEFAULT (1<<2) -#define IAXC_AD_OUTPUT_DEFAULT (1<<3) - -struct iaxc_audio_device { - char *name; /* name of the device */ - long capabilities; /* flags, defined above */ - int devID; /* driver-specific ID */ -}; +#include "iaxclient.h" struct iaxc_audio_driver { /* data */ @@ -96,8 +86,8 @@ /* methods */ int (*initialize)(struct iaxc_audio_driver *d); int (*destroy)(struct iaxc_audio_driver *d); /* free resources */ - int (*select_input)(struct iaxc_audio_driver *d, int devID); - int (*select_output)(struct iaxc_audio_driver *d, int devID); + int (*select_devices)(struct iaxc_audio_driver *d, int input, int output, int ring); + int (*selected_devices)(struct iaxc_audio_driver *d, int *input, int *output, int *ring); /* * select_ring ? @@ -114,7 +104,6 @@ -#include "iaxclient.h" struct iaxc_call { |
From: <st...@us...> - 2003-07-10 14:19:56
|
Update of /cvsroot/iaxclient/iaxclient/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22059 Modified Files: audio_portaudio.c iaxclient_lib.c iaxclient_lib.h Log Message: New PortAudio driver. This does: 1) Adding a mechanism to list and select audio devices (I'll add some UI for this to wx.c). 2) Making the backend more flexible w.r.t. frame sizes (currently, things are hard-coded for 20ms frames, which are used for GSM, but I think iLBC wants 30ms frames, for some reason. 3) Starting/stopping (and opening/closing) the audio devices as necessary, instead of only at startup. 4) Making the audio driver abstraction a little cleaner, which might make other audio drivers (like to external phone interfaces) easier. Index: audio_portaudio.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/audio_portaudio.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- audio_portaudio.c 23 Jun 2003 13:32:18 -0000 1.12 +++ audio_portaudio.c 10 Jul 2003 14:19:53 -0000 1.13 @@ -21,15 +21,20 @@ #include "iaxclient_lib.h" +static PortAudioStream *iStream, *oStream; + +static selectedInput, selectedOutput; + +#define FRAMES_PER_BUFFER 80 /* 80 frames == 10ms */ + +#define RBSZ 1024 /* Needs to be Pow(2), 1024 = 512 samples = 64ms */ +static char inRingBuf[RBSZ], outRingBuf[RBSZ]; +static RingBuffer inRing, outRing; -static PABLIO_Stream *iStream; -static PABLIO_Stream *oStream; static int oneStream; static int virtualMono; -static const PaDeviceInfo **inputDevices; -static const PaDeviceInfo **outputDevices; -static int nInputDevices; -static int nOutputDevices; + +static int running; /* scan devices and stash pointers to dev structures. * But, these structures only remain valid while Pa is initialized, @@ -38,40 +43,95 @@ * PaDeviceID's associated with devices (since their index in these * input/output arrays isn't the same as their index in the combined * array */ -static int pa_scan_devices() { +static int scan_devices(struct iaxc_audio_driver *d) { int nDevices; int i; - /* we may be called multiple times */ - if(inputDevices){ - free(inputDevices); - inputDevices=NULL; + d->nDevices = nDevices = Pa_CountDevices(); + d->devices = malloc(nDevices * sizeof(struct iaxc_audio_device)); + + for(i=0;i<nDevices;i++) + { + const PaDeviceInfo *pa; + struct iaxc_audio_device *dev; + + pa=Pa_GetDeviceInfo(i); + dev = &(d->devices[i]); + + dev->name = (char *)pa->name; + dev->devID = i; + dev->capabilities = 0; + + if(pa->maxInputChannels > 0) + dev->capabilities |= IAXC_AD_INPUT; + + if(pa->maxOutputChannels > 0) + dev->capabilities |= IAXC_AD_OUTPUT; + + if(i == Pa_GetDefaultInputDeviceID()) + dev->capabilities |= IAXC_AD_INPUT_DEFAULT; + + if(i == Pa_GetDefaultOutputDeviceID()) + dev->capabilities |= IAXC_AD_OUTPUT_DEFAULT; } +} - if(outputDevices){ - free(outputDevices); - outputDevices=NULL; +void mono2stereo(SAMPLE *out, SAMPLE *in, int nSamples) { + int i; + //fprintf(stderr, "mono2stereo: %d samples\n", nSamples); + for(i=0;i<nSamples;i++) { + *(out++) = *in; + *(out++) = *(in++); } +} - nInputDevices = nOutputDevices = 0; +void stereo2mono(SAMPLE *out, SAMPLE *in, int nSamples) { + int i; + //fprintf(stderr, "stereo2mono: %d samples\n", nSamples); + for(i=0;i<nSamples;i++) { + *(out) = *(in++); + out++; in++; + //*(out++) += *(in++); + } +} - nDevices = Pa_CountDevices(); +int pa_callback(void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, PaTimestamp outTime, void *userData ) { + int totBytes = framesPerBuffer * sizeof(SAMPLE); - /* allocate in/out arrays big enough for all devices */ - inputDevices = malloc(nDevices * sizeof(PaDeviceInfo *)); - outputDevices = malloc(nDevices * sizeof(PaDeviceInfo *)); + short virtualBuffer[FRAMES_PER_BUFFER * 2]; - for(i=0;i<nDevices;i++) - { - const PaDeviceInfo *d; - d=Pa_GetDeviceInfo(i); + if(virtualMono && framesPerBuffer > FRAMES_PER_BUFFER) { + fprintf(stderr, "ERROR: buffer in callback is too big!\n"); + exit(1); + } - if(d->maxInputChannels > 0) - inputDevices[nInputDevices++] = d; + if(inputBuffer) { + /* input overflow might happen here */ + if(virtualMono) { + stereo2mono(virtualBuffer, inputBuffer, framesPerBuffer); + RingBuffer_Write(&inRing, virtualBuffer, totBytes); + } else { + RingBuffer_Write(&inRing, inputBuffer, totBytes); + } + } + if(outputBuffer) + { + int bWritten; + /* output underflow might happen here */ + if(virtualMono) { + bWritten = RingBuffer_Read(&outRing, virtualBuffer, totBytes); + mono2stereo(outputBuffer, virtualBuffer, bWritten/2); + bWritten *=2; + } else { + bWritten = RingBuffer_Read(&outRing, outputBuffer, totBytes); + } - if(d->maxOutputChannels > 0) - outputDevices[nOutputDevices++] = d; + /* zero underflowed space [ silence might be more golden than garbage? ] */ + if(bWritten < totBytes) + memset(outputBuffer + bWritten, 0, totBytes - bWritten); } + return 0; } @@ -91,18 +151,22 @@ * Win32 works fine, in all cases, with a single stream and real mono, * so far. * */ - -int pa_initialize_audio() { - PaError err; - - /* Open simplified blocking I/O layer on top of PortAudio. */ - +int pa_openstreams (struct iaxc_audio_driver *d ) { + PaError err; #ifndef MACOSX /* first, try opening one stream for in/out, Mono */ /* except for MacOSX, which needs virtual stereo */ - err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, - (PABLIO_READ | PABLIO_WRITE | PABLIO_MONO) ); - + err = Pa_OpenStream ( &iStream, + selectedInput, 1, paInt16, NULL, /* input info */ + selectedOutput, 1, paInt16, NULL, /* output info */ + 8000.0, + FRAMES_PER_BUFFER, /* frames per buffer -- 10ms */ + 0, /* numbuffers */ /* use default */ + 0, /* flags */ + pa_callback, + NULL /* userdata */ + ); + if( err == paNoError ) { /* if this works, set iStream, oStream to this stream */ oStream = iStream; @@ -115,8 +179,16 @@ #ifndef LINUX /* then, we try a single stream, virtual stereo. Except on linux, * see note above */ - err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, - (PABLIO_READ | PABLIO_WRITE | PABLIO_STEREO) ); + err = Pa_OpenStream ( &iStream, + selectedInput, 2, paInt16, NULL, /* input info */ + selectedOutput, 2, paInt16, NULL, /* output info */ + 8000.0, + FRAMES_PER_BUFFER, /* frames per buffer -- 10ms */ + 0, /* numbuffers */ /* use default */ + 0, /* flags */ + pa_callback, + NULL /* userdata */ + ); if( err == paNoError ) { /* if this works, set iStream, oStream to this stream */ @@ -130,15 +202,32 @@ /* finally, we go to the worst case. Two opens, virtual mono */ oneStream = 0; virtualMono = 1; - err = OpenAudioStream( &iStream, SAMPLE_RATE, paInt16, - (PABLIO_READ | PABLIO_STEREO) ); + err = Pa_OpenStream ( &iStream, + selectedInput, 2, paInt16, NULL, /* input info */ + paNoDevice, 0, paInt16, NULL, /* output info */ + 8000.0, + FRAMES_PER_BUFFER, /* frames per buffer -- 10ms */ + 0, /* numbuffers */ /* use default */ + 0, /* flags */ + pa_callback, + NULL /* userdata */ + ); if( err != paNoError ) { handle_paerror(err, "opening separate input stream"); return -1; } - err = OpenAudioStream( &oStream, SAMPLE_RATE, paInt16, - (PABLIO_WRITE | PABLIO_STEREO) ); + + err = Pa_OpenStream ( &oStream, + paNoDevice, 0, paInt16, NULL, /* input info */ + selectedOutput, 2, paInt16, NULL, /* output info */ + 8000.0, + FRAMES_PER_BUFFER, /* frames per buffer -- 10ms */ + 0, /* numbuffers */ /* use default */ + 0, /* flags */ + pa_callback, + NULL /* userdata */ + ); if( err != paNoError ) { handle_paerror(err, "opening separate output stream"); @@ -148,6 +237,49 @@ return 0; } +int pa_start (struct iaxc_audio_driver *d ) { + PaError err; + + if(running) return 0; + + //fprintf(stderr, "starting pa\n"); + + if(pa_openstreams(d)) + return -1; + + err = Pa_StartStream(iStream); + if(err != paNoError) + return -1; + + if(!oneStream){ + err = Pa_StartStream(oStream); + if(err != paNoError) { + Pa_StopStream(iStream); + return -1; + } + } + + running = 1; + return 0; +} + +int pa_stop (struct iaxc_audio_driver *d ) { + PaError err; + + if(!running) return 0; + + err = Pa_AbortStream(iStream); + err = Pa_CloseStream(iStream); + + if(!oneStream){ + err = Pa_AbortStream(oStream); + err = Pa_CloseStream(oStream); + } + + running = 0; + return 0; +} + void pa_shutdown_audio() { CloseAudioStream( iStream ); if(!oneStream) CloseAudioStream( oStream ); @@ -157,67 +289,83 @@ fprintf(stderr, "PortAudio error at %s: %s\n", where, Pa_GetErrorText(err)); } -void pa_read_audio_input() { +int pa_input(struct iaxc_audio_driver *d, void *samples, int *nSamples) { + static SAMPLE *stereoBuf = NULL; + static int stereoBufSiz = 0; + int bytestoread; + + bytestoread = *nSamples * sizeof(SAMPLE); + + /* we don't return partial buffers */ + if(RingBuffer_GetReadAvailable(&inRing) < bytestoread) { + *nSamples = 0; + return 0; + } + + RingBuffer_Read(&inRing, samples, bytestoread); } +int pa_output(struct iaxc_audio_driver *d, void *samples, int nSamples) { + static SAMPLE *stereoBuf = NULL; + static int stereoBufSiz = 0; + int bytestowrite = nSamples * sizeof(SAMPLE); -void mono2stereo(SAMPLE *out, SAMPLE *in, int nSamples) { - int i; - //fprintf(stderr, "mono2stereo: %d samples\n", nSamples); - for(i=0;i<nSamples;i++) { - *(out++) = *in; - *(out++) = *(in++); + RingBuffer_Write(&outRing, samples, bytestowrite); + + return 0; +} + +int pa_select_input (struct iaxc_audio_driver *d, int input) { + selectedInput = input; + if(running) { + pa_stop(d); + pa_start(d); } } -void stereo2mono(SAMPLE *out, SAMPLE *in, int nSamples) { - int i; - //fprintf(stderr, "stereo2mono: %d samples\n", nSamples); - for(i=0;i<nSamples;i++) { - *(out) = *(in++); - out++; in++; - //*(out++) += *(in++); +int pa_select_output (struct iaxc_audio_driver *d, int output) { + selectedOutput = output; + if(running) { + pa_stop(d); + pa_start(d); } } -void pa_play_recv_audio(void *fr, int fr_size) { - - SAMPLE stereobuf[FRAMES_PER_BLOCK * 2]; - SAMPLE *buf; - if(GetAudioStreamWriteable(oStream) < FRAMES_PER_BLOCK) - { - //fprintf(stderr, "audio_portaudio: audio output overflow\n"); - return; - } +int pa_destroy (struct iaxc_audio_driver *d ) { + //implementme + return 0; +} - if(virtualMono) { - mono2stereo(stereobuf, (SAMPLE *)fr, FRAMES_PER_BLOCK); - buf = stereobuf; - } else { - buf = (SAMPLE *)fr; - } +/* initialize audio driver */ +int pa_initialize (struct iaxc_audio_driver *d ) { + PaError err; - // Play the audio as decoded - WriteAudioStream(oStream, buf, FRAMES_PER_BLOCK); -} + /* initialize portaudio */ + if(paNoError != (err = Pa_Initialize())) + return err; -void pa_send_audio(struct timeval *lastouttm, struct iaxc_call *most_recent_answer, int iEncodeType) { - SAMPLE samples[FRAMES_PER_BLOCK * 2]; // could be stereo - SAMPLE monobuf[FRAMES_PER_BLOCK]; - SAMPLE *buf; + /* scan devices */ + scan_devices(d); - /* send all available complete frames */ - while(GetAudioStreamReadable(iStream) >= (FRAMES_PER_BLOCK)) - { - ReadAudioStream(iStream, samples, FRAMES_PER_BLOCK); - if(virtualMono) { - stereo2mono(monobuf, samples, FRAMES_PER_BLOCK); - buf = monobuf; - } else { - buf = samples; - } - send_encoded_audio(most_recent_answer, buf, iEncodeType); - } -} + /* setup methods */ + d->initialize = pa_initialize; + d->destroy = pa_destroy; + d->select_input = pa_select_input; + d->select_output = pa_select_output; + d->start = pa_start; + d->stop = pa_stop; + d->output = pa_output; + d->input = pa_input; + + /* setup private data stuff */ + selectedInput = Pa_GetDefaultInputDeviceID(); + selectedOutput = Pa_GetDefaultOutputDeviceID(); + + RingBuffer_Init(&inRing, RBSZ, inRingBuf); + RingBuffer_Init(&outRing, RBSZ, outRingBuf); + + running = 0; + return 0; +} Index: iaxclient_lib.c =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- iaxclient_lib.c 23 Jun 2003 19:29:03 -0000 1.29 +++ iaxclient_lib.c 10 Jul 2003 14:19:53 -0000 1.30 @@ -19,6 +19,7 @@ struct iaxc_registration *registrations = NULL; +struct iaxc_audio_driver audio; static int iAudioType; static int iEncodeType; @@ -28,7 +29,6 @@ int netfd; int port; int c, i; -char rcmd[RBUFSIZE]; int iaxc_audio_output_mode = 0; // Normal @@ -230,14 +230,15 @@ gettimeofday(&lastouttm,NULL); switch (iAudioType) { - case AUDIO_INTERNAL: #ifdef USE_WIN_AUDIO + case AUDIO_INTERNAL: if (win_initialize_audio() != 0) return -1; -#endif break; +#endif + default: case AUDIO_INTERNAL_PA: - if (pa_initialize_audio() != 0) + if (pa_initialize(&audio)) return -1; break; } @@ -247,16 +248,9 @@ void iaxc_shutdown() { MUTEXLOCK(&iaxc_lock); iaxc_dump_all_calls(); - switch (iAudioType) { - case AUDIO_INTERNAL: -#ifdef USE_WIN_AUDIO - win_shutdown_audio(); -#endif - break; - case AUDIO_INTERNAL_PA: - pa_shutdown_audio(); - break; - } + + audio.destroy(&audio); + MUTEXUNLOCK(&iaxc_lock); MUTEXDESTROY(&iaxc_lock); } @@ -350,27 +344,36 @@ if( (calls[selected_call].state & IAXC_CALL_STATE_OUTGOING) || (calls[selected_call].state & IAXC_CALL_STATE_COMPLETE)) { - switch (iAudioType) { - case AUDIO_INTERNAL: - iaxc_service_network(netfd); -#ifdef USE_WIN_AUDIO - win_process_audio_buffers(&lastouttm, &calls[selected_call], iEncodeType); -#endif - iaxc_service_network(netfd); - break; - case AUDIO_INTERNAL_PA: - iaxc_service_network(netfd); - pa_send_audio(&lastouttm, &calls[selected_call], iEncodeType); - break; - default: - iaxc_service_network(netfd); - iaxc_external_service_audio(); - iaxc_service_network(netfd); - break; + /* FIXME: frame size should be variable? */ + short buf[160]; + int toRead; + + // make sure audio is running + if(audio.start(&audio)) + { + iaxc_usermsg(IAXC_ERROR, "Can't start audio"); + } + + for(;;) { + toRead = 160; + if(audio.input(&audio,buf,&toRead)) + { + iaxc_usermsg(IAXC_ERROR, "ERROR reading audio\n"); + break; } + if(!toRead) break; /* frame not available */ + /* currently, pa will always give us 0 or what we asked + * for samples */ + + send_encoded_audio(&calls[selected_call], buf, iEncodeType); + } + } else { - static int i=0; - if(i++ % 50 == 0) iaxc_do_levels_callback(-99,-99); + static int i=0; + if(i++ % 50 == 0) iaxc_do_levels_callback(-99,-99); + + // make sure audio is stopped + audio.stop(&audio); } return 0; } @@ -405,23 +408,10 @@ return; } else { /* its an audio packet to be output to user */ total_consumed += cur; + if(iaxc_audio_output_mode != 0) continue; - switch (iAudioType) { - case AUDIO_INTERNAL: -#ifdef USE_WIN_AUDIO - win_flush_audio_output_buffers(); - win_play_recv_audio(fr, sizeof(fr)); -#else -#endif - break; - case AUDIO_INTERNAL_PA: - pa_play_recv_audio(fr, sizeof(fr)); - break; - case AUDIO_EXTERNAL: - // Add external audio callback here - break; - } + audio.output(&audio,fr,sizeof(fr)/2); } } } Index: iaxclient_lib.h =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/lib/iaxclient_lib.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- iaxclient_lib.h 3 Jul 2003 18:17:14 -0000 1.18 +++ iaxclient_lib.h 10 Jul 2003 14:19:53 -0000 1.19 @@ -59,7 +59,6 @@ #endif -#define RBUFSIZE 256 #define MAXARGS 10 #define MAXARG 256 #define MAX_SESSIONS 4 @@ -76,16 +75,44 @@ void iaxc_do_levels_callback(float input, float output); -#if 0 -/* Audio Driver Abstraction TODO */ -struct audio_driver_struct { - char *name; - int (*initialize)(struct audio_driver_struct *d); +#define IAXC_AD_INPUT (1<<0) +#define IAXC_AD_OUTPUT (1<<1) +#define IAXC_AD_INPUT_DEFAULT (1<<2) +#define IAXC_AD_OUTPUT_DEFAULT (1<<3) + +struct iaxc_audio_device { + char *name; /* name of the device */ + long capabilities; /* flags, defined above */ + int devID; /* driver-specific ID */ +}; +struct iaxc_audio_driver { + /* data */ + char *name; /* driver name */ + struct iaxc_audio_device *devices; /* list of devices */ + int nDevices; /* count of devices */ + void *priv; /* pointer to private data */ + + /* methods */ + int (*initialize)(struct iaxc_audio_driver *d); + int (*destroy)(struct iaxc_audio_driver *d); /* free resources */ + int (*select_input)(struct iaxc_audio_driver *d, int devID); + int (*select_output)(struct iaxc_audio_driver *d, int devID); + + /* + * select_ring ? + * set_input_level + * set_output_level + * set_latency + */ + + int (*start)(struct iaxc_audio_driver *d); + int (*stop)(struct iaxc_audio_driver *d); + int (*output)(struct iaxc_audio_driver *d, void *samples, int nSamples); + int (*input)(struct iaxc_audio_driver *d, void *samples, int *nSamples); }; -typedef struct audio_driver_struct *iaxc_audio_driver; -#endif + #include "iaxclient.h" |
From: <st...@us...> - 2003-07-09 15:08:01
|
Update of /cvsroot/iaxclient/iaxclient In directory sc8-pr-cvs1:/tmp/cvs-serv7050 Modified Files: README Log Message: add reference to CVS tarball. Index: README =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/README,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- README 3 Jul 2003 21:33:45 -0000 1.4 +++ README 9 Jul 2003 15:07:58 -0000 1.5 @@ -36,6 +36,8 @@ Up-to-date versions of iaxclient are available from a sourceforge CVS repository. +CVS tarballs are also available as a link from the home page. + ======================================================================= LICENSES |