Postby robcan12345 » 04 Nov 2007 19:18
Yes i have tried, but nothing changes.....
These are the Open.hpp and Open.hpp files:
***********OPEN.HPP******************
#ifndef _WXVLC_OPEN_H_
#define _WXVLC_OPEN_H_
#include "wxwidgets.hpp"
#include "pjsua-lib/pjsua.h"
#include <wx/spinctrl.h>
#include <wx/notebook.h>
class AutoBuiltPanel;
namespace wxvlc
{
class SubsFileDialog;
class SoutDialog;
WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
class OpenDialog: public wxDialog
{
public:
/* Constructor */
OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
int i_access_method, int i_arg = 0 );
/* Extended Contructor */
OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
int i_access_method, int i_arg = 0 , int _i_method = 0 );
virtual ~OpenDialog();
int Show();
int Show( int i_access_method, int i_arg = 0 );
void UpdateMRL();
void UpdateMRL( int i_access_method );
wxArrayString mrl;
private:
wxPanel *FilePanel( wxWindow* parent );
wxPanel *DiscPanel( wxWindow* parent );
wxPanel *NetPanel( wxWindow* parent );
ArrayOfAutoBuiltPanel input_tab_array;
/* Event handlers (these functions should _not_ be virtual) */
void OnOk( wxCommandEvent& event );
void OnCancel( wxCommandEvent& event );
void OnClose( wxCloseEvent& event );
void OnCall( wxCommandEvent& event );
void OnPageChange( wxNotebookEvent& event );
void OnMRLChange( wxCommandEvent& event );
/* Event handlers for the file page */
void OnFilePanelChange( wxCommandEvent& event );
void OnFileBrowse( wxCommandEvent& event );
void OnSubFileBrowse( wxCommandEvent& event );
void OnSubFileChange( wxCommandEvent& event );
/* Event handlers for the disc page */
void OnDiscPanelChangeSpin( wxSpinEvent& event );
void OnDiscPanelChange( wxCommandEvent& event );
void OnDiscTypeChange( wxCommandEvent& event );
#ifdef HAVE_LIBCDIO
void OnDiscProbe( wxCommandEvent& event );
#endif
void OnDiscDeviceChange( wxCommandEvent& event );
/* Event handlers for the net page */
void OnNetPanelChangeSpin( wxSpinEvent& event );
void OnNetPanelChange( wxCommandEvent& event );
void OnNetTypeChange( wxCommandEvent& event );
/* Event handlers for the stream output */
void OnSubsFileEnable( wxCommandEvent& event );
void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
/* Event handlers for the stream output */
void OnSoutEnable( wxCommandEvent& event );
void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
/* Event handlers for the caching option */
void OnCachingEnable( wxCommandEvent& event );
void OnCachingChange( wxCommandEvent& event );
void OnCachingChangeSpin( wxSpinEvent& event );
/*SIP */
pj_status_t status;
pj_status_t pjsua_create();
DECLARE_EVENT_TABLE();
intf_thread_t *p_intf;
wxWindow *p_parent;
int i_current_access_method;
int i_disc_type_selection;
int i_method; /* Normal or for the stream dialog ? */
int i_open_arg;
wxComboBox *mrl_combo;
wxComboBox *sip_combo;
wxNotebook *notebook;
/* Controls for the file panel */
wxComboBox *file_combo;
wxComboBox *subfile_combo;
wxFileDialog *file_dialog;
/* Controls for the disc panel */
wxRadioBox *disc_type;
wxCheckBox *disc_probe;
wxTextCtrl *disc_device;
wxSpinCtrl *disc_title; int i_disc_title;
wxSpinCtrl *disc_chapter; int i_disc_chapter;
wxSpinCtrl *disc_sub; int i_disc_sub;
wxSpinCtrl *disc_audio; int i_disc_audio;
/* The media equivalent name for a DVD names. For example,
* "Title", is "Track" for a CD-DA */
wxStaticText *disc_title_label;
wxStaticText *disc_chapter_label;
wxStaticText *disc_sub_label;
wxStaticText *disc_audio_label;
/* Indicates if the disc device control was modified */
bool b_disc_device_changed;
/* Controls for the net panel */
wxRadioBox *net_type;
int i_net_type;
wxPanel *net_subpanels[4];
wxRadioButton *net_radios[4];
wxSpinCtrl *net_ports[4];
int i_net_ports[4];
wxTextCtrl *net_addrs[4];
wxCheckBox *net_timeshift;
wxCheckBox *net_ipv6;
/* Controls for the subtitles file */
wxButton *subsfile_button;
wxButton *subbrowse_button;
wxCheckBox *subsfile_checkbox;
SubsFileDialog *subsfile_dialog;
wxArrayString subsfile_mrl;
/* Controls for the stream output */
wxButton *sout_button;
wxCheckBox *sout_checkbox;
SoutDialog *sout_dialog;
wxArrayString sout_mrl;
/* Controls for the caching options */
wxCheckBox *caching_checkbox;
wxSpinCtrl *caching_value;
int i_caching;
};
};
enum
{
FILE_ACCESS = 0,
DISC_ACCESS,
NET_ACCESS,
/* Auto-built panels */
CAPTURE_ACCESS
};
#define MAX_ACCESS CAPTURE_ACCESS
#endif
***************OPEN.CPP(most important parts)**************************
#include "dialogs/open.hpp"
#include "dialogs/streamout.hpp"
#include "dialogs/preferences_widgets.h"
#include "dialogs/subtitles.hpp"
#include "pjsua-lib/pjsua.h"
#include "charset.h"
#undef HAVE_LIBCDIO // Disable broken code
#ifdef HAVE_LIBCDIO
#include <cdio/cdio.h>
#include <cdio/cd_types.h>
#include <cdio/logging.h>
#endif /* HAVE_LIBCDIO */
#ifdef HAVE_VCDINFO
#include <libvcd/version.h>
/* There was a bug in libvcdinfo <= 23 which prevented C++ compilation */
#if LIBVCD_VERSION_NUM > 23
#include <libvcd/info.h>
#endif /* LIBVCD_VERSION_NUM > 23 */
#endif /* HAVE_VCDINFO */
#include <wx/combobox.h>
#include <wx/statline.h>
#include <wx/tokenzr.h>
#ifndef wxRB_SINGLE
# define wxRB_SINGLE 0
#endif
#define SELECTION_DISC_TYPE_DVD_MENUS 0
#define SELECTION_DISC_TYPE_DVD 1
#define SELECTION_DISC_TYPE_VCD 2
#define SELECTION_DISC_TYPE_CDDA 3
/*****************************************************************************
* Event Table.
*****************************************************************************/
/* IDs for the controls and the menu commands */
int x=0;
enum
{
Notebook_Event = wxID_HIGHEST,
MRL_Event,
FileBrowse_Event,
SubFileBrowse_Event,
FileName_Event,
SubFileName_Event,
DiscType_Event,
#ifdef HAVE_LIBCDIO
DiscProbe_Event,
#endif
DiscDevice_Event,
DiscTitle_Event,
DiscChapter_Event,
DiscSub_Event,
DiscAudio_Event,
NetType_Event,
NetRadio1_Event, NetRadio2_Event, NetRadio3_Event, NetRadio4_Event,
NetPort1_Event, NetPort2_Event, NetPort3_Event,
NetAddr1_Event, NetAddr2_Event, NetAddr3_Event, NetAddr4_Event,
NetForceIPv6_Event, NetTimeshift_Event,
SubsFileEnable_Event,
SubsFileSettings_Event,
SoutEnable_Event,
SoutSettings_Event,
CachingEnable_Event,
CachingChange_Event,
AdvancedOptions_Event
};
BEGIN_EVENT_TABLE(OpenDialog, wxDialog)
/* Button events */
EVT_BUTTON(wxID_OK, OpenDialog::OnOk)
EVT_BUTTON(wxID_CANCEL, OpenDialog::OnCancel)
EVT_BUTTON(wxID_ANY, OpenDialog::OnCall)
EVT_NOTEBOOK_PAGE_CHANGED(Notebook_Event, OpenDialog::OnPageChange)
EVT_TEXT(MRL_Event, OpenDialog::OnMRLChange)
/* Events generated by the file panel */
EVT_TEXT(FileName_Event, OpenDialog::OnFilePanelChange)
EVT_BUTTON(FileBrowse_Event, OpenDialog::OnFileBrowse)
EVT_TEXT(SubFileName_Event, OpenDialog::OnSubFileChange)
EVT_BUTTON(SubFileBrowse_Event, OpenDialog::OnSubFileBrowse)
/* Events generated by the disc panel */
EVT_RADIOBOX(DiscType_Event, OpenDialog::OnDiscTypeChange)
#ifdef HAVE_LIBCDIO
EVT_CHECKBOX(DiscProbe_Event, OpenDialog::OnDiscProbe)
#endif
EVT_TEXT(DiscDevice_Event, OpenDialog::OnDiscDeviceChange)
EVT_TEXT(DiscDevice_Event, OpenDialog::OnDiscPanelChange)
EVT_TEXT(DiscTitle_Event, OpenDialog::OnDiscPanelChange)
EVT_SPINCTRL(DiscTitle_Event, OpenDialog::OnDiscPanelChangeSpin)
EVT_TEXT(DiscChapter_Event, OpenDialog::OnDiscPanelChange)
EVT_SPINCTRL(DiscChapter_Event, OpenDialog::OnDiscPanelChangeSpin)
EVT_TEXT(DiscSub_Event, OpenDialog::OnDiscPanelChange)
EVT_TEXT(DiscAudio_Event, OpenDialog::OnDiscPanelChange)
EVT_SPINCTRL(DiscSub_Event, OpenDialog::OnDiscPanelChangeSpin)
/* Events generated by the net panel */
EVT_RADIOBUTTON(NetRadio1_Event, OpenDialog::OnNetTypeChange)
EVT_RADIOBUTTON(NetRadio2_Event, OpenDialog::OnNetTypeChange)
EVT_RADIOBUTTON(NetRadio3_Event, OpenDialog::OnNetTypeChange)
EVT_RADIOBUTTON(NetRadio4_Event, OpenDialog::OnNetTypeChange)
EVT_TEXT(NetPort1_Event, OpenDialog::OnNetPanelChange)
EVT_SPINCTRL(NetPort1_Event, OpenDialog::OnNetPanelChangeSpin)
EVT_TEXT(NetPort2_Event, OpenDialog::OnNetPanelChange)
EVT_SPINCTRL(NetPort2_Event, OpenDialog::OnNetPanelChangeSpin)
EVT_TEXT(NetPort3_Event, OpenDialog::OnNetPanelChange)
EVT_SPINCTRL(NetPort3_Event, OpenDialog::OnNetPanelChangeSpin)
EVT_TEXT(NetAddr2_Event, OpenDialog::OnNetPanelChange)
EVT_TEXT(NetAddr3_Event, OpenDialog::OnNetPanelChange)
EVT_TEXT(NetAddr4_Event, OpenDialog::OnNetPanelChange)
EVT_CHECKBOX(NetForceIPv6_Event, OpenDialog::OnNetPanelChange)
EVT_CHECKBOX(NetTimeshift_Event, OpenDialog::OnNetPanelChange)
/* Events generated by the subtitle file buttons */
EVT_CHECKBOX(SubsFileEnable_Event, OpenDialog::OnSubsFileEnable)
EVT_BUTTON(SubsFileSettings_Event, OpenDialog::OnSubsFileSettings)
/* Events generated by the stream output buttons */
EVT_CHECKBOX(SoutEnable_Event, OpenDialog::OnSoutEnable)
EVT_BUTTON(SoutSettings_Event, OpenDialog::OnSoutSettings)
/* Events generated by the caching button */
EVT_CHECKBOX(CachingEnable_Event, OpenDialog::OnCachingEnable)
EVT_TEXT(CachingChange_Event, OpenDialog::OnCachingChange)
EVT_SPINCTRL(CachingChange_Event, OpenDialog::OnCachingChangeSpin)
/* Hide the window when the user closes the window */
EVT_CLOSE(OpenDialog::OnClose)
END_EVENT_TABLE()
/*Adding sip mrl*/
wxStaticText *sip_label;
wxButton *call_button= new wxButton( panel, wxID_ANY, wxU(_("&CALL")) );
sip_label = new wxStaticText( panel, -1, wxU(_("Supporto SIP:")) );
sip_combo = new wxComboBox( panel, MRL_Event, wxT(""),wxDefaultPosition, wxDefaultSize );
sip_combo->SetToolTip( wxU(_("E'possibile effettuare chiamate SIP "
"Inserendo l'url SIP da chiamare.\n")) );
sip_sizer->Add( sip_label, 0, wxALL | wxALIGN_CENTER_VERTICAL, 6 );
sip_sizer->Add( sip_combo, 1, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL,6 );
sip_sizer->Add( call_button, 1, wxALIGN_LEFT |wxALIGN_CENTER_VERTICAL );
adv_sizer->Add( sip_sizer, 0, wxBOTTOM | wxLEFT|wxRIGHT | wxEXPAND, 6 );
/*****************************************************************************
* Events methods.
*****************************************************************************/
void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
{
mrl = SeparateEntries( mrl_combo->GetValue() );
mrl_combo->Append( mrl_combo->GetValue() );
if( mrl_combo->GetCount() > 10 ) mrl_combo->Delete( 0 );
mrl_combo->SetSelection( mrl_combo->GetCount() - 1 );
if( i_method == OPEN_STREAM )
{
if( IsModal() ) EndModal( wxID_OK );
Hide();
return;
}
/* Update the playlist */
playlist_t *p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL ) return;
for( int i = 0; i < (int)mrl.GetCount(); i++ )
{
vlc_bool_t b_start = !i && i_open_arg;
playlist_item_t *p_item;
char *psz_utf8;
psz_utf8 = wxFromLocale( mrl );
p_item = playlist_ItemNew( p_intf, psz_utf8, psz_utf8 );
wxLocaleFree( psz_utf8 );
/* Insert options */
while( i + 1 < (int)mrl.GetCount() &&
((const char *)mrl[i + 1].mb_str(wxConvUTF8))[0] == ':' )
{
psz_utf8 = wxFromLocale( mrl[i + 1] );
playlist_ItemAddOption( p_item, psz_utf8 );
wxLocaleFree( psz_utf8 );
i++;
}
/* Get the options from the subtitles dialog */
if( subsfile_checkbox->IsChecked() && subsfile_mrl.GetCount() )
{
for( int j = 0; j < (int)subsfile_mrl.GetCount(); j++ )
{
psz_utf8 = wxFromLocale( subsfile_mrl[j] );
playlist_ItemAddOption( p_item, psz_utf8 );
wxLocaleFree( psz_utf8 );
}
}
/* Get the options from the stream output dialog */
if( sout_checkbox->IsChecked() && sout_mrl.GetCount() )
{
for( int j = 0; j < (int)sout_mrl.GetCount(); j++ )
{
psz_utf8 = wxFromLocale( sout_mrl[j] );
playlist_ItemAddOption( p_item, psz_utf8 );
wxLocaleFree( psz_utf8 );
}
}
if( b_start )
{
playlist_AddItem( p_playlist, p_item,
PLAYLIST_APPEND,
PLAYLIST_END );
playlist_Control( p_playlist, PLAYLIST_ITEMPLAY, p_item );
}
else
{
playlist_AddItem( p_playlist, p_item,
PLAYLIST_APPEND|PLAYLIST_PREPARSE,
PLAYLIST_END );
}
}
vlc_object_release( p_playlist );
Hide();
if( IsModal() ) EndModal( wxID_OK );
}
void OpenDialog::OnCancel( wxCommandEvent& WXUNUSED(event) )
{
wxCloseEvent cevent;
OnClose(cevent);
}
void OpenDialog::OnClose( wxCloseEvent& WXUNUSED(event) )
{
Hide();
if( IsModal() ) EndModal( wxID_CANCEL );
}
void OpenDialog::OnCall( wxCommandEvent& event )
{
status = pjsua_create();
}
void OpenDialog::OnPageChange( wxNotebookEvent& event )
{
UpdateMRL( event.GetSelection() );
}
void OpenDialog::OnMRLChange( wxCommandEvent& event )
{
//mrl = SeparateEntries( event.GetString() );
}
FOR ME IS VERY IMPORTANT TO REACH IN THIS WORK!!! PLEASE HELP ME!!!!!