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() ...@@ -341,11 +341,9 @@ void Interface::CreateOurMenuBar()
wxU(_("Open &Capture Device...\tCtrl-C")) ); wxU(_("Open &Capture Device...\tCtrl-C")) );
file_menu->AppendSeparator(); file_menu->AppendSeparator();
file_menu->Append( Wizard_Event, wxU(_("&Wizard...\tCtrl-W")) );
file_menu->Append( StreamWizard_Event, file_menu->Append( StreamWizard_Event,
wxU(_("Streaming &Wizard...\tCtrl-W")) ); wxU(_("Old streaming Wizard...")) );
#if 0
file_menu->Append( Wizard_Event, wxU(_("New Wizard...")) );
#endif
file_menu->AppendSeparator(); file_menu->AppendSeparator();
file_menu->Append( Exit_Event, wxU(_("E&xit\tCtrl-X")) ); file_menu->Append( Exit_Event, wxU(_("E&xit\tCtrl-X")) );
......
...@@ -981,8 +981,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -981,8 +981,8 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
if( i_method == OPEN_STREAM ) if( i_method == OPEN_STREAM )
{ {
Hide();
if( IsModal() ) EndModal( wxID_OK ); if( IsModal() ) EndModal( wxID_OK );
Hide();
return; return;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Authors: Olivier Teulire <ipkiss@via.ecp.fr> * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
#include "wxwindows.h" #include "wxwindows.h"
#include "bitmaps/shuffle_on.xpm"
#include "bitmaps/repeat.xpm"
#include "bitmaps/loop.xpm"
/* Callback prototype */ /* Callback prototype */
static int PlaylistChanged( vlc_object_t *, const char *, static int PlaylistChanged( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * ); vlc_value_t, vlc_value_t, void * );
...@@ -96,6 +100,8 @@ enum ...@@ -96,6 +100,8 @@ enum
DEFINE_LOCAL_EVENT_TYPE( wxEVT_PLAYLIST ); DEFINE_LOCAL_EVENT_TYPE( wxEVT_PLAYLIST );
BEGIN_EVENT_TABLE(Playlist, wxFrame) BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_SIZE(Playlist::OnSize)
/* Menu events */ /* Menu events */
EVT_MENU(AddFile_Event, Playlist::OnAddFile) EVT_MENU(AddFile_Event, Playlist::OnAddFile)
EVT_MENU(AddMRL_Event, Playlist::OnAddMRL) EVT_MENU(AddMRL_Event, Playlist::OnAddMRL)
...@@ -118,9 +124,10 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame) ...@@ -118,9 +124,10 @@ BEGIN_EVENT_TABLE(Playlist, wxFrame)
EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection) EVT_MENU(DeleteSelection_Event, Playlist::OnDeleteSelection)
EVT_MENU(SelectAll_Event, Playlist::OnSelectAll) EVT_MENU(SelectAll_Event, Playlist::OnSelectAll)
EVT_MENU(Infos_Event, Playlist::OnInfos) EVT_MENU(Infos_Event, Playlist::OnInfos)
EVT_CHECKBOX(Random_Event, Playlist::OnRandom)
EVT_CHECKBOX(Repeat_Event, Playlist::OnRepeat) EVT_TOOL(Random_Event, Playlist::OnRandom)
EVT_CHECKBOX(Loop_Event, Playlist::OnLoop) EVT_TOOL(Repeat_Event, Playlist::OnRepeat)
EVT_TOOL(Loop_Event, Playlist::OnLoop)
EVT_MENU(EnableGroup_Event, Playlist::OnEnDis) EVT_MENU(EnableGroup_Event, Playlist::OnEnDis)
EVT_MENU(DisableGroup_Event, Playlist::OnEnDis) EVT_MENU(DisableGroup_Event, Playlist::OnEnDis)
...@@ -249,36 +256,59 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -249,36 +256,59 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxPanel *playlist_panel = new wxPanel( this, -1 ); wxPanel *playlist_panel = new wxPanel( this, -1 );
playlist_panel->SetAutoLayout( TRUE ); playlist_panel->SetAutoLayout( TRUE );
/* Create the Random checkbox */ /* Create the toolbar */
wxCheckBox *random_checkbox = wxToolBar *toolbar =
new wxCheckBox( playlist_panel, Random_Event, wxU(_("Random")) ); 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 ); var_Get( p_intf, "random", &val );
vlc_bool_t b_random = val.b_bool; 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 */ /* Create the Loop tool */
wxCheckBox *loop_checkbox = toolbar->AddTool( Loop_Event, wxT(""), wxBitmap( loop_xpm),
new wxCheckBox( playlist_panel, Loop_Event, wxU(_("Repeat All")) ); wxBitmap( loop_xpm), wxITEM_CHECK,
wxU(_(HELP_LOOP ) ) );
var_Get( p_intf, "loop", &val ); var_Get( p_intf, "loop", &val );
int b_loop = val.b_bool ; int b_loop = val.b_bool ;
loop_checkbox->SetValue( b_loop ); toolbar->ToggleTool( Loop_Event, b_loop );
/* Create the Repeat one checkbox */ /* Create the Repeat one checkbox */
wxCheckBox *repeat_checkbox = toolbar->AddTool( Repeat_Event, wxT(""), wxBitmap( repeat_xpm),
new wxCheckBox( playlist_panel, Repeat_Event, wxU(_("Repeat One")) ); wxBitmap( repeat_xpm), wxITEM_CHECK,
wxU(_(HELP_REPEAT ) ) );
var_Get( p_intf, "repeat", &val ); var_Get( p_intf, "repeat", &val );
int b_repeat = val.b_bool ; int b_repeat = val.b_bool ;
repeat_checkbox->SetValue( b_repeat ); toolbar->ToggleTool( Repeat_Event, b_repeat) ;
/* Create the Search Textbox */ /* Create the Search Textbox */
search_text = search_text =
new wxTextCtrl( playlist_panel, SearchText_Event, wxT(""), new wxTextCtrl( toolbar, SearchText_Event, wxT(""),
wxDefaultPosition, wxSize(140, -1), wxDefaultPosition, wxSize(100, -1),
wxTE_PROCESS_ENTER); wxTE_PROCESS_ENTER);
/* Create the search button */ /* Create the search button */
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 */ /* Create the listview */
...@@ -287,15 +317,20 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -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 * themselves to the size of a listview, and with a wxDefaultSize the
* playlist window is ridiculously small */ * playlist window is ridiculously small */
listview = new wxListView( playlist_panel, ListView_Event, listview = new wxListView( playlist_panel, ListView_Event,
wxDefaultPosition, wxSize( 500, 300 ), wxDefaultPosition, wxDefaultSize,
wxLC_REPORT | wxSUNKEN_BORDER ); wxLC_REPORT | wxSUNKEN_BORDER );
listview->InsertColumn( 0, wxU(_("Name")) ); listview->InsertColumn( 0, wxU(_("Name")) );
#if 0
listview->InsertColumn( 1, wxU(_("Author")) ); listview->InsertColumn( 1, wxU(_("Author")) );
listview->InsertColumn( 2, wxU(_("Duration")) ); #endif
listview->InsertColumn( 1, wxU(_("Duration")) );
#if 0
listview->InsertColumn( 3, wxU(_("Group")) ); listview->InsertColumn( 3, wxU(_("Group")) );
listview->SetColumnWidth( 0, 270 ); #endif
listview->SetColumnWidth( 1, 150 ); listview->SetColumnWidth( 0, 240 );
listview->SetColumnWidth( 2, 80 ); listview->SetColumnWidth( 1, 55 );
DoSize();
/* Create the Up-Down buttons */ /* Create the Up-Down buttons */
wxButton *up_button = wxButton *up_button =
...@@ -304,6 +339,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -304,6 +339,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxButton *down_button = wxButton *down_button =
new wxButton( playlist_panel, Down_Event, wxU(_("Down") ) ); new wxButton( playlist_panel, Down_Event, wxU(_("Down") ) );
#if 0
/* Create the iteminfo button */ /* Create the iteminfo button */
wxButton *iteminfo_button = wxButton *iteminfo_button =
new wxButton( playlist_panel, Infos_Event, wxU(_("Item info") ) ); new wxButton( playlist_panel, Infos_Event, wxU(_("Item info") ) );
...@@ -312,6 +348,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -312,6 +348,7 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
button_sizer->Add( iteminfo_button, 0, wxALIGN_CENTER|wxLEFT, 5); button_sizer->Add( iteminfo_button, 0, wxALIGN_CENTER|wxLEFT, 5);
button_sizer->Layout(); button_sizer->Layout();
#endif
wxBoxSizer *updown_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *updown_sizer = new wxBoxSizer( wxHORIZONTAL );
updown_sizer->Add( up_button, 0, wxALIGN_LEFT|wxRIGHT, 3); updown_sizer->Add( up_button, 0, wxALIGN_LEFT|wxRIGHT, 3);
...@@ -319,36 +356,39 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -319,36 +356,39 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
updown_sizer->Layout(); updown_sizer->Layout();
wxBoxSizer *checkbox_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *checkbox_sizer = new wxBoxSizer( wxHORIZONTAL );
checkbox_sizer->Add( random_checkbox, 0, #if 0
wxEXPAND | wxALIGN_RIGHT | wxALL, 5); //checkbox_sizer->Add( random_checkbox, 0,
checkbox_sizer->Add( loop_checkbox, 0, // wxEXPAND | wxALIGN_RIGHT | wxALL, 5);
//checkbox_sizer->Add( loop_checkbox, 0,
wxEXPAND | wxALIGN_RIGHT | wxALL, 5); wxEXPAND | wxALIGN_RIGHT | wxALL, 5);
checkbox_sizer->Add( repeat_checkbox, 0, checkbox_sizer->Add( repeat_checkbox, 0,
wxEXPAND | wxALIGN_RIGHT | wxALL, 5); wxEXPAND | wxALIGN_RIGHT | wxALL, 5);
checkbox_sizer->Layout(); checkbox_sizer->Layout();
wxBoxSizer *search_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *search_sizer = new wxBoxSizer( wxHORIZONTAL );
search_sizer->Add( search_text, 0, wxRIGHT|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->Add( search_button, 0, wxLEFT|wxALIGN_CENTER, 3);
search_sizer->Layout(); search_sizer->Layout();
#endif
/* The top and bottom sizers */ /* The top and bottom sizers */
#if 0
wxBoxSizer *top_sizer = new wxBoxSizer( wxHORIZONTAL ); 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->Add( search_sizer, 1, wxLEFT|wxRIGHT|wxALIGN_RIGHT, 4 );
top_sizer->Layout(); top_sizer->Layout();
#endif
wxBoxSizer *bottom_sizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *bottom_sizer = new wxBoxSizer( wxHORIZONTAL );
bottom_sizer->Add( updown_sizer, 0, bottom_sizer->Add( updown_sizer, 0,
wxEXPAND |wxRIGHT | wxLEFT | wxALIGN_LEFT, 4 ); wxEXPAND |wxRIGHT | wxLEFT | wxALIGN_LEFT, 4 );
bottom_sizer->Add( button_sizer, 0, // bottom_sizer->Add( button_sizer, 0,
wxEXPAND|wxLEFT | wxRIGHT | wxALIGN_RIGHT, 4 ); // wxEXPAND|wxLEFT | wxRIGHT | wxALIGN_RIGHT, 4 );
bottom_sizer->Layout(); bottom_sizer->Layout();
wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *main_sizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *panel_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( listview, 1, wxEXPAND | wxALL, 5 );
panel_sizer->Add( bottom_sizer, 0, wxEXPAND | wxALL, 5); panel_sizer->Add( bottom_sizer, 0, wxEXPAND | wxALL, 5);
panel_sizer->Layout(); panel_sizer->Layout();
...@@ -389,6 +429,19 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ): ...@@ -389,6 +429,19 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
Rebuild(); 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::~Playlist()
{ {
playlist_t *p_playlist = playlist_t *p_playlist =
...@@ -431,6 +484,20 @@ void Playlist::UpdateItem( int i ) ...@@ -431,6 +484,20 @@ void Playlist::UpdateItem( int i )
return; 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, 0, wxL2U(p_item->input.psz_name) );
listview->SetItem( i, 1, wxU( playlist_ItemGetInfo( p_item, listview->SetItem( i, 1, wxU( playlist_ItemGetInfo( p_item,
_("General"), _("Author") ) ) ); _("General"), _("Author") ) ) );
...@@ -438,7 +505,7 @@ void Playlist::UpdateItem( int i ) ...@@ -438,7 +505,7 @@ void Playlist::UpdateItem( int i )
p_item->i_group); p_item->i_group);
listview->SetItem( i, 3, listview->SetItem( i, 3,
wxL2U( psz_group ? psz_group : _("Normal") ) ); wxL2U( psz_group ? psz_group : _("Normal") ) );
#endif
if( p_item->b_enabled == VLC_FALSE ) if( p_item->b_enabled == VLC_FALSE )
{ {
wxListItem listitem; wxListItem listitem;
...@@ -453,7 +520,7 @@ void Playlist::UpdateItem( int i ) ...@@ -453,7 +520,7 @@ void Playlist::UpdateItem( int i )
secstotimestr( psz_duration, dur/1000000 ); secstotimestr( psz_duration, dur/1000000 );
else else
memcpy( psz_duration, "-:--:--", sizeof("-:--:--") ); 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 */ /* Change the colour for the currenty played stream */
wxListItem listitem; wxListItem listitem;
...@@ -508,7 +575,6 @@ void Playlist::Rebuild() ...@@ -508,7 +575,6 @@ void Playlist::Rebuild()
{ {
listview->Focus( p_playlist->i_index ); listview->Focus( p_playlist->i_index );
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
...@@ -1156,6 +1222,11 @@ void Playlist::OnEnDis( wxCommandEvent& event ) ...@@ -1156,6 +1222,11 @@ void Playlist::OnEnDis( wxCommandEvent& event )
void Playlist::OnPopup( wxListEvent& event ) void Playlist::OnPopup( wxListEvent& event )
{ {
i_popup_item = event.GetIndex(); 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() ) ); Playlist::PopupMenu( popup_menu, ScreenToClient( wxGetMousePosition() ) );
} }
......
...@@ -106,7 +106,7 @@ void Timer::Notify() ...@@ -106,7 +106,7 @@ void Timer::Notify()
b_old_seekable = VLC_FALSE; b_old_seekable = VLC_FALSE;
p_main_interface->statusbar->SetStatusText( 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 ); p_main_interface->TogglePlayButton( PLAYING_S );
i_old_playing_status = PLAYING_S; i_old_playing_status = PLAYING_S;
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <wx/statline.h> #include <wx/statline.h>
#include "stream.h"
class wizHelloPage; class wizHelloPage;
class wizInputPage; class wizInputPage;
...@@ -62,12 +64,12 @@ enum ...@@ -62,12 +64,12 @@ enum
EncapRadio6_Event, EncapRadio7_Event, EncapRadio6_Event, EncapRadio7_Event,
EncapRadio8_Event, EncapRadio9_Event, EncapRadio8_Event, EncapRadio9_Event,
VideoEnable_Event, VideoCodec_Event, VideoEnable_Event, VideoCodec_Event,VideoBitrate_Event,
AudioEnable_Event, AudioCodec_Event, AudioEnable_Event, AudioCodec_Event,AudioBitrate_Event,
}; };
#define TEXTWIDTH 60 #define TEXTWIDTH 55
#define ACTION_STREAM 0 #define ACTION_STREAM 0
#define ACTION_TRANSCODE 1 #define ACTION_TRANSCODE 1
...@@ -95,13 +97,15 @@ END_EVENT_TABLE() ...@@ -95,13 +97,15 @@ END_EVENT_TABLE()
#define HELLO_TITLE _("Streaming/Transcoding Wizard") #define HELLO_TITLE _("Streaming/Transcoding Wizard")
#define HELLO_TEXT _("This wizard helps you to stream, transcode or" \ #define HELLO_TEXT _("This wizard helps you to stream, transcode or" \
" save a stream") " 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_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_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 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 " \ "for file to file transcoding. You should use its transcoding " \
"features to save network streams, for example" ) "features to save network streams, for example" )
...@@ -118,13 +122,14 @@ END_EVENT_TABLE() ...@@ -118,13 +122,14 @@ END_EVENT_TABLE()
#define PARTIAL _("Use this to read only a part of the stream. " \ #define PARTIAL _("Use this to read only a part of the stream. " \
"You must be able to control the incoming stream " \ "You must be able to control the incoming stream " \
"(for example, a file or a disc, but not an UDP " \ "(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") #define INPUT_BUTTON _("Choose")
/* Transcode 1 */ /* Transcode 1 */
#define TRANSCODE1_TITLE _("Transcode") #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 " \ #define TR_VIDEO_TEXT0 _("If your stream has video and you want to " \
"transcode it, enable this") "transcode it, enable this")
...@@ -143,11 +148,13 @@ END_EVENT_TABLE() ...@@ -143,11 +148,13 @@ END_EVENT_TABLE()
#define INVALID_MCAST_ADDRESS _("This does not appear to be a valid " \ #define INVALID_MCAST_ADDRESS _("This does not appear to be a valid " \
"multicast address" ) "multicast address" )
#define NO_ADDRESS _("You need to enter an address" )
/* Encap */ /* Encap */
#define ENCAP_TITLE _("Encapsulation format") #define ENCAP_TITLE _("Encapsulation format")
#define ENCAP_TEXT _("In this page, you will select how the stream will be "\ #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 */ /* Transcode 2 */
...@@ -268,7 +275,7 @@ struct encap encaps_array[] = ...@@ -268,7 +275,7 @@ struct encap encaps_array[] =
{ MUX_PS, "ps","MPEG PS", "MPEG Program Stream" }, { MUX_PS, "ps","MPEG PS", "MPEG Program Stream" },
{ MUX_TS, "ts","MPEG TS", "MPEG Transport Stream" }, { MUX_TS, "ts","MPEG TS", "MPEG Transport Stream" },
{ MUX_MPEG, "ps", "MPEG 1", "MPEG 1 Format" }, { MUX_MPEG, "ps", "MPEG 1", "MPEG 1 Format" },
{ MUX_OGG, "ogg," "OGG", "OGG" }, { MUX_OGG, "ogg", "OGG", "OGG" },
{ MUX_RAW, "raw", "RAW", "RAW" }, { MUX_RAW, "raw", "RAW", "RAW" },
{ MUX_ASF, "asf","ASF", "ASF" }, { MUX_ASF, "asf","ASF", "ASF" },
{ MUX_AVI, "avi","AVI", "AVI" }, { MUX_AVI, "avi","AVI", "AVI" },
...@@ -288,6 +295,7 @@ class wizHelloPage : public wxWizardPageSimple ...@@ -288,6 +295,7 @@ class wizHelloPage : public wxWizardPageSimple
wizHelloPage( wxWizard *parent); wizHelloPage( wxWizard *parent);
void OnActionChange(wxEvent& event); void OnActionChange(wxEvent& event);
void OnWizardPageChanging(wxWizardEvent& event); void OnWizardPageChanging(wxWizardEvent& event);
void OnMoreInfo( wxCommandEvent& event );
protected: protected:
int i_action; int i_action;
WizardDialog *p_parent; WizardDialog *p_parent;
...@@ -298,6 +306,9 @@ class wizHelloPage : public wxWizardPageSimple ...@@ -298,6 +306,9 @@ class wizHelloPage : public wxWizardPageSimple
BEGIN_EVENT_TABLE(wizHelloPage, wxWizardPageSimple) BEGIN_EVENT_TABLE(wizHelloPage, wxWizardPageSimple)
EVT_RADIOBUTTON( ActionRadio0_Event, wizHelloPage::OnActionChange) EVT_RADIOBUTTON( ActionRadio0_Event, wizHelloPage::OnActionChange)
EVT_RADIOBUTTON( ActionRadio1_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) EVT_WIZARD_PAGE_CHANGING(-1, wizHelloPage::OnWizardPageChanging)
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -326,6 +337,7 @@ class wizInputPage : public wxWizardPage ...@@ -326,6 +337,7 @@ class wizInputPage : public wxWizardPage
WizardDialog *p_parent; WizardDialog *p_parent;
wxRadioButton *input_radios[2]; wxRadioButton *input_radios[2];
wxCheckBox *enable_checkbox;
wxBoxSizer *mainSizer; wxBoxSizer *mainSizer;
wxArrayString mrl; wxArrayString mrl;
wxTextCtrl *mrl_text; wxTextCtrl *mrl_text;
...@@ -362,9 +374,11 @@ public: ...@@ -362,9 +374,11 @@ public:
protected: protected:
wxCheckBox *video_checkbox; wxCheckBox *video_checkbox;
wxComboBox *video_combo; wxComboBox *video_combo;
wxComboBox *vb_combo;
wxStaticText * video_text; wxStaticText * video_text;
wxCheckBox *audio_checkbox; wxCheckBox *audio_checkbox;
wxComboBox *audio_combo; wxComboBox *audio_combo;
wxComboBox *ab_combo;
wxStaticText * audio_text; wxStaticText * audio_text;
WizardDialog *p_parent; WizardDialog *p_parent;
...@@ -506,6 +520,19 @@ END_EVENT_TABLE() ...@@ -506,6 +520,19 @@ END_EVENT_TABLE()
/* Local functions */ /* Local functions */
static int ismult( char *psz_uri ); 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 * Implementation of the pages
***************************************************************************/ ***************************************************************************/
...@@ -521,11 +548,7 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent) ...@@ -521,11 +548,7 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent)
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */ /* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU( HELLO_TITLE ) ), pageHeader( this, mainSizer, HELLO_TITLE, HELLO_TEXT );
0, wxALL, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext(HELLO_TEXT , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
/* Create the radio buttons with their helps */ /* Create the radio buttons with their helps */
action_radios[0] = new wxRadioButton( this, ActionRadio0_Event, action_radios[0] = new wxRadioButton( this, ActionRadio0_Event,
...@@ -534,27 +557,23 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent) ...@@ -534,27 +557,23 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent)
wxU( HELLO_TRANSCODE ) ); wxU( HELLO_TRANSCODE ) );
i_action = 0; 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( action_radios[0], 0, wxALL, 5 );
stream_sizer->Add( 0,0,1 );
stream_sizer->Add( new wxButton( this, MoreInfoStreaming_Event, stream_sizer->Add( new wxButton( this, MoreInfoStreaming_Event,
wxU( _("More Info")) ), 0, wxALL | wxU( _("More Info")) ), 0, 0, 0 );
wxEXPAND | wxALIGN_RIGHT, 5 ); mainSizer->Add( stream_sizer, 0, wxALL | wxEXPAND , 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);
wxBoxSizer *transcode_sizer = new wxBoxSizer( wxHORIZONTAL );
transcode_sizer->Add( action_radios[1], 0, wxALL, 5 ); transcode_sizer->Add( action_radios[1], 0, wxALL, 5 );
transcode_sizer->Add( 0,0,1);
transcode_sizer->Add( new wxButton( this, MoreInfoTranscode_Event, transcode_sizer->Add( new wxButton( this, MoreInfoTranscode_Event,
wxU( _("More Info")) ), 0, wxALL | wxU( _("More Info")) ), 0 , 0 , 0 );
wxALIGN_RIGHT, 5 );
mainSizer->Add( transcode_sizer, 0, wxALL | wxEXPAND, 5 ); mainSizer->Add( transcode_sizer, 0, wxALL | wxEXPAND, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext( HELLO_TRANSCODE_DESC ,TEXTWIDTH, false))) mainSizer->Add( 0, 0, 1 );
, 0, wxBOTTOM, 5 );
mainSizer->Add( new wxStaticLine(this, -1 ), 0, wxEXPAND| wxTOP| mainSizer->Add( new wxStaticLine(this, -1 ), 0, wxEXPAND| wxTOP|
wxBOTTOM, 5 ); wxBOTTOM, 5 );
...@@ -567,6 +586,16 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent) ...@@ -567,6 +586,16 @@ wizHelloPage::wizHelloPage( wxWizard *parent) : wxWizardPageSimple(parent)
mainSizer->Fit(this); 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) void wizHelloPage::OnActionChange(wxEvent& event)
{ {
i_action = event.GetId() - ActionRadio0_Event; i_action = event.GetId() - ActionRadio0_Event;
...@@ -591,14 +620,11 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t ...@@ -591,14 +620,11 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
p_parent = (WizardDialog *)parent; p_parent = (WizardDialog *)parent;
b_chosen = false; b_chosen = false;
p_open_dialog = NULL; p_open_dialog = NULL;
pl_panel = NULL;
mainSizer = new wxBoxSizer(wxVERTICAL); mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */ /* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU( INPUT_TITLE ) ), pageHeader( this, mainSizer, INPUT_TITLE, INPUT_TEXT );
0, wxALL, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext(INPUT_TEXT , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
/* Create the radio buttons */ /* Create the radio buttons */
input_radios[0] = new wxRadioButton( this, InputRadio0_Event , input_radios[0] = new wxRadioButton( this, InputRadio0_Event ,
...@@ -624,6 +650,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t ...@@ -624,6 +650,7 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
mainSizer->Add( open_panel ); mainSizer->Add( open_panel );
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
...@@ -634,12 +661,12 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t ...@@ -634,12 +661,12 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
pl_panel = new wxPanel(this, -1); pl_panel = new wxPanel(this, -1);
wxBoxSizer *plSizer = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer *plSizer = new wxBoxSizer( wxHORIZONTAL );
listview = new wxListView( pl_panel, ListView_Event, listview = new wxListView( pl_panel, ListView_Event,
wxDefaultPosition, wxSize(300,200), wxDefaultPosition, wxSize(300,300),
wxLC_REPORT | wxSUNKEN_BORDER ); wxLC_REPORT | wxSUNKEN_BORDER );
listview->InsertColumn( 0, wxU(_("Name")) ); listview->InsertColumn( 0, wxU(_("Name")) );
listview->InsertColumn( 1, wxU(_("URI")) ); listview->InsertColumn( 1, wxU(_("URI")) );
listview->SetColumnWidth( 0, 250 ); listview->SetColumnWidth( 0, 250 );
listview->SetColumnWidth( 1, 50 ); listview->SetColumnWidth( 1, 100 );
for( int i=0 ; i < p_playlist->i_size ; i++ ) for( int i=0 ; i < p_playlist->i_size ; i++ )
{ {
wxString filename = wxL2U( p_playlist->pp_items[i]->input. wxString filename = wxL2U( p_playlist->pp_items[i]->input.
...@@ -653,7 +680,9 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t ...@@ -653,7 +680,9 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
pl_panel->SetSizer( plSizer ); pl_panel->SetSizer( plSizer );
plSizer->Layout(); plSizer->Layout();
mainSizer->Add( pl_panel, 1, wxALL|wxEXPAND, 5 ); mainSizer->Add( pl_panel, 1, wxALL|wxEXPAND, 5 );
pl_panel->Hide(); pl_panel->Hide();
mainSizer->Hide( pl_panel );
mainSizer->Layout(); mainSizer->Layout();
} }
else else
...@@ -668,30 +697,35 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t ...@@ -668,30 +697,35 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
} }
/* Partial Extract Box */ /* Partial Extract Box */
mainSizer->Add( 0, 10, 0 );
wxStaticBox *partial_box = new wxStaticBox( this, -1, wxStaticBox *partial_box = new wxStaticBox( this, -1,
wxU(_("Partial Extract")) ); wxU(_("Partial Extract")) );
wxStaticBoxSizer *partial_sizer = new wxStaticBoxSizer( partial_box, wxStaticBoxSizer *partial_sizer = new wxStaticBoxSizer( partial_box,
wxVERTICAL ); wxVERTICAL );
wxCheckBox *enable_checkbox = new wxCheckBox( this, PartialEnable_Event, enable_checkbox = new wxCheckBox( this, PartialEnable_Event,
wxU(_("Enable") ) ); wxU(_("Enable") ) );
enable_checkbox->SetToolTip(wxU(_(PARTIAL) ) ) ; enable_checkbox->SetToolTip(wxU(_(PARTIAL) ) ) ;
partial_sizer->Add( enable_checkbox, 0 , wxLEFT , 5 ); partial_sizer->Add( enable_checkbox, 0 , wxLEFT , 5 );
wxFlexGridSizer *partial_sizer2 = new wxFlexGridSizer( 4,1,20 ); wxFlexGridSizer *partial_sizer2 = new wxFlexGridSizer( 4 , 1 , 20 );
partial_sizer2->Add( new wxStaticText(this, -1, wxU(_("From"))),0,wxLEFT ,5); partial_sizer2->Add( new wxStaticText(this, -1, wxU(_( "From" ) ) ),
0 , wxLEFT , 5 );
from_text = new wxTextCtrl( this, -1, wxT(""), 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( 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(""), to_text = new wxTextCtrl( this, -1, wxT(""),
wxDefaultPosition, wxSize(80,25) ); wxDefaultPosition, wxSize( 80 , 25 ) );
partial_sizer2->Add( to_text, 0 , wxALIGN_RIGHT); partial_sizer2->Add( to_text, 0 , wxALIGN_RIGHT );
partial_sizer->Add( partial_sizer2, 0, wxALL, 0 ); 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(); from_text->Disable();
to_text->Disable(); to_text->Disable();
...@@ -702,12 +736,6 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t ...@@ -702,12 +736,6 @@ wizInputPage::wizInputPage( wxWizard *parent, wxWizardPage *prev, intf_thread_t
wizInputPage::~wizInputPage() 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) void wizInputPage::OnInputChange(wxEvent& event)
...@@ -730,7 +758,7 @@ void wizInputPage::OnInputChange(wxEvent& event) ...@@ -730,7 +758,7 @@ void wizInputPage::OnInputChange(wxEvent& event)
mainSizer->Hide( open_panel ); mainSizer->Hide( open_panel );
pl_panel->Show(); pl_panel->Show();
mainSizer->Show( pl_panel ); mainSizer->Show( pl_panel );
mainSizer->Layout(); mainSizer->Layout();
} }
} }
...@@ -744,7 +772,7 @@ void wizInputPage::OnEnablePartial(wxCommandEvent& event) ...@@ -744,7 +772,7 @@ void wizInputPage::OnEnablePartial(wxCommandEvent& event)
void wizInputPage::OnChoose(wxCommandEvent& event) void wizInputPage::OnChoose(wxCommandEvent& event)
{ {
p_open_dialog = new OpenDialog( p_intf, this, -1, -1, OPEN_STREAM ); 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] ); mrl_text->SetValue(p_open_dialog->mrl[0] );
} }
...@@ -760,19 +788,13 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event) ...@@ -760,19 +788,13 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event)
event.GetDirection() ) event.GetDirection() )
{ {
wxMessageBox( wxU( CHOOSE_STREAM ), wxU( ERROR_MSG ), wxMessageBox( wxU( CHOOSE_STREAM ), wxU( ERROR_MSG ),
wxICON_WARNING | wxOK, this ); wxICON_WARNING | wxOK, this->p_parent );
event.Veto(); event.Veto();
return;
} }
else else
{ {
p_parent->SetMrl( (const char *)mrl_text->GetValue().c_str() ); 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 else
...@@ -788,6 +810,14 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event) ...@@ -788,6 +810,14 @@ void wizInputPage::OnWizardPageChanging(wxWizardEvent& event)
p_parent->SetMrl( (const char*) listitem.GetText().c_str() ); 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; return;
} }
...@@ -834,25 +864,20 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent, ...@@ -834,25 +864,20 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
/* Add the main texts */ /* Header */
main_sizer->Add( new wxStaticText(this, -1, pageHeader( this, main_sizer, TRANSCODE1_TITLE, TRANSCODE1_TEXT );
wxU( vlc_wraptext( TRANSCODE1_TITLE ,TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
main_sizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext(TRANSCODE1_TEXT , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
/* Video Box */ /* Video Box */
wxStaticBox *video_box = new wxStaticBox( this, -1, wxU(_("Video")) ); wxStaticBox *video_box = new wxStaticBox( this, -1, wxU(_("Video")) );
wxStaticBoxSizer *video_sizer = new wxStaticBoxSizer( video_box, wxStaticBoxSizer *video_sizer = new wxStaticBoxSizer( video_box,
wxVERTICAL ); wxVERTICAL );
/* Line 1 : only the checkbox */ /* Line 1 : only the checkbox */
wxFlexGridSizer *video_sizer1 = new wxFlexGridSizer( 1,1,20 ); wxFlexGridSizer *video_sizer1 = new wxFlexGridSizer( 2,3,20 );
video_sizer1->Add( new wxCheckBox( this, VideoEnable_Event, video_sizer1->Add( new wxCheckBox( this, VideoEnable_Event,
wxU(_("Transcode video") ) ), 0 , wxLEFT , 5 ); wxU(_("Transcode video") ) ), 0 , 0 , 5 );
video_sizer1->Add( 0,0,1);
/* Line 2 : codec */ /* Line 2 : codec */
wxFlexGridSizer *video_sizer2 = new wxFlexGridSizer( 2,1,20 ); video_sizer1->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT ,5);
video_sizer2->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT ,5);
video_combo = new wxComboBox( this, VideoCodec_Event, wxT(""), video_combo = new wxComboBox( this, VideoCodec_Event, wxT(""),
wxDefaultPosition, wxSize(200,25) ); wxDefaultPosition, wxSize(200,25) );
for( int i= 0; vcodecs_array[i].psz_display != NULL; i++ ) for( int i= 0; vcodecs_array[i].psz_display != NULL; i++ )
...@@ -860,28 +885,35 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent, ...@@ -860,28 +885,35 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
video_combo->Append( wxU( vcodecs_array[i].psz_display ) , video_combo->Append( wxU( vcodecs_array[i].psz_display ) ,
(void *)&vcodecs_array[i] ); (void *)&vcodecs_array[i] );
} }
video_sizer2->Add( video_combo, 0 , wxALIGN_RIGHT); video_sizer1->Add( video_combo, 0 , wxALIGN_LEFT , 0 );
video_sizer1->Add( new wxStaticText(this, -1, wxU(_("Bitrate (kb/s)"))),0,
wxLEFT ,5);
vb_combo = new wxComboBox( this, VideoBitrate_Event, wxT("1024"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(vbitrates_array), vbitrates_array );
video_sizer1->Add( vb_combo, 0, wxALIGN_LEFT , 0 );
/* Line 3 : text */ /* Line 3 : text */
video_text = new wxStaticText( this, -1, video_text = new wxStaticText( this, -1,
wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH, false) ) ); wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH, false) ) );
wxFlexGridSizer *video_sizer3 = new wxFlexGridSizer( 2,1,20 );
video_sizer3->Add( video_text, 0, wxLEFT, 5 );
/* Fill the main video sizer */ /* Fill the main video sizer */
video_sizer->Add( video_sizer1 , 0, wxEXPAND, 5 ); video_sizer->Add( video_sizer1 , 0, wxEXPAND , 5 );
video_sizer->Add( video_sizer2, 0, wxALL, 5 ); video_sizer->Add( video_text, 0, wxLEFT|wxTOP , 5 );
video_sizer->Add( video_sizer3, 0, wxEXPAND );
/* Audio box */ /* Audio box */
wxStaticBox *audio_box = new wxStaticBox( this, -1, wxU(_("Audio")) ); wxStaticBox *audio_box = new wxStaticBox( this, -1, wxU(_("Audio")) );
wxStaticBoxSizer *audio_sizer = new wxStaticBoxSizer( audio_box, wxStaticBoxSizer *audio_sizer = new wxStaticBoxSizer( audio_box,
wxVERTICAL ); wxVERTICAL );
/* Line1: enabler */ /* Line1: enabler */
wxFlexGridSizer *audio_sizer1 = new wxFlexGridSizer( 1,1,20); wxFlexGridSizer *audio_sizer1 = new wxFlexGridSizer( 2,3,20);
audio_sizer1->Add( new wxCheckBox( this, AudioEnable_Event, audio_sizer1->Add( new wxCheckBox( this, AudioEnable_Event,
wxU(_("Transcode audio") ) ), 0 , wxLEFT, 5 ); wxU(_("Transcode audio") ) ), 0 , wxLEFT, 5 );
audio_sizer1->Add( 0, 0, 1 );
/* Line 2 : codec */ /* Line 2 : codec */
wxFlexGridSizer *audio_sizer2 = new wxFlexGridSizer( 2,1,20 ); audio_sizer1->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT,5);
audio_sizer2->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT,5);
audio_combo = new wxComboBox( this, AudioCodec_Event, wxT(""), audio_combo = new wxComboBox( this, AudioCodec_Event, wxT(""),
wxDefaultPosition, wxSize(200,25) ); wxDefaultPosition, wxSize(200,25) );
for( int i= 0; acodecs_array[i].psz_display != NULL; i++ ) for( int i= 0; acodecs_array[i].psz_display != NULL; i++ )
...@@ -889,16 +921,21 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent, ...@@ -889,16 +921,21 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
audio_combo->Append( wxU( acodecs_array[i].psz_display ) , audio_combo->Append( wxU( acodecs_array[i].psz_display ) ,
(void *)&acodecs_array[i] ); (void *)&acodecs_array[i] );
} }
audio_sizer2->Add( audio_combo, 0 , wxALIGN_RIGHT ); audio_sizer1->Add( audio_combo, 0 , wxALIGN_LEFT, 0 );
audio_sizer1->Add( new wxStaticText(this, -1, wxU(_("Bitrate (kb/s)"))),0,
wxLEFT ,5);
ab_combo = new wxComboBox( this, AudioBitrate_Event, wxT("192"),
wxDefaultPosition, wxDefaultSize,
WXSIZEOF(abitrates_array), abitrates_array );
audio_sizer1->Add( ab_combo, 0, wxALIGN_LEFT, 0 );
/* Line 3 : text */ /* Line 3 : text */
audio_text = new wxStaticText( this, -1, audio_text = new wxStaticText( this, -1,
wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH, false) ) ); wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH, false) ) );
wxFlexGridSizer *audio_sizer3 = new wxFlexGridSizer( 2,1,20 );
audio_sizer3->Add( audio_text, 0, wxLEFT,5 );
audio_sizer->Add(audio_sizer1, 0, wxEXPAND, 5); audio_sizer->Add(audio_sizer1, 0, wxEXPAND, 5);
audio_sizer->Add(audio_sizer2, 0, wxALL, 5 ); audio_sizer->Add( audio_text, 0, wxLEFT | wxTOP, 5 );
audio_sizer->Add(audio_sizer3, 0, wxEXPAND );
main_sizer->Add( video_sizer, 1, wxGROW, 0 ); main_sizer->Add( video_sizer, 1, wxGROW, 0 );
main_sizer->Add( audio_sizer, 1, wxGROW, 0 ); main_sizer->Add( audio_sizer, 1, wxGROW, 0 );
...@@ -906,8 +943,8 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent, ...@@ -906,8 +943,8 @@ wizTranscodeCodecPage::wizTranscodeCodecPage( wxWizard *parent,
SetSizerAndFit( main_sizer ); SetSizerAndFit( main_sizer );
/* Default disabled */ /* Default disabled */
video_combo->Disable(); video_text->Disable(); video_combo->Disable(); video_text->Disable();vb_combo->Disable();
audio_combo->Disable(); audio_text->Disable(); audio_combo->Disable(); audio_text->Disable();ab_combo->Disable();
} }
...@@ -920,12 +957,14 @@ wizTranscodeCodecPage::~wizTranscodeCodecPage() ...@@ -920,12 +957,14 @@ wizTranscodeCodecPage::~wizTranscodeCodecPage()
void wizTranscodeCodecPage::OnEnableVideo(wxCommandEvent& event) void wizTranscodeCodecPage::OnEnableVideo(wxCommandEvent& event)
{ {
video_combo->Enable( event.IsChecked() ); video_combo->Enable( event.IsChecked() );
vb_combo->Enable( event.IsChecked() );
video_text->Enable( event.IsChecked() ); video_text->Enable( event.IsChecked() );
} }
void wizTranscodeCodecPage::OnEnableAudio(wxCommandEvent& event) void wizTranscodeCodecPage::OnEnableAudio(wxCommandEvent& event)
{ {
audio_combo->Enable( event.IsChecked() ); audio_combo->Enable( event.IsChecked() );
ab_combo->Enable( event.IsChecked() );
audio_text->Enable( event.IsChecked() ); audio_text->Enable( event.IsChecked() );
} }
...@@ -972,12 +1011,10 @@ void wizTranscodeCodecPage::OnWizardPageChanging(wxWizardEvent& event) ...@@ -972,12 +1011,10 @@ void wizTranscodeCodecPage::OnWizardPageChanging(wxWizardEvent& event)
for( i = 0 ; i< 9 ; i++ ) for( i = 0 ; i< 9 ; i++ )
{ {
//fprintf(stderr,"vcodecs[%i].muxers[%i] = %i\n",i_video_codec,i,vcodecs_array[i_video_codec].muxers[i]);
if( vcodecs_array[i_video_codec].muxers[i] != -1 ) if( vcodecs_array[i_video_codec].muxers[i] != -1 )
{ {
for( j = 0 ; j< 9 ; j++ ) for( j = 0 ; j< 9 ; j++ )
{ {
// fprintf(stderr," acodecs[%i].muxers[%i] = %i\n",i_audio_codec,j,acodecs_array[i_audio_codec].muxers[j]);
if( acodecs_array[i_audio_codec].muxers[j] == if( acodecs_array[i_audio_codec].muxers[j] ==
vcodecs_array[i_video_codec].muxers[i] ) vcodecs_array[i_video_codec].muxers[i] )
{ {
...@@ -996,9 +1033,18 @@ void wizTranscodeCodecPage::OnWizardPageChanging(wxWizardEvent& event) ...@@ -996,9 +1033,18 @@ void wizTranscodeCodecPage::OnWizardPageChanging(wxWizardEvent& event)
audio_combo->GetSelection() : i_audio_codec )); audio_combo->GetSelection() : i_audio_codec ));
acodec = strdup(c->psz_codec); acodec = strdup(c->psz_codec);
int vb = atoi(vb_combo->GetValue().c_str() );
if( vb == 0 )
{
vb = 1024;
}
int ab = atoi(ab_combo->GetValue().c_str() );
if( ab == 0)
{
ab = 192;
}
/* FIXME: Support bitrate */ p_parent->SetTranscode( vcodec, vb , acodec, ab );
p_parent->SetTranscode( vcodec, 1000, acodec, 200 );
((wizEncapPage*)GetNext())->SetAction( p_parent->GetAction() ); ((wizEncapPage*)GetNext())->SetAction( p_parent->GetAction() );
p_parent->SetAction( p_parent->GetAction() ); p_parent->SetAction( p_parent->GetAction() );
...@@ -1023,12 +1069,9 @@ wizStreamingMethodPage::wizStreamingMethodPage( wxWizard *parent, ...@@ -1023,12 +1069,9 @@ wizStreamingMethodPage::wizStreamingMethodPage( wxWizard *parent,
mainSizer = new wxBoxSizer(wxVERTICAL); mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */ /* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU( pageHeader( this, mainSizer, STREAMING1_TITLE, STREAMING1_TEXT );
vlc_wraptext( STREAMING1_TITLE, TEXTWIDTH, false) ) ),
0, wxALL, 5 ); mainSizer->Add( 0,0,1 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext(STREAMING1_TEXT , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
i_method = 0; i_method = 0;
...@@ -1052,18 +1095,28 @@ wizStreamingMethodPage::wizStreamingMethodPage( wxWizard *parent, ...@@ -1052,18 +1095,28 @@ wizStreamingMethodPage::wizStreamingMethodPage( wxWizard *parent,
address_sizer = new wxStaticBoxSizer(address_box, address_sizer = new wxStaticBoxSizer(address_box,
wxVERTICAL ); wxVERTICAL );
/* Big kludge, we take the longest text to get the size */
address_text = new wxStaticText(this, -1, address_text = new wxStaticText(this, -1,
wxU( vlc_wraptext( methods_array[2].psz_address, wxU( vlc_wraptext(methods_array[2].psz_address,
TEXTWIDTH, false ) ), wxDefaultPosition, TEXTWIDTH, false ) ),
wxSize(200,25) ); wxDefaultPosition, wxDefaultSize );
address_txtctrl = new wxTextCtrl( this, -1, wxU(""), wxDefaultPosition, address_txtctrl = new wxTextCtrl( this, -1, wxU(""), wxDefaultPosition,
wxSize(200,25)); wxSize(200,25));
address_sizer->Add( address_text, 0, wxALL, 5 ); address_sizer->Add( address_text, 0, wxALL, 5 );
address_sizer->Add( address_txtctrl, 0, wxALL, 5 ); address_sizer->Add( address_txtctrl, 0, wxALL, 5 );
address_sizer->Layout(); address_sizer->Layout();
/* Set the minimum size */
address_sizer->SetMinSize( address_sizer->GetSize() );
address_text->SetLabel( wxU(
vlc_wraptext( _(methods_array[0].psz_address), TEXTWIDTH, false)));
mainSizer->Add( method_sizer, 0, wxALL | wxEXPAND, 5 ); mainSizer->Add( method_sizer, 0, wxALL | wxEXPAND, 5 );
mainSizer->Add( address_sizer, 0, wxALL | wxEXPAND, 5 ); mainSizer->Add( address_sizer, 0, wxALL | wxEXPAND, 5 );
mainSizer->Add( 0,0,1 );
mainSizer->Layout(); mainSizer->Layout();
SetSizer(mainSizer); SetSizer(mainSizer);
...@@ -1077,14 +1130,22 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event) ...@@ -1077,14 +1130,22 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event)
unsigned int i; unsigned int i;
if( !event.GetDirection() ) return; if( !event.GetDirection() ) return;
/* Check valid multicast address */ /* Check valid address */
if( i_method == 1 && !ismult((char *) address_txtctrl->GetValue().c_str()) ) if( i_method == 1 && !ismult((char *) address_txtctrl->GetValue().c_str()) )
{ {
wxMessageBox( wxU( INVALID_MCAST_ADDRESS ) , wxU( ERROR_MSG ), wxMessageBox( wxU( INVALID_MCAST_ADDRESS ) , wxU( ERROR_MSG ),
wxICON_WARNING | wxOK, this ); wxICON_WARNING | wxOK, this->p_parent );
event.Veto(); event.Veto();
} }
else if( i_method == 0 && address_txtctrl->GetValue().IsEmpty() )
{
wxMessageBox( wxU( NO_ADDRESS ) , wxU( ERROR_MSG ),
wxICON_WARNING | wxOK, this->p_parent );
event.Veto();
}
((wizEncapPage *)GetNext())->SetPrev(this); ((wizEncapPage *)GetNext())->SetPrev(this);
for( i = 0 ; i< 9 ; i++ ) for( i = 0 ; i< 9 ; i++ )
{ {
...@@ -1096,6 +1157,9 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event) ...@@ -1096,6 +1157,9 @@ void wizStreamingMethodPage::OnWizardPageChanging(wxWizardEvent& event)
} }
p_parent->SetStream( methods_array[i_method].psz_access , p_parent->SetStream( methods_array[i_method].psz_access ,
(char *)address_txtctrl->GetValue().c_str() ); (char *)address_txtctrl->GetValue().c_str() );
/* Set the action for the muxer page */
((wizEncapPage*)GetNext())->SetAction( p_parent->GetAction() );
return; return;
} }
...@@ -1110,8 +1174,6 @@ void wizStreamingMethodPage::OnMethodChange(wxEvent& event) ...@@ -1110,8 +1174,6 @@ void wizStreamingMethodPage::OnMethodChange(wxEvent& event)
i_method = event.GetId() - MethodRadio0_Event; i_method = event.GetId() - MethodRadio0_Event;
address_text->SetLabel( wxU( address_text->SetLabel( wxU(
vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH, false))); vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH, false)));
address_sizer->Layout();
mainSizer->Layout();
} }
/*************************************************** /***************************************************
...@@ -1128,21 +1190,21 @@ wizEncapPage::wizEncapPage( wxWizard *parent ) : wxWizardPage(parent) ...@@ -1128,21 +1190,21 @@ wizEncapPage::wizEncapPage( wxWizard *parent ) : wxWizardPage(parent)
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */ /* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU(ENCAP_TITLE) ), pageHeader( this, mainSizer, ENCAP_TITLE, ENCAP_TEXT );
0, wxALL, 5 );
mainSizer->Add( new wxStaticText(this, -1, mainSizer->Add( 0,0,1 );
wxU( vlc_wraptext(ENCAP_TEXT , TEXTWIDTH, false ) ) ),
0, wxALL, 5 );
for( i = 0 ; i< 9 ; i++ ) for( i = 0 ; i< 9 ; i++ )
{ {
encap_radios[i] = new wxRadioButton( this, EncapRadio0_Event + i, encap_radios[i] = new wxRadioButton( this, EncapRadio0_Event + i,
wxU( encaps_array[i].psz_encap ) ); wxU( encaps_array[i].psz_encap ) );
encap_radios[i]->SetToolTip( wxU(_( encaps_array[i].psz_descr ) ) ); encap_radios[i]->SetToolTip( wxU(_( encaps_array[i].psz_descr ) ) );
mainSizer->Add( encap_radios[i], 0, wxALL, 5 ); mainSizer->Add( encap_radios[i], 0, wxLEFT, 5 );
encap_radios[i]->Disable(); encap_radios[i]->Disable();
} }
mainSizer->Add( 0,0,1 );
SetSizer(mainSizer); SetSizer(mainSizer);
mainSizer->Fit(this); mainSizer->Fit(this);
} }
...@@ -1198,14 +1260,12 @@ wxWizardPage *wizEncapPage::GetPrev() const { return p_prev; } ...@@ -1198,14 +1260,12 @@ wxWizardPage *wizEncapPage::GetPrev() const { return p_prev; }
wxWizardPage *wizEncapPage::GetNext() const wxWizardPage *wizEncapPage::GetNext() const
{ {
fprintf(stderr,"Action is %i (%i %i)",i_action,ACTION_STREAM,ACTION_TRANSCODE);
if( i_action== ACTION_STREAM ) if( i_action== ACTION_STREAM )
return p_streaming_page; return p_streaming_page;
else else
return p_transcode_page; return p_transcode_page;
} }
void wizEncapPage::SetAction( int i_act ) { i_action = i_act; } void wizEncapPage::SetAction( int i_act ) { i_action = i_act; }
void wizEncapPage::SetPrev( wxWizardPage *page) { p_prev = page; } void wizEncapPage::SetPrev( wxWizardPage *page) { p_prev = page; }
...@@ -1223,12 +1283,13 @@ wizTranscodeExtraPage::wizTranscodeExtraPage( wxWizard *parent, ...@@ -1223,12 +1283,13 @@ wizTranscodeExtraPage::wizTranscodeExtraPage( wxWizard *parent,
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */ /* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU( EXTRATRANSCODE_TITLE )), pageHeader( this, mainSizer, EXTRATRANSCODE_TITLE, EXTRATRANSCODE_TEXT );
mainSizer->Add( new wxStaticText( this, -1,
wxU(_("Select the file to save to") ) ),
0, wxALL, 5 ); 0, wxALL, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext( EXTRATRANSCODE_TEXT , TEXTWIDTH, mainSizer->Add( new wxButton( this, Open_Event, wxU("Choose") ) );
false ) ) ), 0, wxALL, 5 );
mainSizer->Add( new wxButton( this, Open_Event, wxU("Open") ) );
SetSizer(mainSizer); SetSizer(mainSizer);
mainSizer->Fit(this); mainSizer->Fit(this);
} }
...@@ -1265,11 +1326,8 @@ wizStreamingExtraPage::wizStreamingExtraPage( wxWizard *parent, ...@@ -1265,11 +1326,8 @@ wizStreamingExtraPage::wizStreamingExtraPage( wxWizard *parent,
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */ /* Create the texts */
mainSizer->Add( new wxStaticText(this, -1, wxU( EXTRASTREAMING_TITLE )), pageHeader( this, mainSizer, EXTRASTREAMING_TITLE, EXTRASTREAMING_TEXT );
0, wxALL, 5 );
mainSizer->Add( new wxStaticText(this, -1,
wxU( vlc_wraptext(EXTRASTREAMING_TEXT , TEXTWIDTH,
false ) ) ), 0, wxALL, 5 );
SetSizer(mainSizer); SetSizer(mainSizer);
mainSizer->Fit(this); mainSizer->Fit(this);
} }
...@@ -1349,9 +1407,8 @@ void WizardDialog::SetMrl( const char *mrl ) ...@@ -1349,9 +1407,8 @@ void WizardDialog::SetMrl( const char *mrl )
this->mrl = strdup( mrl ); this->mrl = strdup( mrl );
} }
void WizardDialog::SetPartial( int from, int to ) void WizardDialog::SetPartial( int i_from, int i_to )
{ {
msg_Dbg(p_intf, "From %i to %i", from, to );
this->i_from = i_from; this->i_from = i_from;
this->i_to = i_to; this->i_to = i_to;
} }
......
...@@ -671,6 +671,10 @@ private: ...@@ -671,6 +671,10 @@ private:
void ShowInfos( int item ); void ShowInfos( int item );
/* Event handlers (these functions should _not_ be virtual) */ /* Event handlers (these functions should _not_ be virtual) */
void OnSize( wxSizeEvent &event);
void DoSize();
void OnAddFile( wxCommandEvent& event ); void OnAddFile( wxCommandEvent& event );
void OnAddMRL( wxCommandEvent& event ); void OnAddMRL( wxCommandEvent& event );
void OnClose( wxCommandEvent& event ); void OnClose( wxCommandEvent& event );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment