image ResEx Logo
ResExcellence www : Powered by Google
Cell Phone Themes Icons Mighty Mouse Cursors Software Reviews Widgets & Widgets

Articles
   3D
   Audio
   Custom Controls
   General RB
   Graphics
   Hacks
   Mac OS X
   Menus
   Novelty
   Printing
   REALbasic 2005
   REALbasic 2006
   Registration
   Resources
   Reviews
   Serial
   Speech
   Sockets
   XML
   Video
Resource Links
News
   Current News
   February 2006
   January 2006
   December 2005
   November 2005
   October 2005
   September 2005
   August 2005
   July 2005
   June 2005
   May 2005
   April 2005
   March 2005









REALbasic for Dummies
by Erick Tejkowski


Learning REALbasic through Applications
by Clayton E., Crooks II


REALbasic for Macintosh
by Michael Swaine


REALbasic Cross-Platform Application Development
by Mark S. Choate





Older files are in Stuffit 5 or greater format. Newer files are ".Zip". Download StuffIt Expander
Tell us about a bad link. Thank You!

iPod Trickery Part 1 by Erick Tejkowsi
06-06-03

Printer Version




06-06-03_img2.jpg (8k) Have you ever wondered how all those neat iPod utilities work? This week we start a multi-week tutorial about using REALbasic to have some fun with your iPod. Everyone knows that an iPod is really just a specialized external hard drive. When you mount your iPod on the desktop, you can double-click its icon to view its contents, copy files to the iPod, and select "Get Info" to learn about the drive.

Working with the iPod in REALbasic is really just as easy as working with files on any other drive. There are, however, a few simple secrets you need to know about first. Let's see what those secrets are!

iPod Secrets
Yes, an iPod is really just a hard drive. Apple has made judicious use of invisible files on the iPod, though. Using REALbasic, you can easily scan through the items on the drive, looking for invisible files and folders. If you do, you'll soon discover that there is one invisible folder named iPod_Control. Inside that folder is another folder named Music. Look inside the Music folder and you'll find any number of folders with names like F00, F01, and F02... Within each of those numbered folders, you can find the audio files that make up the Library on your iPod. For this week's project, we'll find those music files.

Build the Interface
Launch REALbasic and add a Listbox, a PopupMenu, and two Pushbuttons to Window1. Arrange the interface however you want, but mine looks like this:

06-06-03_img1.jpg (15k)

Next, add a Property to Window1 to keep track of the found iPods.

iPods(0) as folderItem

Add the Code
The first think we'll do is scan through all mounted drives, looking for an iPod. All we have to do is look for that iPod_Control folder. If we find one, we can guess that it's an iPod. Then, we stick the names of all found iPods in the PopupMenu control. Add the following code to the Action event of PushButton1.

Once we find an iPod, its a simple matter to loop through all of the music folders to search for files. Add the following code to the Action event of PushButton2 to scan the iPod for tunes.

Conclusion
That's all there is to it! Choose Debug-Run to see your work. Don't forget to mount an iPod before you test it, otherwise this project won't do much. You can download the code for this week's project here.

If you have a lot of files on your iPod, you might notice that this code takes some time to find the files. Worse yet, it seems to lock up the interface while it searches. Next week we'll see how to give the user some feedback while the project searches for files. We'll also make the application more responsive by "threading" the heavy lifting. Finally, we'll improve the utility by allowing the user the copy files from the iPod to another hard drive. See you next week!




Cell Phone Themes Icons Mighty Mouse Cursors Software Reviews Widgets & Widgets

Maintained by the Staff of ResExcellence. This entire site ©1997-2006 ResExcellence
Privacy Statement? Sure we gotta Privacy Statement. [an error occurred while processing this directive]