Truxton media get id

From truxwiki.com
Revision as of 17:32, 8 July 2020 by Sam (talk | contribs) (Created page with "This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the file. This corresponds to the <code>ID</code> column of the <code>Media</code> tab...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This retrieves the GUID of the file. This corresponds to the ID column of the Media table.

Syntax

void truxton_media_get_id( uint64_t media_handle, char * destination_string, size_t max_size );

Parameters

media_handle

The handle created by the truxton_media_open_id or truxton_media_create call.

destination_string

The string to be written to.

max_size

The maximum number of characters that can be written to destination_string.

Sample

void print_id(uint64_t truxton)
{
   uint64_t media = truxton_media_open_id(truxton, "1506fd04-3b7f-a872-ba0d-ec43efbdcf9e");

   if ( media != 0 )
   {
      return;
   }

   char guid_string[ 40 ];

   truxton_media_get_id( file, guid_string, sizeof(guid_string));
   truxton_media_free(file);

   printf( "Media ID is %s\n", guid_string);
}