Lizzy v1.1.1

Package christophedelory.playlist

The home of the playlist management API.

See:
          Description

Interface Summary
PlaylistVisitor A playlist hierarchy visitor.
SpecificPlaylist The base definition of a specific playlist implementation.
SpecificPlaylistProvider A specific playlist provider manages a given type of playlist (for example ASX or M3U).
 

Class Summary
AbstractPlaylistComponent The base component of a playlist.
AbstractTimeContainer The base definition of time containers.
BasePlaylistVisitor A starting point for a playlist visitor.
Media The definition of a media content.
Parallel A playlist group in which multiple elements can play back at the same time.
Playlist The definition of the top-level element: the playlist.
Sequence A playlist sequence: the media contents play one after the other.
SpecificPlaylistFactory The playlist factory.
 

Package christophedelory.playlist Description

The home of the playlist management API. You should begin here with SpecificPlaylistFactory.
You will find below the main steps in order to properly use the API for parsing an existing playlist (exception catching is not performed):

The "generic" playlist hierarchy is the following:

Now you want to save your playlist in a given format, let's say "ASX". First you have to retrieve the associated playlist provider. Two methods are available for that purpose:
  1. You know the "internal" identifier of this provider ("asx" in this case, see the diagram below): use the following code:
    SpecificPlaylistProvider provider = SpecificPlaylistFactory.getInstance().findProviderById("asx");
        
  2. Or use the typical file name extension for this type of playlist:
    SpecificPlaylistProvider provider = SpecificPlaylistFactory.getInstance().findProviderByExtension(".asx");
        
Note: if you prefer to keep the same format as for the source, simply use the input playlist's provider, like this:
SpecificPlaylistProvider provider = specificPlaylist.getProvider();
The "specific" playlist providers hierarchy is the following:

Now convert your generic playlist description to the chosen format:
SpecificPlaylist newSpecificPlaylist = provider.toSpecificPlaylist(genericPlaylist);
If everything ran well, you can now flush the result to any output stream:
newSpecificPlaylist.writeTo(System.out, null);
Enjoy!


© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.