* @return The media library object. NULL if the media library
* object could not be loaded
*/
-VLC_EXPORT( media_library_t*, ml_Hold, ( vlc_object_t* p_this ) );
-#define ml_Hold( a ) ml_Hold( VLC_OBJECT(a) )
-
-/**
- * @brief Discard your ref to media library
- * @param p_this The object holding the media library
- */
-VLC_EXPORT( void, ml_Release, ( vlc_object_t* p_this ) );
-#define ml_Release(a) ml_Release( VLC_OBJECT(a) )
+VLC_EXPORT( media_library_t*, ml_Get, ( vlc_object_t* p_this ) );
+#define ml_Get( a ) ml_Get( VLC_OBJECT(a) )
/**
* @brief Create a Media Library VLC object.
if( p_media )
ml_gc_incref( p_media );
this->media = p_media;
- p_ml = ml_Hold( _p_intf );
+ p_ml = ml_Get( _p_intf );
}
MLItem::~MLItem()
// Free private data
if( this->media )
ml_gc_decref( this->media );
- ml_Release( p_intf );
if( !children.isEmpty() )
clearChildren();
}
MLModel::MLModel( intf_thread_t* _p_intf, QObject *parent )
:VLCModel( _p_intf, parent )
{
- p_ml = ml_Hold( p_intf );
+ p_ml = ml_Get( p_intf );
vlc_array_t *p_result_array = vlc_array_new();
ml_Find( p_ml, p_result_array, ML_MEDIA );
insertResultArray( p_result_array );
var_DelCallback( p_ml, "media-meta-change", mediaUpdated, this );
var_DelCallback( p_ml, "media-deleted", mediaDeleted, this );
var_DelCallback( p_ml, "media-added", mediaAdded, this );
- ml_Release( p_intf );
}
void MLModel::clear()
main_layout->addWidget( recursivity, 1, 0 );
main_layout->addWidget( buttonsBox, 2, 0 );
- p_ml = ml_Hold( p_intf );
+ p_ml = ml_Get( p_intf );
init();
BUTTONACT( save, save() );
MLConfDialog::~MLConfDialog()
{
- ml_Release( p_intf );
}
void MLConfDialog::init()
mdate
ml_Create
ml_Destroy
-ml_Hold
-ml_Release
+ml_Get
media_New
ml_OpConnectChilds
ml_FtreeSpec
return p_ml;
}
-#undef ml_Hold
+#undef ml_Get
/**
* @brief Acquire a reference to the media library singleton
* @param p_this Object that holds the reference
* @return media_library_t The ml object. NULL if not compiled with
* media library or if unable to load
*/
-media_library_t* ml_Hold( vlc_object_t* p_this )
+media_library_t* ml_Get( vlc_object_t* p_this )
{
media_library_t* p_ml;
vlc_mutex_lock( &( libvlc_priv( p_this->p_libvlc )->ml_lock ) );
= ml_Create( VLC_OBJECT( p_this->p_libvlc ), NULL );
p_ml = libvlc_priv (p_this->p_libvlc)->p_ml;
}
- if( p_ml )
- vlc_object_hold( p_ml );
vlc_mutex_unlock( &( libvlc_priv( p_this->p_libvlc )->ml_lock ) );
return p_ml;
}
-#undef ml_Release
-/**
- * @brief Release a reference to the media library singleton
- * @param p_this Object that holds the reference
- */
-void ml_Release( vlc_object_t* p_this )
-{
- media_library_t* p_ml;
- p_ml = libvlc_priv (p_this->p_libvlc)->p_ml;
- if( p_ml == NULL )
- {
- msg_Warn( p_this->p_libvlc , "Spurious release ML called");
- return;
- }
- assert( VLC_OBJECT( p_ml ) != p_this );
- vlc_object_release( p_ml );
-}
-
/**
* @brief Destructor for ml_media_t
*/
#ifndef MEDIA_LIBRARY
#include<vlc_media_library.h>
-#undef ml_Hold
-media_library_t* ml_Hold ( vlc_object_t* p_this )
+#undef ml_Get
+media_library_t* ml_Get ( vlc_object_t* p_this )
{
VLC_UNUSED( p_this );
return NULL;
}
-#undef ml_Release
-void ml_Release ( vlc_object_t* p_this )
-{
- VLC_UNUSED( p_this );
- assert( 0 );
-}
-
media_library_t* ml_Create ( vlc_object_t *p_this, char* psz_name )
{
VLC_UNUSED( p_this );