]> git.sesse.net Git - vlc/commitdiff
* backport of [11467] and [11479]
authorDerk-Jan Hartman <hartman@videolan.org>
Mon, 20 Jun 2005 23:34:38 +0000 (23:34 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Mon, 20 Jun 2005 23:34:38 +0000 (23:34 +0000)
modules/gui/macosx/playlist.m
modules/misc/dummy/dummy.c

index 8674a4300346fc923503a81dd4ebf98c649a0c2a..db9ce190a38c9689c846510178844694e87fa6d8 100644 (file)
@@ -1069,7 +1069,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
         playlist_view_t *p_view;
         p_view = playlist_ViewFind( p_playlist, i_current_view );
         if( p_view && p_view->p_root )
+        {
             i_return = p_view->p_root->i_children;
+            if( i_current_view == VIEW_CATEGORY )
+            {
+                i_return--; /* remove the GENERAL item from the list */
+                i_return += p_playlist->p_general->i_children; /* add the items of the general node */
+            }
+        }
     }
     else
     {
@@ -1101,8 +1108,20 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
         /* root object */
         playlist_view_t *p_view;
         p_view = playlist_ViewFind( p_playlist, i_current_view );
-        if( p_view && index < p_view->p_root->i_children && index >= 0 )
-            p_return = p_view->p_root->pp_children[index];
+        if( p_view && p_view->p_root ) p_return = p_view->p_root->pp_children[index];
+        
+        if( i_current_view == VIEW_CATEGORY )
+        {
+            if( p_playlist->p_general->i_children && index >= 0 && index < p_playlist->p_general->i_children )
+            {
+                p_return = p_playlist->p_general->pp_children[index];
+            }
+            else if( p_view && p_view->p_root && index >= 0 && index - p_playlist->p_general->i_children < p_view->p_root->i_children )
+            {
+                p_return = p_view->p_root->pp_children[index - p_playlist->p_general->i_children + 1];
+                
+            }
+        }
     }
     else
     {
@@ -1152,8 +1171,13 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
         /* root object */
         playlist_view_t *p_view;
         p_view = playlist_ViewFind( p_playlist, i_current_view );
-        if( p_view && p_view->p_root )
-            i_return = p_view->p_root->i_children;
+        if( p_view && p_view->p_root ) i_return = p_view->p_root->i_children;
+        
+        if( i_current_view == VIEW_CATEGORY )
+        {
+            i_return--;
+            i_return += p_playlist->p_general->i_children;
+        }
     }
     else
     {
index eeb231b91384ab8f479d2d42124a086a59f1ed07..70ef803bba62234ecba87c85817108d1c1910a10 100644 (file)
@@ -80,7 +80,7 @@ vlc_module_begin();
         set_description( _("Dummy decoder function") );
         set_capability( "decoder", 0 );
         set_callbacks( E_(OpenDecoder), E_(CloseDecoder) );
-        add_bool( "dummy-save-es", 0, NULL, SAVE_TEXT, SAVE_LONGTEXT, VLC_FALSE );
+        add_bool( "dummy-save-es", 0, NULL, SAVE_TEXT, SAVE_LONGTEXT, VLC_TRUE );
     add_submodule();
         set_description( _("Dummy encoder function") );
         set_capability( "encoder", 0 );
@@ -95,7 +95,7 @@ vlc_module_begin();
         set_capability( "video output", 1 );
         set_callbacks( E_(OpenVideo), NULL );
         add_category_hint( N_("Video"), NULL, VLC_FALSE );
-        add_string( "dummy-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, VLC_FALSE );
+        add_string( "dummy-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, VLC_TRUE );
     add_submodule();
         set_description( _("Dummy font renderer function") );
         set_capability( "text renderer", 1 );