]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/NexuizDemoRecorder/main/src/main/java/com/nexuiz/demorecorder/application/plugins/EncoderPlugin.java
Merge branch 'master' of ssh://git.xonotic.org/xonotic
[xonotic/xonotic.git] / misc / tools / NexuizDemoRecorder / main / src / main / java / com / nexuiz / demorecorder / application / plugins / EncoderPlugin.java
1 package com.nexuiz.demorecorder.application.plugins;
2
3 import java.util.Properties;
4
5 import com.nexuiz.demorecorder.application.DemoRecorderApplication;
6 import com.nexuiz.demorecorder.application.jobs.RecordJob;
7
8 public interface EncoderPlugin {
9         
10         /**
11          * Makes the application layer known to the plug-in, which is required so that the plug-in
12          * can access the preferences of the application. Call this method first before using any
13          * of the others.
14          */
15         public void setApplicationLayer(DemoRecorderApplication appLayer);
16
17         /**
18          * Returns the name of the plug-in. Must not contain a "."
19          */
20         public String getName();
21         
22         /**
23          * Returns true if the plug-in is enabled (checked from the preferences of the app layer)
24          * @return true if the plug-in is enabled
25          */
26         public boolean isEnabled();
27         
28         /**
29          * Global preferences are preferences of a plug-in that are application-wide and not job-
30          * specific. They should be shown in a global preferences dialog.
31          * Use this method in order to tell the application layer and GUI which global settings your
32          * encoder plug-in offers, and set a reasonable default. Note that for the default-values being
33          * set you can either set to "true" or "false", any String (can be empty), or "filechooser" if
34          * you want the user to select a file. 
35          * @return
36          */
37         public Properties getGlobalPreferences();
38         
39         /**
40          * In order to influence the order of settings being displayed to the user in a UI, return an array
41          * of all keys used in the Properties object returned in getGlobalPreferences(), with your desired
42          * order.
43          * @return
44          */
45         public String[] getGlobalPreferencesOrder();
46         
47         /**
48          * Here you can return a Properties object that contains keys for values that can be specific to each
49          * individual RecordJob. 
50          * @return
51          */
52         public Properties getJobSpecificPreferences();
53         
54         /**
55          * In order to influence the order of job-specific settings being displayed to the user in a UI,
56          * return an array of all keys used in the Properties object returned in getJobSpecificPreferences(), with
57          * your desired order.
58          * @return
59          */
60         public String[] getJobSpecificPreferencesOrder();
61         
62         /**
63          * Will be called by the application layer when a job has been successfully recorded and moved to its
64          * final destination. This method has to perform the specific tasks your plug-in is supposed to do.
65          * @param job
66          * @throws EncoderPluginException
67          */
68         public void executeEncoder(RecordJob job) throws EncoderPluginException;
69 }