vlc/libvlc.h: Use libvlc_time_t.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 7 Jan 2008 19:22:47 +0000 (19:22 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 7 Jan 2008 19:22:47 +0000 (19:22 +0000)
include/vlc/libvlc.h
include/vlc/libvlc_structures.h
src/control/media_instance.c

index 76a0757..680882f 100644 (file)
@@ -230,7 +230,7 @@ VLC_PUBLIC_API libvlc_event_manager_t *
     libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
                                            libvlc_exception_t * p_e );
 
-VLC_PUBLIC_API vlc_int64_t
+VLC_PUBLIC_API libvlc_time_t
    libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
                                          libvlc_exception_t * p_e );
 
@@ -445,17 +445,17 @@ VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libv
 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
 
 /** \bug This might go away ... to be replaced by a broader system */
-VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length     ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time       ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API void        libvlc_media_instance_set_time       ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
-VLC_PUBLIC_API float       libvlc_media_instance_get_position   ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API void        libvlc_media_instance_set_position   ( libvlc_media_instance_t *, float, libvlc_exception_t *);
-VLC_PUBLIC_API void        libvlc_media_instance_set_chapter    ( libvlc_media_instance_t *, int, libvlc_exception_t *);
-VLC_PUBLIC_API int         libvlc_media_instance_get_chapter    (libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API int         libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API vlc_bool_t  libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API float       libvlc_media_instance_get_rate       ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API void        libvlc_media_instance_set_rate       ( libvlc_media_instance_t *, float, libvlc_exception_t *);
+VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_length     ( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_time       ( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API void          libvlc_media_instance_set_time       ( libvlc_media_instance_t *, libvlc_time_t, libvlc_exception_t *);
+VLC_PUBLIC_API float         libvlc_media_instance_get_position   ( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API void          libvlc_media_instance_set_position   ( libvlc_media_instance_t *, float, libvlc_exception_t *);
+VLC_PUBLIC_API void          libvlc_media_instance_set_chapter    ( libvlc_media_instance_t *, int, libvlc_exception_t *);
+VLC_PUBLIC_API int           libvlc_media_instance_get_chapter    (libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API int           libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API vlc_bool_t    libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API float         libvlc_media_instance_get_rate       ( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API void          libvlc_media_instance_set_rate       ( libvlc_media_instance_t *, float, libvlc_exception_t *);
 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state   ( libvlc_media_instance_t *, libvlc_exception_t *);
 
 /**
index c98126b..4f46c14 100644 (file)
@@ -66,6 +66,19 @@ typedef char * libvlc_tag_t;
 
 /**@} */
 
+/*****************************************************************************
+ * Time
+ *****************************************************************************/
+/** defgroup libvlc_time Time
+ * \ingroup libvlc
+ * LibVLC Time support in libvlc
+ * @{
+ */
+
+typedef vlc_int64_t libvlc_time_t;
+
+/**@} */
+
 /*****************************************************************************
  * Media Descriptor
  *****************************************************************************/
@@ -373,7 +386,7 @@ typedef struct libvlc_event_t
         } media_instance_position_changed;
         struct
         {
-            long int new_time;
+            libvlc_time_t new_time;
         } media_instance_time_changed;
 
         /* media list */
index 366a4fe..33e4709 100644 (file)
@@ -221,7 +221,6 @@ input_time_changed( vlc_object_t * p_this, char const * psz_cmd,
     libvlc_event_t event;
     event.type = libvlc_MediaInstanceTimeChanged;
     event.u.media_instance_time_changed.new_time = val.i_time;
-
     libvlc_event_send( p_mi->p_event_manager, &event );
     return VLC_SUCCESS;
 }
@@ -594,7 +593,7 @@ void libvlc_media_instance_set_drawable( libvlc_media_instance_t *p_mi,
 /**************************************************************************
  * Getters for stream information
  **************************************************************************/
-vlc_int64_t libvlc_media_instance_get_length(
+libvlc_time_t libvlc_media_instance_get_length(
                              libvlc_media_instance_t *p_mi,
                              libvlc_exception_t *p_e )
 {
@@ -611,7 +610,7 @@ vlc_int64_t libvlc_media_instance_get_length(
     return (val.i_time+500LL)/1000LL;
 }
 
-vlc_int64_t libvlc_media_instance_get_time(
+libvlc_time_t libvlc_media_instance_get_time(
                                    libvlc_media_instance_t *p_mi,
                                    libvlc_exception_t *p_e )
 {
@@ -629,7 +628,7 @@ vlc_int64_t libvlc_media_instance_get_time(
 
 void libvlc_media_instance_set_time(
                                  libvlc_media_instance_t *p_mi,
-                                 vlc_int64_t time,
+                                 libvlc_time_t time,
                                  libvlc_exception_t *p_e )
 {
     input_thread_t *p_input_thread;