Urgency: Normal
Description: Make input plugins dynamically loadable
With a probe() function, and stuff...
-Status: Todo
+Status: Done 7 Feb 2001 (sam)
Task: 0x45
Difficulty: Guru
displaying and sound playback, but the streams continues to
be decoded. One will have to do a file implementation as
well as a network implementation.
-Status: Todo
+Status: Done 8 Feb 2001 (Meuuh)
Task: 0x20
Difficulty: Hard
Difficulty: Easy
Urgency: Normal
Description: Make interface more responsive
-Status: Todo
When in "waiting for stream" mode, the interface is refreshed
every 5 seconds. This is too long, and can be confusing for
the user. Make it refresh at least after a keyboard/mouse event.
one after the other. We need a smarter way to handle this,
through AddFile(), MoveFile(), etc. functions. input_file
has to be modified to support this as well.
-Status: Todo
+Status: Done 8 Feb 2001 (sam)
Task: 0x02
Difficulty: Medium
the "waiting for stream" message.
Status: Todo
-
-
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
+/*****************************************************************************
+ * playlist_item_t: playlist item
+ *****************************************************************************/
typedef struct playlist_item_s
{
char* psz_name;
int i_status; /* unused yet */
} playlist_item_t;
+/*****************************************************************************
+ * playlist_t: playlist structure
+ *****************************************************************************
+ * The structure contains information about the size and browsing mode of
+ * the playlist, a change lock, a dynamic array of playlist items, and a
+ * current item which is an exact copy of one of the array members.
+ *****************************************************************************/
typedef struct playlist_s
{
int i_index; /* current index */
playlist_item_t* p_item;
} playlist_t;
-/* Used by playlist_Add */
+/* Used by intf_PlstAdd */
#define PLAYLIST_START 0
#define PLAYLIST_END -1
#define PLAYLIST_RANDOM 3 /* Shuffle play */
#define PLAYLIST_REVERSE_RANDOM -3 /* Reverse shuffle play */
-playlist_t * playlist_Create ( void );
-void playlist_Init ( playlist_t * p_playlist );
-int playlist_Add ( playlist_t * p_playlist,
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+playlist_t * intf_PlstCreate ( void );
+void intf_PlstInit ( playlist_t * p_playlist );
+int intf_PlstAdd ( playlist_t * p_playlist,
int i_pos, char * psz_item );
-void playlist_Next ( playlist_t * p_playlist );
-void playlist_Prev ( playlist_t * p_playlist );
-void playlist_Destroy ( playlist_t * p_playlist );
+void intf_PlstNext ( playlist_t * p_playlist );
+void intf_PlstPrev ( playlist_t * p_playlist );
+void intf_PlstDestroy ( playlist_t * p_playlist );
#include "main.h"
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
static void NextItem( playlist_t * p_playlist );
-playlist_t * playlist_Create ( void )
+/*****************************************************************************
+ * intf_PlstCreate: create playlist
+ *****************************************************************************
+ * Create a playlist structure.
+ *****************************************************************************/
+playlist_t * intf_PlstCreate ( void )
{
playlist_t *p_playlist;
return( p_playlist );
}
-void playlist_Init ( playlist_t * p_playlist )
+/*****************************************************************************
+ * intf_PlstInit: initialize playlist
+ *****************************************************************************
+ * Initialize a playlist structure.
+ *****************************************************************************/
+void intf_PlstInit ( playlist_t * p_playlist )
{
vlc_mutex_init( &p_playlist->change_lock );
- p_playlist->i_index = -1; /* -1 means we are not playing anything yet */
+ p_playlist->i_index = -1; /* -1 means we are not playing anything yet */
p_playlist->i_size = 0;
p_playlist->i_mode = PLAYLIST_FORWARD;
intf_Msg("intf: playlist initialized");
}
-int playlist_Add( playlist_t * p_playlist, int i_pos, char * psz_item )
+/*****************************************************************************
+ * intf_PlstAdd: add an item to the playlist
+ *****************************************************************************
+ * Add an item to the playlist at position i_pos. If i_pos is PLAYLIST_END,
+ * add it at the end regardless of the playlist current size.
+ *****************************************************************************/
+int intf_PlstAdd( playlist_t * p_playlist, int i_pos, char * psz_item )
{
int i_index;
playlist_item_t * p_item;
return( 0 );
}
-void playlist_Next( playlist_t * p_playlist )
+/*****************************************************************************
+ * intf_PlstNext: switch to next playlist item
+ *****************************************************************************
+ * Switch to the next item of the playlist. If there is no next item, the
+ * position of the resulting item is set to -1.
+ *****************************************************************************/
+void intf_PlstNext( playlist_t * p_playlist )
{
vlc_mutex_lock( &p_playlist->change_lock );
vlc_mutex_unlock( &p_playlist->change_lock );
}
-void playlist_Prev( playlist_t * p_playlist )
+/*****************************************************************************
+ * intf_PlstPrev: switch to previous playlist item
+ *****************************************************************************
+ * Switch to the previous item of the playlist. If there is no previous
+ * item, the position of the resulting item is set to -1.
+ *****************************************************************************/
+void intf_PlstPrev( playlist_t * p_playlist )
{
vlc_mutex_lock( &p_playlist->change_lock );
p_playlist->i_mode = -p_playlist->i_mode;
vlc_mutex_unlock( &p_playlist->change_lock );
}
-int playlist_Delete( playlist_t * p_playlist, int i_pos )
+/*****************************************************************************
+ * intf_PlstDelete: delete an item from the playlist
+ *****************************************************************************
+ * Delete the item in the playlist with position i_pos.
+ *****************************************************************************/
+int intf_PlstDelete( playlist_t * p_playlist, int i_pos )
{
int i_index;
char * psz_name;
return( 0 );
}
-void playlist_Destroy( playlist_t * p_playlist )
+/*****************************************************************************
+ * intf_PlstDestroy: destroy the playlist
+ *****************************************************************************
+ * Delete all items in the playlist and free the playlist structure.
+ *****************************************************************************/
+void intf_PlstDestroy( playlist_t * p_playlist )
{
int i_index;
for( i_index = p_playlist->i_size - 1; p_playlist->i_size; i_index-- )
{
- playlist_Delete( p_playlist, i_index );
+ intf_PlstDelete( p_playlist, i_index );
}
vlc_mutex_destroy( &p_playlist->change_lock );
intf_Msg("intf: playlist destroyed");
}
+/*****************************************************************************
+ * Following functions are local
+ *****************************************************************************/
+
+/*****************************************************************************
+ * NextItem: select next playlist item
+ *****************************************************************************
+ * This function copies the next playlist item to the current structure,
+ * depending on the playlist browsing mode.
+ *****************************************************************************/
static void NextItem( playlist_t * p_playlist )
{
if( !p_playlist->i_size )
/*
* Initialize playlist and get commandline files
*/
- p_main->p_playlist = playlist_Create( );
+ p_main->p_playlist = intf_PlstCreate( );
if( !p_main->p_playlist )
{
intf_ErrMsg( "playlist error: playlist initialization failed" );
intf_MsgDestroy();
return( errno );
}
- playlist_Init( p_main->p_playlist );
+ intf_PlstInit( p_main->p_playlist );
/*
* Read configuration
if( !p_main->p_bank )
{
intf_ErrMsg( "plugin error: plugin bank initialization failed" );
- playlist_Destroy( p_main->p_playlist );
+ intf_PlstDestroy( p_main->p_playlist );
intf_MsgDestroy();
return( errno );
}
{
intf_ErrMsg( "module error: module bank initialization failed" );
bank_Destroy( p_main->p_bank );
- playlist_Destroy( p_main->p_playlist );
+ intf_PlstDestroy( p_main->p_playlist );
intf_MsgDestroy();
return( errno );
}
/*
* Free playlist
*/
- playlist_Destroy( p_main->p_playlist );
+ intf_PlstDestroy( p_main->p_playlist );
#ifdef SYS_BEOS
/*
/* We assume that the remaining parameters are filenames */
for( i_opt = optind; i_opt < i_argc; i_opt++ )
{
- playlist_Add( p_main->p_playlist, PLAYLIST_END, ppsz_argv[ i_opt ] );
+ intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, ppsz_argv[ i_opt ] );
}
return( 0 );