options_dialog.cpp

Go to the documentation of this file.
00001 /*
00002  *  Copyright (C) Massimo Cora' 2005-2006 <maxcvs@email.it>
00003  *  Copyright (C) Fabio Zecchini 2005 <zio.zec@gmail.com>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #if defined(__GNUG__) && !defined(__APPLE__)
00021 #pragma implementation "options_dialog.h"
00022 #endif
00023 
00024 // For compilers that support precompilation, includes "wx/wx.h".
00025 #include "wx/wxprec.h"
00026 
00027 #ifdef __BORLANDC__
00028 #pragma hdrstop
00029 #endif
00030 
00031 #ifndef WX_PRECOMP
00032 #include "wx/wx.h"
00033 #endif
00034 
00037 
00038 #include "options_dialog.h"
00039 #include <wx/socket.h>
00040 
00041 
00042 #include "main_frame.h"
00043 
00044 
00047 
00052 IMPLEMENT_DYNAMIC_CLASS( DialogOptions, wxDialog )
00053 
00054 
00058 BEGIN_EVENT_TABLE( DialogOptions, wxDialog )
00059 
00061     EVT_BUTTON( ID_BUTTON2, DialogOptions::OnButton3Click )
00062 
00063     EVT_COMBOBOX( ID_COMBOBOX, DialogOptions::OnComboboxSelected )
00064 
00065     EVT_BUTTON( ID_BUTTON1, DialogOptions::OnButton1Click )
00066 
00067     EVT_CHECKBOX( ID_CHECK_XML1, DialogOptions::OnCheckboxXmlFile1 )
00068 
00069     EVT_BUTTON( ID_BUTTON, DialogOptions::OnButton2Click )
00070 
00071     EVT_CHECKBOX( ID_CHECK_XML2, DialogOptions::OnCheckboxXmlFile2 )
00072 
00073     EVT_CHECKBOX( ID_CHECKBOX3, DialogOptions::OnGcardUseClick )
00074 
00075     EVT_BUTTON( ID_OPTIONS_BUTTON_CANCEL, DialogOptions::OnOptionsButtonCancelClick )
00076 
00077     EVT_BUTTON( ID_OPTIONS_BUTTON_OK, DialogOptions::OnOptionsButtonOkClick )
00078 
00080 
00081 END_EVENT_TABLE()
00082 
00087 DialogOptions::DialogOptions( )
00088 {
00089 }
00090 
00091 DialogOptions::DialogOptions( wxWindow* parent, StreamerCtrlThread *streamer_thread, 
00092                                                          ReceiverCtrlThread *receiver_thread,
00093                                                          MainFrame *mainframe_pointer,
00094                                                          wxWindowID id, const wxString& caption, const wxPoint& pos, 
00095                                                          const wxSize& size, long style )
00096 {
00097 
00098         // set up our threads pointers
00099         m_streamer_thread = streamer_thread;
00100         m_receiver_thread = receiver_thread;
00101 
00102         // and the mainframe class pointer [useful for callback purposes]
00103         m_mainframe_pointer = mainframe_pointer;
00104 
00105     Create(parent, id, caption, pos, size, style);
00106 }
00107 
00112 bool DialogOptions::Create( wxWindow* parent, wxWindowID id, const wxString& caption, 
00113                                                    const wxPoint& pos, const wxSize& size, long style )
00114 {
00116     m_panel_streamer = NULL;
00117     m_rtsp_stream_text = NULL;
00118     m_start_rtsp_check = NULL;
00119     m_rtsp_port_text = NULL;
00120     m_rtsp_fps_text = NULL;
00121     m_proto_choose = NULL;
00122     m_multi_face_stream_check = NULL;
00123     m_multi_face_stream_text = NULL;
00124     m_grab_video_check = NULL;
00125     m_grab_video_text = NULL;
00126     m_grab_file_check = NULL;
00127     m_grab_file_text = NULL;
00128     m_grab_audio_check = NULL;
00129     m_grab_audio_text = NULL;
00130     m_uni_setting = NULL;
00131     m_stream_receive_iface_text = NULL;
00132     m_stream_send_iface_text = NULL;
00133     m_panel_client = NULL;
00134     m_receive_stream_text = NULL;
00135     m_receive_stream_check = NULL;
00136     m_receive_audio_check = NULL;
00137     m_panel_preferences = NULL;
00138     m_face_tracking_check = NULL;
00139     m_algorithm_choose = NULL;
00140     m_flipped_mode_check = NULL;
00141     m_xml_file_1 = NULL;
00142     xml_button_1 = NULL;
00143     m_xml_enable_1 = NULL;
00144     m_xml_file_2 = NULL;
00145     xml_button_2 = NULL;
00146     m_xml_enable_2 = NULL;
00147     m_freeze_time = NULL;
00148     m_hitrate = NULL;
00149     m_gcard_use_check = NULL;
00150     m_radius_min = NULL;
00151     m_radius_max = NULL;
00152     m_center_x = NULL;
00153     m_center_y = NULL;
00155 
00157     SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS);
00158     wxDialog::Create( parent, id, caption, pos, size, style );
00159 
00160     CreateControls();
00161     GetSizer()->Fit(this);
00162     GetSizer()->SetSizeHints(this);
00163     Centre();
00165 
00166 
00167         // try to set the checks buttons to a disable-mode
00168         if ( m_streamer_thread->isStreaming() ) {
00169                 m_start_rtsp_check->SetValue( true );
00170                 m_start_rtsp_check->Enable( false );
00171 
00172                 // FIXME: disable client/preferences panel.
00173                 m_panel_client->Enable( false );
00174                 m_panel_preferences->Enable( false );
00175         }
00176 
00177         if ( m_receiver_thread->isReceiving() ) {
00178                 m_receive_stream_check->SetValue( true );
00179                 m_receive_stream_check->Enable( false );
00180 
00181                 // FIXME
00182                 m_panel_streamer->Enable( false );
00183         }
00184 
00185 
00186     return TRUE;
00187 }
00188 
00193 void DialogOptions::CreateControls()
00194 {    
00196     DialogOptions* itemDialog1 = this;
00197 
00198     wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
00199     itemDialog1->SetSizer(itemBoxSizer2);
00200 
00201     wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
00202     itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
00203 
00204     wxNotebook* itemNotebook4 = new wxNotebook( itemDialog1, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxNB_TOP );
00205 
00206     m_panel_streamer = new wxPanel( itemNotebook4, ID_PANEL_STREAMER, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
00207     wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
00208     m_panel_streamer->SetSizer(itemBoxSizer6);
00209 
00210     wxStaticBox* itemStaticBoxSizer7Static = new wxStaticBox(m_panel_streamer, wxID_ANY, _("General server setting :"));
00211     wxStaticBoxSizer* itemStaticBoxSizer7 = new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
00212     itemBoxSizer6->Add(itemStaticBoxSizer7, 0, wxGROW|wxALL, 5);
00213     wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
00214     itemStaticBoxSizer7->Add(itemBoxSizer8, 0, wxGROW|wxALL, 5);
00215     wxStaticText* itemStaticText9 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Stream subsession"), wxDefaultPosition, wxDefaultSize, 0 );
00216     itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00217 
00218     itemBoxSizer8->Add(14, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00219 
00220     m_rtsp_stream_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL8, _("testStream"), wxDefaultPosition, wxDefaultSize, 0 );
00221     if (ShowToolTips())
00222         m_rtsp_stream_text->SetToolTip(_("To receive the stream the client side must set a rtsp path like \"rtsp://12.34.56.78/testStream\". This is the subsession \"/testStream\" part."));
00223     itemBoxSizer8->Add(m_rtsp_stream_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00224 
00225     itemBoxSizer8->Add(5, 5, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00226 
00227     m_start_rtsp_check = new wxCheckBox( m_panel_streamer, ID_CHECKBOX6, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00228     m_start_rtsp_check->SetValue(FALSE);
00229     itemBoxSizer8->Add(m_start_rtsp_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00230 
00231     wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxHORIZONTAL);
00232     itemStaticBoxSizer7->Add(itemBoxSizer14, 0, wxGROW|wxALL, 5);
00233     wxStaticText* itemStaticText15 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("RTSP Port (TCP) :"), wxDefaultPosition, wxDefaultSize, 0 );
00234     itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00235 
00236     itemBoxSizer14->Add(15, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00237 
00238     m_rtsp_port_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL5, _("8554"), wxDefaultPosition, wxSize(40, -1), 0 );
00239     if (ShowToolTips())
00240         m_rtsp_port_text->SetToolTip(_("the port the RTSPServer wll listen to"));
00241     itemBoxSizer14->Add(m_rtsp_port_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00242 
00243     wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxHORIZONTAL);
00244     itemStaticBoxSizer7->Add(itemBoxSizer18, 0, wxGROW|wxALL, 5);
00245     wxStaticText* itemStaticText19 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("FPS :"), wxDefaultPosition, wxDefaultSize, 0 );
00246     if (ShowToolTips())
00247         itemStaticText19->SetToolTip(_("Frames per second"));
00248     itemBoxSizer18->Add(itemStaticText19, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00249 
00250     itemBoxSizer18->Add(75, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00251 
00252     m_rtsp_fps_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL, _("25"), wxDefaultPosition, wxSize(40, -1), 0 );
00253     if (ShowToolTips())
00254         m_rtsp_fps_text->SetToolTip(_("Frames per second"));
00255     itemBoxSizer18->Add(m_rtsp_fps_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00256 
00257     wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxHORIZONTAL);
00258     itemStaticBoxSizer7->Add(itemBoxSizer22, 0, wxGROW|wxALL, 5);
00259     wxStaticText* itemStaticText23 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Protocol"), wxDefaultPosition, wxDefaultSize, 0 );
00260     itemBoxSizer22->Add(itemStaticText23, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00261 
00262     itemBoxSizer22->Add(61, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00263 
00264     wxString m_proto_chooseStrings[] = {
00265         _("H263+"),
00266         _("MJPEG")
00267     };
00268     m_proto_choose = new wxComboBox( m_panel_streamer, ID_COMBOBOX1, _("H263+"), wxDefaultPosition, wxDefaultSize, 2, m_proto_chooseStrings, wxCB_READONLY );
00269     m_proto_choose->SetStringSelection(_("H263+"));
00270     if (ShowToolTips())
00271         m_proto_choose->SetToolTip(_("choose the protocol you want to stream with"));
00272     itemBoxSizer22->Add(m_proto_choose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00273 
00274     wxStaticBox* itemStaticBoxSizer26Static = new wxStaticBox(m_panel_streamer, wxID_ANY, _("Serverside computing [needs OmniStuff preferences]"));
00275     wxStaticBoxSizer* itemStaticBoxSizer26 = new wxStaticBoxSizer(itemStaticBoxSizer26Static, wxVERTICAL);
00276     itemBoxSizer6->Add(itemStaticBoxSizer26, 0, wxGROW|wxALL, 5);
00277     wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL);
00278     itemStaticBoxSizer26->Add(itemBoxSizer27, 0, wxGROW|wxALL, 5);
00279     wxStaticText* itemStaticText28 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Multi face stream"), wxDefaultPosition, wxDefaultSize, 0 );
00280     itemBoxSizer27->Add(itemStaticText28, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00281 
00282     itemBoxSizer27->Add(20, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00283 
00284     m_multi_face_stream_check = new wxCheckBox( m_panel_streamer, ID_CHECKBOX1, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00285     m_multi_face_stream_check->SetValue(FALSE);
00286     if (ShowToolTips())
00287         m_multi_face_stream_check->SetToolTip(_("Enabling this option will assure that all the face detecting/tracking/etc computing is done on server. Client will then receive only the detected faces"));
00288     itemBoxSizer27->Add(m_multi_face_stream_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00289 
00290     itemBoxSizer27->Add(10, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00291 
00292     wxStaticText* itemStaticText32 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Max streams"), wxDefaultPosition, wxDefaultSize, 0 );
00293     itemBoxSizer27->Add(itemStaticText32, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00294 
00295     itemBoxSizer27->Add(10, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00296 
00297     m_multi_face_stream_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL3, _("5"), wxDefaultPosition, wxSize(30, -1), 0 );
00298     itemBoxSizer27->Add(m_multi_face_stream_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00299 
00300     wxStaticBox* itemStaticBoxSizer35Static = new wxStaticBox(m_panel_streamer, wxID_ANY, _("Video"));
00301     wxStaticBoxSizer* itemStaticBoxSizer35 = new wxStaticBoxSizer(itemStaticBoxSizer35Static, wxVERTICAL);
00302     itemBoxSizer6->Add(itemStaticBoxSizer35, 0, wxGROW|wxALL, 5);
00303     wxBoxSizer* itemBoxSizer36 = new wxBoxSizer(wxHORIZONTAL);
00304     itemStaticBoxSizer35->Add(itemBoxSizer36, 0, wxGROW|wxALL, 5);
00305     wxStaticText* itemStaticText37 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Grab webcam"), wxDefaultPosition, wxDefaultSize, 0 );
00306     itemBoxSizer36->Add(itemStaticText37, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00307 
00308     itemBoxSizer36->Add(32, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00309 
00310     m_grab_video_check = new wxCheckBox( m_panel_streamer, ID_CHECKBOX7, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00311     m_grab_video_check->SetValue(TRUE);
00312     itemBoxSizer36->Add(m_grab_video_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00313 
00314     itemBoxSizer36->Add(10, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00315 
00316     wxStaticText* itemStaticText41 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Input port"), wxDefaultPosition, wxDefaultSize, 0 );
00317     itemBoxSizer36->Add(itemStaticText41, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00318 
00319     itemBoxSizer36->Add(25, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00320 
00321     m_grab_video_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL6, _("0"), wxDefaultPosition, wxSize(30, -1), 0 );
00322     itemBoxSizer36->Add(m_grab_video_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00323 
00324     wxStaticLine* itemStaticLine44 = new wxStaticLine( m_panel_streamer, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL );
00325     itemStaticBoxSizer35->Add(itemStaticLine44, 0, wxGROW|wxALL, 5);
00326 
00327     wxBoxSizer* itemBoxSizer45 = new wxBoxSizer(wxHORIZONTAL);
00328     itemStaticBoxSizer35->Add(itemBoxSizer45, 0, wxGROW|wxALL, 5);
00329     wxStaticText* itemStaticText46 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Grab from file"), wxDefaultPosition, wxDefaultSize, 0 );
00330     itemBoxSizer45->Add(itemStaticText46, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00331 
00332     itemBoxSizer45->Add(35, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00333 
00334     m_grab_file_check = new wxCheckBox( m_panel_streamer, ID_CHECKBOX8, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00335     m_grab_file_check->SetValue(FALSE);
00336     itemBoxSizer45->Add(m_grab_file_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00337 
00338     wxBoxSizer* itemBoxSizer49 = new wxBoxSizer(wxHORIZONTAL);
00339     itemStaticBoxSizer35->Add(itemBoxSizer49, 0, wxGROW|wxALL, 5);
00340     m_grab_file_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL7, _T(""), wxDefaultPosition, wxSize(230, -1), 0 );
00341     itemBoxSizer49->Add(m_grab_file_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00342 
00343     wxButton* itemButton51 = new wxButton( m_panel_streamer, ID_BUTTON2, _("Path..."), wxDefaultPosition, wxDefaultSize, 0 );
00344     itemBoxSizer49->Add(itemButton51, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00345 
00346     wxStaticBox* itemStaticBoxSizer52Static = new wxStaticBox(m_panel_streamer, wxID_ANY, _("Audio"));
00347     wxStaticBoxSizer* itemStaticBoxSizer52 = new wxStaticBoxSizer(itemStaticBoxSizer52Static, wxVERTICAL);
00348     itemBoxSizer6->Add(itemStaticBoxSizer52, 0, wxGROW|wxALL, 5);
00349     wxBoxSizer* itemBoxSizer53 = new wxBoxSizer(wxHORIZONTAL);
00350     itemStaticBoxSizer52->Add(itemBoxSizer53, 0, wxGROW|wxALL, 5);
00351     wxStaticText* itemStaticText54 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Grab audio"), wxDefaultPosition, wxDefaultSize, 0 );
00352     itemBoxSizer53->Add(itemStaticText54, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00353 
00354     itemBoxSizer53->Add(47, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00355 
00356     m_grab_audio_check = new wxCheckBox( m_panel_streamer, ID_CHECKBOX5, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00357     m_grab_audio_check->SetValue(FALSE);
00358     itemBoxSizer53->Add(m_grab_audio_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00359 
00360     itemBoxSizer53->Add(10, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00361 
00362     wxStaticText* itemStaticText58 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Input port"), wxDefaultPosition, wxDefaultSize, 0 );
00363     itemBoxSizer53->Add(itemStaticText58, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00364 
00365     itemBoxSizer53->Add(25, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00366 
00367     m_grab_audio_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL4, _("0"), wxDefaultPosition, wxSize(30, -1), 0 );
00368     itemBoxSizer53->Add(m_grab_audio_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00369 
00370     m_uni_setting = new wxStaticBox(m_panel_streamer, wxID_ANY, _("Unicast setting : "));
00371     wxStaticBoxSizer* itemStaticBoxSizer61 = new wxStaticBoxSizer(m_uni_setting, wxVERTICAL);
00372     itemBoxSizer6->Add(itemStaticBoxSizer61, 0, wxGROW|wxALL, 5);
00373     wxBoxSizer* itemBoxSizer62 = new wxBoxSizer(wxHORIZONTAL);
00374     itemStaticBoxSizer61->Add(itemBoxSizer62, 0, wxGROW|wxALL, 5);
00375     wxStaticText* itemStaticText63 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Receiving interface ip :"), wxDefaultPosition, wxDefaultSize, 0 );
00376     itemBoxSizer62->Add(itemStaticText63, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00377 
00378     m_stream_receive_iface_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL2, _("0.0.0.0"), wxDefaultPosition, wxDefaultSize, 0 );
00379     if (ShowToolTips())
00380         m_stream_receive_iface_text->SetToolTip(_("Enter the ip address of the interface you want to receive to"));
00381     itemBoxSizer62->Add(m_stream_receive_iface_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00382 
00383     wxBoxSizer* itemBoxSizer65 = new wxBoxSizer(wxHORIZONTAL);
00384     itemStaticBoxSizer61->Add(itemBoxSizer65, 0, wxGROW|wxALL, 5);
00385     wxStaticText* itemStaticText66 = new wxStaticText( m_panel_streamer, wxID_STATIC, _("Sending interface ip:    "), wxDefaultPosition, wxDefaultSize, 0 );
00386     itemBoxSizer65->Add(itemStaticText66, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00387 
00388     m_stream_send_iface_text = new wxTextCtrl( m_panel_streamer, ID_TEXTCTRL1, _("0.0.0.0"), wxDefaultPosition, wxDefaultSize, 0 );
00389     if (ShowToolTips())
00390         m_stream_send_iface_text->SetToolTip(_("Enter the ip address of the interface you want to stream from"));
00391     itemBoxSizer65->Add(m_stream_send_iface_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00392 
00393     itemNotebook4->AddPage(m_panel_streamer, _("RTSP Server"));
00394 
00395     m_panel_client = new wxPanel( itemNotebook4, ID_PANEL_CLIENT_STREAM, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
00396     wxBoxSizer* itemBoxSizer69 = new wxBoxSizer(wxVERTICAL);
00397     m_panel_client->SetSizer(itemBoxSizer69);
00398 
00399     wxStaticBox* itemStaticBoxSizer70Static = new wxStaticBox(m_panel_client, wxID_ANY, _("Client setting :"));
00400     wxStaticBoxSizer* itemStaticBoxSizer70 = new wxStaticBoxSizer(itemStaticBoxSizer70Static, wxVERTICAL);
00401     itemBoxSizer69->Add(itemStaticBoxSizer70, 0, wxGROW|wxALL, 5);
00402     wxBoxSizer* itemBoxSizer71 = new wxBoxSizer(wxHORIZONTAL);
00403     itemStaticBoxSizer70->Add(itemBoxSizer71, 0, wxGROW|wxALL, 5);
00404     wxStaticText* itemStaticText72 = new wxStaticText( m_panel_client, wxID_STATIC, _("RTSP address: "), wxDefaultPosition, wxDefaultSize, 0 );
00405     if (ShowToolTips())
00406         itemStaticText72->SetToolTip(_("Should be an address like rtsp://82.83.84.1/testStream"));
00407     itemBoxSizer71->Add(itemStaticText72, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00408 
00409     itemBoxSizer71->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00410 
00411     m_receive_stream_text = new wxTextCtrl( m_panel_client, ID_TEXTCTRL10, _("rtsp://192.168.2.2:8554/testStream"), wxDefaultPosition, wxSize(200, -1), 0 );
00412     if (ShowToolTips())
00413         m_receive_stream_text->SetToolTip(_("rtsp://host[:port]/streamPath"));
00414     itemBoxSizer71->Add(m_receive_stream_text, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00415 
00416     itemBoxSizer71->Add(5, 5, 0, wxGROW|wxALL, 5);
00417 
00418     wxBoxSizer* itemBoxSizer76 = new wxBoxSizer(wxHORIZONTAL);
00419     itemStaticBoxSizer70->Add(itemBoxSizer76, 0, wxGROW|wxALL, 5);
00420     wxStaticText* itemStaticText77 = new wxStaticText( m_panel_client, wxID_STATIC, _("Connect and receive stream(s)"), wxDefaultPosition, wxDefaultSize, 0 );
00421     itemBoxSizer76->Add(itemStaticText77, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00422 
00423     itemBoxSizer76->Add(5, 5, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00424 
00425     m_receive_stream_check = new wxCheckBox( m_panel_client, ID_CHECKBOX2, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00426     m_receive_stream_check->SetValue(FALSE);
00427     if (ShowToolTips())
00428         m_receive_stream_check->SetToolTip(_("Connect to the specified address and receive the video stream, displaying it.\nIf the omnidirectional-face tracking is checked the program will try to find human faces and it will display them separately. In this version you can only run a receiver or exclusively a streamer per Omnimeeting instance.  Will be fixed in next version."));
00429     itemBoxSizer76->Add(m_receive_stream_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00430 
00431     wxStaticBox* itemStaticBoxSizer80Static = new wxStaticBox(m_panel_client, wxID_ANY, _("Audio"));
00432     wxStaticBoxSizer* itemStaticBoxSizer80 = new wxStaticBoxSizer(itemStaticBoxSizer80Static, wxVERTICAL);
00433     itemBoxSizer69->Add(itemStaticBoxSizer80, 0, wxGROW|wxALL, 5);
00434     wxBoxSizer* itemBoxSizer81 = new wxBoxSizer(wxHORIZONTAL);
00435     itemStaticBoxSizer80->Add(itemBoxSizer81, 0, wxGROW|wxALL, 5);
00436     wxStaticText* itemStaticText82 = new wxStaticText( m_panel_client, wxID_STATIC, _("Receive and playback MP3 audio stream (if available)"), wxDefaultPosition, wxDefaultSize, 0 );
00437     itemBoxSizer81->Add(itemStaticText82, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00438 
00439     itemBoxSizer81->Add(5, 5, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00440 
00441     m_receive_audio_check = new wxCheckBox( m_panel_client, ID_CHECKBOX4, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00442     m_receive_audio_check->SetValue(TRUE);
00443     if (ShowToolTips())
00444         m_receive_audio_check->SetToolTip(_("If audio is streamed by server we will receive and play it."));
00445     itemBoxSizer81->Add(m_receive_audio_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00446 
00447     itemNotebook4->AddPage(m_panel_client, _("Client Stream"));
00448 
00449     m_panel_preferences = new wxPanel( itemNotebook4, ID_PANEL_PREFERENCES, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
00450     wxBoxSizer* itemBoxSizer86 = new wxBoxSizer(wxVERTICAL);
00451     m_panel_preferences->SetSizer(itemBoxSizer86);
00452 
00453     wxStaticBox* itemStaticBoxSizer87Static = new wxStaticBox(m_panel_preferences, wxID_ANY, _("Omnidirectional Face Detecting and Tracking"));
00454     wxStaticBoxSizer* itemStaticBoxSizer87 = new wxStaticBoxSizer(itemStaticBoxSizer87Static, wxVERTICAL);
00455     itemBoxSizer86->Add(itemStaticBoxSizer87, 0, wxGROW|wxALL, 5);
00456     wxBoxSizer* itemBoxSizer88 = new wxBoxSizer(wxHORIZONTAL);
00457     itemStaticBoxSizer87->Add(itemBoxSizer88, 0, wxGROW|wxALL, 5);
00458     wxStaticText* itemStaticText89 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("Face detecting/tracking"), wxDefaultPosition, wxDefaultSize, 0 );
00459     itemBoxSizer88->Add(itemStaticText89, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00460 
00461     itemBoxSizer88->Add(5, 5, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00462 
00463     m_face_tracking_check = new wxCheckBox( m_panel_preferences, ID_CHECKBOX, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00464     m_face_tracking_check->SetValue(FALSE);
00465     if (ShowToolTips())
00466         m_face_tracking_check->SetToolTip(_("Face tracking feature, works ONLY with an omnidirectional stream!"));
00467     itemBoxSizer88->Add(m_face_tracking_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00468 
00469     wxBoxSizer* itemBoxSizer92 = new wxBoxSizer(wxHORIZONTAL);
00470     itemStaticBoxSizer87->Add(itemBoxSizer92, 0, wxGROW|wxALL, 5);
00471     wxStaticText* itemStaticText93 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("Detection Algorithm"), wxDefaultPosition, wxDefaultSize, 0 );
00472     itemBoxSizer92->Add(itemStaticText93, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00473 
00474     itemBoxSizer92->Add(5, 5, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00475 
00476     wxString m_algorithm_chooseStrings[] = {
00477         _("SimpleDetection"),
00478         _("VRFilterDetection")
00479     };
00480     m_algorithm_choose = new wxComboBox( m_panel_preferences, ID_COMBOBOX, _("SimpleDetection"), wxDefaultPosition, wxDefaultSize, 2, m_algorithm_chooseStrings, wxCB_READONLY );
00481     m_algorithm_choose->SetStringSelection(_("SimpleDetection"));
00482     itemBoxSizer92->Add(m_algorithm_choose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00483 
00484     wxBoxSizer* itemBoxSizer96 = new wxBoxSizer(wxHORIZONTAL);
00485     itemStaticBoxSizer87->Add(itemBoxSizer96, 0, wxGROW|wxALL, 5);
00486     wxStaticText* itemStaticText97 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("Flipped mode"), wxDefaultPosition, wxDefaultSize, 0 );
00487     itemBoxSizer96->Add(itemStaticText97, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00488 
00489     itemBoxSizer96->Add(5, 5, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00490 
00491     m_flipped_mode_check = new wxCheckBox( m_panel_preferences, ID_CHECKBOX9, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00492     m_flipped_mode_check->SetValue(FALSE);
00493     itemBoxSizer96->Add(m_flipped_mode_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00494 
00495     wxStaticBox* itemStaticBoxSizer100Static = new wxStaticBox(m_panel_preferences, wxID_ANY, _("Haarcascades [only SimpleDetection]"));
00496     wxStaticBoxSizer* itemStaticBoxSizer100 = new wxStaticBoxSizer(itemStaticBoxSizer100Static, wxVERTICAL);
00497     itemBoxSizer86->Add(itemStaticBoxSizer100, 0, wxGROW|wxALL, 5);
00498     wxBoxSizer* itemBoxSizer101 = new wxBoxSizer(wxHORIZONTAL);
00499     itemStaticBoxSizer100->Add(itemBoxSizer101, 0, wxGROW|wxALL, 5);
00500     m_xml_file_1 = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL11, _T(""), wxDefaultPosition, wxSize(200, -1), 0 );
00501     if (ShowToolTips())
00502         m_xml_file_1->SetToolTip(_("Insert an Haar Cascade xml file [you can find them into OpenCv distribution] or provide one made by yourself"));
00503     itemBoxSizer101->Add(m_xml_file_1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00504 
00505     xml_button_1 = new wxButton( m_panel_preferences, ID_BUTTON1, _("Path..."), wxDefaultPosition, wxDefaultSize, 0 );
00506     itemBoxSizer101->Add(xml_button_1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00507 
00508     m_xml_enable_1 = new wxCheckBox( m_panel_preferences, ID_CHECK_XML1, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00509     m_xml_enable_1->SetValue(FALSE);
00510     itemBoxSizer101->Add(m_xml_enable_1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00511 
00512     wxBoxSizer* itemBoxSizer105 = new wxBoxSizer(wxHORIZONTAL);
00513     itemStaticBoxSizer100->Add(itemBoxSizer105, 0, wxGROW|wxALL, 5);
00514     m_xml_file_2 = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL9, _T(""), wxDefaultPosition, wxSize(200, -1), 0 );
00515     if (ShowToolTips())
00516         m_xml_file_2->SetToolTip(_("Insert an Haar Cascade xml file [you can find them into OpenCv distribution] or provide one made by yourself"));
00517     itemBoxSizer105->Add(m_xml_file_2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00518 
00519     xml_button_2 = new wxButton( m_panel_preferences, ID_BUTTON, _("Path..."), wxDefaultPosition, wxDefaultSize, 0 );
00520     itemBoxSizer105->Add(xml_button_2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00521 
00522     m_xml_enable_2 = new wxCheckBox( m_panel_preferences, ID_CHECK_XML2, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00523     m_xml_enable_2->SetValue(FALSE);
00524     itemBoxSizer105->Add(m_xml_enable_2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00525 
00526     wxBoxSizer* itemBoxSizer109 = new wxBoxSizer(wxHORIZONTAL);
00527     itemStaticBoxSizer100->Add(itemBoxSizer109, 0, wxGROW|wxALL, 5);
00528     wxStaticText* itemStaticText110 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("Freeze time :"), wxDefaultPosition, wxDefaultSize, 0 );
00529     itemBoxSizer109->Add(itemStaticText110, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00530 
00531     m_freeze_time = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL13, _("20"), wxDefaultPosition, wxSize(30, -1), 0 );
00532     itemBoxSizer109->Add(m_freeze_time, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00533 
00534     itemBoxSizer109->Add(50, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00535 
00536     wxStaticText* itemStaticText113 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("Track window hitrate :"), wxDefaultPosition, wxDefaultSize, 0 );
00537     itemBoxSizer109->Add(itemStaticText113, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00538 
00539     m_hitrate = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL14, _("0.80"), wxDefaultPosition, wxSize(40, -1), 0 );
00540     itemBoxSizer109->Add(m_hitrate, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00541 
00542     wxStaticBox* itemStaticBoxSizer115Static = new wxStaticBox(m_panel_preferences, wxID_ANY, _("Hardware options"));
00543     wxStaticBoxSizer* itemStaticBoxSizer115 = new wxStaticBoxSizer(itemStaticBoxSizer115Static, wxVERTICAL);
00544     itemBoxSizer86->Add(itemStaticBoxSizer115, 0, wxGROW|wxALL, 5);
00545     wxBoxSizer* itemBoxSizer116 = new wxBoxSizer(wxHORIZONTAL);
00546     itemStaticBoxSizer115->Add(itemBoxSizer116, 0, wxGROW|wxALL, 5);
00547     wxStaticText* itemStaticText117 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("Use hardware 3d graphic card acceleration"), wxDefaultPosition, wxDefaultSize, 0 );
00548     itemBoxSizer116->Add(itemStaticText117, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00549 
00550     itemBoxSizer116->Add(12, 5, 2, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00551 
00552     m_gcard_use_check = new wxCheckBox( m_panel_preferences, ID_CHECKBOX3, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
00553     m_gcard_use_check->SetValue(FALSE);
00554     if (ShowToolTips())
00555         m_gcard_use_check->SetToolTip(_("Enabling this there will be a check if your card support pixel and vertex shaders. The hardware acceleration is used to convert from Omnidirectional Images to Panoramic ones."));
00556     itemBoxSizer116->Add(m_gcard_use_check, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00557 
00558     wxStaticBox* itemStaticBoxSizer120Static = new wxStaticBox(m_panel_preferences, wxID_ANY, _("Omnidirectional Options :"));
00559     wxStaticBoxSizer* itemStaticBoxSizer120 = new wxStaticBoxSizer(itemStaticBoxSizer120Static, wxVERTICAL);
00560     itemBoxSizer86->Add(itemStaticBoxSizer120, 0, wxGROW|wxALL, 5);
00561     wxBoxSizer* itemBoxSizer121 = new wxBoxSizer(wxHORIZONTAL);
00562     itemStaticBoxSizer120->Add(itemBoxSizer121, 0, wxGROW|wxALL, 5);
00563     wxStaticText* itemStaticText122 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("RAY MIN :"), wxDefaultPosition, wxDefaultSize, 0 );
00564     itemBoxSizer121->Add(itemStaticText122, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00565 
00566     itemBoxSizer121->Add(12, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00567 
00568     m_radius_min = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL15, _("40"), wxDefaultPosition, wxSize(30, -1), 0 );
00569     itemBoxSizer121->Add(m_radius_min, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00570 
00571     itemBoxSizer121->Add(65, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00572 
00573     wxStaticText* itemStaticText126 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("RAY MAX :"), wxDefaultPosition, wxDefaultSize, 0 );
00574     itemBoxSizer121->Add(itemStaticText126, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00575 
00576     itemBoxSizer121->Add(8, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00577 
00578     m_radius_max = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL16, _("220"), wxDefaultPosition, wxSize(30, -1), 0 );
00579     itemBoxSizer121->Add(m_radius_max, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00580 
00581     wxBoxSizer* itemBoxSizer129 = new wxBoxSizer(wxHORIZONTAL);
00582     itemStaticBoxSizer120->Add(itemBoxSizer129, 0, wxGROW|wxALL, 5);
00583     wxStaticText* itemStaticText130 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("CENTER X :"), wxDefaultPosition, wxDefaultSize, 0 );
00584     itemBoxSizer129->Add(itemStaticText130, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00585 
00586     itemBoxSizer129->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00587 
00588     m_center_x = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL17, _("326"), wxDefaultPosition, wxSize(30, -1), 0 );
00589     itemBoxSizer129->Add(m_center_x, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00590 
00591     itemBoxSizer129->Add(65, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00592 
00593     wxStaticText* itemStaticText134 = new wxStaticText( m_panel_preferences, wxID_STATIC, _("CENTER Y :"), wxDefaultPosition, wxDefaultSize, 0 );
00594     itemBoxSizer129->Add(itemStaticText134, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
00595 
00596     itemBoxSizer129->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00597 
00598     m_center_y = new wxTextCtrl( m_panel_preferences, ID_TEXTCTRL18, _("250"), wxDefaultPosition, wxSize(30, -1), 0 );
00599     itemBoxSizer129->Add(m_center_y, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00600 
00601     itemNotebook4->AddPage(m_panel_preferences, _("Omnistuff preferences"));
00602 
00603     itemBoxSizer3->Add(itemNotebook4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2);
00604 
00605     wxBoxSizer* itemBoxSizer137 = new wxBoxSizer(wxHORIZONTAL);
00606     itemBoxSizer2->Add(itemBoxSizer137, 0, wxALIGN_RIGHT|wxALL, 5);
00607 
00608     wxButton* itemButton138 = new wxButton( itemDialog1, ID_OPTIONS_BUTTON_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
00609     itemBoxSizer137->Add(itemButton138, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00610 
00611     wxButton* itemButton139 = new wxButton( itemDialog1, ID_OPTIONS_BUTTON_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
00612     itemBoxSizer137->Add(itemButton139, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
00613 
00615 
00616 
00617         m_xml_file_2->Disable();
00618         xml_button_2->Disable();
00619 
00620 }
00621 
00626 bool DialogOptions::ShowToolTips()
00627 {
00628     return TRUE;
00629 }
00630 
00635 wxBitmap DialogOptions::GetBitmapResource( const wxString& name )
00636 {
00637     // Bitmap retrieval
00639     return wxNullBitmap;
00641 }
00642 
00647 wxIcon DialogOptions::GetIconResource( const wxString& name )
00648 {
00649     // Icon retrieval
00651     return wxNullIcon;
00653 }
00658 void DialogOptions::OnOptionsButtonCancelClick( wxCommandEvent& event )
00659 {
00661     // Before editing this code, remove the block markers.
00662     Destroy();
00664 }
00665 
00666 
00670 void DialogOptions::OnOptionsButtonOkClick( wxCommandEvent& event )
00671 {
00672         // we must parse the options given by the user.
00673         
00674         //
00675         //
00676         //              S T R E A M I N G
00677         //
00678         //
00679 
00680         // first of all check the rtsp server status and its mode [on/off]
00681         if ( m_start_rtsp_check->IsChecked() && m_start_rtsp_check->IsEnabled() ) {
00682                 // check if thread is running. If it is simply return
00683                 if ( m_streamer_thread->isStreaming() ) {
00684                         wxMessageDialog dlg1( this, wxT( "RTSP Server is already running!" ), wxT( "Info" ), wxOK );
00685                         dlg1.ShowModal();
00686                         return;
00687                 }
00688 
00689                 wxString rtsp_stream_str = m_rtsp_stream_text->GetValue();
00690                 if ( rtsp_stream_str.IsEmpty() ) {
00691                         wxMessageDialog dlg1( this, wxT( "Please fill in a Stream value!" ), wxT( "Info" ), wxOK );
00692                         dlg1.ShowModal();
00693                         return;
00694                 }
00695 
00696                 wxString rtsp_port = m_rtsp_port_text->GetValue();
00697                 if ( rtsp_port.IsEmpty() || !rtsp_port.IsNumber() ) {
00698                         wxMessageDialog dlg1( this, wxT( "Please fill in a correct port number value!" ), wxT( "Info" ), wxOK );
00699                         dlg1.ShowModal();
00700                         return;
00701                 }
00702 
00703                 wxString rtsp_fps = m_rtsp_fps_text->GetValue();
00704                 if ( rtsp_fps.IsEmpty() || !rtsp_fps.IsNumber() ) {
00705                         wxMessageDialog dlg1( this, wxT( "Please fill in a correct FPS value!" ), wxT( "Info" ), wxOK );
00706                         dlg1.ShowModal();
00707                         return;
00708                 }
00709 
00710                 // is webcam/file both disabled? then we cannot start server
00711                 if ( !m_grab_video_check->IsChecked() && !m_grab_file_check->IsChecked() && 
00712                         !m_grab_audio_check->IsChecked() ) {
00713                         wxMessageDialog dlg1( this, wxT( "Please choose where to grab from: webcam or file of microphone!" ), wxT( "Info" ), wxOK );
00714                         dlg1.ShowModal();
00715                         return;
00716                 }
00717 
00718                 wxString rtsp_webcam_port;
00719                 wxString file_path;
00720 
00721                 // webcam will be the default, even if file_grab is enabled.
00722                 if ( m_grab_video_check->IsChecked() ) {
00723                         m_grab_video_text->GetValue();
00724                 } 
00725                 else {          // file stuff
00726                         if ( m_grab_file_text->GetValue().IsEmpty() ) {
00727                                 wxMessageDialog dlg1( this, wxT( "Please choose file path!" ), wxT( "Info" ), wxOK );
00728                                 dlg1.ShowModal();
00729                                 return;
00730                         }
00731                         file_path = m_grab_file_text->GetValue();
00732                 }
00733 
00734                 // choose proto
00735                 wxString rtsp_proto = m_proto_choose->GetValue();
00736 
00737                 // number of streams
00738                 long num_of_streams;
00739                 if ( !m_multi_face_stream_check->IsChecked () ) {
00740                         num_of_streams = 1;
00741                 }
00742                 else {
00743                         if ( !m_face_tracking_check->IsChecked() ) {
00744                                 wxMessageDialog dlg1( this, 
00745                                         wxT( "Please fill up the Omnistuff options, then enable this option" ), 
00746                                         wxT( "Info" ), wxOK );
00747                                 dlg1.ShowModal();
00748                                 return;
00749                         }
00750                         else {          // set the omnistuff values for MULTISTREAM
00751 
00752                                 wxString n_streams = m_multi_face_stream_text->GetValue ();
00753                 
00754                                 // get the number of streams
00755                                 if ( n_streams.IsEmpty () || !n_streams.IsNumber () ) {
00756                                         num_of_streams = 1;
00757                                 }
00758                                 else {
00759                                         n_streams.ToLong( &num_of_streams );
00760                                 }
00761 
00762                                 // and th eomnidirectional stuff options
00763                                 wxArrayString *c_array = new wxArrayString();
00764 
00765                                 int cascade_count = 0;
00766 
00767                                 if ( m_xml_enable_1->IsChecked() ) { 
00768                                         wxString str = m_xml_file_1->GetValue();
00769                                         if ( !str.IsEmpty() ) {
00770                                                 c_array->Add(str);
00771                                                 cascade_count++;
00772                                         }
00773                                 }
00774 
00775                                 if ( m_xml_enable_2->IsChecked() ) {
00776                                         wxString str = m_xml_file_2->GetValue();
00777                                         if ( !str.IsEmpty() ) {
00778                                                 c_array->Add(str);
00779                                                 cascade_count++;
00780                                         }
00781                                 }
00782 
00783                                 wxString algorithm_str = m_algorithm_choose->GetValue();
00784                                 bool algo_simple;
00785 
00786                                 if ( algorithm_str.CompareTo( wxT("SimpleDetection") ) == 0 ){
00787                                         algo_simple = true;
00788                                 }
00789                                 else {
00790                                         algo_simple = false;
00791                                 }
00792 
00793                                 // get radius_max, min and center_x, y 
00794                                 long max_, min_, x = 0, y = 0;
00795                                 long freeze;
00796                                 double hitrate;
00797 
00798                                 (m_radius_max->GetValue()).ToLong(&max_);
00799                                 (m_radius_min->GetValue()).ToLong(&min_);
00800                                 (m_center_x->GetValue()).ToLong(&x);
00801                                 (m_center_y->GetValue()).ToLong(&y);
00802                                 (m_freeze_time->GetValue()).ToLong(&freeze);
00803                                 (m_hitrate->GetValue()).ToDouble(&hitrate);
00804                         
00805                                 // setFacetrackOptions
00806                                 m_mainframe_pointer->SetFacetrackOptions( c_array, cascade_count, (int)min_,
00807                                          (int)max_, (int)x, (int)y, (int)freeze, hitrate, 
00808                                          m_gcard_use_check->IsChecked (), m_flipped_mode_check->IsChecked(), num_of_streams, algo_simple );
00809                         }                       
00810                 }
00811 
00812                 long audio_port;
00813                 if ( !m_grab_audio_check->IsChecked () ) {
00814                         audio_port = -1;
00815                 }
00816                 else {
00817                         wxString g_audio = m_grab_audio_text->GetValue ();
00818 
00819                         if ( g_audio.IsEmpty () || !g_audio.IsNumber () ) {
00820                                 audio_port = -1;
00821                         }
00822                         else {
00823                                 g_audio.ToLong( &audio_port );
00824                         }
00825                 }
00826 
00827 
00828                 // last conversions
00829                 long rtsp_port_int, rtsp_fps_int, rtsp_webcam_port_int;
00830                 
00831                 rtsp_port.ToLong( &rtsp_port_int );
00832                 rtsp_fps.ToLong( &rtsp_fps_int );
00833                 rtsp_webcam_port.ToLong( &rtsp_webcam_port_int );
00834 
00835 
00836                 // last check: should we use audio or video?
00837                 if ( !m_multi_face_stream_check->IsChecked() && !m_grab_video_check->IsChecked() 
00838                         && !m_grab_file_check->IsChecked() ) {
00839 
00840                         // we will run only with audio stream...
00841                         rtsp_proto = wxString(wxT(""));;
00842                 }
00843 
00844 
00845                 //
00846                 // create the thread object and run it
00847                 //
00848 
00849 
00850                 m_streamer_thread->Create( m_gcard_use_check->GetValue(), rtsp_proto, 
00851                         file_path, rtsp_webcam_port_int, (unsigned int)num_of_streams, (unsigned int)audio_port,
00852                         rtsp_stream_str, (unsigned short)rtsp_port_int, 
00853                          rtsp_fps_int );
00854                 m_streamer_thread->Run();
00855 
00856                 m_mainframe_pointer->PrintStatusBarMessage( wxT( "Start streaming..." ), 0 );
00857         }
00858 
00859 
00860         //
00861         //
00862         //              R E C E I V I N G 
00863         //
00864         //
00865 
00866         // should we receive a stream?
00867         if ( m_receive_stream_check->IsChecked() && m_receive_stream_check->IsEnabled() ) {
00868                 if ( m_receiver_thread->isReceiving() ) {
00869                         wxMessageDialog dlg1( this, wxT( "RTSP Receiver is already running!" ), wxT( "Info" ), wxOK );
00870                         dlg1.ShowModal();
00871                         return;
00872                 }
00873 
00874                 wxString addr_str = m_receive_stream_text->GetValue();
00875 
00876                 if ( addr_str.IsEmpty() ) {
00877                         wxMessageDialog dlg( this, wxT( "Please fill the RTSP address field" ), wxT( "Warning" ), wxOK );
00878                         dlg.ShowModal();
00879                         return;
00880                 }
00881 
00882                 // Should we perform a face tracking/detecting?
00883                 // the stream we receive is an omnidirectional one?
00884                 // do this check *only if* multistream is disabled
00885                 if ( m_face_tracking_check->IsChecked() && !m_multi_face_stream_check->IsChecked() ) {
00886                         wxArrayString *c_array = new wxArrayString();
00887 
00888                         int cascade_count = 0;
00889 
00890                         if ( m_xml_enable_1->IsChecked() ) { 
00891                                 wxString str = m_xml_file_1->GetValue();
00892                                 if ( !str.IsEmpty() ) {
00893                                         c_array->Add(str);
00894                                         cascade_count++;
00895                                 }
00896                         }
00897 
00898                         if ( m_xml_enable_2->IsChecked() ) {
00899                                 wxString str = m_xml_file_2->GetValue();
00900                                 if ( !str.IsEmpty() ) {
00901                                         c_array->Add(str);
00902                                         cascade_count++;
00903                                 }
00904                         }
00905 
00906                         wxString algorithm_str = m_algorithm_choose->GetValue();
00907 
00908                         bool algo_simple;
00909                         if ( algorithm_str.CompareTo( wxT("SimpleDetection") ) == 0 ){
00910                                 algo_simple = true;
00911                         }
00912                         else {
00913                                 algo_simple = false;
00914                         }
00915 
00916                         // get radius_max, min and center_x, y 
00917                         long max_, min_, x = 0, y = 0;
00918                         long freeze;
00919                         double hitrate;
00920 
00921                         (m_radius_max->GetValue()).ToLong(&max_);
00922                         (m_radius_min->GetValue()).ToLong(&min_);
00923                         (m_center_x->GetValue()).ToLong(&x);
00924                         (m_center_y->GetValue()).ToLong(&y);
00925                         (m_freeze_time->GetValue()).ToLong(&freeze);
00926                         (m_hitrate->GetValue()).ToDouble(&hitrate);
00927                         
00928                         // setFacetrackOptions
00929                         m_mainframe_pointer->SetFacetrackOptions( c_array, cascade_count, (int)min_,
00930                                  (int)max_, (int)x, (int)y, (int)freeze, hitrate, 
00931                                  m_gcard_use_check->IsChecked (), m_flipped_mode_check->IsChecked(), 
00932                                  -1, algo_simple );
00933                 }
00934 
00935                 // let the server listening. Two seconds should suffice
00936 #ifdef __LINUX__
00937                 sleep (2);
00938 #else
00939                 Sleep(2);
00940 #endif // ____LINUX__
00941 
00942                 //
00943                 // create the receiver and receive the stream
00944                 // perform simple display of frames
00945                 //
00946                 m_receiver_thread->Create( addr_str, m_multi_face_stream_check->IsChecked () );
00947                 m_receiver_thread->Run();
00948                 
00949                 m_mainframe_pointer->PrintStatusBarMessage( wxT( "Start receiving stream..." ), 1 );
00950 
00951         }
00952 
00953         Close();
00954         event.Skip();
00955 }
00956 
00957 
00958 
00959 
00964 void DialogOptions::OnButton1Click( wxCommandEvent& event )
00965 {
00966     wxFileDialog file (this , wxT( "Choose haarcascade file.." ), wxT( "" ), wxT( "" ), wxT( "XML files (*.xml)|*.xml" ), wxOPEN);
00967         if ( file.ShowModal() ){
00968                 
00969                 m_xml_file_1->SetValue(file.GetPath());
00970 
00971         }
00972 
00973         file.Destroy();
00974 }
00975 
00976 
00977 
00982 void DialogOptions::OnButton2Click( wxCommandEvent& event )
00983 {
00984         wxFileDialog file (this , wxT( "Choose haarcascade file.." ), wxT( "" ), wxT( "" ), wxT( "XML files (*.xml)|*.xml" ), wxOPEN);
00985         if ( file.ShowModal() ){
00986                 
00987                 m_xml_file_2->SetValue(file.GetPath());
00988 
00989         }
00990 
00991         file.Destroy();
00992 }
00993 
00994 
00995 
01000 void DialogOptions::OnButton3Click( wxCommandEvent& event )
01001 {
01002         wxFileDialog file (this , wxT( "Choose video file.." ), wxT( "" ), wxT( "" ), wxT( "Video files (*.avi)|*.avi" ), wxOPEN);
01003         if ( file.ShowModal() ){
01004                 
01005                 m_grab_file_text->SetValue(file.GetPath());
01006 
01007         }
01008 
01009         file.Destroy();
01010 }
01011 
01012 
01017 void DialogOptions::OnCheckboxXmlFile1( wxCommandEvent& event )
01018 {       
01019         if( m_xml_enable_1->IsChecked()){
01020                 xml_button_1->Enable();
01021                 m_xml_file_1->Enable();
01022         }
01023         else{
01024                 xml_button_1->Disable();
01025                 m_xml_file_1->Disable();
01026         }
01027 }
01028 
01029 
01034 void DialogOptions::OnCheckboxXmlFile2( wxCommandEvent& event )
01035 {
01036         if( m_xml_enable_2->IsChecked()){
01037                 xml_button_2->Enable();
01038                 m_xml_file_2->Enable();
01039         }
01040         else{
01041                 xml_button_2->Disable();
01042                 m_xml_file_2->Disable();
01043         }
01044 }
01045 
01046 
01051 void DialogOptions::OnGcardUseClick( wxCommandEvent& event )
01052 {
01053         // check for 3d gcard availability
01054         if ( OmniGCardConverter::check_for_3d_gcard_availability() == false ) {
01055                 wxMessageDialog dlg1( this, 
01056                         wxT("Your card doesn't support pixel/vertex shader handling."
01057                         "This feature won't be available for your system.") , wxT( "Warning" ), wxOK );
01058                 dlg1.ShowModal();
01059 
01060                 m_gcard_use_check->SetValue( false );
01061         }
01062 
01063     // Before editing this code, remove the block markers.
01064     event.Skip();
01065 }
01066 
01067 
01072 void DialogOptions::OnComboboxSelected( wxCommandEvent& event )
01073 {
01075     // Before editing this code, remove the block markers.
01076     event.Skip();
01078 }
01079 
01080 

Generated on Tue Dec 26 10:32:38 2006 for Omnimeeting by  doxygen 1.4.7