package turgen.plugin;

import javax.swing.JPanel;
import turgen.Turgen;
import turgen.generator.SignalGenerator;
import turgen.playlist.AbstractPlayListItem;
import turgen.tapeimage.TapeImageChunk;

/** Dummy plugin that does nothing*/
public final class DummyPlugin implements Plugin {

    private static final int[] dummyInstructions = {SignalGenerator.INSTR_END};
    private JPanel  panel;
    private final String[] chunkNames;
    private final BinaryConvertor[] convertors;
    private InOutProvider ioProvider;

    public DummyPlugin() {
        this.chunkNames = new String[0];
        this.convertors = new BinaryConvertor[0];
    }
    
    public String getName() {
        return "Dummy Plugin";
    }

    public int[] convertItem(AbstractPlayListItem plr) {
        return dummyInstructions;
    }

    public String getLastError() {
        return "";
    }

    public void init() {
        panel = new JPanel();
    }

    public JPanel getItemPanel() {
        return panel;
    }

    public String validateItemOnPanel() {
        return null;
    }

    public void resetPanel() {
        
    }

    public AbstractPlayListItem getItemFromPanel() {
        DummyPlaylistItem dpi = new DummyPlaylistItem();
        dpi.inFile=ioProvider.getInFile();
        dpi.outFile=ioProvider.getOutFile();
        dpi.pluginClass=Turgen.pluginManager.getPluginClassName(this);
        return dpi;
    }

    public void fillPanel(AbstractPlayListItem plr) {
        
    }

    public void setInOutProvider(InOutProvider prov) {
        ioProvider = prov;
    }

    public String[] getSupportedTapeImageChunks() {
        return chunkNames;
    }

    public void addInstructionsForChunk(InstructionStream is, TapeImageChunk chunk) throws Exception {
        
    }

    public BinaryConvertor[] getBinaryConvertors() {
        return convertors;
    }

    public String getCountry() {
        return "UN";
    }

    public boolean isUsingAlternateFileChooser() {
        return false;
    }

}
