Difference between revisions of "Truxton media get name"
Jump to navigation
Jump to search
(Created page with "This retrieves the name of the media. It corresponds to the <code>Name</code> column of the <code>Media</code> table. =Syntax= <syntaxhighlight lang="C"> void truxton_media_g...") |
|||
| (4 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
This retrieves the name of the media. | This retrieves the name of the media. | ||
| − | It corresponds to the <code>Name</code> column of the <code>Media</code> table. | + | It corresponds to the <code>[Name]</code> column of the <code><nowiki>[</nowiki>[[Media Table|Media]]<nowiki>]</nowiki></code> table. |
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
void truxton_media_get_name( uint64_t media_handle, char * destination_string, size_t max_size ); | void truxton_media_get_name( uint64_t media_handle, char * destination_string, size_t max_size ); | ||
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
| Line 18: | Line 18: | ||
=Sample= | =Sample= | ||
| − | < | + | <source lang="C" highlight="12"> |
| − | void print_name(uint64_t truxton) | + | void print_name( uint64_t truxton ) |
{ | { | ||
| − | uint64_t media = truxton_media_open_id(truxton, "150929ce-bf30-4d5d-08d9-b48a0806c843"); | + | uint64_t media = truxton_media_open_id( truxton, "150929ce-bf30-4d5d-08d9-b48a0806c843" ); |
| − | if ( | + | if ( media != 0 ) |
{ | { | ||
return; | return; | ||
| Line 30: | Line 30: | ||
char name_string[ MAX_PATH ]; | char name_string[ MAX_PATH ]; | ||
| − | truxton_media_get_name(media, name_string, sizeof(name_string)); | + | truxton_media_get_name( media, name_string, sizeof(name_string) ); |
| − | printf( "Name is %s\n", name_string); | + | printf( "Name is %s\n", name_string ); |
| − | truxton_media_free(media); | + | truxton_media_free( media ); |
} | } | ||
| − | </ | + | </source> |
Latest revision as of 07:42, 3 February 2024
This retrieves the name of the media.
It corresponds to the [Name] column of the [Media] table.
Syntax
void truxton_media_get_name( uint64_t media_handle, char * destination_string, size_t max_size );
Parameters
media_handle
The handle created by the truxton_media_create or truxton_media_open_id 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_name( uint64_t truxton )
{
uint64_t media = truxton_media_open_id( truxton, "150929ce-bf30-4d5d-08d9-b48a0806c843" );
if ( media != 0 )
{
return;
}
char name_string[ MAX_PATH ];
truxton_media_get_name( media, name_string, sizeof(name_string) );
printf( "Name is %s\n", name_string );
truxton_media_free( media );
}