Changeset 722ab9f14ee31f8f0633cfc7a0b79401c47316fe
- Timestamp:
- 22/04/08 19:51:49
(6 months ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1208886709 +0200
- git-parent:
[1f26dd3fc7a3a285a00e5e84db113ae4b496da5b]
- git-author:
- Rafaël Carré <funman@videolan.org> 1208886693 +0200
- Message:
playlist-tree has only 2 meaningful values now
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r04cfbc3 |
r722ab9f |
|
| 190 | 190 | playlist_item_t * p_ml_onelevel; /** < "Library" in ONELEVEL view */ |
|---|
| 191 | 191 | |
|---|
| 192 | | bool b_always_tree;/**< Always display as tree */ |
|---|
| 193 | | bool b_never_tree;/**< Never display as tree */ |
|---|
| | 192 | bool b_tree; /**< Display as a tree */ |
|---|
| 194 | 193 | |
|---|
| 195 | 194 | bool b_doing_ml; /**< Doing media library stuff, |
|---|
| rf94a2f9 |
r722ab9f |
|
| 1122 | 1122 | "start VLC." ) |
|---|
| 1123 | 1123 | |
|---|
| 1124 | | #define PLTREE_TEXT N_("Use playlist tree") |
|---|
| | 1124 | #define PLTREE_TEXT N_("Display playlist tree") |
|---|
| 1125 | 1125 | #define PLTREE_LONGTEXT N_( \ |
|---|
| 1126 | 1126 | "The playlist can use a tree to categorize some items, like the " \ |
|---|
| 1127 | | "contents of a directory. \"Default\" means that the tree will only " \ |
|---|
| 1128 | | "be used when really needed." ) |
|---|
| 1129 | | static int pi_pltree_values[] = { 0, 1, 2 }; |
|---|
| 1130 | | static const char *ppsz_pltree_descriptions[] = { N_("Default"), N_("Always"), N_("Never") }; |
|---|
| 1131 | | |
|---|
| | 1127 | "contents of a directory." ) |
|---|
| 1132 | 1128 | |
|---|
| 1133 | 1129 | |
|---|
| … | … | |
| 1869 | 1865 | add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, false ); |
|---|
| 1870 | 1866 | add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, false ); |
|---|
| 1871 | | add_integer( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, |
|---|
| 1872 | | true ); |
|---|
| 1873 | | change_integer_list( pi_pltree_values, ppsz_pltree_descriptions, 0 ); |
|---|
| | 1867 | add_bool( "playlist-tree", 0, NULL, PLTREE_TEXT, PLTREE_LONGTEXT, false ); |
|---|
| 1874 | 1868 | |
|---|
| 1875 | 1869 | add_string( "open", "", NULL, OPEN_TEXT, OPEN_LONGTEXT, false ); |
|---|
| r449fd28 |
r722ab9f |
|
| 63 | 63 | playlist_t *p_playlist; |
|---|
| 64 | 64 | bool b_save; |
|---|
| 65 | | int i_tree; |
|---|
| 66 | 65 | |
|---|
| 67 | 66 | /* Allocate structure */ |
|---|
| … | … | |
| 96 | 95 | p_playlist->last_rebuild_date = 0; |
|---|
| 97 | 96 | |
|---|
| 98 | | i_tree = var_CreateGetBool( p_playlist, "playlist-tree" ); |
|---|
| 99 | | p_playlist->b_always_tree = (i_tree == 1); |
|---|
| 100 | | p_playlist->b_never_tree = (i_tree == 2); |
|---|
| | 97 | p_playlist->b_tree = var_CreateGetBool( p_playlist, "playlist-tree" ); |
|---|
| 101 | 98 | |
|---|
| 102 | 99 | p_playlist->b_doing_ml = false; |
|---|
| r1f26dd3 |
r722ab9f |
|
| 320 | 320 | * Get the node in the preferred tree from a node in one of category |
|---|
| 321 | 321 | * or onelevel tree. |
|---|
| 322 | | * For example, for the SAP node, it will return the node in the category |
|---|
| 323 | | * tree if --playlist-tree is not set to never, because the SAP node prefers |
|---|
| 324 | | * category |
|---|
| 325 | 322 | */ |
|---|
| 326 | 323 | playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist, |
|---|
| … | … | |
| 330 | 327 | if( p_node->p_parent == p_playlist->p_root_category ) |
|---|
| 331 | 328 | { |
|---|
| 332 | | if( p_playlist->b_always_tree ) |
|---|
| | 329 | if( p_playlist->b_tree ) |
|---|
| 333 | 330 | return p_node; |
|---|
| 334 | 331 | for( i = 0 ; i< p_playlist->p_root_onelevel->i_children; i++ ) |
|---|
| … | … | |
| 341 | 338 | else if( p_node->p_parent == p_playlist->p_root_onelevel ) |
|---|
| 342 | 339 | { |
|---|
| 343 | | if( p_playlist->b_never_tree ) |
|---|
| | 340 | if( !p_playlist->b_tree ) |
|---|
| 344 | 341 | return p_node; |
|---|
| 345 | 342 | for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ ) |
|---|