]> git.sesse.net Git - vlc/blobdiff - src/control/libvlc_internal.h
Implement clickable osdmenu. The clickable positioning and scaling guessing is not...
[vlc] / src / control / libvlc_internal.h
index dd2f64d3ca80a3ff0b82b52dbefbc39f836cfa90..218d7d7210cb009538edaef5e32937a8e17b056e 100644 (file)
@@ -39,7 +39,7 @@ extern "C" {
  * Internal creation and destruction functions
  ***************************************************************************/
 VLC_EXPORT (libvlc_int_t *, libvlc_InternalCreate, ( void ) );
-VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, char *ppsz_argv[] ) );
+VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[] ) );
 VLC_EXPORT (int, libvlc_InternalCleanup, ( libvlc_int_t * ) );
 VLC_EXPORT (int, libvlc_InternalDestroy, ( libvlc_int_t *, vlc_bool_t ) );
 
@@ -67,6 +67,7 @@ struct libvlc_instance_t
     libvlc_int_t *p_libvlc_int;
     vlm_t        *p_vlm;
     int           b_playlist_locked;
+    unsigned      ref_count;
     vlc_mutex_t   instance_lock;
     vlc_mutex_t   event_callback_lock;
     struct libvlc_callback_entry_list_t *p_callback_list;
@@ -88,6 +89,7 @@ struct libvlc_media_descriptor_t
     vlc_dictionary_t   tags; /* To be merged with core's meta soon */
     struct libvlc_media_list_t *p_subitems; /* A media descriptor can have
                                            * Sub item */
+    void *p_user_data; /* Allows for VLC.framework to hook into media descriptor without creating a new VLCMedia object. */
 };
 
 struct libvlc_tag_query_t
@@ -106,13 +108,24 @@ struct libvlc_media_list_t
     vlc_mutex_t                 object_lock;
     libvlc_media_descriptor_t * p_md; /* The media_descriptor from which the
                                        * mlist comes, if any. */
-    DECL_ARRAY(void *)          items;
+    vlc_array_t                items;
  
     /* Other way to see that media list */
     /* Used in flat_media_list.c */
     libvlc_media_list_t *       p_flat_mlist;
 };
 
+typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t * p_mlv ) ;
+
+typedef int (*libvlc_media_list_view_count_func_t)( struct libvlc_media_list_view_t * p_mlv,
+        libvlc_exception_t * ) ;
+
+typedef libvlc_media_descriptor_t *
+        (*libvlc_media_list_view_item_at_index_func_t)(
+                struct libvlc_media_list_view_t * p_mlv,
+                int index,
+                libvlc_exception_t * ) ;
+
 /* A way to see a media list */
 struct libvlc_media_list_view_t
 {
@@ -123,31 +136,17 @@ struct libvlc_media_list_view_t
     
     libvlc_media_list_t *       p_mlist;
 
-    void *                      this_view_data;
+    struct libvlc_media_list_view_private_t * p_this_view_data;
 
     /* Accessors */
-    int (*pf_count)( struct libvlc_media_list_view_t * p_mlv,
-                      libvlc_exception_t * );
-    libvlc_media_descriptor_t *
-        (*pf_item_at_index)( struct libvlc_media_list_view_t * p_mlv,
-                              int index,
-                              libvlc_exception_t * );
-    int  (*pf_index_of_item)( struct libvlc_media_list_view_t * p_mlv,
-                              libvlc_media_descriptor_t * p_md,
-                              libvlc_exception_t * );
-
-    /* Setters */
-    void (*pf_insert_at_index)( struct libvlc_media_list_view_t * p_mlv,
-                                     libvlc_media_descriptor_t * p_md,
-                                     int index,
-                                     libvlc_exception_t * );
-    void (*pf_remove_at_index)( struct libvlc_media_list_view_t * p_mlv,
-                                     int index,
-                                     libvlc_exception_t * );
-    void (*pf_add_item)( struct libvlc_media_list_view_t * p_mlv,
-                         libvlc_media_descriptor_t * p_md,
-                         libvlc_exception_t * );
-        
+    libvlc_media_list_view_count_func_t         pf_count;
+    libvlc_media_list_view_item_at_index_func_t pf_item_at_index;
+
+    libvlc_media_list_view_release_func_t       pf_release;
+
+    /* Notification callback */
+    void (*pf_ml_item_added)(const libvlc_event_t *, void *);
+    void (*pf_ml_item_removed)(const libvlc_event_t *, void *);
 };
 
 struct libvlc_dynamic_media_list_t
@@ -172,6 +171,8 @@ struct libvlc_media_instance_t
     libvlc_media_descriptor_t * p_md; /* current media descriptor */
     libvlc_event_manager_t *    p_event_manager;
     libvlc_drawable_t           drawable;
+    
+    vlc_bool_t        b_own_its_input_thread;
 };
 
 struct libvlc_media_list_player_t
@@ -284,8 +285,19 @@ VLC_EXPORT (libvlc_media_descriptor_t *, libvlc_media_descriptor_new_from_input_
 VLC_EXPORT (libvlc_media_descriptor_t *, libvlc_media_descriptor_duplicate,
                         ( libvlc_media_descriptor_t * ) );
 
-/* Media List */
-VLC_EXPORT ( void, libvlc_media_list_flat_media_list_release, ( libvlc_media_list_t * ) );
+/* Media List View */
+VLC_EXPORT ( libvlc_media_list_view_t *, libvlc_media_list_view_new,
+                          ( libvlc_media_list_t * p_mlist,
+                            libvlc_media_list_view_count_func_t pf_count,
+                            libvlc_media_list_view_item_at_index_func_t pf_item_at_index,
+                            libvlc_media_list_view_release_func_t pf_release,
+                            void * this_view_data,
+                            libvlc_exception_t * p_e ) );
+
+VLC_EXPORT ( void, libvlc_media_list_view_set_ml_notification_callback, (
+                libvlc_media_list_view_t * p_mlv,
+                void (*item_added)(const libvlc_event_t *, void *),
+                void (*item_removed)(const libvlc_event_t *, void *) ));
 
 /* Events */
 VLC_EXPORT (void, libvlc_event_init, ( libvlc_instance_t *p_instance, libvlc_exception_t *p_e ) );