Commit 26603c85 authored by Clément Stenac's avatar Clément Stenac

* New wizard is now about usable, yet unfinished

    Todo
	- Heavy testing
	- Missing sanity checks
	- Extra options
	- Fix layout bugs

* playlist.cpp : Smaller layout, icons to do...

* timer.cpp : show the name and not the URI in status bar

* open.cpp : Bugfix for modal mode
parent 2f6ba22b
......@@ -341,11 +341,9 @@ void Interface::CreateOurMenuBar()
wxU(_("Open &Capture Device...\tCtrl-C")) );
file_menu->AppendSeparator();
file_menu->Append( Wizard_Event, wxU(_("&Wizard...\tCtrl-W")) );
file_menu->Append( StreamWizard_Event,
wxU(_("Streaming &Wizard...\tCtrl-W")) );
#if 0
file_menu->Append( Wizard_Event, wxU(_("New Wizard...")) );
#endif
wxU(_("Old streaming Wizard...")) );
file_menu->AppendSeparator();
file_menu->Append( Exit_Event, wxU(_("E&xit\tCtrl-X")) );
......
......@@ -981,8 +981,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
if( i_method == OPEN_STREAM )
{
Hide();
if( IsModal() ) EndModal( wxID_OK );
Hide();
return;
}
......
......@@ -6,7 +6,7 @@
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* 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.
......@@ -29,6 +29,10 @@
#include "wxwindows.h"
#include "bitmaps/shuffle_on.xpm"
#include "bitmaps/repeat.xpm"
#include "bitmaps/loop.xpm"
/* Callback prototype */
static int PlaylistChanged( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
......@@ -96,6 +100,8 @@ enum
DEFINE_LOCAL_EVENT_TYPE( wxEVT_PLAYLIST );
BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_SIZE(Playlist::OnSize)
/* Menu events */
EVT_MENU(AddFile_Event, Playlist::OnAddFile)
EVT_MENU(AddMRL_Event, Playlist::OnAddMRL)
......@@ -118,9 +124,10 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection)
EVT_MENU(SelectAll_Event, Playlist::OnSelectAll)
EVT_MENU(Infos_Event, Playlist::OnInfos)
EVT_CHECKBOX(Random_Event, Playlist::OnRandom)
EVT_CHECKBOX(Repeat_Event, Playlist::OnRepeat)
EVT_CHECKBOX(Loop_Event, Playlist::OnLoop)
EVT_TOOL(Random_Event, Playlist::OnRandom)
EVT_TOOL(Repeat_Event, Playlist::OnRepeat)
EVT_TOOL(Loop_Event, Playlist::OnLoop)
EVT_MENU(EnableGroup_Event, Playlist::OnEnDis)
EVT_MENU(DisableGroup_Event, Playlist::OnEnDis)
......@@ -249,36 +256,59 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxPanel *playlist_panel = new wxPanel( this, -1 );
playlist_panel->SetAutoLayout( TRUE );
/* Create the Random checkbox */
wxCheckBox *random_checkbox =
new wxCheckBox( playlist_panel, Random_Event, wxU(_("Random")) );
/* Create the toolbar */
wxToolBar *toolbar =
CreateToolBar( wxTB_HORIZONTAL | wxTB_FLAT | wxTB_DOCKABLE );
#define HELP_SHUFFLE "Shuffle"
#define HELP_LOOP "Loop"
#define HELP_REPEAT "Repeat"
/* Create the random tool */
toolbar->AddTool( Random_Event, wxT(""), wxBitmap(shuffle_on_xpm),
wxBitmap(shuffle_on_xpm), wxITEM_CHECK,
wxU(_(HELP_SHUFFLE) ) );
var_Get( p_intf, "random", &val );
vlc_bool_t b_random = val.b_bool;
random_checkbox->SetValue( b_random == VLC_FALSE ? 0 : 1 );
toolbar->ToggleTool( Random_Event , b_random );
/* Create the Loop Checkbox */
wxCheckBox *loop_checkbox =
new wxCheckBox( playlist_panel, Loop_Event, wxU(_("Repeat All")) );
/* Create the Loop tool */
toolbar->AddTool( Loop_Event, wxT(""), wxBitmap( loop_xpm),
wxBitmap( loop_xpm), wxITEM_CHECK,
wxU(_(HELP_LOOP ) ) );
var_Get( p_intf, "loop", &val );
int b_loop = val.b_bool ;
loop_checkbox->SetValue( b_loop );
toolbar->ToggleTool( Loop_Event, b_loop );
/* Create the Repeat one checkbox */
wxCheckBox *repeat_checkbox =
new wxCheckBox( playlist_panel, Repeat_Event, wxU(_("Repeat One")) );
toolbar->AddTool( Repeat_Event, wxT(""), wxBitmap( repeat_xpm),
wxBitmap( repeat_xpm), wxITEM_CHECK,
wxU(_(HELP_REPEAT ) ) );
var_Get( p_intf, "repeat", &val );
int b_repeat = val.b_bool ;
repeat_checkbox->SetValue( b_repeat );
toolbar->ToggleTool( Repeat_Event, b_repeat) ;
/* Create the Search Textbox */
search_text =
new wxTextCtrl( playlist_panel, SearchText_Event, wxT(""),
wxDefaultPosition, wxSize(140, -1),
new wxTextCtrl( toolbar, SearchText_Event, wxT(""),
wxDefaultPosition, wxSize(100, -1),
wxTE_PROCESS_ENTER);
/* Create the search button */
search_button =
new wxButton( playlist_panel, Search_Event, wxU(_("Search")) );
new wxButton( toolbar , Search_Event, wxU(_("Search")) );
search_button->SetDefault();
wxControl *p_dummy_ctrl =
new wxControl( toolbar, -1, wxDefaultPosition,
wxSize(64, 16 ), wxBORDER_NONE );
toolbar->AddSeparator();
toolbar->AddControl( p_dummy_ctrl );
toolbar->AddControl( search_text );
toolbar->AddControl( search_button );
toolbar->Realize();
/* Create the listview */
......@@ -287,15 +317,20 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
* themselves to the size of a listview, and with a wxDefaultSize the
* playlist window is ridiculously small */
listview = new wxListView( playlist_panel, ListView_Event,
wxDefaultPosition, wxSize( 500, 300 ),
wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxSUNKEN_BORDER );
listview->InsertColumn( 0, wxU(_("Name")) );
#if 0
listview->InsertColumn( 1, wxU(_("Author")) );
listview->InsertColumn( 2, wxU(_("Duration")) );
#endif
listview->InsertColumn( 1, wxU(_("Duration")) );
#if 0
listview->InsertColumn( 3, wxU(_("Group")) );
listview->SetColumnWidth( 0, 270 );
listview->SetColumnWidth( 1, 150 );
listview->SetColumnWidth( 2, 80 );
#endif
listview->SetColumnWidth( 0, 240 );
listview->SetColumnWidth( 1, 55 );
DoSize();
/* Create the Up-Down buttons */
wxButton *up_button =
......@@ -304,6 +339,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxButton *down_button =
new wxButton( playlist_panel, Down_Event, wxU(_("Down") ) );
#if 0
/* Create the iteminfo button */
wxButton *iteminfo_button =
new wxButton( playlist_panel, Infos_Event, wxU(_("Item info") ) );
......@@ -312,6 +348,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( iteminfo_button, 0, wxALIGN_CENTER|wxLEFT, 5);
button_sizer->Layout();
#endif
wxBoxSizer *updown_sizer = new wxBoxSizer( wxHORIZONTAL );
updown_sizer->Add( up_button, 0, wxALIGN_LEFT|wxRIGHT, 3);
......@@ -319,36 +356,39 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
updown_sizer->Layout();
wxBoxSizer *checkbox_sizer = new wxBoxSizer( wxHORIZONTAL );
checkbox_sizer->Add( random_checkbox, 0,
wxEXPAND | wxALIGN_RIGHT | wxALL, 5);
checkbox_sizer->Add( loop_checkbox, 0,
#if 0
//checkbox_sizer->Add( random_checkbox, 0,
// wxEXPAND | wxALIGN_RIGHT | wxALL, 5);
//checkbox_sizer->Add( loop_checkbox, 0,
wxEXPAND | wxALIGN_RIGHT | wxALL, 5);
checkbox_sizer->Add( repeat_checkbox, 0,
wxEXPAND | wxALIGN_RIGHT | wxALL, 5);
checkbox_sizer->Layout();
wxBoxSizer *search_sizer = new wxBoxSizer( wxHORIZONTAL );
search_sizer->Add( search_text, 0, wxRIGHT|wxALIGN_CENTER, 3);
search_sizer->Add( search_button, 0, wxLEFT|wxALIGN_CENTER, 3);
// search_sizer->Add( search_text, 0, wxRIGHT|wxALIGN_CENTER, 3);
// search_sizer->Add( search_button, 0, wxLEFT|wxALIGN_CENTER, 3);
search_sizer->Layout();
#endif
/* The top and bottom sizers */
#if 0
wxBoxSizer *top_sizer = new wxBoxSizer( wxHORIZONTAL );
top_sizer->Add( checkbox_sizer, 1, wxLEFT|wxRIGHT|wxALIGN_LEFT, 4 );
top_sizer->Add( checkbox_sizer, 1, wxLEFT|wxRIGHT|wxALIGN_LEFT, 4 );
top_sizer->Add( search_sizer, 1, wxLEFT|wxRIGHT|wxALIGN_RIGHT, 4 );
top_sizer->Layout();
#endif
wxBoxSizer *bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
bottom_sizer->Add( updown_sizer, 0,
wxEXPAND |wxRIGHT | wxLEFT | wxALIGN_LEFT, 4 );
bottom_sizer->Add( button_sizer, 0,
wxEXPAND|wxLEFT | wxRIGHT | wxALIGN_RIGHT, 4 );
// bottom_sizer->Add( button_sizer, 0,
// wxEXPAND|wxLEFT | wxRIGHT | wxALIGN_RIGHT, 4 );
bottom_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( top_sizer, 0, wxEXPAND | wxALL, 5 );
// panel_sizer->Add( top_sizer, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( listview, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( bottom_sizer, 0, wxEXPAND | wxALL, 5);
panel_sizer->Layout();
......@@ -389,6 +429,19 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
Rebuild();
}
void Playlist::OnSize( wxSizeEvent& event)
{
DoSize();
event.Skip();
}
void Playlist::DoSize()
{
wxSize size = GetClientSize();
listview->SetSize( 0,0,size.x,size.y);
}
Playlist::~Playlist()
{
playlist_t *p_playlist =
......@@ -431,6 +484,20 @@ void Playlist::UpdateItem( int i )
return;
}
char *psz_author = playlist_ItemGetInfo( p_item, _("General"), _("Author"));
if( !strcmp( psz_author, "" ) )
{
listview->SetItem( i, 0, wxL2U(p_item->input.psz_name) );
}
else
{
wxString msg;
msg.Printf( wxString(wxU( psz_author )) + wxT(" - ") +
wxString(wxL2U(p_item->input.psz_name)) );
listview->SetItem( i, 0, msg );
}
#if 0
listview->SetItem( i, 0, wxL2U(p_item->input.psz_name) );
listview->SetItem( i, 1, wxU( playlist_ItemGetInfo( p_item,
_("General"), _("Author") ) ) );
......@@ -438,7 +505,7 @@ void Playlist::UpdateItem( int i )
p_item->i_group);
listview->SetItem( i, 3,
wxL2U( psz_group ? psz_group : _("Normal") ) );
#endif
if( p_item->b_enabled == VLC_FALSE )
{
wxListItem listitem;
......@@ -453,7 +520,7 @@ void Playlist::UpdateItem( int i )
secstotimestr( psz_duration, dur/1000000 );
else
memcpy( psz_duration, "-:--:--", sizeof("-:--:--") );
listview->SetItem( i, 2, wxU(psz_duration) );
listview->SetItem( i, 1, wxU(psz_duration) );
/* Change the colour for the currenty played stream */
wxListItem listitem;
......@@ -508,7 +575,6 @@ void Playlist::Rebuild()
{
listview->Focus( p_playlist->i_index );
}
vlc_object_release( p_playlist );
}
......@@ -1156,6 +1222,11 @@ void Playlist::OnEnDis( wxCommandEvent& event )
void Playlist::OnPopup( wxListEvent& event )
{
i_popup_item = event.GetIndex();
for( long item = 0; item < listview->GetItemCount(); item++ )
{
listview->Select( item, FALSE );
}
listview->Select( i_popup_item );
Playlist::PopupMenu( popup_menu, ScreenToClient( wxGetMousePosition() ) );
}
......
......@@ -106,7 +106,7 @@ void Timer::Notify()
b_old_seekable = VLC_FALSE;
p_main_interface->statusbar->SetStatusText(
wxU(p_intf->p_sys->p_input->psz_source), 2 );
wxU(p_intf->p_sys->p_input->p_item->psz_name), 2 );
p_main_interface->TogglePlayButton( PLAYING_S );
i_old_playing_status = PLAYING_S;
......
......@@ -36,6 +36,8 @@
#include <wx/statline.h>
#include "stream.h"
class wizHelloPage;
class wizInputPage;
......@@ -62,12 +64,12 @@ enum
EncapRadio6_Event, EncapRadio7_Event,
EncapRadio8_Event, EncapRadio9_Event,
VideoEnable_Event, VideoCodec_Event,
AudioEnable_Event, AudioCodec_Event,
VideoEnable_Event, VideoCodec_Event,VideoBitrate_Event,
AudioEnable_Event, AudioCodec_Event,AudioBitrate_Event,
};
#define TEXTWIDTH 60
#define TEXTWIDTH 55
#define ACTION_STREAM 0
#define ACTION_TRANSCODE 1
......@@ -95,13 +97,15 @@ END_EVENT_TABLE()
#define HELLO_TITLE _("Streaming/Transcoding Wizard")
#define HELLO_TEXT _("This wizard helps you to stream, transcode or" \
" save a stream")
#define HELLO_STREAMING _("Stream")
#define HELLO_STREAMING _("Stream to network")
#define HELLO_STREAMING_DESC _("Use this to stream on a network")
#define HELLO_TRANSCODE _("Transcode/Save")
#define HELLO_TRANSCODE _("Transcode/Save to file")
#define HELLO_TRANSCODE_DESC _("Use this to re-encode a stream and save it to a file")
#define HELLO_NOTICE _("This wizard only gives access to a small subset of VLC's streaming and transcoding capabilities. Use the Open and Stream Output dialogs to get all of them")
#define MOREINFO_TRANSCODE _("Please notice that VLC is not very suited " \
#define MOREINFO_STREAM _("Use this to stream on a network")
#define MOREINFO_TRANSCODE _("Use this to save a stream to a file. You have the possibility to reencode the stream. You can save whatever VLC can read.\nPlease notice that VLC is not very suited " \
"for file to file transcoding. You should use its transcoding " \
"features to save network streams, for example" )
......@@ -118,13 +122,14 @@ END_EVENT_TABLE()
#define PARTIAL _("Use this to read only a part of the stream. " \
"You must be able to control the incoming stream " \
"(for example, a file or a disc, but not an UDP " \
"network stream.")
"network stream.\n" \
"Enter the starting and ending times (in seconds)")
#define INPUT_BUTTON _("Choose")
/* Transcode 1 */
#define TRANSCODE1_TITLE _("Transcode")
#define TRANSCODE1_TEXT _("If you want to change the compression format of the audio or video tracks, fill in this page. (If you only want to change the container format, proceed to next page)")
#define TRANSCODE1_TEXT _("If you want to change the compression format of the audio or video tracks, fill in this page. (If you only want to change the container format, proceed to next page).")
#define TR_VIDEO_TEXT0 _("If your stream has video and you want to " \
"transcode it, enable this")
......@@ -143,11 +148,13 @@ END_EVENT_TABLE()
#define INVALID_MCAST_ADDRESS _("This does not appear to be a valid " \
"multicast address" )
#define NO_ADDRESS _("You need to enter an address" )
/* Encap */
#define ENCAP_TITLE _("Encapsulation format")
#define ENCAP_TEXT _("In this page, you will select how the stream will be "\
"encapsulated." )
"encapsulated. Depending on the choices you made, all "\
"formats won't be available." )
/* Transcode 2 */
......@@ -268,7 +275,7 @@ struct encap encaps_array[] =
{ MUX_PS, "ps","MPEG PS", "MPEG Program Stream" },
{ MUX_TS, "ts","MPEG TS", "MPEG Transport Stream" },
{ MUX_MPEG, "ps", "MPEG 1", "MPEG 1 Format" },
{ MUX_OGG, "ogg," "OGG", "OGG" },
{ MUX_OGG, "ogg", "OGG", "OGG" },
{ MUX_RAW, "raw", "RAW", "RAW" },
{ MUX_ASF, "asf","ASF", "ASF" },
{ MUX_AVI, "avi","AVI", "AVI" },
......@@ -288,6 +295,7 @@ class wizHelloPage : public wxWizardPageSimple
wizHelloPage( wxWizard *parent);
void OnActionChange(wxEvent& event);
void OnWizardPageChanging(wxWizardEvent& event);
void OnMoreInfo( wxCommandEvent& event );
protected:
int i_action;
WizardDialog *p_parent;
......@@ -298,6 +306,9 @@ class wizHelloPage : public wxWizardPageSimple
BEGIN_EVENT_TABLE(wizHelloPage, wxWizardPageSimple)
EVT_RADIOBUTTON( ActionRadio0_Event, wizHelloPage::OnActionChange)
EVT_RADIOBUTTON( ActionRadio1_Event, wizHelloPage::OnActionChange)
EVT_BUTTON( MoreInfoStreaming_Event, wizHelloPage::OnMoreInfo )
EVT_BUTTON( MoreInfoTranscode_Event, wizHelloPage::OnMoreInfo )
EVT_WIZARD_PAGE_CHANGING(-1, wizHelloPage::OnWizardPageChanging)
END_EVENT_TABLE()
......@@ -326,6 +337,7 @@ class wizInputPage : public wxWizardPage
WizardDialog *p_parent;
wxRadioButton *input_radios[2];
wxCheckBox *enable_checkbox;
wxBoxSizer *mainSizer;
wxArrayString mrl;
wxTextCtrl *mrl_text;
......@@ -362,9 +374,11 @@ public:
protected:
wxCheckBox *video_checkbox;
wxComboBox *video_combo;
wxComboBox *vb_combo;
wxStaticText * video_text;
wxCheckBox *audio_checkbox;
wxComboBox *audio_combo;
wxComboBox *ab_combo;
wxStaticText * audio_text;
WizardDialog *p_parent;
......@@ -506,6 +520,19 @@ END_EVENT_TABLE()
/* Local functions */
static int ismult( char *psz_uri );
static void pageHeader( wxWindow *window, wxBoxSizer *sizer,
char *psz_title, char *psz_text)
{
wxStaticText *wtitle = new wxStaticText( window, -1, wxU( psz_title ) );
wxFont font = wtitle->GetFont();
font.SetPointSize(14);
wtitle->SetFont(font);
sizer->Add( wtitle, 0, wxALL, 5 );
sizer->Add( new wxStaticText( window, -1,
wxU( vlc_wraptext( psz_text , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
}
/***************************************************************************
* Implementation of the pages
***************************************************************************/
......@@ -521,11 +548,7 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent)
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU( HELLO_TITLE ) ),
0, wxALL, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext(HELLO_TEXT , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
pageHeader( this, mainSizer, HELLO_TITLE, HELLO_TEXT );
/* Create the radio buttons with their helps */
action_radios[0] = new wxRadioButton( this, ActionRadio0_Event,
......@@ -534,27 +557,23 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent)
wxU( HELLO_TRANSCODE ) );
i_action = 0;
wxFlexGridSizer *stream_sizer = new wxFlexGridSizer( 2,2,1 );
mainSizer->Add( 0, 0, 1 );
wxBoxSizer *stream_sizer = new wxBoxSizer( wxHORIZONTAL );
stream_sizer->Add( action_radios[0], 0, wxALL, 5 );
stream_sizer->Add( 0,0,1 );
stream_sizer->Add( new wxButton( this, MoreInfoStreaming_Event,
wxU( _("More Info")) ), 0, wxALL |
wxEXPAND | wxALIGN_RIGHT, 5 );
mainSizer->Add( stream_sizer, 0, wxALL| wxEXPAND, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext( HELLO_STREAMING_DESC ,TEXTWIDTH, false))),
0, wxLEFT, 5 );
wxBoxSizer *transcode_sizer = new wxBoxSizer( wxHORIZONTAL);
wxU( _("More Info")) ), 0, 0, 0 );
mainSizer->Add( stream_sizer, 0, wxALL | wxEXPAND , 5 );
wxBoxSizer *transcode_sizer = new wxBoxSizer( wxHORIZONTAL );
transcode_sizer->Add( action_radios[1], 0, wxALL, 5 );
transcode_sizer->Add( 0,0,1);
transcode_sizer->Add( new wxButton( this, MoreInfoTranscode_Event,
wxU( _("More Info")) ), 0, wxALL |
wxALIGN_RIGHT, 5 );
wxU( _("More Info")) ), 0 , 0 , 0 );
mainSizer->Add( transcode_sizer, 0, wxALL | wxEXPAND, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext( HELLO_TRANSCODE_DESC ,TEXTWIDTH, false)))
, 0, wxBOTTOM, 5 );
mainSizer->Add( 0, 0, 1 );
mainSizer->Add( new wxStaticLine(this, -1 ), 0, wxEXPAND| wxTOP|
wxBOTTOM, 5 );
......@@ -567,6 +586,16 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent)
mainSizer->Fit(this);
}
void wizHelloPage::OnMoreInfo(wxCommandEvent& event)
{
wxString msg;
msg.Printf( wxString( wxT( event.GetId() == MoreInfoStreaming_Event ?
MOREINFO_STREAM :
MOREINFO_TRANSCODE ) ) );
wxMessageBox( msg, wxU(_("More information")),
wxOK | wxICON_INFORMATION, this->p_parent );
}
void wizHelloPage::OnActionChange(wxEvent& event)
{
i_action = event.GetId() - ActionRadio0_Event;
......@@ -591,14 +620,11 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
p_parent = (WizardDialog *)parent;
b_chosen = false;
p_open_dialog = NULL;
pl_panel = NULL;
mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU( INPUT_TITLE ) ),
0, wxALL, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext(INPUT_TEXT , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
pageHeader( this, mainSizer, INPUT_TITLE, INPUT_TEXT );
/* Create the radio buttons */
input_radios[0] = new wxRadioButton( this, InputRadio0_Event ,
......@@ -624,6 +650,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
mainSizer->Add( open_panel );
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
......@@ -634,12 +661,12 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
pl_panel = new wxPanel(this, -1);
wxBoxSizer *plSizer = new wxBoxSizer( wxHORIZONTAL );
listview = new wxListView( pl_panel, ListView_Event,
wxDefaultPosition, wxSize(300,200),
wxDefaultPosition, wxSize(300,300),
wxLC_REPORT | wxSUNKEN_BORDER );
listview->InsertColumn( 0, wxU(_("Name")) );
listview->InsertColumn( 1, wxU(_("URI")) );
listview->SetColumnWidth( 0, 250 );
listview->SetColumnWidth( 1, 50 );
listview->SetColumnWidth( 1, 100 );
for( int i=0 ; i < p_playlist->i_size ; i++ )
{
wxString filename = wxL2U( p_playlist->pp_items[i]->input.
......@@ -653,7 +680,9 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
pl_panel->SetSizer( plSizer );
plSizer->Layout();
mainSizer->Add( pl_panel, 1, wxALL|wxEXPAND, 5 );
pl_panel->Hide();
mainSizer->Hide( pl_panel );
mainSizer->Layout();
}
else
......@@ -668,30 +697,35 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
}
/* Partial Extract Box */
mainSizer->Add( 0, 10, 0 );
wxStaticBox *partial_box = new wxStaticBox( this, -1,
wxU(_("Partial Extract")) );
wxStaticBoxSizer *partial_sizer = new wxStaticBoxSizer( partial_box,
wxVERTICAL );
wxCheckBox *enable_checkbox = new wxCheckBox( this, PartialEnable_Event,
enable_checkbox = new wxCheckBox( this, PartialEnable_Event,
wxU(_("Enable") ) );
enable_checkbox->SetToolTip(wxU(_(PARTIAL) ) ) ;
partial_sizer->Add( enable_checkbox, 0 , wxLEFT , 5 );
wxFlexGridSizer *partial_sizer2 = new wxFlexGridSizer( 4,1,20 );
partial_sizer2->Add( new wxStaticText(this, -1, wxU(_("From"))),0,wxLEFT ,5);
wxFlexGridSizer *partial_sizer2 = new wxFlexGridSizer( 4 , 1 , 20 );
partial_sizer2->Add( new wxStaticText(this, -1, wxU(_( "From" ) ) ),
0 , wxLEFT , 5 );
from_text = new wxTextCtrl( this, -1, wxT(""),
wxDefaultPosition, wxSize(80,25) );
wxDefaultPosition, wxSize( 80,25 ) );
partial_sizer2->Add( from_text, 0 , wxALIGN_RIGHT);
partial_sizer2->Add( new wxStaticText(this, -1, wxU(_("To"))),0,wxLEFT ,5);
partial_sizer2->Add( new wxStaticText(this, -1, wxU(_( "To" ) ) ),
0 , wxLEFT , 5 );
to_text = new wxTextCtrl( this, -1, wxT(""),
wxDefaultPosition, wxSize(80,25) );
partial_sizer2->Add( to_text, 0 , wxALIGN_RIGHT);
wxDefaultPosition, wxSize( 80 , 25 ) );
partial_sizer2->Add( to_text, 0 , wxALIGN_RIGHT );
partial_sizer->Add( partial_sizer2, 0, wxALL, 0 );
mainSizer->Add( partial_sizer, 0, wxALL, 5 );
partial_sizer->Fit( partial_box );
mainSizer->Add( partial_sizer, 0, 0, 0 );
from_text->Disable();
to_text->Disable();
......@@ -702,12 +736,6 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
wizInputPage::~wizInputPage()
{
if( p_open_dialog )
{
fprintf(stderr,"CA CRAINT, %p\n",p_open_dialog);
// p_open_dialog->EndModal(wxID_CANCEL );
// delete p_open_dialog;
}
}
void wizInputPage::OnInputChange(wxEvent& event)
......@@ -730,7 +758,7 @@ void wizInputPage::OnInputChange(wxEvent& event)
mainSizer->Hide( open_panel );
pl_panel->Show();
mainSizer->Show( pl_panel );
mainSizer->Layout();
mainSizer->Layout();
}
}
......@@ -744,7 +772,7 @@ void wizInputPage::OnEnablePartial(wxCommandEvent& event)
void wizInputPage::OnChoose(wxCommandEvent& event)
{
p_open_dialog = new OpenDialog( p_intf, this, -1, -1, OPEN_STREAM );
if( p_open_dialog->ShowModal() == wxID_OK )
if( p_open_dialog->ShowModal() == wxID_OK )
{
mrl_text->SetValue(p_open_dialog->mrl[0] );
}
......@@ -760,19 +788,13 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event)
event.GetDirection() )
{
wxMessageBox( wxU( CHOOSE_STREAM ), wxU( ERROR_MSG ),
wxICON_WARNING | wxOK, this );
wxICON_WARNING | wxOK, this->p_parent );
event.Veto();
return;
}
else
{
p_parent->SetMrl( (const char *)mrl_text->GetValue().c_str() );
if( from_text->IsEnabled() )
{
msg_Dbg( p_intf, "Partial streaming enabled");
int i_from = atoi( from_text->GetValue().mb_str() );
int i_to = atoi( to_text->GetValue().mb_str() );
p_parent->SetPartial( i_from, i_to );
}
}
}
else
......@@ -788,6 +810,14 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event)
p_parent->SetMrl( (const char*) listitem.GetText().c_str() );
}
}
if( enable_checkbox->IsChecked() )
{
int i_from = atoi( from_text->GetValue().mb_str() );
int i_to = atoi( to_text->GetValue().mb_str() );
msg_Dbg( p_intf, "Partial streaming enabled, from %i to %i",
i_from,i_to);
p_parent->SetPartial( i_from, i_to );
}
return;
}
......@@ -834,25 +864,20 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,