diff options
Diffstat (limited to 'NET/worlds/scape/MusicManager.java')
| -rw-r--r-- | NET/worlds/scape/MusicManager.java | 560 |
1 files changed, 560 insertions, 0 deletions
diff --git a/NET/worlds/scape/MusicManager.java b/NET/worlds/scape/MusicManager.java new file mode 100644 index 0000000..c50ae78 --- /dev/null +++ b/NET/worlds/scape/MusicManager.java @@ -0,0 +1,560 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.DialogReceiver; +/* */ import NET.worlds.console.Main; +/* */ import NET.worlds.console.MainCallback; +/* */ import NET.worlds.network.URL; +/* */ import java.util.Hashtable; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class MusicManager +/* */ implements MainCallback, DialogReceiver +/* */ { +/* 55 */ private static Hashtable<URL, MusicManager> managers = new Hashtable(); +/* */ private static MusicManagerDialog dialog; +/* */ private static boolean registered; +/* */ private static URL lastWorldURL; +/* */ private static boolean showDialog; +/* */ private static MusicManager curManager; +/* 61 */ private static String lastRoomName = ""; +/* */ +/* */ private static int lastCDTrack; +/* */ private static URL lastMIDIFile; +/* */ private String name; +/* 66 */ private Hashtable<String, MusicTrack> tracks = new Hashtable(); +/* 67 */ private Hashtable<String, MusicRoom> rooms = new Hashtable(); +/* */ private World world; +/* */ private String fileName; +/* */ private boolean maybeMusicChange; +/* */ +/* */ public static void showDialog() +/* */ { +/* 74 */ if (dialog == null) +/* 75 */ showDialog = true; +/* */ } +/* */ +/* */ public MusicManager() { +/* 79 */ if (!registered) { +/* 80 */ Main.register(this); +/* 81 */ registered = true; +/* 82 */ curManager = this; +/* */ } +/* */ } +/* */ +/* */ private MusicManager(World world, URL url) { +/* 87 */ this.world = world; +/* 88 */ this.name = world.getName(); +/* 89 */ String file = url.unalias().toLowerCase(); +/* 90 */ int index = file.lastIndexOf(".world"); +/* 91 */ if (index != -1) { +/* 92 */ this.fileName = (url.unalias().substring(0, index) + ".music"); +/* 93 */ load(); +/* */ } +/* */ } +/* */ +/* */ public World getWorld() { +/* 98 */ return this.world; +/* */ } +/* */ +/* */ public String getName() { +/* 102 */ return this.name; +/* */ } +/* */ +/* */ public String getFileName() { +/* 106 */ return this.fileName; +/* */ } +/* */ +/* */ public Hashtable<String, MusicTrack> getMusic() { +/* 110 */ return this.tracks; +/* */ } +/* */ +/* */ public MusicTrack getMusic(String name) { +/* 114 */ return (MusicTrack)this.tracks.get(name); +/* */ } +/* */ +/* */ public Hashtable<String, MusicRoom> getRooms() { +/* 118 */ return this.rooms; +/* */ } +/* */ +/* */ public MusicRoom getRoom(String name) { +/* 122 */ return (MusicRoom)this.rooms.get(name); +/* */ } +/* */ +/* */ public synchronized void maybeChangedMusic() { +/* 126 */ this.maybeMusicChange = true; +/* */ } +/* */ +/* */ /* Error */ +/* */ public void save() +/* */ { +/* */ // Byte code: +/* */ // 0: aconst_null +/* */ // 1: astore_1 +/* */ // 2: new 153 java/io/PrintStream +/* */ // 5: dup +/* */ // 6: new 155 java/io/FileOutputStream +/* */ // 9: dup +/* */ // 10: aload_0 +/* */ // 11: getfield 122 NET/worlds/scape/MusicManager:fileName Ljava/lang/String; +/* */ // 14: invokespecial 157 java/io/FileOutputStream:<init> (Ljava/lang/String;)V +/* */ // 17: invokespecial 158 java/io/PrintStream:<init> (Ljava/io/OutputStream;)V +/* */ // 20: astore_1 +/* */ // 21: aload_0 +/* */ // 22: getfield 58 NET/worlds/scape/MusicManager:tracks Ljava/util/Hashtable; +/* */ // 25: invokestatic 161 NET/worlds/core/Sort:sortKeys (Ljava/util/Hashtable;)[Ljava/lang/String; +/* */ // 28: astore_2 +/* */ // 29: iconst_0 +/* */ // 30: istore_3 +/* */ // 31: goto +100 -> 131 +/* */ // 34: aload_0 +/* */ // 35: getfield 58 NET/worlds/scape/MusicManager:tracks Ljava/util/Hashtable; +/* */ // 38: aload_2 +/* */ // 39: iload_3 +/* */ // 40: aaload +/* */ // 41: invokevirtual 137 java/util/Hashtable:get (Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 44: checkcast 141 NET/worlds/scape/MusicTrack +/* */ // 47: astore 4 +/* */ // 49: aload 4 +/* */ // 51: invokevirtual 167 NET/worlds/scape/MusicTrack:getMIDIFileName ()Ljava/lang/String; +/* */ // 54: astore 5 +/* */ // 56: aload 5 +/* */ // 58: invokevirtual 170 java/lang/String:length ()I +/* */ // 61: ifne +7 -> 68 +/* */ // 64: ldc -82 +/* */ // 66: astore 5 +/* */ // 68: aload_1 +/* */ // 69: new 100 java/lang/StringBuilder +/* */ // 72: dup +/* */ // 73: ldc -80 +/* */ // 75: invokespecial 110 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 78: aload 4 +/* */ // 80: invokevirtual 178 NET/worlds/scape/MusicTrack:getName ()Ljava/lang/String; +/* */ // 83: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 86: ldc -77 +/* */ // 88: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 91: aload 4 +/* */ // 93: invokevirtual 181 NET/worlds/scape/MusicTrack:getVirtTrackNumber ()I +/* */ // 96: invokevirtual 184 java/lang/StringBuilder:append (I)Ljava/lang/StringBuilder; +/* */ // 99: ldc -77 +/* */ // 101: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 104: aload 5 +/* */ // 106: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 109: ldc -77 +/* */ // 111: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 114: aload 4 +/* */ // 116: invokevirtual 187 NET/worlds/scape/MusicTrack:getLooping ()Z +/* */ // 119: invokevirtual 191 java/lang/StringBuilder:append (Z)Ljava/lang/StringBuilder; +/* */ // 122: invokevirtual 119 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 125: invokevirtual 194 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 128: iinc 3 1 +/* */ // 131: iload_3 +/* */ // 132: aload_2 +/* */ // 133: arraylength +/* */ // 134: if_icmplt -100 -> 34 +/* */ // 137: aload_0 +/* */ // 138: getfield 60 NET/worlds/scape/MusicManager:rooms Ljava/util/Hashtable; +/* */ // 141: invokestatic 161 NET/worlds/core/Sort:sortKeys (Ljava/util/Hashtable;)[Ljava/lang/String; +/* */ // 144: astore_2 +/* */ // 145: iconst_0 +/* */ // 146: istore_3 +/* */ // 147: goto +58 -> 205 +/* */ // 150: aload_0 +/* */ // 151: getfield 60 NET/worlds/scape/MusicManager:rooms Ljava/util/Hashtable; +/* */ // 154: aload_2 +/* */ // 155: iload_3 +/* */ // 156: aaload +/* */ // 157: invokevirtual 137 java/util/Hashtable:get (Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 160: checkcast 147 NET/worlds/scape/MusicRoom +/* */ // 163: astore 4 +/* */ // 165: aload_1 +/* */ // 166: new 100 java/lang/StringBuilder +/* */ // 169: dup +/* */ // 170: ldc -59 +/* */ // 172: invokespecial 110 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 175: aload 4 +/* */ // 177: invokevirtual 199 NET/worlds/scape/MusicRoom:getRoomName ()Ljava/lang/String; +/* */ // 180: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 183: ldc -77 +/* */ // 185: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 188: aload 4 +/* */ // 190: invokevirtual 202 NET/worlds/scape/MusicRoom:getMusicName ()Ljava/lang/String; +/* */ // 193: invokevirtual 115 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 196: invokevirtual 119 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 199: invokevirtual 194 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 202: iinc 3 1 +/* */ // 205: iload_3 +/* */ // 206: aload_2 +/* */ // 207: arraylength +/* */ // 208: if_icmplt -58 -> 150 +/* */ // 211: goto +28 -> 239 +/* */ // 214: astore_2 +/* */ // 215: aload_1 +/* */ // 216: ifnull +31 -> 247 +/* */ // 219: aload_1 +/* */ // 220: invokevirtual 205 java/io/PrintStream:close ()V +/* */ // 223: goto +24 -> 247 +/* */ // 226: astore 6 +/* */ // 228: aload_1 +/* */ // 229: ifnull +7 -> 236 +/* */ // 232: aload_1 +/* */ // 233: invokevirtual 205 java/io/PrintStream:close ()V +/* */ // 236: aload 6 +/* */ // 238: athrow +/* */ // 239: aload_1 +/* */ // 240: ifnull +7 -> 247 +/* */ // 243: aload_1 +/* */ // 244: invokevirtual 205 java/io/PrintStream:close ()V +/* */ // 247: return +/* */ // Line number table: +/* */ // Java source line #130 -> byte code offset #0 +/* */ // Java source line #132 -> byte code offset #2 +/* */ // Java source line #134 -> byte code offset #21 +/* */ // Java source line #135 -> byte code offset #29 +/* */ // Java source line #136 -> byte code offset #34 +/* */ // Java source line #137 -> byte code offset #49 +/* */ // Java source line #138 -> byte code offset #56 +/* */ // Java source line #139 -> byte code offset #64 +/* */ // Java source line #140 -> byte code offset #68 +/* */ // Java source line #141 -> byte code offset #91 +/* */ // Java source line #142 -> byte code offset #114 +/* */ // Java source line #140 -> byte code offset #125 +/* */ // Java source line #135 -> byte code offset #128 +/* */ // Java source line #144 -> byte code offset #137 +/* */ // Java source line #145 -> byte code offset #145 +/* */ // Java source line #146 -> byte code offset #150 +/* */ // Java source line #147 -> byte code offset #165 +/* */ // Java source line #145 -> byte code offset #202 +/* */ // Java source line #149 -> byte code offset #211 +/* */ // Java source line #151 -> byte code offset #215 +/* */ // Java source line #152 -> byte code offset #219 +/* */ // Java source line #150 -> byte code offset #226 +/* */ // Java source line #151 -> byte code offset #228 +/* */ // Java source line #152 -> byte code offset #232 +/* */ // Java source line #153 -> byte code offset #236 +/* */ // Java source line #151 -> byte code offset #239 +/* */ // Java source line #152 -> byte code offset #243 +/* */ // Java source line #154 -> byte code offset #247 +/* */ // Local variable table: +/* */ // start length slot name signature +/* */ // 0 248 0 this MusicManager +/* */ // 1 243 1 out java.io.PrintStream +/* */ // 28 179 2 keys String[] +/* */ // 214 1 2 localException Exception +/* */ // 30 102 3 i int +/* */ // 146 60 3 i int +/* */ // 47 68 4 m MusicTrack +/* */ // 163 26 4 r MusicRoom +/* */ // 54 51 5 midiName String +/* */ // 226 11 6 localObject Object +/* */ // Exception table: +/* */ // from to target type +/* */ // 2 211 214 java/lang/Exception +/* */ // 2 215 226 finally +/* */ } +/* */ +/* */ /* Error */ +/* */ private void load() +/* */ { +/* */ // Byte code: +/* */ // 0: aload_0 +/* */ // 1: getfield 58 NET/worlds/scape/MusicManager:tracks Ljava/util/Hashtable; +/* */ // 4: invokevirtual 223 java/util/Hashtable:clear ()V +/* */ // 7: aload_0 +/* */ // 8: getfield 60 NET/worlds/scape/MusicManager:rooms Ljava/util/Hashtable; +/* */ // 11: invokevirtual 223 java/util/Hashtable:clear ()V +/* */ // 14: aconst_null +/* */ // 15: astore_1 +/* */ // 16: aconst_null +/* */ // 17: astore_2 +/* */ // 18: new 226 java/io/DataInputStream +/* */ // 21: dup +/* */ // 22: new 228 java/io/FileInputStream +/* */ // 25: dup +/* */ // 26: aload_0 +/* */ // 27: getfield 122 NET/worlds/scape/MusicManager:fileName Ljava/lang/String; +/* */ // 30: invokespecial 230 java/io/FileInputStream:<init> (Ljava/lang/String;)V +/* */ // 33: invokespecial 231 java/io/DataInputStream:<init> (Ljava/io/InputStream;)V +/* */ // 36: astore_1 +/* */ // 37: goto +125 -> 162 +/* */ // 40: new 234 java/util/StringTokenizer +/* */ // 43: dup +/* */ // 44: aload_2 +/* */ // 45: ldc -77 +/* */ // 47: invokespecial 236 java/util/StringTokenizer:<init> (Ljava/lang/String;Ljava/lang/String;)V +/* */ // 50: astore_3 +/* */ // 51: aload_3 +/* */ // 52: invokevirtual 239 java/util/StringTokenizer:nextToken ()Ljava/lang/String; +/* */ // 55: astore 4 +/* */ // 57: aload 4 +/* */ // 59: ldc -14 +/* */ // 61: invokevirtual 244 java/lang/String:equals (Ljava/lang/Object;)Z +/* */ // 64: ifeq +55 -> 119 +/* */ // 67: new 141 NET/worlds/scape/MusicTrack +/* */ // 70: dup +/* */ // 71: aload_3 +/* */ // 72: invokevirtual 239 java/util/StringTokenizer:nextToken ()Ljava/lang/String; +/* */ // 75: aload_3 +/* */ // 76: invokevirtual 239 java/util/StringTokenizer:nextToken ()Ljava/lang/String; +/* */ // 79: invokestatic 248 java/lang/Integer:parseInt (Ljava/lang/String;)I +/* */ // 82: aload_3 +/* */ // 83: invokevirtual 239 java/util/StringTokenizer:nextToken ()Ljava/lang/String; +/* */ // 86: aload_3 +/* */ // 87: invokevirtual 239 java/util/StringTokenizer:nextToken ()Ljava/lang/String; +/* */ // 90: invokestatic 253 java/lang/Boolean:valueOf (Ljava/lang/String;)Ljava/lang/Boolean; +/* */ // 93: invokevirtual 258 java/lang/Boolean:booleanValue ()Z +/* */ // 96: invokespecial 261 NET/worlds/scape/MusicTrack:<init> (Ljava/lang/String;ILjava/lang/String;Z)V +/* */ // 99: astore 5 +/* */ // 101: aload_0 +/* */ // 102: getfield 58 NET/worlds/scape/MusicManager:tracks Ljava/util/Hashtable; +/* */ // 105: aload 5 +/* */ // 107: invokevirtual 178 NET/worlds/scape/MusicTrack:getName ()Ljava/lang/String; +/* */ // 110: aload 5 +/* */ // 112: invokevirtual 264 java/util/Hashtable:put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 115: pop +/* */ // 116: goto +46 -> 162 +/* */ // 119: aload 4 +/* */ // 121: ldc_w 268 +/* */ // 124: invokevirtual 244 java/lang/String:equals (Ljava/lang/Object;)Z +/* */ // 127: ifeq +35 -> 162 +/* */ // 130: new 147 NET/worlds/scape/MusicRoom +/* */ // 133: dup +/* */ // 134: aload_3 +/* */ // 135: invokevirtual 239 java/util/StringTokenizer:nextToken ()Ljava/lang/String; +/* */ // 138: aload_3 +/* */ // 139: invokevirtual 239 java/util/StringTokenizer:nextToken ()Ljava/lang/String; +/* */ // 142: invokespecial 270 NET/worlds/scape/MusicRoom:<init> (Ljava/lang/String;Ljava/lang/String;)V +/* */ // 145: astore 5 +/* */ // 147: aload_0 +/* */ // 148: getfield 60 NET/worlds/scape/MusicManager:rooms Ljava/util/Hashtable; +/* */ // 151: aload 5 +/* */ // 153: invokevirtual 199 NET/worlds/scape/MusicRoom:getRoomName ()Ljava/lang/String; +/* */ // 156: aload 5 +/* */ // 158: invokevirtual 264 java/util/Hashtable:put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 161: pop +/* */ // 162: aload_1 +/* */ // 163: invokevirtual 271 java/io/DataInputStream:readLine ()Ljava/lang/String; +/* */ // 166: dup +/* */ // 167: astore_2 +/* */ // 168: ifnonnull -128 -> 40 +/* */ // 171: goto +38 -> 209 +/* */ // 174: astore_3 +/* */ // 175: aload_1 +/* */ // 176: ifnull +46 -> 222 +/* */ // 179: aload_1 +/* */ // 180: invokevirtual 274 java/io/DataInputStream:close ()V +/* */ // 183: goto +39 -> 222 +/* */ // 186: astore 7 +/* */ // 188: goto +34 -> 222 +/* */ // 191: astore 6 +/* */ // 193: aload_1 +/* */ // 194: ifnull +12 -> 206 +/* */ // 197: aload_1 +/* */ // 198: invokevirtual 274 java/io/DataInputStream:close ()V +/* */ // 201: goto +5 -> 206 +/* */ // 204: astore 7 +/* */ // 206: aload 6 +/* */ // 208: athrow +/* */ // 209: aload_1 +/* */ // 210: ifnull +12 -> 222 +/* */ // 213: aload_1 +/* */ // 214: invokevirtual 274 java/io/DataInputStream:close ()V +/* */ // 217: goto +5 -> 222 +/* */ // 220: astore 7 +/* */ // 222: return +/* */ // Line number table: +/* */ // Java source line #157 -> byte code offset #0 +/* */ // Java source line #158 -> byte code offset #7 +/* */ // Java source line #159 -> byte code offset #14 +/* */ // Java source line #160 -> byte code offset #16 +/* */ // Java source line #162 -> byte code offset #18 +/* */ // Java source line #163 -> byte code offset #37 +/* */ // Java source line #164 -> byte code offset #40 +/* */ // Java source line #165 -> byte code offset #51 +/* */ // Java source line #166 -> byte code offset #57 +/* */ // Java source line #167 -> byte code offset #67 +/* */ // Java source line #168 -> byte code offset #75 +/* */ // Java source line #169 -> byte code offset #86 +/* */ // Java source line #167 -> byte code offset #96 +/* */ // Java source line #170 -> byte code offset #101 +/* */ // Java source line #171 -> byte code offset #116 +/* */ // Java source line #172 -> byte code offset #130 +/* */ // Java source line #173 -> byte code offset #138 +/* */ // Java source line #172 -> byte code offset #142 +/* */ // Java source line #174 -> byte code offset #147 +/* */ // Java source line #163 -> byte code offset #162 +/* */ // Java source line #177 -> byte code offset #171 +/* */ // Java source line #180 -> byte code offset #175 +/* */ // Java source line #181 -> byte code offset #179 +/* */ // Java source line #182 -> byte code offset #183 +/* */ // Java source line #178 -> byte code offset #191 +/* */ // Java source line #180 -> byte code offset #193 +/* */ // Java source line #181 -> byte code offset #197 +/* */ // Java source line #182 -> byte code offset #201 +/* */ // Java source line #184 -> byte code offset #206 +/* */ // Java source line #180 -> byte code offset #209 +/* */ // Java source line #181 -> byte code offset #213 +/* */ // Java source line #182 -> byte code offset #217 +/* */ // Java source line #185 -> byte code offset #222 +/* */ // Local variable table: +/* */ // start length slot name signature +/* */ // 0 223 0 this MusicManager +/* */ // 15 199 1 in java.io.DataInputStream +/* */ // 17 151 2 line String +/* */ // 50 89 3 tok java.util.StringTokenizer +/* */ // 174 1 3 localException Exception +/* */ // 55 65 4 type String +/* */ // 99 12 5 track MusicTrack +/* */ // 145 12 5 room MusicRoom +/* */ // 191 16 6 localObject Object +/* */ // 186 1 7 localIOException java.io.IOException +/* */ // 204 1 7 localIOException1 java.io.IOException +/* */ // 220 1 7 localIOException2 java.io.IOException +/* */ // Exception table: +/* */ // from to target type +/* */ // 18 171 174 java/lang/Exception +/* */ // 175 183 186 java/io/IOException +/* */ // 18 175 191 finally +/* */ // 193 201 204 java/io/IOException +/* */ // 209 217 220 java/io/IOException +/* */ } +/* */ +/* */ public void mainCallback() +/* */ { +/* 188 */ Pilot pilot = Pilot.getActive(); +/* 189 */ if (pilot != null) { +/* 190 */ World world = pilot.getWorld(); +/* 191 */ boolean worldChange = false; +/* 192 */ String newRoomName = ""; +/* 193 */ if (world != null) { +/* 194 */ URL url = world.getSourceURL(); +/* 195 */ if (!url.equals(lastWorldURL)) { +/* 196 */ MusicManager manager = (MusicManager)managers.get(url); +/* 197 */ if (manager == null) { +/* 198 */ manager = new MusicManager(world, url); +/* 199 */ managers.put(url, manager); +/* */ } +/* 201 */ lastWorldURL = url; +/* 202 */ curManager = manager; +/* 203 */ worldChange = true; +/* */ } +/* 205 */ Room room = pilot.getRoom(); +/* 206 */ if (room != null) { +/* 207 */ String roomName = room.getName(); +/* 208 */ if (roomName != null) +/* 209 */ newRoomName = roomName; +/* */ } +/* */ } else { +/* 212 */ lastWorldURL = null; } +/* 213 */ synchronized (this) { +/* 214 */ if ((worldChange) || (!newRoomName.equals(lastRoomName)) || +/* 215 */ (curManager.maybeMusicChange)) { +/* 216 */ curManager.maybeMusicChange = false; +/* 217 */ lastRoomName = newRoomName; +/* 218 */ MusicRoom mr = curManager.getRoom(lastRoomName); +/* 219 */ CDAudio cd = CDAudio.get(); +/* 220 */ boolean found = false; +/* 221 */ if (mr != null) { +/* 222 */ MusicTrack mt = curManager.getMusic(mr.getMusicName()); +/* 223 */ if (mt != null) { +/* 224 */ found = true; +/* 225 */ int track = mt.getVirtTrackNumber(); +/* 226 */ boolean changed = false; +/* 227 */ if (track != cd.getCDTrack()) { +/* 228 */ cd.setCDTrack(lastCDTrack = track); +/* 229 */ changed = true; +/* */ } +/* 231 */ String name = mt.getMIDIFileName(); +/* */ URL midiPath; +/* 233 */ URL midiPath; if (name.length() != 0) { +/* 234 */ midiPath = URL.make(world.getSourceURL(), +/* 235 */ mt.getMIDIFileName()); +/* */ } else +/* 237 */ midiPath = cd.getDefaultMIDIFile(); +/* 238 */ if (!midiPath.equals(cd.getMIDIFile())) { +/* 239 */ cd.setMIDIFile(lastMIDIFile = midiPath); +/* 240 */ changed = true; +/* */ } +/* 242 */ if (changed) +/* 243 */ cd.change(mt.getLooping()); +/* */ } +/* */ } +/* 246 */ if (!found) { +/* 247 */ if (((lastCDTrack != 0) && (cd.getCDTrack() == lastCDTrack)) || ( +/* 248 */ (lastMIDIFile != null) && +/* 249 */ (lastMIDIFile.equals(cd.getMIDIFile())))) { +/* 250 */ cd.setCDTrack(0); +/* 251 */ cd.setMIDIFile(cd.getDefaultMIDIFile()); +/* 252 */ cd.stop(); +/* */ } +/* 254 */ lastCDTrack = 0; +/* 255 */ lastMIDIFile = null; +/* */ } +/* */ } +/* */ } +/* */ } +/* 260 */ lastWorldURL = null; +/* 261 */ if ((lastWorldURL != null) && (dialog == null) && (showDialog)) { +/* 262 */ showDialog = false; +/* 263 */ dialog = new MusicManagerDialog( +/* 264 */ (MusicManager)managers.get(lastWorldURL)); +/* */ } +/* */ } +/* */ +/* */ public void dialogDone(Object who, boolean confirmed) { +/* 269 */ if (confirmed) { +/* 270 */ save(); +/* */ } else { +/* 272 */ load(); +/* 273 */ maybeChangedMusic(); +/* */ } +/* 275 */ dialog = null; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\MusicManager.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |