Skip to content

Commit cbde6d4

Browse files
committed
2 parents 5c378f3 + 45d1944 commit cbde6d4

10 files changed

+323
-142
lines changed

src/bms/player/beatoraja/PlayModeConfig.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ public void setDuration(int inputduration) {
254254
*/
255255
public static class ControllerConfig {
256256

257+
public static final int ANALOG_SCRATCH_VER_2 = 0;
258+
259+
public static final int ANALOG_SCRATCH_VER_1 = 1;
260+
257261
private String name = "";
258262

259263
private int[] keys;
@@ -271,6 +275,10 @@ public static class ControllerConfig {
271275
* アナログスクラッチを利用するか(INFINITASコントローラの場合true)
272276
*/
273277
private boolean analogScratch = false;
278+
/**
279+
* アナログスクラッチモード
280+
*/
281+
private int analogScratchMode = 0;
274282
/**
275283
* アナログスクラッチ停止閾値
276284
*/
@@ -416,6 +424,14 @@ public void setAnalogScratch(boolean analogScratch) {
416424
this.analogScratch = analogScratch;
417425
}
418426

427+
public int getAnalogScratchMode() {
428+
return analogScratchMode;
429+
}
430+
431+
public void setAnalogScratchMode(int analogScratchMode) {
432+
this.analogScratchMode = analogScratchMode;
433+
}
434+
419435
public int getAnalogScratchThreshold() {
420436
return this.analogScratchThreshold;
421437
}

src/bms/player/beatoraja/audio/AbstractAudioDriver.java

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import bms.model.*;
44
import bms.player.beatoraja.ResourcePool;
55

6+
import java.nio.file.InvalidPathException;
67
import java.nio.file.Path;
78
import java.nio.file.Paths;
89
import java.util.*;
@@ -249,37 +250,40 @@ public synchronized void setModel(BMSModel model) {
249250
return;
250251
}
251252
String name = model.getWavList()[wavid];
252-
for (Note note : waventry.getValue()) {
253-
// 音切りあり・なし両方のデータが必要になるケースがある
254-
if (note.getMicroStarttime() == 0 && note.getMicroDuration() == 0) {
255-
// 音切りなしのケース
256-
Path p = dpath.resolve(name);
257-
wavmap[wavid] = cache.get(new AudioKey(p.toString(), note));
258-
if (wavmap[wavid] == null) {
259-
break;
260-
}
261-
} else {
262-
// 音切りありのケース
263-
boolean b = true;
264-
if (slicesound[note.getWav()] == null) {
265-
slicesound[note.getWav()] = new Array<SliceWav<T>>();
266-
}
267-
for (SliceWav<T> slice : slicesound[note.getWav()]) {
268-
if (slice.starttime == note.getMicroStarttime() && slice.duration == note.getMicroDuration()) {
269-
b = false;
253+
try {
254+
Path p = dpath.resolve(name);
255+
for (Note note : waventry.getValue()) {
256+
// 音切りあり・なし両方のデータが必要になるケースがある
257+
if (note.getMicroStarttime() == 0 && note.getMicroDuration() == 0) {
258+
// 音切りなしのケース
259+
wavmap[wavid] = cache.get(new AudioKey(p.toString(), note));
260+
if (wavmap[wavid] == null) {
270261
break;
271262
}
272-
}
273-
if (b) {
274-
Path p = dpath.resolve(name);
275-
T sliceaudio = cache.get(new AudioKey(p.toString(), note));
276-
if (sliceaudio != null) {
277-
slicesound[note.getWav()].add(new SliceWav<T>(note, sliceaudio));
278-
} else {
279-
return;
263+
} else {
264+
// 音切りありのケース
265+
boolean b = true;
266+
if (slicesound[note.getWav()] == null) {
267+
slicesound[note.getWav()] = new Array<SliceWav<T>>();
268+
}
269+
for (SliceWav<T> slice : slicesound[note.getWav()]) {
270+
if (slice.starttime == note.getMicroStarttime() && slice.duration == note.getMicroDuration()) {
271+
b = false;
272+
break;
273+
}
274+
}
275+
if (b) {
276+
T sliceaudio = cache.get(new AudioKey(p.toString(), note));
277+
if (sliceaudio != null) {
278+
slicesound[note.getWav()].add(new SliceWav<T>(note, sliceaudio));
279+
} else {
280+
return;
281+
}
280282
}
281283
}
282284
}
285+
} catch (InvalidPathException e) {
286+
Logger.getGlobal().warning(e.getMessage());
283287
}
284288
progress.incrementAndGet();
285289
});

0 commit comments

Comments
 (0)