Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
exch-bms2 committed Apr 27, 2019
2 parents 5c378f3 + 45d1944 commit cbde6d4
Show file tree
Hide file tree
Showing 10 changed files with 323 additions and 142 deletions.
16 changes: 16 additions & 0 deletions src/bms/player/beatoraja/PlayModeConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ public void setDuration(int inputduration) {
*/
public static class ControllerConfig {

public static final int ANALOG_SCRATCH_VER_2 = 0;

public static final int ANALOG_SCRATCH_VER_1 = 1;

private String name = "";

private int[] keys;
Expand All @@ -271,6 +275,10 @@ public static class ControllerConfig {
* アナログスクラッチを利用するか(INFINITASコントローラの場合true)
*/
private boolean analogScratch = false;
/**
* アナログスクラッチモード
*/
private int analogScratchMode = 0;
/**
* アナログスクラッチ停止閾値
*/
Expand Down Expand Up @@ -416,6 +424,14 @@ public void setAnalogScratch(boolean analogScratch) {
this.analogScratch = analogScratch;
}

public int getAnalogScratchMode() {
return analogScratchMode;
}

public void setAnalogScratchMode(int analogScratchMode) {
this.analogScratchMode = analogScratchMode;
}

public int getAnalogScratchThreshold() {
return this.analogScratchThreshold;
}
Expand Down
56 changes: 30 additions & 26 deletions src/bms/player/beatoraja/audio/AbstractAudioDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import bms.model.*;
import bms.player.beatoraja.ResourcePool;

import java.nio.file.InvalidPathException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
Expand Down Expand Up @@ -249,37 +250,40 @@ public synchronized void setModel(BMSModel model) {
return;
}
String name = model.getWavList()[wavid];
for (Note note : waventry.getValue()) {
// 音切りあり・なし両方のデータが必要になるケースがある
if (note.getMicroStarttime() == 0 && note.getMicroDuration() == 0) {
// 音切りなしのケース
Path p = dpath.resolve(name);
wavmap[wavid] = cache.get(new AudioKey(p.toString(), note));
if (wavmap[wavid] == null) {
break;
}
} else {
// 音切りありのケース
boolean b = true;
if (slicesound[note.getWav()] == null) {
slicesound[note.getWav()] = new Array<SliceWav<T>>();
}
for (SliceWav<T> slice : slicesound[note.getWav()]) {
if (slice.starttime == note.getMicroStarttime() && slice.duration == note.getMicroDuration()) {
b = false;
try {
Path p = dpath.resolve(name);
for (Note note : waventry.getValue()) {
// 音切りあり・なし両方のデータが必要になるケースがある
if (note.getMicroStarttime() == 0 && note.getMicroDuration() == 0) {
// 音切りなしのケース
wavmap[wavid] = cache.get(new AudioKey(p.toString(), note));
if (wavmap[wavid] == null) {
break;
}
}
if (b) {
Path p = dpath.resolve(name);
T sliceaudio = cache.get(new AudioKey(p.toString(), note));
if (sliceaudio != null) {
slicesound[note.getWav()].add(new SliceWav<T>(note, sliceaudio));
} else {
return;
} else {
// 音切りありのケース
boolean b = true;
if (slicesound[note.getWav()] == null) {
slicesound[note.getWav()] = new Array<SliceWav<T>>();
}
for (SliceWav<T> slice : slicesound[note.getWav()]) {
if (slice.starttime == note.getMicroStarttime() && slice.duration == note.getMicroDuration()) {
b = false;
break;
}
}
if (b) {
T sliceaudio = cache.get(new AudioKey(p.toString(), note));
if (sliceaudio != null) {
slicesound[note.getWav()].add(new SliceWav<T>(note, sliceaudio));
} else {
return;
}
}
}
}
} catch (InvalidPathException e) {
Logger.getGlobal().warning(e.getMessage());
}
progress.incrementAndGet();
});
Expand Down
Loading

0 comments on commit cbde6d4

Please sign in to comment.