Commit cb55dfe4 authored by Gildas Bazin's avatar Gildas Bazin

* src/playlist/*: fixed complete fuckage of playlist_ItemAddOption() and moved it to item.c.
* modules/gui/wxwindows/open.cpp: cleanup.
parent caf2925c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* open.cpp : wxWindows plugin for vlc * open.cpp : wxWindows plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2004 VideoLAN * Copyright (C) 2000-2004 VideoLAN
* $Id: open.cpp,v 1.67 2004/01/29 17:51:08 zorglub Exp $ * $Id: open.cpp,v 1.68 2004/02/08 18:17:22 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -889,23 +889,17 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -889,23 +889,17 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
for( int i = 0; i < (int)mrl.GetCount(); i++ ) for( int i = 0; i < (int)mrl.GetCount(); i++ )
{ {
int i_options = 0; vlc_bool_t b_start = !i && i_open_arg;
playlist_item_t *p_item = playlist_item_t *p_item =
playlist_ItemNew( p_intf, playlist_ItemNew( p_intf, (const char*)mrl[i].mb_str(),
(const char*)mrl[i].mb_str(), (const char *)mrl[i].mb_str() );
(const char *)mrl[i].mb_str() );
/* Count the input options */
while( i + i_options + 1 < (int)mrl.GetCount() &&
((const char *)mrl[i + i_options + 1].mb_str())[0] == ':' )
{
i_options++;
}
/* Insert options */ /* Insert options */
for( int j = 0; j < i_options; j++ ) while( i + 1 < (int)mrl.GetCount() &&
((const char *)mrl[i + 1].mb_str())[0] == ':' )
{ {
playlist_ItemAddOption( p_item, mrl[i + j + 1].mb_str() ); playlist_ItemAddOption( p_item, mrl[i + 1].mb_str() );
i++;
} }
/* Get the options from the subtitles dialog */ /* Get the options from the subtitles dialog */
...@@ -926,15 +920,14 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) ) ...@@ -926,15 +920,14 @@ void OpenDialog::OnOk( wxCommandEvent& WXUNUSED(event) )
} }
} }
int i_id = playlist_AddItem( p_playlist, p_item, int i_id = playlist_AddItem( p_playlist, p_item,
PLAYLIST_APPEND, PLAYLIST_END ); PLAYLIST_APPEND, PLAYLIST_END );
if( !i && i_open_arg ) if( b_start )
{ {
int i_pos = playlist_GetPositionById( p_playlist , i_id ); int i_pos = playlist_GetPositionById( p_playlist , i_id );
playlist_Command( p_playlist, PLAYLIST_GOTO, i_pos ); playlist_Command( p_playlist, PLAYLIST_GOTO, i_pos );
} }
i += i_options;
} }
//TogglePlayButton( PLAYING_S ); //TogglePlayButton( PLAYING_S );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* info.c : Playlist info management * info.c : Playlist info management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2004 VideoLAN * Copyright (C) 1999-2004 VideoLAN
* $Id: info.c,v 1.8 2004/01/29 17:51:08 zorglub Exp $ * $Id: info.c,v 1.9 2004/02/08 18:17:22 gbazin Exp $
* *
* Authors: Clment Stenac <zorglub@videolan.org> * Authors: Clment Stenac <zorglub@videolan.org>
* *
...@@ -361,21 +361,3 @@ int playlist_AddOption( playlist_t *p_playlist, int i_pos, ...@@ -361,21 +361,3 @@ int playlist_AddOption( playlist_t *p_playlist, int i_pos,
return VLC_SUCCESS; return VLC_SUCCESS;
} }
/**
* Add a option to one item ( no need for p_playlist )
*
* \param p_item the item on which we want the info
* \param psz_format the option
* \return 0 on success
*/
int playlist_ItemAddOption( playlist_item_t *p_item,
const char *psz_option )
{
INSERT_ELEM( p_item->ppsz_options,
p_item->i_options,
p_item->i_options,
(char *)psz_option);
return VLC_SUCCESS;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* item.c : Playlist item functions * item.c : Playlist item functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2004 VideoLAN * Copyright (C) 1999-2004 VideoLAN
* $Id: item.c,v 1.13 2004/01/29 17:51:08 zorglub Exp $ * $Id: item.c,v 1.14 2004/02/08 18:17:22 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -165,3 +165,21 @@ int playlist_AddItem( playlist_t *p_playlist, playlist_item_t * p_item, ...@@ -165,3 +165,21 @@ int playlist_AddItem( playlist_t *p_playlist, playlist_item_t * p_item,
return p_item->i_id; return p_item->i_id;
} }
/**
* Add a option to one item ( no need for p_playlist )
*
* \param p_item the item on which we want the info
* \param psz_format the option
* \return 0 on success
*/
int playlist_ItemAddOption( playlist_item_t *p_item,
const char *psz_option )
{
if( !psz_option ) return VLC_EGENERIC;
INSERT_ELEM( p_item->ppsz_options, p_item->i_options, p_item->i_options,
strdup( psz_option ) );
return VLC_SUCCESS;
}
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