*
* Authors: Olivier Teulière <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.
#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 * );
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)
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)
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 */
* 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 =
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") ) );
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);
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();
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 =
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") ) ) );
p_item->i_group);
listview->SetItem( i, 3,
wxL2U( psz_group ? psz_group : _("Normal") ) );
-
+#endif
if( p_item->b_enabled == VLC_FALSE )
{
wxListItem listitem;
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;
{
listview->Focus( p_playlist->i_index );
}
-
vlc_object_release( p_playlist );
}
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() ) );
}
#include <wx/statline.h>
+#include "stream.h"
+
class wizHelloPage;
class wizInputPage;
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
#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" )
#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")
#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 */
{ 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" },
wizHelloPage( wxWizard *parent);
void OnActionChange(wxEvent& event);
void OnWizardPageChanging(wxWizardEvent& event);
+ void OnMoreInfo( wxCommandEvent& event );
protected:
int i_action;
WizardDialog *p_parent;
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()
WizardDialog *p_parent;
wxRadioButton *input_radios[2];
+ wxCheckBox *enable_checkbox;
wxBoxSizer *mainSizer;
wxArrayString mrl;
wxTextCtrl *mrl_text;
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;
/* 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
***************************************************************************/
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,
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 );
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;
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 ,
mainSizer->Add( open_panel );
+
playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
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.
pl_panel->SetSizer( plSizer );
plSizer->Layout();
mainSizer->Add( pl_panel, 1, wxALL|wxEXPAND, 5 );
+
pl_panel->Hide();
+ mainSizer->Hide( pl_panel );
mainSizer->Layout();
}
else
}
/* 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();
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)
mainSizer->Hide( open_panel );
pl_panel->Show();
mainSizer->Show( pl_panel );
- mainSizer->Layout();
+ mainSizer->Layout();
}
}
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] );
}
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
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;
}
wxBoxSizer *main_sizer = new wxBoxSizer(wxVERTICAL);
- /* Add the main texts */
- main_sizer->Add( new wxStaticText(this, -1,
- 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 );
+ /* Header */
+ pageHeader( this, main_sizer, TRANSCODE1_TITLE, TRANSCODE1_TEXT );
/* Video Box */
wxStaticBox *video_box = new wxStaticBox( this, -1, wxU(_("Video")) );
wxStaticBoxSizer *video_sizer = new wxStaticBoxSizer( video_box,
wxVERTICAL );
/* 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,
- wxU(_("Transcode video") ) ), 0 , wxLEFT , 5 );
+ wxU(_("Transcode video") ) ), 0 , 0 , 5 );
+ video_sizer1->Add( 0,0,1);
/* Line 2 : codec */
- wxFlexGridSizer *video_sizer2 = new wxFlexGridSizer( 2,1,20 );
- video_sizer2->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT ,5);
+ video_sizer1->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT ,5);
video_combo = new wxComboBox( this, VideoCodec_Event, wxT(""),
wxDefaultPosition, wxSize(200,25) );
for( int i= 0; vcodecs_array[i].psz_display != NULL; i++ )
video_combo->Append( wxU( vcodecs_array[i].psz_display ) ,
(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 */
video_text = new wxStaticText( this, -1,
- wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH, false) ) );
- wxFlexGridSizer *video_sizer3 = new wxFlexGridSizer( 2,1,20 );
- video_sizer3->Add( video_text, 0, wxLEFT, 5 );
+ wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH, false) ) );
/* Fill the main video sizer */
- video_sizer->Add( video_sizer1 , 0, wxEXPAND, 5 );
- video_sizer->Add( video_sizer2, 0, wxALL, 5 );
- video_sizer->Add( video_sizer3, 0, wxEXPAND );
+ video_sizer->Add( video_sizer1 , 0, wxEXPAND , 5 );
+ video_sizer->Add( video_text, 0, wxLEFT|wxTOP , 5 );
+
/* Audio box */
wxStaticBox *audio_box = new wxStaticBox( this, -1, wxU(_("Audio")) );
wxStaticBoxSizer *audio_sizer = new wxStaticBoxSizer( audio_box,
wxVERTICAL );
/* 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,
wxU(_("Transcode audio") ) ), 0 , wxLEFT, 5 );
+ audio_sizer1->Add( 0, 0, 1 );
+
/* Line 2 : codec */
- wxFlexGridSizer *audio_sizer2 = new wxFlexGridSizer( 2,1,20 );
- audio_sizer2->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT,5);
+ audio_sizer1->Add( new wxStaticText(this, -1, wxU(_("Codec"))),0,wxLEFT,5);
audio_combo = new wxComboBox( this, AudioCodec_Event, wxT(""),
wxDefaultPosition, wxSize(200,25) );
for( int i= 0; acodecs_array[i].psz_display != NULL; i++ )
audio_combo->Append( wxU( acodecs_array[i].psz_display ) ,
(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 */
audio_text = new wxStaticText( this, -1,
- wxU( vlc_wraptext( TR_VIDEO_TEXT, TEXTWIDTH, false) ) );
- wxFlexGridSizer *audio_sizer3 = new wxFlexGridSizer( 2,1,20 );
- audio_sizer3->Add( audio_text, 0, wxLEFT,5 );
+ wxU( vlc_wraptext( TR_AUDIO_TEXT, TEXTWIDTH, false) ) );
audio_sizer->Add(audio_sizer1, 0, wxEXPAND, 5);
- audio_sizer->Add(audio_sizer2, 0, wxALL, 5 );
- audio_sizer->Add(audio_sizer3, 0, wxEXPAND );
+ audio_sizer->Add( audio_text, 0, wxLEFT | wxTOP, 5 );
main_sizer->Add( video_sizer, 1, wxGROW, 0 );
main_sizer->Add( audio_sizer, 1, wxGROW, 0 );
SetSizerAndFit( main_sizer );
/* Default disabled */
- video_combo->Disable(); video_text->Disable();
- audio_combo->Disable(); audio_text->Disable();
+ video_combo->Disable(); video_text->Disable();vb_combo->Disable();
+ audio_combo->Disable(); audio_text->Disable();ab_combo->Disable();
}
void wizTranscodeCodecPage::OnEnableVideo(wxCommandEvent& event)
{
video_combo->Enable( event.IsChecked() );
+ vb_combo->Enable( event.IsChecked() );
video_text->Enable( event.IsChecked() );
}
void wizTranscodeCodecPage::OnEnableAudio(wxCommandEvent& event)
{
audio_combo->Enable( event.IsChecked() );
+ ab_combo->Enable( event.IsChecked() );
audio_text->Enable( event.IsChecked() );
}
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 )
{
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] ==
vcodecs_array[i_video_codec].muxers[i] )
{
audio_combo->GetSelection() : i_audio_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, 1000, acodec, 200 );
+ p_parent->SetTranscode( vcodec, vb , acodec, ab );
((wizEncapPage*)GetNext())->SetAction( p_parent->GetAction() );
p_parent->SetAction( p_parent->GetAction() );
mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */
- mainSizer->Add( new wxStaticText(this, -1, wxU(
- vlc_wraptext( STREAMING1_TITLE, TEXTWIDTH, false) ) ),
- 0, wxALL, 5 );
- mainSizer->Add( new wxStaticText(this, -1,
- wxU( vlc_wraptext(STREAMING1_TEXT , TEXTWIDTH, false ) ) ),
- 0, wxALL, 5 );
+ pageHeader( this, mainSizer, STREAMING1_TITLE, STREAMING1_TEXT );
+
+ mainSizer->Add( 0,0,1 );
i_method = 0;
address_sizer = new wxStaticBoxSizer(address_box,
wxVERTICAL );
+ /* Big kludge, we take the longest text to get the size */
address_text = new wxStaticText(this, -1,
- wxU( vlc_wraptext( methods_array[2].psz_address,
- TEXTWIDTH, false ) ), wxDefaultPosition,
- wxSize(200,25) );
+ wxU( vlc_wraptext(methods_array[2].psz_address,
+ TEXTWIDTH, false ) ),
+ wxDefaultPosition, wxDefaultSize );
+
address_txtctrl = new wxTextCtrl( this, -1, wxU(""), wxDefaultPosition,
wxSize(200,25));
address_sizer->Add( address_text, 0, wxALL, 5 );
address_sizer->Add( address_txtctrl, 0, wxALL, 5 );
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( address_sizer, 0, wxALL | wxEXPAND, 5 );
+
+ mainSizer->Add( 0,0,1 );
+
mainSizer->Layout();
SetSizer(mainSizer);
unsigned int i;
if( !event.GetDirection() ) return;
- /* Check valid multicast address */
+ /* Check valid address */
if( i_method == 1 && !ismult((char *) address_txtctrl->GetValue().c_str()) )
{
wxMessageBox( wxU( INVALID_MCAST_ADDRESS ) , wxU( ERROR_MSG ),
- wxICON_WARNING | wxOK, this );
+ wxICON_WARNING | wxOK, this->p_parent );
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);
for( i = 0 ; i< 9 ; i++ )
{
}
p_parent->SetStream( methods_array[i_method].psz_access ,
(char *)address_txtctrl->GetValue().c_str() );
+
+ /* Set the action for the muxer page */
+ ((wizEncapPage*)GetNext())->SetAction( p_parent->GetAction() );
return;
}
i_method = event.GetId() - MethodRadio0_Event;
address_text->SetLabel( wxU(
vlc_wraptext( _(methods_array[i_method].psz_address), TEXTWIDTH, false)));
- address_sizer->Layout();
- mainSizer->Layout();
}
/***************************************************
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */
- mainSizer->Add( new wxStaticText(this, -1, wxU(ENCAP_TITLE) ),
- 0, wxALL, 5 );
- mainSizer->Add( new wxStaticText(this, -1,
- wxU( vlc_wraptext(ENCAP_TEXT , TEXTWIDTH, false ) ) ),
- 0, wxALL, 5 );
+ pageHeader( this, mainSizer, ENCAP_TITLE, ENCAP_TEXT );
+
+ mainSizer->Add( 0,0,1 );
for( i = 0 ; i< 9 ; i++ )
{
encap_radios[i] = new wxRadioButton( this, EncapRadio0_Event + i,
wxU( encaps_array[i].psz_encap ) );
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();
}
+ mainSizer->Add( 0,0,1 );
+
SetSizer(mainSizer);
mainSizer->Fit(this);
}
wxWizardPage *wizEncapPage::GetNext() const
{
- fprintf(stderr,"Action is %i (%i %i)",i_action,ACTION_STREAM,ACTION_TRANSCODE);
if( i_action== ACTION_STREAM )
return p_streaming_page;
else
return p_transcode_page;
}
-
void wizEncapPage::SetAction( int i_act ) { i_action = i_act; }
void wizEncapPage::SetPrev( wxWizardPage *page) { p_prev = page; }
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* 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 );
- mainSizer->Add( new wxStaticText(this, -1,
- wxU( vlc_wraptext( EXTRATRANSCODE_TEXT , TEXTWIDTH,
- false ) ) ), 0, wxALL, 5 );
- mainSizer->Add( new wxButton( this, Open_Event, wxU("Open") ) );
+
+ mainSizer->Add( new wxButton( this, Open_Event, wxU("Choose") ) );
SetSizer(mainSizer);
mainSizer->Fit(this);
}
wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL);
/* Create the texts */
- mainSizer->Add( new wxStaticText(this, -1, wxU( EXTRASTREAMING_TITLE )),
- 0, wxALL, 5 );
- mainSizer->Add( new wxStaticText(this, -1,
- wxU( vlc_wraptext(EXTRASTREAMING_TEXT , TEXTWIDTH,
- false ) ) ), 0, wxALL, 5 );
+ pageHeader( this, mainSizer, EXTRASTREAMING_TITLE, EXTRASTREAMING_TEXT );
+
SetSizer(mainSizer);
mainSizer->Fit(this);
}
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_to = i_to;
}