]> git.sesse.net Git - vlc/blobdiff - include/vlc_vlm.h
Use var_Inherit* instead of var_CreateGet*.
[vlc] / include / vlc_vlm.h
index 4abe29aa27369b1371f429a5e8ff75dcba387465..c9f68f257177cd835f18bd81005455fe62fa61f7 100644 (file)
@@ -87,6 +87,33 @@ typedef struct
 } vlm_schedule_t
 #endif
 
+/** VLM events
+ * You can catch vlm event by adding a callback on the variable "intf-event"
+ * of the VLM object.
+ * This variable is an address that will hold a vlm_event_t* value.
+ */
+enum vlm_event_type_e
+{
+    /* */
+    VLM_EVENT_MEDIA_ADDED   = 0x100,
+    VLM_EVENT_MEDIA_REMOVED,
+    VLM_EVENT_MEDIA_CHANGED,
+
+    /* */
+    VLM_EVENT_MEDIA_INSTANCE_STARTED    = 0x200,
+    VLM_EVENT_MEDIA_INSTANCE_STOPPED,
+    VLM_EVENT_MEDIA_INSTANCE_STATE,
+};
+
+typedef struct
+{
+    int            i_type;            /* a vlm_event_type_e value */
+    int64_t        id;                /* Media ID */
+    const char    *psz_name;          /* Media name */
+    const char    *psz_instance_name; /* Instance name or NULL */
+    input_state_e  input_state;       /* Input instance event type */
+} vlm_event_t;
+
 /** VLM control query */
 enum vlm_query_e
 {
@@ -157,12 +184,13 @@ struct vlm_message_t
 extern "C" {
 #endif
 
-#define vlm_New( a ) __vlm_New( VLC_OBJECT(a) )
-VLC_EXPORT( vlm_t *, __vlm_New, ( vlc_object_t * ) );
+VLC_EXPORT( vlm_t *, vlm_New, ( vlc_object_t * ) );
+#define vlm_New( a ) vlm_New( VLC_OBJECT(a) )
 VLC_EXPORT( void,      vlm_Delete, ( vlm_t * ) );
 VLC_EXPORT( int,       vlm_ExecuteCommand, ( vlm_t *, const char *, vlm_message_t ** ) );
 VLC_EXPORT( int,       vlm_Control, ( vlm_t *p_vlm, int i_query, ... ) );
 
+VLC_EXPORT( vlm_message_t *, vlm_MessageSimpleNew, ( const char * ) );
 VLC_EXPORT( vlm_message_t *, vlm_MessageNew, ( const char *, const char *, ... ) LIBVLC_FORMAT( 2, 3 ) );
 VLC_EXPORT( vlm_message_t *, vlm_MessageAdd, ( vlm_message_t *, vlm_message_t * ) );
 VLC_EXPORT( void,            vlm_MessageDelete, ( vlm_message_t * ) );
@@ -192,7 +220,12 @@ static inline void vlm_media_Init( vlm_media_t *p_media )
  * \param p_dst vlm_media_t instance to copy to
  * \param p_src vlm_media_t instance to copy from
  */
-static inline void vlm_media_Copy( vlm_media_t *p_dst, vlm_media_t *p_src )
+static inline void
+#ifndef __cplusplus
+vlm_media_Copy( vlm_media_t *restrict p_dst, const vlm_media_t *restrict p_src )
+#else
+vlm_media_Copy( vlm_media_t *p_dst, const vlm_media_t *p_src )
+#endif
 {
     int i;