[vlc-devel] commit: Add tree-view for SD only (Geoffroy Couprie )
git version control
git at videolan.org
Sat Aug 23 00:18:19 CEST 2008
vlc | branch: master | Geoffroy Couprie <geo.couprie at gmail.com> | Fri Aug 22 15:12:35 2008 +0200| [6baf831c58de58106c0f3ca82211235922948c8a] | committer: Jean-Baptiste Kempf
Add tree-view for SD only
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6baf831c58de58106c0f3ca82211235922948c8a
---
include/vlc_input.h | 1 +
src/input/item.c | 1 +
src/playlist/services_discovery.c | 3 +++
src/playlist/tree.c | 4 ++--
4 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/vlc_input.h b/include/vlc_input.h
index d3d672b..f97d196 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -73,6 +73,7 @@ struct input_item_t
mtime_t i_duration; /**< Duration in milliseconds*/
uint8_t i_type; /**< Type (file, disc, ...) */
+ bool b_prefers_tree; /**< Do we prefer being displayed as tree*/
int i_categories; /**< Number of info categories */
info_category_t **pp_categories; /**< Pointer to the first info category */
diff --git a/src/input/item.c b/src/input/item.c
index d5c154e..91d30de 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -543,6 +543,7 @@ input_item_t *input_item_NewWithType( vlc_object_t *p_obj, const char *psz_uri,
p_input->psz_uri = NULL;
p_input->i_type = i_type;
+ p_input->b_prefers_tree = false;
if( p_input->i_type == ITEM_TYPE_UNKNOWN )
GuessType( p_input );
diff --git a/src/playlist/services_discovery.c b/src/playlist/services_discovery.c
index 1f2d9bf..13b01bb 100644
--- a/src/playlist/services_discovery.c
+++ b/src/playlist/services_discovery.c
@@ -355,6 +355,9 @@ int playlist_ServicesDiscoveryAdd( playlist_t *p_playlist, const char *psz_modu
p_sds = malloc( sizeof(struct playlist_services_discovery_support_t) );
if( !p_sds )
return VLC_ENOMEM;
+
+ /* We want tree-view for service directory */
+ p_one->p_input->b_prefers_tree = true;
p_sds->p_sd = p_sd;
p_sds->p_one = p_one;
p_sds->p_cat = p_cat;
diff --git a/src/playlist/tree.c b/src/playlist/tree.c
index 1a8d0cc..4f7f7f2 100644
--- a/src/playlist/tree.c
+++ b/src/playlist/tree.c
@@ -336,7 +336,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
int i;
if( p_node->p_parent == p_playlist->p_root_category )
{
- if( p_playlist->b_tree )
+ if( p_playlist->b_tree || p_node->p_input->b_prefers_tree )
return p_node;
for( i = 0 ; i< p_playlist->p_root_onelevel->i_children; i++ )
{
@@ -347,7 +347,7 @@ playlist_item_t * playlist_GetPreferredNode( playlist_t *p_playlist,
}
else if( p_node->p_parent == p_playlist->p_root_onelevel )
{
- if( !p_playlist->b_tree )
+ if( !p_playlist->b_tree || !p_node->p_input->b_prefers_tree )
return p_node;
for( i = 0 ; i< p_playlist->p_root_category->i_children; i++ )
{
More information about the vlc-devel
mailing list