MediaBrowser Status

A quick update on the status of the MediaBrowser class I am working on. I’ve spent a few hours working on it and have some basic functionality working. I’m using Spotlight to find the media items to display. The user can select types of media via the drop down and each type has a list of predefined Spotlight queries associated with it. The user can then pick a query and the media will be filtered accordingly.

I’m not sure right now if this replicates enough of the iApp Media Browser palette. I plan to associate search directories to each query (so a query could be “all movies in my movies folder” or “all images in my pictures folder created in the last week”. I would also like to add in the reverse engineered support iPhoto rolls and albums, and am getting help with that from someone who has already done a lot of the work there.

The media browser doesn’t load the thumbnails for the media immediately, a background thread is responsible for loading the thumbnails (or loading a movie’s poster frame) and until the thumbnails are loaded a placeholder image is used instead. This helps keeps the window responsive to the user.

Screenshot: MediaBrowser002.png

I haven’t finished the public API for the Media Browser class yet. The aim will be to keep it simple (using NSOpenPanel as an example). All of the components in the code are linked together using Cocoa Bindings – the grid view that displays the media has several exposed bindings and with minor effort could be wrapped up in a Interface Builder palette and used in other projects. Queries are defined as simple plists with NSPredicates controlling how the media is filtered. Following is a simple example (plist format highly likely to change):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <dict>
        <key>id</key>
        <string>movies</string>
        <key>searches</key>
        <array>
            <dict>
                <key>NSPredicate</key>
                <string>kMDItemContentTypeTree == "public.movie" and kMDItemFSCreationDate &gt; $YESTERDAY</string>
                <key>title</key>
                <string>All movies Created Since Yesterday</string>
            </dict>
        </array>
        <key>title</key>
        <string>Movies</string>
        <key>viewType</key>
        <string>grid</string>
    </dict>
</array>
</plist>

There are still some bugs to iron out and features to add but hopefully I can get it ready this week for testing.

This entry was posted in Default. Bookmark the permalink.

Comments are closed.