From: <st...@us...> - 2003-06-12 19:57:17
|
Update of /cvsroot/iaxclient/iaxclient/simpleclient/wx In directory sc8-pr-cvs1:/tmp/cvs-serv4757 Modified Files: Makefile wx.cc Removed Files: testcall.c wx.h Log Message: interim commit: 1) remove testcall.c/wx.h. Maybe wx.h might reappear, but testcall.c was just a hacky copy of the cmdline app. wx.h had only about 5 useful lines.. 2) Add cmd-line parsing stuff to the app. Nothing useful yet, but the skeleton is there. Index: Makefile =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile 10 Jun 2003 13:20:53 -0000 1.12 +++ Makefile 12 Jun 2003 19:57:10 -0000 1.13 @@ -3,7 +3,7 @@ #debug CFLAGS:= $(CFLAGS) -g -OBJS= wx.o testcall.o +OBJS= wx.o REZ=echo Index: wx.cc =================================================================== RCS file: /cvsroot/iaxclient/iaxclient/simpleclient/wx/wx.cc,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- wx.cc 11 Jun 2003 16:54:49 -0000 1.24 +++ wx.cc 12 Jun 2003 19:57:12 -0000 1.25 @@ -5,8 +5,7 @@ #include "wx/wx.h" #endif -#include "wx.h" - +#include "wx/cmdline.h" #include "iaxclient.h" @@ -23,8 +22,27 @@ #define LEVEL_MIN -50 #define DEFAULT_SILENCE_THRESHOLD 1 // positive is "auto" +class IAXClient : public wxApp +{ + public: + virtual bool OnInit(); + virtual bool OnCmdLineParsed(wxCmdLineParser& p); + virtual void OnInitCmdLine(wxCmdLineParser& p); +}; + +DECLARE_APP(IAXClient) + IMPLEMENT_APP(IAXClient) +// forward decls for callbacks +extern "C" { + void status_callback(char *msg); + int levels_callback(float input, float output); + int doTestCall(int ac, char **av); +} + + + // event constants enum { @@ -380,21 +398,47 @@ gdk_window_destroy(keyStateWindow); #endif iaxc_stop_processing_thread(); + iaxc_shutdown(); +} + + +void IAXClient::OnInitCmdLine(wxCmdLineParser& p) +{ + // declare our CmdLine options and stuff. + p.AddSwitch(_T("d"),_T("disable-dialpad"),_T("Disable Dial Pad")); +} + +bool IAXClient::OnCmdLineParsed(wxCmdLineParser& p) +{ + if(p.Found(_T("d"))) + fprintf(stderr, "found -d switch\n"); + + return true; } bool IAXClient::OnInit() { + if(!wxApp::OnInit()) + return false; + theFrame = new IAXFrame("IAXTest", 0,0,130,220); + theFrame->Show(TRUE); SetTopWindow(theFrame); - doTestCall(0,NULL); + iaxc_initialize(AUDIO_INTERNAL_PA); + + iaxc_set_encode_format(IAXC_FORMAT_GSM); + iaxc_set_silence_threshold(0); + iaxc_set_levels_callback(levels_callback); iaxc_set_error_callback(status_callback); iaxc_set_status_callback(status_callback); - return true; + iaxc_start_processing_thread(); + + return true; } --- testcall.c DELETED --- --- wx.h DELETED --- |