예제 #1
0
/**************************************************************************
 *       libvlc_media_list_view_new (Internal)
 **************************************************************************/
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_children_at_index_func_t pf_children_at_index,
                            libvlc_media_list_view_constructor_func_t pf_constructor,
                            libvlc_media_list_view_release_func_t pf_release,
                            void * this_view_data,
                            libvlc_exception_t * p_e )
{
    libvlc_media_list_view_t * p_mlv;
    p_mlv = calloc( 1, sizeof(libvlc_media_list_view_t) );
    if( !p_mlv )
        return NULL;

    p_mlv->p_libvlc_instance = p_mlist->p_libvlc_instance;
    p_mlv->p_event_manager = libvlc_event_manager_new( p_mlist,
                                    p_mlv->p_libvlc_instance, p_e );

    libvlc_event_manager_register_event_type( p_mlv->p_event_manager,
            libvlc_MediaListViewItemAdded, p_e );
    libvlc_event_manager_register_event_type( p_mlv->p_event_manager,
            libvlc_MediaListViewWillAddItem, p_e );
    libvlc_event_manager_register_event_type( p_mlv->p_event_manager,
            libvlc_MediaListViewItemDeleted, p_e );
    libvlc_event_manager_register_event_type( p_mlv->p_event_manager,
            libvlc_MediaListViewWillDeleteItem, p_e );

    libvlc_media_list_retain( p_mlist );
    p_mlv->p_mlist = p_mlist;

    p_mlv->pf_count             = pf_count;
    p_mlv->pf_item_at_index     = pf_item_at_index;
    p_mlv->pf_children_at_index = pf_children_at_index;
    p_mlv->pf_constructor       = pf_constructor;
    p_mlv->pf_release           = pf_release;

    p_mlv->p_this_view_data = this_view_data;

    vlc_mutex_init( &p_mlv->object_lock );
    p_mlv->i_refcount = 1;

    return p_mlv;
}
예제 #2
0
파일: VLC.cpp 프로젝트: Lewn/HitjesFoon
void VLC::retain(libvlc_media_list_t *mediaList) {
    // Retain doesn't check for NULL
    if (mediaList != NULL) {
        libvlc_media_list_retain(mediaList);
    }
}
예제 #3
0
/**************************************************************************
 * media_list (Public)
 **************************************************************************/
libvlc_media_list_t *
libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis )
{
    libvlc_media_list_retain( p_mdis->p_mlist );
    return p_mdis->p_mlist;
}
예제 #4
0
static libvlc_media_list_t *
vlc_media_list_copy(const libvlc_media_list_t *instance)
{
    libvlc_media_list_retain((libvlc_media_list_t *)instance);
    return (libvlc_media_list_t *)instance;
}