| 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(); |