|
3 | 3 | import bms.model.*;
|
4 | 4 | import bms.player.beatoraja.ResourcePool;
|
5 | 5 |
|
| 6 | +import java.nio.file.InvalidPathException; |
6 | 7 | import java.nio.file.Path;
|
7 | 8 | import java.nio.file.Paths;
|
8 | 9 | import java.util.*;
|
@@ -249,37 +250,40 @@ public synchronized void setModel(BMSModel model) {
|
249 | 250 | return;
|
250 | 251 | }
|
251 | 252 | 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) { |
270 | 261 | break;
|
271 | 262 | }
|
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 | + } |
280 | 282 | }
|
281 | 283 | }
|
282 | 284 | }
|
| 285 | + } catch (InvalidPathException e) { |
| 286 | + Logger.getGlobal().warning(e.getMessage()); |
283 | 287 | }
|
284 | 288 | progress.incrementAndGet();
|
285 | 289 | });
|
|
0 commit comments