Media Library

Essentials

Songbird keeps track of all media as media items. A media item associates metadata with a GUID, such as user-relevant properties like "Artist Name" and "Track Name", internally relevant metadata such as "isList" or "hidden" and potentially custom metadata like "color". This information is tracked by properties.

Media lists are themselves extensions of media items, and are stored in a library. A media list is, in essence, a list of pointers to media items and cannot store any information about those items other than a sequencing.

Media lists are displayed on media pages

Media Items

Interface: [sbIMediaItem]

Media items are uniquely identified by GUID, though the same underlying media resource may have different GUIDs if it originates from different libraries, servers, songbirds or file formats.

Properties

Interface: [sbIProperties] Useful Code: sbProperties.jsm

Properties are the collection of metadata on a mediaitem. Using sbProperties.jsm you can get this information like this:

var artist  = myMediaItem.getProperty(SBProperties.artistName);
artist = "Van Halen";
myMediaItem.setProperty(SBProperties.artistName, artist);

Media Lists

Interface: [sbIMediaList]

Media lists are ordered lists of media items, and the same item may appear more than once in the list.

'Note': All created media lists are added permanently to a library and appear in the Service Pane's list of playlists unless you explicitly set them to hidden and/or remove them when you are finished with them.

Library

Interface: [sbILibrary]

A library is an unordered list of media items in which each media item may only appear once.

Media Pages

Media pages are XUL pages registered with the MediaPageManager that implement sbIMediaPage and manipulate the mediaListView object they are handed during the onload handler to display a media collection. 

Media List Views

Because media lists can get very big, particularly in the case of libraries, it helps to have an optimized system in place for quickly filtering collections. This functionality is used by the library view (sbLibraryView.xul, which also shows playlists) and the jump-to dialog box (jumpTo.xul).

Media lists can have filters and a search applied to them. Filters cascade -- the results of the first filter are passed to the second and so forth for further reduction. The various filter result lists can be queried for display in a library view. For example, the default Songbird view has three cascading filters -- year, artist, and album. If you select some values for year, only artist and album values which have tracks within that year window will appear "downstream."

From a technical point of view, each additional filter queried on the same property is "or"ed together, and each filter on different property is "and"ed.

Tag page
You must login to post a comment.