.TH "tracks" 3 "Version 1.1.21" "libmtp" \" -*- nroff -*- .ad l .nh .SH NAME libmtp \- tracks .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "\fBLIBMTP_track_t\fP * \fBLIBMTP_new_track_t\fP (void)" .br .ti -1c .RI "void \fBLIBMTP_destroy_track_t\fP (\fBLIBMTP_track_t\fP *)" .br .ti -1c .RI "\fBLIBMTP_track_t\fP * \fBLIBMTP_Get_Tracklisting\fP (\fBLIBMTP_mtpdevice_t\fP *)" .br .ti -1c .RI "\fBLIBMTP_track_t\fP * \fBLIBMTP_Get_Tracklisting_With_Callback\fP (\fBLIBMTP_mtpdevice_t\fP *, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "\fBLIBMTP_track_t\fP * \fBLIBMTP_Get_Tracklisting_With_Callback_For_Storage\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "\fBLIBMTP_track_t\fP * \fBLIBMTP_Get_Trackmetadata\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const)" .br .ti -1c .RI "int \fBLIBMTP_Get_Track_To_File\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t, char const *const, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "int \fBLIBMTP_Get_Track_To_File_Descriptor\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const, int const, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "int \fBLIBMTP_Get_Track_To_Handler\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const, \fBMTPDataPutFunc\fP, void *, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "int \fBLIBMTP_Send_Track_From_File\fP (\fBLIBMTP_mtpdevice_t\fP *, char const *const, \fBLIBMTP_track_t\fP *const, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "int \fBLIBMTP_Send_Track_From_File_Descriptor\fP (\fBLIBMTP_mtpdevice_t\fP *, int const, \fBLIBMTP_track_t\fP *const, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "int \fBLIBMTP_Send_Track_From_Handler\fP (\fBLIBMTP_mtpdevice_t\fP *, \fBMTPDataGetFunc\fP, void *, \fBLIBMTP_track_t\fP *const, \fBLIBMTP_progressfunc_t\fP const, void const *const)" .br .ti -1c .RI "int \fBLIBMTP_Update_Track_Metadata\fP (\fBLIBMTP_mtpdevice_t\fP *, \fBLIBMTP_track_t\fP const *const)" .br .ti -1c .RI "int \fBLIBMTP_Track_Exists\fP (\fBLIBMTP_mtpdevice_t\fP *, uint32_t const)" .br .ti -1c .RI "int \fBLIBMTP_Set_Track_Name\fP (\fBLIBMTP_mtpdevice_t\fP *, \fBLIBMTP_track_t\fP *, const char *)" .br .in -1c .SH "Detailed Description" .PP .SH "Function Documentation" .PP .SS "void LIBMTP_destroy_track_t (\fBLIBMTP_track_t\fP * track)" This destroys a track metadata structure and deallocates the memory used by it, including any strings\&. Never use a track metadata structure again after calling this function on it\&. .PP \fBParameters\fP .RS 4 \fItrack\fP the track metadata to destroy\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_new_track_t()\fP .RE .PP .PP References \fBLIBMTP_track_struct::album\fP, \fBLIBMTP_track_struct::artist\fP, \fBLIBMTP_track_struct::composer\fP, \fBLIBMTP_track_struct::date\fP, \fBLIBMTP_track_struct::filename\fP, \fBLIBMTP_track_struct::genre\fP, and \fBLIBMTP_track_struct::title\fP\&. .PP Referenced by \fBLIBMTP_Get_Tracklisting_With_Callback_For_Storage()\fP, and \fBLIBMTP_Get_Trackmetadata()\fP\&. .SS "int LIBMTP_Get_Track_To_File (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t const id, char const *const path, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This gets a track off the device to a file identified by a filename\&. This is actually just a wrapper for the \fC\fBLIBMTP_Get_Track_To_File()\fP\fP function\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to get the track from\&. .br \fIid\fP the track ID of the track to retrieve\&. .br \fIpath\fP a filename to use for the retrieved track\&. .br \fIcallback\fP a progress indicator function or NULL to ignore\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 0 if the transfer was successful, any other value means failure\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Get_Track_To_File_Descriptor()\fP .RE .PP .PP References \fBLIBMTP_Get_File_To_File()\fP\&. .SS "int LIBMTP_Get_Track_To_File_Descriptor (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t const id, int const fd, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This gets a track off the device to a file identified by a file descriptor\&. This is actually just a wrapper for the \fC\fBLIBMTP_Get_File_To_File_Descriptor()\fP\fP function\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to get the track from\&. .br \fIid\fP the track ID of the track to retrieve\&. .br \fIfd\fP a file descriptor to write the track to\&. .br \fIcallback\fP a progress indicator function or NULL to ignore\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 0 if the transfer was successful, any other value means failure\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Get_Track_To_File()\fP .RE .PP .PP References \fBLIBMTP_Get_File_To_File_Descriptor()\fP\&. .SS "int LIBMTP_Get_Track_To_Handler (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t const id, \fBMTPDataPutFunc\fP put_func, void * priv, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This gets a track off the device to a handler function\&. This is actually just a wrapper for the \fC\fBLIBMTP_Get_File_To_Handler()\fP\fP function\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to get the track from\&. .br \fIid\fP the track ID of the track to retrieve\&. .br \fIput_func\fP the function to call when we have data\&. .br \fIpriv\fP the user-defined pointer that is passed to \fCput_func\fP\&. .br \fIcallback\fP a progress indicator function or NULL to ignore\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 0 if the transfer was successful, any other value means failure\&. .RE .PP .PP References \fBLIBMTP_Get_File_To_Handler()\fP\&. .SS "\fBLIBMTP_track_t\fP * LIBMTP_Get_Tracklisting (\fBLIBMTP_mtpdevice_t\fP * device)" THIS FUNCTION IS DEPRECATED\&. PLEASE UPDATE YOUR CODE IN ORDER NOT TO USE IT\&. .PP \fBSee also\fP .RS 4 \fBLIBMTP_Get_Tracklisting_With_Callback()\fP .RE .PP .PP References \fBLIBMTP_Get_Tracklisting_With_Callback()\fP\&. .SS "\fBLIBMTP_track_t\fP * LIBMTP_Get_Tracklisting_With_Callback (\fBLIBMTP_mtpdevice_t\fP * device, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This returns a long list of all tracks available on the current MTP device\&. Tracks include multimedia objects, both music tracks and video tracks\&. Typical usage: .PP .PP .nf LIBMTP_track_t *tracklist; tracklist = LIBMTP_Get_Tracklisting_With_Callback(device, callback, data); while (tracklist != NULL) { LIBMTP_track_t *tmp; // Do something on each element in the list here\&.\&.\&. tmp = tracklist; tracklist = tracklist->next; LIBMTP_destroy_track_t(tmp); } .fi .PP .PP If you want to group your track listing by storage (per storage unit) or arrange tracks into folders, you must dereference the \fCstorage_id\fP and/or \fCparent_id\fP field of the returned \fCLIBMTP_track_t\fP struct\&. To arrange by folders or files you typically have to create the proper trees by calls to \fC\fBLIBMTP_Get_Storage()\fP\fP and/or \fC\fBLIBMTP_Get_Folder_List()\fP\fP first\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to get the track listing for\&. .br \fIcallback\fP a function to be called during the tracklisting retrieveal for displaying progress bars etc, or NULL if you don't want any callbacks\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 a list of tracks that can be followed using the \fCnext\fP field of the \fCLIBMTP_track_t\fP data structure\&. Each of the metadata tags must be freed after use, and may contain only partial metadata information, i\&.e\&. one or several fields may be NULL or 0\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Get_Trackmetadata()\fP .RE .PP .PP References \fBLIBMTP_Get_Tracklisting_With_Callback_For_Storage()\fP\&. .PP Referenced by \fBLIBMTP_Get_Tracklisting()\fP\&. .SS "\fBLIBMTP_track_t\fP * LIBMTP_Get_Tracklisting_With_Callback_For_Storage (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t const storage_id, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This returns a long list of all tracks available on the current MTP device\&. Tracks include multimedia objects, both music tracks and video tracks\&. Typical usage: .PP .PP .nf LIBMTP_track_t *tracklist; tracklist = LIBMTP_Get_Tracklisting_With_Callback_For_Storage(device, storage_id, callback, data); while (tracklist != NULL) { LIBMTP_track_t *tmp; // Do something on each element in the list here\&.\&.\&. tmp = tracklist; tracklist = tracklist->next; LIBMTP_destroy_track_t(tmp); } .fi .PP .PP If you want to group your track listing by storage (per storage unit) or arrange tracks into folders, you must dereference the \fCstorage_id\fP and/or \fCparent_id\fP field of the returned \fCLIBMTP_track_t\fP struct\&. To arrange by folders or files you typically have to create the proper trees by calls to \fC\fBLIBMTP_Get_Storage()\fP\fP and/or \fC\fBLIBMTP_Get_Folder_List()\fP\fP first\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to get the track listing for\&. .br \fIstorage_id\fP ID of device storage (if null, no filter) .br \fIcallback\fP a function to be called during the tracklisting retrieveal for displaying progress bars etc, or NULL if you don't want any callbacks\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 a list of tracks that can be followed using the \fCnext\fP field of the \fCLIBMTP_track_t\fP data structure\&. Each of the metadata tags must be freed after use, and may contain only partial metadata information, i\&.e\&. one or several fields may be NULL or 0\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Get_Trackmetadata()\fP .RE .PP .PP References \fBLIBMTP_track_struct::filename\fP, \fBLIBMTP_track_struct::filesize\fP, \fBLIBMTP_track_struct::filetype\fP, \fBLIBMTP_track_struct::item_id\fP, \fBLIBMTP_destroy_track_t()\fP, \fBLIBMTP_FILETYPE_IS_TRACK\fP, \fBLIBMTP_new_track_t()\fP, \fBLIBMTP_track_struct::modificationdate\fP, \fBLIBMTP_track_struct::next\fP, \fBLIBMTP_mtpdevice_struct::params\fP, \fBLIBMTP_track_struct::parent_id\fP, \fBLIBMTP_track_struct::storage_id\fP, and \fBLIBMTP_mtpdevice_struct::usbinfo\fP\&. .PP Referenced by \fBLIBMTP_Get_Tracklisting_With_Callback()\fP\&. .SS "\fBLIBMTP_track_t\fP * LIBMTP_Get_Trackmetadata (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t const trackid)" This function retrieves the metadata for a single track off the device\&. .PP Do not call this function repeatedly! The track handles are linearly searched O(n) and the call may involve (slow) USB traffic, so use \fC\fBLIBMTP_Get_Tracklisting()\fP\fP and cache the tracks, preferably as an efficient data structure such as a hash list\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to get the track metadata from\&. .br \fItrackid\fP the object ID of the track that you want the metadata for\&. .RE .PP \fBReturns\fP .RS 4 a track metadata entry on success or NULL on failure\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Get_Tracklisting()\fP .RE .PP .PP References \fBLIBMTP_track_struct::filename\fP, \fBLIBMTP_track_struct::filesize\fP, \fBLIBMTP_track_struct::filetype\fP, \fBLIBMTP_track_struct::item_id\fP, \fBLIBMTP_destroy_track_t()\fP, \fBLIBMTP_FILETYPE_IS_TRACK\fP, \fBLIBMTP_new_track_t()\fP, \fBLIBMTP_track_struct::modificationdate\fP, \fBLIBMTP_mtpdevice_struct::params\fP, \fBLIBMTP_track_struct::parent_id\fP, \fBLIBMTP_track_struct::storage_id\fP, and \fBLIBMTP_mtpdevice_struct::usbinfo\fP\&. .SS "\fBLIBMTP_track_t\fP * LIBMTP_new_track_t (void)" This creates a new track metadata structure and allocates memory for it\&. Notice that if you add strings to this structure they will be freed by the corresponding \fCLIBMTP_destroy_track_t\fP operation later, so be careful of using strdup() when assigning strings, e\&.g\&.: .PP .PP .nf LIBMTP_track_t *track = \fBLIBMTP_new_track_t()\fP; track->title = strdup(titlestr); \&.\&.\&.\&. LIBMTP_destroy_track_t(track); .fi .PP .PP \fBReturns\fP .RS 4 a pointer to the newly allocated metadata structure\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_destroy_track_t()\fP .RE .PP .PP References \fBLIBMTP_track_struct::item_id\fP\&. .PP Referenced by \fBLIBMTP_Get_Tracklisting_With_Callback_For_Storage()\fP, and \fBLIBMTP_Get_Trackmetadata()\fP\&. .SS "int LIBMTP_Send_Track_From_File (\fBLIBMTP_mtpdevice_t\fP * device, char const *const path, \fBLIBMTP_track_t\fP *const metadata, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This function sends a track from a local file to an MTP device\&. A filename and a set of metadata must be given as input\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to send the track to\&. .br \fIpath\fP the filename of a local file which will be sent\&. .br \fImetadata\fP a track metadata set to be written along with the file\&. After this call the field \fCmetadata->item_id\fP will contain the new track ID\&. Other fields such as the \fCmetadata->filename\fP, \fCmetadata->parent_id\fP or \fCmetadata->storage_id\fP may also change during this operation due to device restrictions, so do not rely on the contents of this struct to be preserved in any way\&. .PD 0 .IP "\(bu" 2 \fCmetadata->parent_id\fP should be set to the parent (e\&.g\&. folder) to store this track in\&. Since some devices are a bit picky about where files are placed, a default folder will be chosen if libmtp has detected one for the current filetype and this parameter is set to 0\&. If this is 0 and no default folder can be found, the file will be stored in the root folder\&. .IP "\(bu" 2 \fCmetadata->storage_id\fP should be set to the desired storage (e\&.g\&. memory card or whatever your device presents) to store this track in\&. Setting this to 0 will store the track on the primary storage\&. .PP .br \fIcallback\fP a progress indicator function or NULL to ignore\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 0 if the transfer was successful, any other value means failure\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Send_Track_From_File_Descriptor()\fP .PP \fBLIBMTP_Send_File_From_File()\fP .PP \fBLIBMTP_Delete_Object()\fP .RE .PP .PP References \fBLIBMTP_Send_Track_From_File_Descriptor()\fP\&. .SS "int LIBMTP_Send_Track_From_File_Descriptor (\fBLIBMTP_mtpdevice_t\fP * device, int const fd, \fBLIBMTP_track_t\fP *const metadata, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This function sends a track from a file descriptor to an MTP device\&. A filename and a set of metadata must be given as input\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to send the track to\&. .br \fIfd\fP the filedescriptor for a local file which will be sent\&. .br \fImetadata\fP a track metadata set to be written along with the file\&. After this call the field \fCmetadata->item_id\fP will contain the new track ID\&. Other fields such as the \fCmetadata->filename\fP, \fCmetadata->parent_id\fP or \fCmetadata->storage_id\fP may also change during this operation due to device restrictions, so do not rely on the contents of this struct to be preserved in any way\&. .PD 0 .IP "\(bu" 2 \fCmetadata->parent_id\fP should be set to the parent (e\&.g\&. folder) to store this track in\&. Since some devices are a bit picky about where files are placed, a default folder will be chosen if libmtp has detected one for the current filetype and this parameter is set to 0\&. If this is 0 and no default folder can be found, the file will be stored in the root folder\&. .IP "\(bu" 2 \fCmetadata->storage_id\fP should be set to the desired storage (e\&.g\&. memory card or whatever your device presents) to store this track in\&. Setting this to 0 will store the track on the primary storage\&. .PP .br \fIcallback\fP a progress indicator function or NULL to ignore\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 0 if the transfer was successful, any other value means failure\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Send_Track_From_File()\fP .PP \fBLIBMTP_Delete_Object()\fP .RE .PP .PP References \fBLIBMTP_file_struct::filename\fP, \fBLIBMTP_track_struct::filename\fP, \fBLIBMTP_file_struct::filesize\fP, \fBLIBMTP_track_struct::filesize\fP, \fBLIBMTP_file_struct::filetype\fP, \fBLIBMTP_track_struct::filetype\fP, \fBLIBMTP_file_struct::item_id\fP, \fBLIBMTP_track_struct::item_id\fP, \fBLIBMTP_FILETYPE_IS_TRACK\fP, \fBLIBMTP_Send_File_From_File_Descriptor()\fP, \fBLIBMTP_Update_Track_Metadata()\fP, \fBLIBMTP_file_struct::next\fP, \fBLIBMTP_mtpdevice_struct::params\fP, \fBLIBMTP_file_struct::parent_id\fP, \fBLIBMTP_track_struct::parent_id\fP, \fBLIBMTP_file_struct::storage_id\fP, \fBLIBMTP_track_struct::storage_id\fP, and \fBLIBMTP_mtpdevice_struct::usbinfo\fP\&. .PP Referenced by \fBLIBMTP_Send_Track_From_File()\fP\&. .SS "int LIBMTP_Send_Track_From_Handler (\fBLIBMTP_mtpdevice_t\fP * device, \fBMTPDataGetFunc\fP get_func, void * priv, \fBLIBMTP_track_t\fP *const metadata, \fBLIBMTP_progressfunc_t\fP const callback, void const *const data)" This function sends a track from a handler function to an MTP device\&. A filename and a set of metadata must be given as input\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to send the track to\&. .br \fIget_func\fP the function to call when we have data\&. .br \fIpriv\fP the user-defined pointer that is passed to \fCget_func\fP\&. .br \fImetadata\fP a track metadata set to be written along with the file\&. After this call the field \fCmetadata->item_id\fP will contain the new track ID\&. Other fields such as the \fCmetadata->filename\fP, \fCmetadata->parent_id\fP or \fCmetadata->storage_id\fP may also change during this operation due to device restrictions, so do not rely on the contents of this struct to be preserved in any way\&. .PD 0 .IP "\(bu" 2 \fCmetadata->parent_id\fP should be set to the parent (e\&.g\&. folder) to store this track in\&. Since some devices are a bit picky about where files are placed, a default folder will be chosen if libmtp has detected one for the current filetype and this parameter is set to 0\&. If this is 0 and no default folder can be found, the file will be stored in the root folder\&. .IP "\(bu" 2 \fCmetadata->storage_id\fP should be set to the desired storage (e\&.g\&. memory card or whatever your device presents) to store this track in\&. Setting this to 0 will store the track on the primary storage\&. .PP .br \fIcallback\fP a progress indicator function or NULL to ignore\&. .br \fIdata\fP a user-defined pointer that is passed along to the \fCprogress\fP function in order to pass along some user defined data to the progress updates\&. If not used, set this to NULL\&. .RE .PP \fBReturns\fP .RS 4 0 if the transfer was successful, any other value means failure\&. .RE .PP \fBSee also\fP .RS 4 \fBLIBMTP_Send_Track_From_File()\fP .PP \fBLIBMTP_Delete_Object()\fP .RE .PP .PP References \fBLIBMTP_file_struct::filename\fP, \fBLIBMTP_track_struct::filename\fP, \fBLIBMTP_file_struct::filesize\fP, \fBLIBMTP_track_struct::filesize\fP, \fBLIBMTP_file_struct::filetype\fP, \fBLIBMTP_track_struct::filetype\fP, \fBLIBMTP_file_struct::item_id\fP, \fBLIBMTP_track_struct::item_id\fP, \fBLIBMTP_FILETYPE_IS_TRACK\fP, \fBLIBMTP_Send_File_From_Handler()\fP, \fBLIBMTP_Update_Track_Metadata()\fP, \fBLIBMTP_file_struct::next\fP, \fBLIBMTP_mtpdevice_struct::params\fP, \fBLIBMTP_file_struct::parent_id\fP, \fBLIBMTP_track_struct::parent_id\fP, \fBLIBMTP_file_struct::storage_id\fP, \fBLIBMTP_track_struct::storage_id\fP, and \fBLIBMTP_mtpdevice_struct::usbinfo\fP\&. .SS "int LIBMTP_Set_Track_Name (\fBLIBMTP_mtpdevice_t\fP * device, \fBLIBMTP_track_t\fP * track, const char * newname)" This function renames a single track\&. This simply means that the PTP_OPC_ObjectFileName property is updated, if this is supported by the device\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device that contains the file\&. .br \fItrack\fP the track metadata of the track to rename\&. On success, the filename member is updated\&. Be aware, that this name can be different than newname depending of device restrictions\&. .br \fInewname\fP the new filename for this object\&. .RE .PP \fBReturns\fP .RS 4 0 on success, any other value means failure\&. .RE .PP .PP References \fBLIBMTP_track_struct::filename\fP, \fBLIBMTP_track_struct::filetype\fP, and \fBLIBMTP_track_struct::item_id\fP\&. .SS "int LIBMTP_Track_Exists (\fBLIBMTP_mtpdevice_t\fP * device, uint32_t const id)" Helper function\&. This indicates if a track exists on the device .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to get the track from\&. .br \fIid\fP the track ID of the track to retrieve\&. .RE .PP \fBReturns\fP .RS 4 TRUE (!=0) if the track exists, FALSE (0) if not .RE .PP .PP References \fBLIBMTP_mtpdevice_struct::params\fP\&. .SS "int LIBMTP_Update_Track_Metadata (\fBLIBMTP_mtpdevice_t\fP * device, \fBLIBMTP_track_t\fP const *const metadata)" This function updates the MTP track object metadata on a single file identified by an object ID\&. .PP \fBParameters\fP .RS 4 \fIdevice\fP a pointer to the device to update the track metadata on\&. .br \fImetadata\fP a track metadata set to be written to the file\&. notice that the \fCtrack_id\fP field of the metadata structure must be correct so that the function can update the right file\&. If some properties of this metadata are set to NULL (strings) or 0 (numerical values) they will be discarded and the track will not be tagged with these blank values\&. .RE .PP \fBReturns\fP .RS 4 0 on success, any other value means failure\&. If some or all of the properties fail to update we will still return success\&. On some devices (notably iRiver T30) properties that exist cannot be updated\&. .RE .PP .PP References \fBLIBMTP_track_struct::album\fP, \fBLIBMTP_track_struct::artist\fP, \fBLIBMTP_track_struct::bitrate\fP, \fBLIBMTP_track_struct::bitratetype\fP, \fBLIBMTP_track_struct::composer\fP, \fBLIBMTP_track_struct::date\fP, \fBLIBMTP_track_struct::duration\fP, \fBLIBMTP_track_struct::filetype\fP, \fBLIBMTP_track_struct::genre\fP, \fBLIBMTP_track_struct::item_id\fP, \fBLIBMTP_track_struct::nochannels\fP, \fBLIBMTP_mtpdevice_struct::params\fP, \fBLIBMTP_track_struct::rating\fP, \fBLIBMTP_track_struct::samplerate\fP, \fBLIBMTP_track_struct::title\fP, \fBLIBMTP_track_struct::tracknumber\fP, \fBLIBMTP_mtpdevice_struct::usbinfo\fP, \fBLIBMTP_track_struct::usecount\fP, and \fBLIBMTP_track_struct::wavecodec\fP\&. .PP Referenced by \fBLIBMTP_Send_Track_From_File_Descriptor()\fP, and \fBLIBMTP_Send_Track_From_Handler()\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libmtp from the source code\&.