MCPcopy Create free account
hub / github.com/demoth/jake2 / GetAudioDiskInfo

Method GetAudioDiskInfo

client/src/main/java/jake2/client/CDAudio.java:279–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277 }
278
279 private static int GetAudioDiskInfo() {
280 cdValid = false;
281 maxTrack = 0;
282
283 // check for mp3's if no mp3's return -1
284 int numFiles = 0;
285
286 String folder = cddir.string + "/soundtrack";
287 File f = new File(folder);
288
289 if(f.exists() && f.isDirectory()) {
290 Com.DPrintf("CD Audio we found the sountrack folder\n");
291 File[] children = f.listFiles();
292 for(int i = 0; i < children.length; i++) {
293 boolean isText = checkMP3(children[i]);
294 if(isText)
295 numFiles++;
296 }
297 maxTrack = (byte) numFiles;
298 Com.DPrintf("CD Audio we found " + maxTrack + " MP3s in the folder\n");
299 if (maxTrack < 1)
300 return -1;
301 cdValid = true;
302 return 0;
303 }
304 return -1;
305 }
306
307 private static boolean checkMP3(File f) {
308 String name = f.getName();

Callers 3

CD_fMethod · 0.95
PlayMethod · 0.95
InitMethod · 0.95

Calls 2

DPrintfMethod · 0.95
checkMP3Method · 0.95

Tested by

no test coverage detected