Truxton location get media id

From truxwiki.com
Revision as of 07:05, 14 December 2020 by Sam (talk | contribs) (Created page with "This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the media the location came from. This corresponds to the <code>[MediaID]</code> colum...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This retrieves the GUID of the media the location came from. This corresponds to the [MediaID] column of the [Location] table. The value should be present in the [ID] column of the [Media] table.

Syntax

void truxton_location_get_media_id( uint64_t location_handle, char * destination_string, size_t max_size );

Parameters

location_handle

This handle comes from calling truxton_location_create() or truxton_child_file_create_location()

destination_string

The string to be written to.

max_size

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

Sample

void dump_location(uint64_t location_handle)
{
   double value = 0;
   uint64_t ticks = 0;
   char guid_string[ 40 ];
   char label[ 256 ];

   truxton_location_get_label(location_handle, label, sizeof( label ));
   printf( "%s\n", label );

   truxton_location_get_file_id(location_handle, guid_string, sizeof( guid_string ));
   printf( "File ID: %s\n", guid_string );

   truxton_location_get_media_id(location_handle, guid_string, sizeof( guid_string ));
   printf( "Media ID: %s\n", guid_string );

   value = truxton_location_get_latitude( location_handle );
   printf( "Latitude: %lf\n", value );

   value = truxton_location_get_longitude( location_handle );
   printf( "Longitude: %lf\n", value );

   value = truxton_location_get_altitude( location_handle );
   printf( "Altitude: %lf meters\n", value );

   ticks = truxton_location_get_type( location_handle );
   printf( "Type: %" PRIu64 "\n", value );

   ticks = truxton_location_get_when( location_handle );
   printf( "Ticks: %" PRIu64 "\n", value );
}