* open.cpp : wxWindows plugin for vlc
*****************************************************************************
* 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>
*
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_ItemNew( p_intf,
- (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++;
- }
+ playlist_ItemNew( p_intf, (const char*)mrl[i].mb_str(),
+ (const char *)mrl[i].mb_str() );
/* 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 */
}
}
- int i_id = playlist_AddItem( p_playlist, p_item,
- PLAYLIST_APPEND, PLAYLIST_END );
+ int i_id = playlist_AddItem( p_playlist, p_item,
+ PLAYLIST_APPEND, PLAYLIST_END );
- if( !i && i_open_arg )
+ if( b_start )
{
int i_pos = playlist_GetPositionById( p_playlist , i_id );
playlist_Command( p_playlist, PLAYLIST_GOTO, i_pos );
}
- i += i_options;
}
//TogglePlayButton( PLAYING_S );
* info.c : Playlist info management
*****************************************************************************
* 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: Clément Stenac <zorglub@videolan.org>
*
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;
-}
* item.c : Playlist item functions
*****************************************************************************
* 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>
*
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;
+}