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

java.lang.Object
  extended by com.vwp.sound.mod.modplay.loader.ModuleLoader
      extended by com.vwp.sound.mod.modplay.loader.ModLoader

public class ModLoader
extends ModuleLoader

Makes it possible to load a module from a .MOD file


Nested Class Summary
static class ModLoader.IDInfo
           
 
Field Summary
 
Fields inherited from class com.vwp.sound.mod.modplay.loader.ModuleLoader
EXT_IT, EXT_MOD, EXT_S3M, EXT_STM, EXT_XM, EXT_ZIP, IT, MOD, S3M, STM, UNKNOWN, XM, ZIP
 
Constructor Summary
ModLoader(java.lang.String name, byte[] data)
          loads a module from a .MOD file
 
Method Summary
static ModLoader.IDInfo getIdInfo(java.lang.String id)
           
 Module getModule()
           
static int getPatternCount(int[] positions)
           
static int[] loadPositions(int numPos, RandomAccess raf)
           
static java.lang.String readID(RandomAccess raf)
           
static java.lang.String readName(RandomAccess raf)
           
static int translateEffectNum(int effectNum, int arg1)
          translates effect numbers used by the the .MOD format to effect numbers used by JMOD.
 
Methods inherited from class com.vwp.sound.mod.modplay.loader.ModuleLoader
getData, getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModLoader

public ModLoader(java.lang.String name,
                 byte[] data)
          throws InvalidFormatException,
                 java.io.IOException
loads a module from a .MOD file

Parameters:
name - the name of the module
data - the module data
Throws:
InvalidFormatException
java.io.IOException
Method Detail

getModule

public Module getModule()
Specified by:
getModule in class ModuleLoader
Returns:
the module loaded by this loader

translateEffectNum

public static int translateEffectNum(int effectNum,
                                     int arg1)
                              throws InvalidFormatException
translates effect numbers used by the the .MOD format to effect numbers used by JMOD.

Parameters:
effectNum -
arg1 - is needed for extended effects
Returns:
effect number used by JMOD
Throws:
InvalidFormatException

getIdInfo

public static ModLoader.IDInfo getIdInfo(java.lang.String id)

readID

public static java.lang.String readID(RandomAccess raf)
                               throws java.io.IOException
Throws:
java.io.IOException

readName

public static java.lang.String readName(RandomAccess raf)
                                 throws java.io.IOException
Throws:
java.io.IOException

loadPositions

public static int[] loadPositions(int numPos,
                                  RandomAccess raf)
                           throws java.io.IOException
Throws:
java.io.IOException

getPatternCount

public static int getPatternCount(int[] positions)