macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

iPod Notes: Above and Beyond

by Erica Sadun
12/12/2006

Editor's Note: Don't miss the first article in this two-part series, "Building Interactive iPod Experiences."

One of the great joys about a device like the iPod is that it doesn't just do music. It does videos. It does text. It does games. It does pictures. You can use it as a portable hard drive. With the proper hardware, it can do radio and it can record voice memos and do even more. The device is so flexible, one is constantly finding new ways the Apple engineers have thought of to break out of the MP3-player box and give more power to both developers and end users. The iPod's Notes feature is a great example of this power.

iPod's boring-looking but surprisingly powerful Notes pack a wallop of possibility into the iPod's limited interface. It allows you to use iPods to create self-contained but user-driven presentations. In the first article of this series, "Building Interactive iPod Experiences," you discovered how to use the base features of iPod Notes to build interactive tours and lessons. This article steps it up a notch.

Here, you'll learn to take further control over your iPod Notes and add a more professional veneer. You'll discover how to create a "notes-only" museum mode, how to reuse already existing HTML source material, how to create custom menu presentations, how to control navigation, and more. This article presents some of the more exciting notes options that you can use to move beyond the basics. If learning about how notes work has captured your interest, this article will take you to the next level.

Leveraging Your Notes Preferences

As with any computer, controlling your preferences lets you control your iPod. You specify the way your iPod displays notes by creating and editing a simple text file. The preferences file, preferences.txt, must be stored in the top Notes folder on your iPod. It consists of one or more <META> elements that specify the name of the preference and its settings. There are five possible settings, each of which can be set to either true or false. These settings both help you control the user experience and can make the development process more HTML-author friendly. Here's a quick rundown of these preferences.

NotesOnly

NotesOnly specifies whether your iPod displays all of its features, as you'd normally expect, or whether it limits the user to the notes you've created. When used, NotesOnly mode puts your user directly into Extras -> Notes. They cannot navigate out of there to the standard set of iPod menus until the preferences are reset at a computer--either by editing preferences or removing the preferences file completely. This ensures, for example, that the students who are supposed to be using the iPods to work on their Physics labs cannot spend their time playing MiniGolf and Tetris or listening to Phish. The default value for NotesOnly is FALSE, which allows for full iPod access.

<META NAME="NotesOnly" CONTENT="TRUE">

Tip: I have found NotesOnly mode extremely valuable while debugging. It limits all those times that you have to click Extras and then Notes to get down to see the notes you are working on.

NowPlaying

NowPlaying controls whether your audio links transfer your user from the current note to the Now Playing page for that audio or not. When you set NowPlaying to FALSE, users remain on the notes page whenever they link to audio. The audio plays in the background, but the screen remains on the linking note. Setting NowPlaying to TRUE means that all links to audio will transfer the user to the Now Playing page and the user must press Menu to return to that note. The default value for NowPlaying is TRUE. This setting has no effect on links to pictures, folders, other notes, or video.

<META NAME="NowPlaying" CONTENT="FALSE">

LineWrap

LineWrap determines how the iPod handles line feed (LF) and carriage return (CR) characters. By default, both are shown as used in the text file. Add two carriage returns, for example, to the middle of your text and both are displayed on the iPod. To make the notes ignore embedded LF and CR characters, as you would expect when writing HTML, set the LineWrap value to TRUE. The default value for LineWrap is FALSE.

<META NAME="LineWrap" CONTENT="TRUE">

HideAllTags

HideAllTags lets you cut and paste already existing HTML text by zapping extra tags from view while respecting paragraph (<P>, </P>) and break (<BR>, </BR>) tags. This has the effect of letting you display HTML source material without having to edit out your elements by hand. Anything between angle brackets goes away, leaving a clean and easy-to-read result. The HTML elements like bold or italics or lists are simply ignored. To hide tags, set HideAllTags to TRUE. The default value for HideAllTags is FALSE.

<META NAME="HideAllTags" CONTENT="TRUE">

ShowBodyOnly

ShowBodyOnly takes HTML-source reuse to the next level. It hides all text that does not appear between <BODY> and </BODY>--but only if these elements appear in the source. Sensibly, if there are no <BODY> elements, the entire note is displayed. To use this feature, set ShowBodyOnly to TRUE. The default value for ShowBodyOnly is FALSE.

<META NAME="ShowBodyOnly" CONTENT="TRUE">

Creating Menus with .linx Files

With .linx files, Apple provides a flexible, if strangely buggy, way to lay out menus for your notes. Any text file with a .linx extension is interpreted as a menu. Kind of. Let me explain how this works as simply as possible.

If you place a main.linx file (it can also be called index.linx, but just choose one to use) in your main Notes folder, it defines the way your main menu displays. It can have a TITLE element and it can have links (<A HREF="...">). Pretty much everything else inside the file gets ignored. A .linx file that looks like this:

<TITLE>Welcome to Figlet</TITLE>
<A HREF="MyPictures">View Pictures</A>

and a .linx file that looks like this:

<TITLE>Welcome to Figlet</TITLE>

Blah. Blah blah.
<A HREF="MyPictures">View Pictures</A>
Foo foo!

both produce the same main menu, which is shown in Figure 1.

Figure 1
Figure 1. Using .linx files allows you to create custom menus. Links appear in the order you choose. You can also provide custom titles.

You might assume that you can stick main.linx (or index.linx) files in any folder and they'll provide a default menu for that folder. But you can't. The main/index trick only works in your top-level folder. Put a .linx file (by whatever name) in any other folder and it adds an extra, custom menu as an extra menu item!

For example, I put the following main.linx file into my MyPictures folder as shown in Figure 2.

<TITLE>These Are My Pictures</TITLE>

<A HREF="foxnkit.jpg">A Fox and her Kit</A>

<A HREF="fruits.jpg">Fruit</a>
<A HREF="flwrvase.jpg">Flowers in a Vase</A>
<A HREF="rotaryphone.jpg">Classic Telephone</A>

Figure 2
Figure 2. Adding a main.linx file to a submenu can produce unexpected results.

Figure 3 shows the resulting menu. All the folder files are listed, as well as a link for the .linx file. The TITLE element in the .linx file sets the name of the menu item.

Figure 3
Figure 3. Using a .linx file (by any name) in submenus produces unexpected results.

In order to get the result that I really wanted, which was to replace the folder-as-menu contents of the MyPictures folder, you need to link directly to the .linx file from main.linx in your main Notes folder and abandon using links directly to folders. This code produces the menu shown in Figure 4. Feel free to name your secondary .linx files as you wish. The whole main/index naming convention only applies to the home Notes folder.

<TITLE>Welcome to Figlet</TITLE>
<A HREF="MyPictures/main.linx">View Pictures</A>

Figure 4
Figure 4. By linking to the .linx file and not to the subfolder, a correct result was achieved.

One thing you've got to be aware of is that .linx files slightly mess up NotesOnly mode. There's a bug in the current firmware. After dismounting your iPod, you'll end up at the main iPod menu and not directly in Notes. Navigate down into Extras -> Notes when this happens. Fortunately, once there, you're there. NotesOnly mode takes over and becomes the top level. If you use .linx files, be prepared for this extra step until Apple fixes this bug. You'll have to manually enter Extras -> Notes before delivering your product.

In addition to .linx files, Apple also provides single-link .link file support. As these files are even buggier than their multi-link big brothers, I cannot recommend using them and will not discuss them further in this article. If you want to learn more about them, consult Apple's iPod Notes Feature Guide (PDF).

Pages: 1, 2

Next Pagearrow