|
This destroys a file metadata structure and deallocates the memory used by it, including any strings. Never use a file metadata structure again after calling this function on it.
|
|
This destroys a file sample metadata type.
|
|
This gets a file off the device to a local file identified by a filename.
|
|
This gets a file off the device to a file identified by a file descriptor. This function can potentially be used for streaming files off the device for playback or broadcast for example, by downloading the file into a stream sink e.g. a socket.
|
|
THIS FUNCTION IS DEPRECATED. PLEASE UPDATE YOUR CODE IN ORDER NOT TO USE IT. |
|
This returns a long list of all files available on the current MTP device. Folders will not be returned. Typical usage:
LIBMTP_file_t *filelist;
filelist = LIBMTP_Get_Filelisting_With_Callback(device, callback, data); while (filelist != NULL) { LIBMTP_file_t *tmp;
// Do something on each element in the list here... tmp = filelist; filelist = filelist->next; LIBMTP_destroy_file_t(tmp); }
|
|
This function retrieves the metadata for a single file off the device.
Do not call this function repeatedly! The file handles are linearly searched O(n) and the call may involve (slow) USB traffic, so use Incidentally this function will return metadata for a folder (association) as well, but this is not a proper use of it, it is intended for file manipulation, not folder manipulation.
|
|
This helper function returns a textual description for a libmtp file type to be used in dialog boxes etc.
|
|
This routine gets representative sample data for an object. This uses the RepresentativeSampleData property of the album, if the device supports it.
|
|
This routine figures out whether a certain filetype supports representative samples (small thumbnail images) or not. This typically applies to JPEG files, MP3 files and Album abstract playlists, but in theory any filetype could support representative samples.
|
|
This creates a new file metadata structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding
LIBMTP_file_t *file = LIBMTP_new_file_t(); file->filename = strdup(namestr); .... LIBMTP_destroy_file_t(file);
|
|
This creates a new sample data metadata structure and allocates memory for it. Notice that if you add strings to this structure they will be freed by the corresponding
|
|
This function sends a local file to an MTP device. A filename and a set of metadata must be given as input.
|
|
This function sends a generic file from a file descriptor to an MTP device. A filename and a set of metadata must be given as input.
This can potentially be used for sending in a stream of unknown length. Send music files with
|
|
This routine sends representative sample data for an object. This uses the RepresentativeSampleData property of the album, if the device supports it. The data should be of a format acceptable to the player (for iRiver and Creative, this seems to be JPEG) and must not be too large. (for a Creative, max seems to be about 20KB.) TODO: there must be a way to find the max size for an ObjectPropertyValue.
|