Difference between revisions of "Truxton media set id"
Jump to navigation
Jump to search
(Created page with "Sets the identifier of the media object. This corresponds to the <code>ID</code> column of the <code> File</code> table. =Syntax= <syntaxhighlight lang="C"> v...") |
|||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Sets the identifier of the media object. | Sets the identifier of the media object. | ||
| − | This corresponds to the <code>ID</code> column of the <code>[[ | + | This corresponds to the <code>[ID]</code> column of the <code><nowiki>[</nowiki>[[Media Table|Media]]<nowiki>]</nowiki></code> table. |
| + | The [[TGUID#Media_ID|media identifier]] is not random. | ||
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
| − | void truxton_media_set_id( uint64_t media_handle, char * id ); | + | void truxton_media_set_id( uint64_t media_handle, char const * id ); |
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
| Line 15: | Line 16: | ||
=Remarks= | =Remarks= | ||
| − | + | This identifier will be stored in the <code>[ID]</code> column of the <code>[Media]</code> table in the database. | |
| − | This identifier will be stored in the <code>ID</code> column of the <code>Media</code> table in the database. | ||
=Sample= | =Sample= | ||
| − | < | + | <source lang="C" highlight="5"> |
| − | void add_folder(uint64_t truxton, char * folder) | + | void add_folder( uint64_t truxton, char * folder ) |
{ | { | ||
| − | uint64_t media = truxton_media_create(truxton); | + | uint64_t media = truxton_media_create( truxton ); |
truxton_media_set_id( media, "1506fd04-3b7f-a872-ba0d-ec43efbdcf9e" ); | truxton_media_set_id( media, "1506fd04-3b7f-a872-ba0d-ec43efbdcf9e" ); | ||
| Line 28: | Line 28: | ||
load_all_files( media, folder ); | load_all_files( media, folder ); | ||
| − | truxton_media_free(media); | + | truxton_media_free( media ); |
} | } | ||
| − | </ | + | </source> |
Latest revision as of 07:38, 3 February 2024
Sets the identifier of the media object.
This corresponds to the [ID] column of the [Media] table.
The media identifier is not random.
Syntax
void truxton_media_set_id( uint64_t media_handle, char const * id );
Parameters
media_handle
The handle created by the truxton_media_create or truxton_media_open_id call.
id
The string representation of a GUID.
Remarks
This identifier will be stored in the [ID] column of the [Media] table in the database.
Sample
void add_folder( uint64_t truxton, char * folder )
{
uint64_t media = truxton_media_create( truxton );
truxton_media_set_id( media, "1506fd04-3b7f-a872-ba0d-ec43efbdcf9e" );
load_all_files( media, folder );
truxton_media_free( media );
}