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

Author:
torkjel

Nested Class Summary
static class ModLoader.IDInfo
           
 
Field Summary
 
Fields inherited from class com.vwp.sound.mod.modplay.loader.ModuleLoader
IT, MOD, S3M, STM, UNKNOWN, XM, ZIP
 
Constructor Summary
ModLoader(String name, byte[] data)
          loads a module from a .MOD file
 
Method Summary
static ModLoader.IDInfo getIdInfo(String id)
           
 Module getModule()
           
static int getPatternCount(int[] positions)
           
static int[] loadPositions(int numPos, RandomAccess raf)
           
static String readID(RandomAccess raf)
           
static 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
getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader, getModuleLoader
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModLoader

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

Parameters:
name - the name of the module
data - the module data
Throws:
InvalidFormatException
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(String id)

readID

public static String readID(RandomAccess raf)
                     throws IOException
Throws:
IOException

readName

public static String readName(RandomAccess raf)
                       throws IOException
Throws:
IOException

loadPositions

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

getPatternCount

public static int getPatternCount(int[] positions)