playlist_item_t * p_local_onelevel; /** < "Playlist" in ONELEVEL view */
playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL view */
- bool b_always_tree;/**< Always display as tree */
- bool b_never_tree;/**< Never display as tree */
+ bool b_tree; /**< Display as a tree */
bool b_doing_ml; /**< Doing media library stuff,
* get quicker */
"The media library is automatically saved and reloaded each time you " \
"start VLC." )
-#define PLTREE_TEXT N_("Use playlist tree")
+#define PLTREE_TEXT N_("Display playlist tree")
#define PLTREE_LONGTEXT N_( \
"The playlist can use a tree to categorize some items, like the " \
- "contents of a directory. \"Default\" means that the tree will only " \
- "be used when really needed." )
-static int pi_pltree_values[] = { 0, 1, 2 };
-static const char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N_("Never") };
-
+ "contents of a directory." )
/*****************************************************************************
add_bool( "play-and-exit", 0, NULL, PAE_TEXT, PAE_LONGTEXT, false );
add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, false );
add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false );
- add_integer( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT,
- true );
- change_integer_list( pi_pltree_values, ppsz_pltree_descriptions, 0 );
+ add_bool( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, false );
add_string( "open", "", NULL, OPEN_TEXT, OPEN_LONGTEXT, false );
change_need_restart();
static const char playlist_name[] = "playlist";
playlist_t *p_playlist;
bool b_save;
- int i_tree;
/* Allocate structure */
p_playlist = vlc_custom_create( p_parent, sizeof( *p_playlist ),
p_playlist->b_reset_currently_playing = true;
p_playlist->last_rebuild_date = 0;
- i_tree = var_CreateGetBool( p_playlist, "playlist-tree" );
- p_playlist->b_always_tree = (i_tree == 1);
- p_playlist->b_never_tree = (i_tree == 2);
+ p_playlist->b_tree = var_CreateGetBool( p_playlist, "playlist-tree" );
p_playlist->b_doing_ml = false;
/**
* Get the node in the preferred tree from a node in one of category
* or onelevel tree.
- * For example, for the SAP node, it will return the node in the category
- * tree if --playlist-tree is not set to never, because the SAP node prefers
- * category
*/
playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
playlist_item_t *p_node )
int i;
if( p_node->p_parent == p_playlist->p_root_category )
{
- if( p_playlist->b_always_tree )
+ if( p_playlist->b_tree )
return p_node;
for( i = 0 ; i< p_playlist->p_root_onelevel->i_children; i++ )
{
}
else if( p_node->p_parent == p_playlist->p_root_onelevel )
{
- if( p_playlist->b_never_tree )
+ if( !p_playlist->b_tree )
return p_node;
for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ )
{