|
From: Ali S. <ca...@gm...> - 2008-02-26 01:55:39
|
Hi, I would like to suggest some policies regarding the way we handle the derived file types, Album and Playlist. I propose that LIBMTP_Album_t and LIBMTP_Playlist_t both should have a field for their parent directory rather than supply a parent directory at the time of creation. The reason being an LIBMTP_Album_t is displayed as a file on my device (and i expect most other devices). This means that when we create new albums, a new file must be created to represent this via LIBMTP_new_file() as libmtp does not implicitly create an encapsulated file for every new derived type we create on the device (eg track, album or playlist). This way when a new album is created on the device with this field set to 0, it can be updated to the corresponding default destination's ID. This helps us GUI makers keep different views of the underlying file/album/playlist abstraction in sync with the device, since we can tell who the parent folder is for the given album and look it up in a hash table etc. Sometimes I wonder if the policy should be that when a new derived file type is created on the device, libmtp should create a file as well. The reason is simple: if one were to disconnect the device, and reconnect it, one would see two duplicate object IDs. One of which is a file and the other would be the derived file type we created, perhaps this could be returned via a double pointer from the LIBMTP_Create_* functions. Just some thoughts :) Ali |