Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Gallery interfaces

IGallery provides the functionality to catalog content available on the device. Its primary purpose is to support multimedia applications that use media metainfo such as Album, Artist, or media type (e.g. video or video), but it indexes all files in its mounted directories and thus it can be used by generically file system browsing applications.

IGallery is typically supported by an underlying database engine. The IGallery interface does not permit direct access to the underlying database(s), but its methods generally take input in the form of SQL clauses. This allows users to perform powerful and arbitrary complex operations on a Gallery and at the same time allows the implementation to hide the intimate details involved in creating and maintaining the database(s).

A Gallery exposes its contents through a single simple pseudo database table. Each row represents an entry in the Gallery and each column represents a piece of metadata information for the entry.

@TABLE@

ID Column 1 Column 2 Column 3
Entry 1 1
Entry 2 2
Entry 3 3

The class implementing IGallery must define the columns supported in the table. The IGallery interface requires classes implementing IGallery to comply with schema versioning and only allows classes to add columns when incrementing the schema version in order to ensure that IGallery users are forward compatible with newer schema versions. See AEEGallerySchema.h for an example schema definition.

Simple queries do not require the table name. However, some complex operations may require subqueries which may require the tablename to appear in the SQL clause. The fragment "@TABLE@" is used to represent the pseudo table. An example, an IGallery_Update() call used to update sizes for folder entries, is shown here:

nErr = IGallery_Update(pif, L"FileSize =" L" (SELECT TOTAL(FileSize)" L" 

FROM (SELECT FullPath AS Path, FileSize, MimeType 

FROM @TABLE@)" L" WHERE MimeType <> 'x-directory' 

AND Path LIKE FullPath || '%')", L"MimeType = 'x-directory'", &piStmt);

From the end user's perspective, whether the media content is DRM protected or not, is and should be transparent.