iPhone OS 3.1: noway

It has a bit faster spotlight (they added some indexes, lol), that’s true.
But a bug with sorting non-english track names makes navigation completely unusable. All such tracks are put into “123″ section even though locale supports required symbols and they’re shown as jump letters.

I’m lucky iTunes allows upgrade to an older version, because I don’t have a copy of my library on a PC.
So waiting for next beta… :)

ArtDoctor 2.0 console

Works with firmware 3.0 both on Windows and Mac OS X (using Mono) – tested on iPod Touch 1g (Windows 7, Snow Leopard) and iPhone 3GS (Snow Leopard).

This is still experimental, so comments and bugreports are welcome!

Download: ArtDoctor2con.

Still have no time to make GUI, sorry.

New iTunes library is here

I’ve just got why you should use new iTunes (8.2) since beta 5. They have replaced old iTunesDB library with new one based on SQLite, so sync is a bit odd thing now.
Device itself doesn’t use iTunesDB at all, but iTunes still does – I think it’s for compatibility reasons. When syncing, iTunes writes both iTunesDB and new library files to device. If there’s no iTunesDB file on device, iTunes will also purge new library and all your music will appear as “other” data.

I wonder whether new library will completely supersede iTunesDB or will they continue coexisting for compatibility reasons. But anyway, linux guys would be happy since SQLite format is open and much more clear for understanding.

Sync: “Slide to cancel”

Slide to CancelYeah, I’ve just found out how to handle this and terminate sync when user slides cancel switch.

We need following functions (meta-language):

ERROR AMDObserveNotification(HANDLE proxy, CFSTR notification);
ERROR AMDListenForNotifications(HANDLE proxy, NOTIFY_CALLBACK cb, USERDATA data);

and callback delegate:

typedef void (*NOTIFY_CALLBACK)(CFSTR notification, USERDATA data);

First, we need AMDObserveNotification to subscribe notifications about “com.apple.itunes-client.syncCancelRequest”. Then we should start listening for notifications (second function) until we get “AMDNotificationFaceplant”.
That’s it. When notification got, you should unlock and close lock file handle (don’t sure if you need to post “syncDidFinish” to proxy, seems it doesn’t matter) and terminate sync gracefully.

P.S. The same notification is also got when you unplug your device, so you should always be ready for errors.

ArtDoctor page added

No updates yet, it is still version 1.0.2.

Go to product page.

ArtDoctor

Artwork (album art) is a great feature of Apple devices. It not only helps to distinguish your albums, movies or podcasts visually, but also it is a real eye-candy. A lot of people enjoy it!

Loading pictures from tags and resizing them every time is really slow, so devices are using cache with images of several different sizes to speed-up loading. And sometimes this cache is getting corrupted. As a result you can see “black squares” or partially drawn images, or even images from other album/movie.

In such cases iTunes won’t help you a bit – it reads images directly from tags and doesn’t even know about cache corruption. Also for new devices there’s no “Show artwork on device” option anymore. And even if your device is either jailbroken or you have TouchCopy (or other file manager), deleting artwork cache won’t force it to get rebuilt.

As a workaround, you may automate iTunes via COM and rewrite artwork for each track, but it takes a lot of time and you’re not guaranteed it won’t get corruped on next sync.

ArtDoctor utility was written exactly for healing corrupted cache. It will scan all your albums, get uncorrupted artwork from tags and write it into cache. You may use existing cache (to keep images that can’t be extracted from tags, e.g. video thumbnails) or recreate it from scratch.

ArtDoctor deals directly with binary cache, without rewriting tags, modifying iTunes database and performing other stupid things. Thereby it is very fast (takes several minutes on average content) and doesn’t affect synchronization.

Download ArtDoctor 1.0.2.

It requires .NET Framework 3.0 (or newer), iTunes and Windows XP/Vista/7 to run.

Note: ArtDoctor 1.0.2 doesn’t support iPhone OS 3.0. Please refer to ArtDoctor 2.0 preview.

mp4patch

There are many ways to convert video for your iPod/iPhone. You may use user-friendly GUI programs or command-line utilities like ffmpeg or mencoder… But almost none of them could embed soft sublitles to resulting mp4 file. Hard-coded subtitles are the best what they can.

But there’s a cross-platform tool called MP4Box to deal with mp4 containers. It can add subtitle streams by typing smth like:

mp4box -add source.mp4 -add subtitle.srt:lang=en output.mp4

This allows you to add audio tracks as well.

The resulted file will play great on a PC, but your iPod would fail to recognize subtitles and alternative audio tracks.

Solution

mp4patch is a small cross-platform utility to solve this incompatibility issue. It takes an mp4 file and changes it to make acceptable by iPod Touch and iPhone devices (older iPods don’t support soft subtitles and track selection).

Usage is quite simple:

mp4patch input.mp4

If you’re running Windows, you may download mp4patch binary. If you’re running other OS (or you’re a geek) you can compile it from source.

How to compile

First of all, download source code: mp4patch.c.

If you are going to compile it under Windows and Visual C++, you also need stdint.h header. Put it near the source.

If you’re using gcc, use smth like

gcc -o mp4patch mp4patch.c

If you’re using VC++, use

cl /GF /O2 /TP /I . /MT mp4patch.c /link /manifest
mt -manifest mp4patch.exe.manifest -outputresource:mp4patch.exe
del mp4patch.obj mp4patch.exe.manifest

Notes:
1. All the mess with manifest file is to make UAC happy.
2. /MT switch makes static linking with C runtime. You may use /MD instead to link dynamically and to get smaller output size.

If you use some other compiler, please refer to its documentation.