Plugin SDK

Aus Ultimate Media Collector (UMC) - Wiki

Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

What you can do

The UMC Plugins SDK gives you the ability to develop different type of plugins to be used within UMC.

Plugin TypePlugin DescriptionAvailable in this version
ScannerUsed to scan the filesystem for mediafilesYES
ScraperUsed to gather information from an online movie databaseYES
MusicDBNO
SeriesYES
FanartUsed to collect fanart from online sourcesYES
PersonUsed to collect information about persons like actor, directors,…YES
GUIWill extend the UMC Java GUI with new featuresYES


What you will need

  1. The whole UMC GUI is based on Java so know-how in this programming language is absolutely necessary.
  2. Download the latest UMC Plugins SDK from http://www.hdd-player.de/umc/sdk/umc_plugins_sdk.rar
  3. The whole SDK is not available at the moment but the Jar with all needed interfaces,beans,helper methods,... is available and can be included in any Java project

  4. Download the latest Eclipse release from http://www.eclipse.org/ (you can use any other IDE but this document will give you only advice for the use within Eclipse)
  5. The UMC Javadoc

Installation

  1. Install Eclipse anywhere on your pc.
  2. Start Eclipse and choose a workspace folder to be used.
  3. Extract the downloaded file umc_plugins_sdk.rar in the previously selected workspace directory. This will create a directory Plugins.

Configuration

  1. Now switch back to Eclipse and Select File->New->Java Project
  2. In the area Contents choose the option Create project from existing source and select the Plugins directory which has been created in the workspace folder while extracting the file umc_plugins_sdk.rar.
  3. Enter the project name Plugins in the field Project name (important: do not use any other name!) and click the Finish button.

Create a new plugin

  1. Switch to the Package Explorer (tipp: change to hierarchical package presentation) and open the folder plugins. Here you will find a movie sample plugin (movie.sample). If you want to create your own plugin simply create an new folder an name it for example gui.movie.yourpluginname. Under this folder create the folder src and bin.
  2. Right-click on the folder 'src' and select Build Path -> Use as Source Folder (the 'src'-folder will disappear and Eclipse creates a new source folder entry 'plugins/gui.movie.yourpluginname/src'.
  3. Right-click on 'plugins/gui.movie.yourpluginname /src' and select Build Path -> Configure Output Folder... -> Specific Output Folder -> Browse -> navigate to 'plugins/gui.movie.yourpluginname /bin' -> Ok -> Ok
  4. Now it’s time to add the main class for your new plugin:
  5. - Righ-click on 'plugins/gui.movie.yourpluginname/src' and select New -> Class

    Package: plugins.gui.{plupinType}.{pluginName} (for example plugins.gui.movie.yourpluginname) Name: {yourpluginname} Superclass: com.umc.plugins.gui.AbstractMoviePlugin Interfaces: com.umc.plugins.gui.IPluginMovie

    Click the button Finish.

Developing new plugins

Here you will find information how youcan implement your own plugins to extend UMC.

UMC GUI Plugins

What is a GUI plugin

GUI plugins can extend the current version of the UMC Java GUI with additional features.

Example

UMC Parser Plugins

What is a parser plugin

A parser plugin is responsible for loading and parsing nfo/xml files. By default UMC will scan and find all relevant xml files in the defined libraries if the naming convetion is like:

  • Terminator.mkv
  • Terminator[Movie].xml

If UMC should suppot for example other nfo's than the standard UMC nfo's you can develop a new parser plugin for this special nfo type. Let's take a look at the workflow to understand better where the parser plugin will be exactly loaded and processed:

  1. UMC scans all defined libraries for nfo's and fanart (cover,backdrop,..) and stores all needed information in some kind of lists
  2. UMC scans all defined libraries for medie files and creates for every found medie file a job
  3. UMC will assign some basic data/information to this job objects (filename,filetype,scandir,....) -> if in step 1 a appropriate nfo/xml has been found for that movie UMC will assign this file to the job object
  4. after all jobs has been created UMC will create the so called BackgroundWorkers and start them -> each BackgroundWorker will grep a job from the joblist an dprocess this object
  5. each BackgroundWorker will load the selected parser plugin to retreive information from a possible nfo/xml file to assign it to the oject

So if you would like to be able to process for example files like Terminator.nfo (this filetype is not directly supported by UMC) you can provide your own parser plugin. In this plugin you can retreive all needed information from the given job object to knwo where the file is located for example. With this information you can try to search for your special Terminator.nfo and read the values from this file to assign them to the given job object.

Example

ToDo

UMC Scanner Plugins

What is a scanner plugin

Example

Even if the UMC PLugin SDK ist not available until now you can start developing new scanner plugins for UMC. Just create a Plugin-Class and implement a Interface called "IPluginScanner ". Create a interface in your IDE and name it as mentioned and just copy the following content to this interfcae.

/**
 * This interface defines all methods which are needed for UMC scanner plugins.
 * By use of this interface independency is gained from the used plugin.
 *
 * @author DonGyros
 * 
 * @version 0.1 04.09.2009
 *
 */
public interface IPluginScanner 
{	
 
	public static enum SCANNERTYPE{MOVIE, SERIES, PHOTO, MUSIC}; 
 
	/**
	 * This is the main method which will be called by the backend.
	 * 
	 * @param dir A directory to be scanned
	 * @param recursive true if the given directory should be scanned recursively else false
	 */
	public void searchFiles(File dir,boolean recursive);
 
	/**
	 * Returns the plugin type (either IPluginScanner.SCANNERTYPE.MOVIE, IPluginScanner.SCANNERTYPE.SERIES, IPluginScanner.SCANNERTYPE.PHOTO or IPluginScanner.SCANNERTYPE.MUSIC).
	 * @return
	 */
	public SCANNERTYPE getType();
 
	/**
	 * Returns the name of the plugin (must be the same name as the class file is named!!! For example the name for MyPlugin.class is MyPlugin).
	 * @return
	 */
	public String getName();
 
	/**
	 * Returns the name of the plugin to be shown in the gui.
	 * @return
	 */
	public String getDisplayName();
 
	/**
	 * Returns the description of the plugin.
	 * 
	 * @return Plugin description
	 */
	public String getDescription();
 
	/**
	 * Returns the name of the plugin author.
	 * @return
	 */
	public String getAuthor();
 
	/**
	 * Returns the version of the plugin.
	 * @return
	 */
	public double getVersion();
}

One last thing you will need is to call the method public static Movie createMovieBean(File aFile,boolean isVideoTS,boolean isBDMV,String groupTitle) from the MediaFactory class.

Interface and factory class should be soon available in the Plugin SDK.

Now create a new class and implement this methods. If you copy the compiled version of this class to the plugin directory (UMC applicationfolder/plugins/scanner) it should be selectable in the GUI the next time you start UMC.

UMC Javadoc

You can find the UMC Javadoc UMC here

Persönliche Werkzeuge
Development