Difference between revisions of "Truxton event set media id"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This sets the source media of the event. =Syntax= <source lang="C"> void truxton_event_set_media_id( uint64_t event_handle, char const * id ); </source> =Parameters= ==<code...")
 
Line 8: Line 8:
 
=Parameters=
 
=Parameters=
 
==<code>event_handle</code>==
 
==<code>event_handle</code>==
The handle to an eventcreated by the [[truxton_event_create]] call.
+
The handle to an event created by the [[truxton_event_create]] call.
  
 
==<code>id</code>==
 
==<code>id</code>==

Revision as of 10:59, 11 November 2020

This sets the source media of the event.

Syntax

void truxton_event_set_media_id( uint64_t event_handle, char const * id );

Parameters

event_handle

The handle to an event created by the truxton_event_create call.

id

The string representation of a GUID. It corresponds to the [MediaID] column of the [Event] table.

Remarks

This identifier should be a value from the [ID] column of the [Media] table in the database.

Sample

void dump_event(uint64_t event_handle)
{
   char guid_string[ 40 ];

   truxton_event_get_file_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "File ID is %s\n", guid_string );

   truxton_event_get_media_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "Media ID is %s\n", guid_string );

   truxton_event_get_id( event_handle, guid_string, sizeof(guid_string) );
   printf( "Event ID is %s\n", guid_string );

   uint64_t value = truxton_event_get_type( event_handle );
   printf( "Type is %" PRIu64 "\n", value );

   value = truxton_event_get_start( event_handle );
   printf( "Start is %" PRIu64 "\n", value );

   value = truxton_event_get_end( event_handle );
   printf( "End is %" PRIu64 "\n", value );
}