-#define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, ret, code )\
-returnType libvlc_vlm_get_media_instance_## attr( libvlc_instance_t *p_instance, \
- char *psz_name, int i_instance, libvlc_exception_t *p_exception ) \
-{ \
- vlm_media_instance_t *p_mi = libvlc_vlm_get_media_instance( p_instance, psz_name, i_instance, \
- p_exception ); \
- if( p_mi ) { \
- returnType ret_value; \
- code; \
- vlm_media_instance_Delete( p_mi ); \
- return ret_value; \
- } \
- libvlc_exception_raise( p_exception, "Unable to get %s "#attr "attribute" ); \
- return ret; \
+float libvlc_vlm_get_media_instance_position( libvlc_instance_t *p_instance,
+ char *psz_name, int i_instance, libvlc_exception_t *p_exception )
+{
+#ifdef ENABLE_VLM
+ float result = -1;
+ vlm_media_instance_t *p_mi = libvlc_vlm_get_media_instance( p_instance, psz_name,
+ i_instance, p_exception );
+ if( p_mi )
+ {
+ result = p_mi->d_position;
+ vlm_media_instance_Delete( p_mi );
+ return result;
+ }
+ libvlc_exception_raise( p_exception, "Unable to get position attribute" );
+ return result;
+#else
+ libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
+ return VLC_EGENERIC;
+#endif
+}
+
+int libvlc_vlm_get_media_instance_time( libvlc_instance_t *p_instance,
+ char *psz_name, int i_instance, libvlc_exception_t *p_exception )
+{
+#ifdef ENABLE_VLM
+ int result = -1;
+ vlm_media_instance_t *p_mi = libvlc_vlm_get_media_instance( p_instance, psz_name,
+ i_instance, p_exception );
+ if( p_mi )
+ {
+ result = p_mi->i_time;
+ vlm_media_instance_Delete( p_mi );
+ return result;
+ }
+ libvlc_exception_raise( p_exception, "Unable to get time attribute" );
+ return result;
+#else
+ libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
+ return VLC_EGENERIC;
+#endif
+}
+
+int libvlc_vlm_get_media_instance_length( libvlc_instance_t *p_instance,
+ char *psz_name, int i_instance, libvlc_exception_t *p_exception )
+{
+#ifdef ENABLE_VLM
+ int result = -1;
+ vlm_media_instance_t *p_mi = libvlc_vlm_get_media_instance( p_instance, psz_name,
+ i_instance, p_exception );
+ if( p_mi )
+ {
+ result = p_mi->i_length;
+ vlm_media_instance_Delete( p_mi );
+ return result;
+ }
+ libvlc_exception_raise( p_exception, "Unable to get length attribute" );
+ return result;
+#else
+ libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
+ return VLC_EGENERIC;
+#endif
+}
+
+int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *p_instance,
+ char *psz_name, int i_instance, libvlc_exception_t *p_exception )
+{
+#ifdef ENABLE_VLM
+ int result = -1;
+ vlm_media_instance_t *p_mi = libvlc_vlm_get_media_instance( p_instance, psz_name,
+ i_instance, p_exception );
+ if( p_mi )
+ {
+ result = p_mi->i_rate;
+ vlm_media_instance_Delete( p_mi );
+ return result;
+ }
+ libvlc_exception_raise( p_exception, "Unable to get rate attribute" );
+ return result;
+#else
+ libvlc_exception_raise( p_exception, "VLM has been disabled in this libvlc." );
+ return VLC_EGENERIC;
+#endif