com.vwp.sound.mod.modplay.loader
Class ModuleLoader

java.lang.Object
  extended by com.vwp.sound.mod.modplay.loader.ModuleLoader
Direct Known Subclasses:
ITLoader, ModLoader, S3MLoader, STMLoader, XMLoader, ZippedModuleLoader

public abstract class ModuleLoader
extends java.lang.Object

Must be extended by classes that load modules


Field Summary
protected static java.lang.String EXT_IT
           
protected static java.lang.String EXT_MOD
           
protected static java.lang.String EXT_S3M
           
protected static java.lang.String EXT_STM
           
protected static java.lang.String EXT_XM
           
protected static java.lang.String EXT_ZIP
           
static int IT
           
static int MOD
           
static int S3M
           
static int STM
           
static int UNKNOWN
           
static int XM
           
static int ZIP
           
 
Constructor Summary
ModuleLoader()
           
 
Method Summary
protected static byte[] getData(java.io.InputStream in)
           
abstract  Module getModule()
           
static ModuleLoader getModuleLoader(java.io.File modFile)
           
static ModuleLoader getModuleLoader(java.io.InputStream in, java.lang.String modFile)
           
static ModuleLoader getModuleLoader(int type, java.lang.String name, byte[] data)
           
static ModuleLoader getModuleLoader(int type, java.lang.String name, java.io.File modFile)
           
static ModuleLoader getModuleLoader(int type, java.lang.String name, java.net.URL modURL)
           
static ModuleLoader getModuleLoader(java.lang.String name, byte[] data)
           
static ModuleLoader getModuleLoader(java.net.URL modURL)
           
protected static void skip(java.io.DataInputStream dis, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
See Also:
Constant Field Values

MOD

public static final int MOD
See Also:
Constant Field Values

XM

public static final int XM
See Also:
Constant Field Values

S3M

public static final int S3M
See Also:
Constant Field Values

STM

public static final int STM
See Also:
Constant Field Values

IT

public static final int IT
See Also:
Constant Field Values

ZIP

public static final int ZIP
See Also:
Constant Field Values

EXT_MOD

protected static final java.lang.String EXT_MOD
See Also:
Constant Field Values

EXT_XM

protected static final java.lang.String EXT_XM
See Also:
Constant Field Values

EXT_S3M

protected static final java.lang.String EXT_S3M
See Also:
Constant Field Values

EXT_STM

protected static final java.lang.String EXT_STM
See Also:
Constant Field Values

EXT_IT

protected static final java.lang.String EXT_IT
See Also:
Constant Field Values

EXT_ZIP

protected static final java.lang.String EXT_ZIP
See Also:
Constant Field Values
Constructor Detail

ModuleLoader

public ModuleLoader()
Method Detail

getModuleLoader

public static ModuleLoader getModuleLoader(int type,
                                           java.lang.String name,
                                           java.io.File modFile)
                                    throws InvalidFormatException,
                                           java.io.IOException
Throws:
InvalidFormatException
java.io.IOException

getModuleLoader

public static ModuleLoader getModuleLoader(int type,
                                           java.lang.String name,
                                           java.net.URL modURL)
                                    throws InvalidFormatException,
                                           java.io.IOException
Throws:
InvalidFormatException
java.io.IOException

getModuleLoader

public static ModuleLoader getModuleLoader(java.net.URL modURL)
                                    throws InvalidFormatException,
                                           java.io.IOException
Throws:
InvalidFormatException
java.io.IOException

getModuleLoader

public static ModuleLoader getModuleLoader(java.io.File modFile)
                                    throws InvalidFormatException,
                                           java.io.IOException
Throws:
InvalidFormatException
java.io.IOException

getModuleLoader

public static ModuleLoader getModuleLoader(java.io.InputStream in,
                                           java.lang.String modFile)
                                    throws InvalidFormatException,
                                           java.io.IOException
Throws:
InvalidFormatException
java.io.IOException

getModuleLoader

public static ModuleLoader getModuleLoader(java.lang.String name,
                                           byte[] data)
                                    throws InvalidFormatException,
                                           java.io.IOException
Throws:
InvalidFormatException
java.io.IOException

getModuleLoader

public static ModuleLoader getModuleLoader(int type,
                                           java.lang.String name,
                                           byte[] data)
                                    throws InvalidFormatException,
                                           java.io.IOException
Throws:
InvalidFormatException
java.io.IOException

getData

protected static byte[] getData(java.io.InputStream in)
                         throws java.io.IOException
Parameters:
in - stream containing the module data
Returns:
the raw module data
Throws:
java.io.IOException

getModule

public abstract Module getModule()
Returns:
the module loaded by a module loader.

skip

protected static void skip(java.io.DataInputStream dis,
                           int len)
                    throws java.io.IOException
Throws:
java.io.IOException