intf_thread_t *_p_intf,
const module_t *p_module )
: wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize ),
- name( wxU(p_module->psz_object_name) ),
+ name( wxU(module_GetObjName(p_module)) ),
p_advanced_mrl_combo( NULL ),
p_intf( _p_intf ), p_open_dialog( dialog ), p_advanced_dialog( NULL )
{
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
- module_config_t *p_item = p_module->p_config,
- *p_end = p_item + p_module->confsize;
bool b_advanced = false;
+ unsigned int i_confsize;
+ module_config_t *p_config;
+ int n;
- if( p_item ) do
+ p_config = module_GetConfig (p_module, &i_confsize);
+ for( n = 0; n < i_confsize; n++ )
{
+ module_config_t *p_item = p_config + n;
if( !(p_item->i_type & CONFIG_HINT) && p_item->b_advanced )
b_advanced = true;
sizer->Add( control, 0, wxEXPAND | wxALL, 2 );
}
- while( p_item < p_end && p_item++ );
if( b_advanced )
{
/* Build the advanced dialog */
p_advanced_dialog =
new wxDialog( this, -1, ((wxString)wxU(_("Advanced options"))) +
- wxT(" (") + wxU( p_module->psz_longname ) + wxT(")"),
- wxDefaultPosition, wxDefaultSize,
+ wxT(" (") + wxU( module_GetLongName(p_module) ) +
+ wxT(")"), wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
sizer->Add( mrl_sizer_sizer, 0, wxEXPAND | wxALL, 2 );
/* Add advanced options to panel */
- module_config_t *p_item = p_module->p_config;
- if( p_item ) do
+ for( n = 0; n < i_confsize; n++ )
{
+ module_config_t *p_item = p_config + n;
if( p_item->i_type & CONFIG_HINT || !p_item->b_advanced )
continue;
sizer->Add( control, 0, wxEXPAND | wxALL, 2 );
}
- while( p_item < p_end && p_item++ );
/* Separation */
wxPanel *dummy_panel = new wxPanel( p_advanced_dialog, -1 );
p_advanced_dialog->SetSizerAndFit( sizer );
}
+ module_PutConfig (p_config);
+
this->SetSizerAndFit( sizer );
}
sout_button->Enable();
subsfile_mrl.Add( wxString(wxT("sout=")) + wxL2U(psz_sout) );
}
- if( psz_sout ) free( psz_sout );
+ free( psz_sout );
common_opt_sizer->Add( sout_button, 1, wxALIGN_LEFT |
wxALIGN_CENTER_VERTICAL );
notebook->AddPage( NetPanel( notebook ), wxU(_("Network")),
i_access_method == NET_ACCESS );
- module_t *p_module = config_FindModule( VLC_OBJECT(p_intf), "v4l" );
+ module_t *p_module = module_Find( VLC_OBJECT(p_intf), "v4l" );
if( p_module )
{
AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel );
- notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
- p_module->psz_shortname : p_module->psz_object_name ),
+ notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
+ module_Put( p_module );
}
- p_module = config_FindModule( VLC_OBJECT(p_intf), "pvr" );
+ p_module = module_Find( VLC_OBJECT(p_intf), "pvr" );
if( p_module )
{
AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel );
- notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
- p_module->psz_shortname : p_module->psz_object_name ),
+ notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
+ module_Put( p_module );
}
- p_module = config_FindModule( VLC_OBJECT(p_intf), "dvb" );
+ p_module = module_Find( VLC_OBJECT(p_intf), "dvb" );
if( p_module )
{
AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel );
- notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
- p_module->psz_shortname : p_module->psz_object_name ),
+ notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
+ module_Put( p_module );
}
- p_module = config_FindModule( VLC_OBJECT(p_intf), "dshow" );
+ p_module = module_Find( VLC_OBJECT(p_intf), "dshow" );
if( p_module )
{
AutoBuiltPanel *autopanel =
new AutoBuiltPanel( notebook, this, p_intf, p_module );
input_tab_array.Add( autopanel );
- notebook->AddPage( autopanel, wxU( p_module->psz_shortname ?
- p_module->psz_shortname : p_module->psz_object_name ),
+ notebook->AddPage( autopanel, wxU( module_GetName(p_module, 0) ),
i_access_method == CAPTURE_ACCESS );
+ module_Put( p_module );
}
/* Update Disc panel */
OpenDialog::~OpenDialog()
{
/* Clean up */
- if( file_dialog ) delete file_dialog;
- if( sout_dialog ) delete sout_dialog;
- if( subsfile_dialog ) delete subsfile_dialog;
+ delete file_dialog;
+ delete sout_dialog;
+ delete subsfile_dialog;
}
int OpenDialog::Show( int i_access_method, int i_arg )
0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
subfile_combo = new wxComboBox( panel, SubFileName_Event,
wxL2U( psz_subsfile ) );
- if( psz_subsfile ) free( psz_subsfile );
+ free( psz_subsfile );
subbrowse_button = new wxButton( panel, SubFileBrowse_Event,
wxU(_("Browse...")) );
subfile_sizer->Add( subfile_combo, 1, wxALL | wxALIGN_CENTER_VERTICAL, 5 );
}
/* Update the playlist */
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
for( int i = 0; i < (int)mrl.GetCount(); i++ )
{
- vlc_bool_t b_start = !i && i_open_arg;
+ bool b_start = !i && i_open_arg;
input_item_t *p_input;
char *psz_utf8;
}
}
- if( b_start )
- {
- playlist_AddInput( p_playlist, p_input,
- PLAYLIST_APPEND | PLAYLIST_GO,
- PLAYLIST_END, VLC_TRUE, VLC_FALSE );
- }
- else
- {
- playlist_AddInput( p_playlist, p_input,
- PLAYLIST_APPEND|PLAYLIST_PREPARSE,
- PLAYLIST_END, VLC_TRUE, VLC_FALSE );
- }
+ /* FIXME: playlist_AddInput() can fail */
+ playlist_AddInput( p_playlist, p_input,
+ PLAYLIST_APPEND | ( b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE ),
+ PLAYLIST_END, true, pl_Unlocked );
+ vlc_gc_decref( p_input );
}
-
- vlc_object_release( p_playlist );
+ pl_Release( p_intf );
Hide();
break;
}
- free(psz_device);
+ free( psz_device );
disc_probe->SetValue(FALSE);
UpdateMRL( DISC_ACCESS );
disc_audio->SetRange( 0, 7 ); // up to 8 audio channels
disc_chapter->SetRange( 0, 255 );
disc_title->SetToolTip( wxU(_("Title number.")) );
- // \bug [string] needs to be DVDs instead of DVD's
disc_sub->SetToolTip( wxU(_(
- "DVD's can have up to 32 subtitles numbered 0..31. "
+ "DVDs can have up to 32 subtitles numbered 0..31. "
"Note this is not the same thing as a subtitle name (e.g. 'en'). "
"If a value -1 is used, no subtitle will be shown." )) );
- // \bug [string] needs to be DVDs instead of DVD's
disc_audio->SetToolTip( wxU(_("Audio track number. "
- "DVD's can have up to 8 audio tracks numbered 0..7."
+ "DVDs can have up to 8 audio tracks numbered 0..7."
)) );
break;
disc_title->SetRange( 0, 99 ); // only 100 tracks allowed on VCDs
disc_sub->SetRange( -1, 3 ); // up to 4 subtitles -1 = no subtitle
disc_audio->SetRange( 0, 1 ); // up to 2 audio tracks
- // \bug [string] needs to be SVCDs instead of SVCD's
disc_sub->SetToolTip( wxU(_(
- "SVCD's can have up to 4 subtitles numbered 0..3. "
+ "SVCDs can have up to 4 subtitles numbered 0..3. "
"If a value -1 is used, no subtitle will be shown." )) );
- // \bug [string] needs to be SVCDs instead of SVCD's
disc_audio->SetToolTip( wxU(_("Audio track number. "
- "VCD's can have up to 2 audio tracks numbered 0 or 1. "
+ "VCDs can have up to 2 audio tracks numbered 0 or 1. "
)) );
break;
disc_title->SetValue( 0 ); i_disc_title = 0;
disc_chapter->SetValue( 0 ); i_disc_chapter = 0;
- if( psz_device ) free( psz_device );
+ free( psz_device );
UpdateMRL( DISC_ACCESS );
}
*****************************************************************************/
wxArrayString SeparateEntries( wxString entries )
{
- vlc_bool_t b_quotes_mode = VLC_FALSE;
+ bool b_quotes_mode = false;
wxArrayString entries_array;
wxString entry;
{
/* Enters quotes mode */
entry.RemoveLast();
- b_quotes_mode = VLC_TRUE;
+ b_quotes_mode = true;
}
else if( b_quotes_mode && entry.Last() == wxT('\"') )
{
/* Finished the quotes mode */
entry.RemoveLast();
- b_quotes_mode = VLC_FALSE;
+ b_quotes_mode = false;
}
else if( !b_quotes_mode && entry.Last() != wxT('\"') )
{