]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/menus.cpp
s/pl_Yield/pl_Hold/
[vlc] / modules / gui / wince / menus.cpp
index f9a9b5b4790a01041acba04b0f776dc17963f9d0..644d8c0b284d354950970c1de88b1b9dd3b75b9d 100644 (file)
@@ -29,8 +29,9 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_interface.h>
+#include <vlc_playlist.h>
 
 #include "wince.h"
 
@@ -221,15 +222,13 @@ void PopupMenu( intf_thread_t *p_intf, HWND p_parent, POINT point )
     }
     else
     {
-        playlist_t * p_playlist =
-            (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                           FIND_ANYWHERE );
-        if( p_playlist && p_playlist->i_size )
+        playlist_t * p_playlist = pl_Hold( p_intf );
+        if( p_playlist && !playlist_IsEmpty( p_playlist ) )
         {
             AppendMenu( hmenu, MF_SEPARATOR, 0, _T("") );
             AppendMenu( hmenu, MF_STRING, PlayStream_Event, _T("Play") );
         }
-        if( p_playlist ) vlc_object_release( p_playlist );
+        if( p_playlist ) pl_Release( p_intf );
     }
 
     AppendMenu( hmenu, MF_POPUP|MF_STRING, (UINT)MiscMenu( p_intf ),
@@ -461,7 +460,7 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
                   int *pi_objects, int i_start_id )
 {
     vlc_object_t *p_object;
-    vlc_bool_t b_section_empty = VLC_FALSE;
+    bool b_section_empty = false;
     int i;
 
     /* Initializations */
@@ -478,7 +477,7 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
             }
 
             AppendMenu( hMenu, MF_SEPARATOR, 0, _T("") );
-            b_section_empty = VLC_TRUE;
+            b_section_empty = true;
             continue;
         }
 
@@ -487,14 +486,14 @@ void RefreshMenu( intf_thread_t *p_intf, vector<MenuItemExt*> *p_menu_list,
             AppendMenu( hMenu, MF_GRAYED | MF_STRING,
                         MenuDummy_Event, _FROMMB(ppsz_varnames[i]) );
 
-            b_section_empty = VLC_FALSE;
+            b_section_empty = false;
             continue;
         }
 
-        p_object = (vlc_object_t *)vlc_object_get( pi_objects[i] );
+        p_object = (vlc_object_t *)vlc_object_get( p_intf->p_libvlc, pi_objects[i] );
         if( p_object == NULL ) continue;
 
-        b_section_empty = VLC_FALSE;
+        b_section_empty = false;
         CreateMenuItem( p_intf, p_menu_list, hMenu, ppsz_varnames[i],
                         p_object, &i_item_id );
         vlc_object_release( p_object );
@@ -762,7 +761,7 @@ void OnMenuEvent( intf_thread_t *p_intf, int id )
     if( p_menuitemext )
     {
         vlc_object_t *p_object = (vlc_object_t *)
-            vlc_object_get( p_menuitemext->i_object_id );
+            vlc_object_get( p_intf->p_libvlc, p_menuitemext->i_object_id );
         if( p_object == NULL ) return;
 
         var_Set( p_object, p_menuitemext->psz_var, p_menuitemext->val );