From: Jorg S. <Jor...@gm...> - 2006-07-09 12:39:13
|
Hi Christian, Christian King wrote: > Hi. > > I was wondering if someone could offer me some advice. I'm writing a > (hopefully) small > program to sync files between a directory on my HDD and my iPod. Right > now I'm looking > at how to copy the files onto the iPod, and I figured > itdb_cp_track_to_ipod was the right > function to use. My problem is with the (pointer to) Itdb_Track struct > I'm supposed to > pass. How much information has to be filled out in the Itdb_Track struct > before passing > it to cp_track_to_ipod? As far as I remember no information is needed other than having set the mountpoint (itdb_set_mountpoint). track->transferred must be FALSE for any copying to take place. The function only copies the track (and sets track->filemarker). > The comment explicitly mentions what happens to the members transferred and > ipod_path, but nothing else. As best I can tell, cp_track_to_ipod > doesn't change them, > but that doesn't mean they aren't changed somewhere else. > > Secondly, assuming that I have to fill out the entire Itdb_Track struct, > how much of it > can I leave blank before my iPod (6GB 2nd Gen Mini) refuses to play the > tracks? No idea. Among the unexpected required fields are the correct tracklength and probably also the correct file length. > I also note that itdb_track_set_defaults looks useful, at least for > setting some of the > unknown functions, but it is static, and not called from itdb_track_new. > Why is that? > Just not ready for use yet? (using libgpod 0.3.2) It's called for you each time you add a track to the itdb (itdb_track_add ). It can't be done in itdb_track_new because it needs to know the filetype for some entries. > I also have a couple of questions about specific members : > For the id field of the track struct, are there any limitations beyond a > unique 32 bit > unsigned integer? I ask because I loaded up my iPod with some test > tracks from > my windows computer with iTunes and all the ids are odd and start at > 123, but > perhaps that's just iTunes being weird... The ID numbers are redistributed automatically when writing out the iTunesDB. So don't worry about them. > Also, for the Type field, what is the easiest way to find out if an MP3 > is VBR or CBR? > I'm not interested in actually playing the files, so I would prefer a > relatively simple > library to work with. Wrong forum ;-) > P.S. > Jorg, > My iPod was initialized with iTunes on windows, and : > iPod_Control/Music has 50 directories : f00 to f49 > My ModelNumStr is : M9803 > It's a Blue, 6GB, 2nd Gen Mini if that helps... Thanks -- I've added you to my list. Cheers, JCS. |