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 for Mac OS X: possible!

Some time ago a Mac port of Mono was released, so it made completely possible to run .NET applications there. But ArtDoctor needs to operate directly with device and was strictly tied with iTunesMobileDevice.dll, which has no analog on a Mac.

And today I’ve managed to create a fully cross-platform .NET library to deal with Apple devices. It even works without re-compiling for target platform. The trick is to use MobileDevice (dll on Windows and framework on Mac OS X) instead and apply some dll redirections for Mono.

However, it’s not just to change referenced library name. Unlike iTunesMobileDevice, MobileDevice framework doesn’t use native threads on both platforms. Also it is more strict about strings, so hand-made CFStrings most likely won’t do.

P.S. I really have no idea why both of these libraries are included in Windows distribution of Apple Mobile Device Support, ’cause they don’t even reference each other.

foobar2000: WASAPI on Windows7

Looking at Google Analytics I’ve found out that somebody came to this site looking for solution of WASAPI issue. Well, maybe it should be here :)

On builds before 7068 WASAPI was working as expected. But all newer builds (up to RC1 7100) cause it to throw “unrecoverable playback error: could not open device 88890020″.
I don’t know what exactly does it mean, but I know how to fix it. The default 1000 ms buffer size does not fit for some reason, so you should decrease it – 500 (and less) ms buffer is ok. Note that this number could vary for different hardware.

Well, maybe it’s not a perfect solution, but it does work for now!

foo_cuefilter 0.1.7

This is almost a complete code rewrite.
It should have better performance and no stupid glitches (I hope) of previous version.

Go to product page to read more.

Quick download: foo_cuefilter 0.1.7.

foo_w7shell 0.2.7.0

This release introduces new experimental feature: playlist list in jumplist (OMG! A lot of “lists” around.) Now you can change playlist without opening main window – just choose one from foobar’s context menu.

Also there are two new icons for “play” and “preferences”. Hope they’re not very awful… :)

Go to product page to read more.

Quick download: foo_w7shell 0.2.7.0.

ArtDoctor future

For some time I thought that current ArtDoctor version (1.0.2) can fix any artwork-related issues. Well, I was wrong: maybe in case of iTunes that’s true, but other managers could not be trusted a bit.

A few days ago I was trying to resolve a reported issue with “parameter is not valid” error.
At first I thought there were some changes in thumbnail formats (error was got on iTouch 2G, and I’ve never tested it on that device). Then I looked in ArtworkDB and noticed that it had invalid information inside, like overlapping offsets in cache files.
So I understood ArtDoctor must also be able to rewrite artwork database, not only cache. It still doesn’t affect main database and is safe for your player. Even if something goes wrong, you won’t lose your music.
Continue Reading »

foo_w7shell 0.2.6.2 released

This is minor release. It should solve an issue with thumbnail flipped vertically in late betas (7057).
It also doesn’t crash anymore on foobar2000 update/reinstallation, when foobar runs without creating a window.

Go to product page to read more.

Quick download: foo_w7shell 0.2.6.2.

Lost records in DataView

What should you do if you need to get position of a record in DataView? Generally, DataView implements an IList interface, so you may concider calling ((IList) dataView).IndexOf(dataRowView) would do all the magic for you.
I thought in such a way before I found out, that calling IndexOf on a DataRowView being edited would return “-1″ (i.e. not found).

It happens because a DataRow creates a temporary copy of itself when calling BeginEdit() and associates a DataRowView with that copy. And calling IndexOf on DataView performs lookup through DataTable’s index, who has no idea about that temporary copy and returns nothing.

So you should finish with editing before performing any lookup.

ArtDoctor page added

No updates yet, it is still version 1.0.2.

Go to product page.