Exemple #1
0
  private int updateData(Pattern pattern, int patternpos) {
    int[] data = pattern.getData();
    if (data.length == 0) return patternpos;
    int check = data[patternpos++];

    ud.reset();

    if ((check & 0x80) != 0) {
      // note
      if ((check & 0x1) != 0) ud.setNote(data[patternpos++]);

      // instrument
      if ((check & 0x2) != 0) {
        int tmp = data[patternpos++] - 1;
        ud.setInstrument(mod.getModule().getInstrument(tmp));
      }

      // volume
      if ((check & 0x4) != 0) ud.setVolume(data[patternpos++] & 0xff);

      // effect
      if ((check & 0x8) != 0) ud.setEffect(data[patternpos++]);

      // effect param
      if ((check & 0x10) != 0) ud.setEffectParameter(data[patternpos++] & 0xff);
    } else {
      ud.setNote(check);
      ud.setInstrument(mod.getModule().getInstrument(data[patternpos++] - 1));
      ud.setVolume(data[patternpos++] & 0xff);
      ud.setEffect(data[patternpos++]);
      ud.setEffectParameter(data[patternpos++] & 0xff);
    }
    return patternpos;
  }
Exemple #2
0
  final int skip(Pattern pattern, int patternpos) {
    int[] data = pattern.getData();
    if (data.length == 0) return patternpos;
    int check = data[patternpos++];

    if ((check & 0x80) != 0) {
      if ((check & 0x1) != 0) patternpos++;
      if ((check & 0x2) != 0) patternpos++;
      if ((check & 0x4) != 0) patternpos++;
      if ((check & 0x8) != 0) patternpos++;
      if ((check & 0x10) != 0) patternpos++;
    } else {
      patternpos += 4;
    }

    return patternpos;
  }