diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/Sound.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/scape/Sound.java')
| -rw-r--r-- | NET/worlds/scape/Sound.java | 940 |
1 files changed, 940 insertions, 0 deletions
diff --git a/NET/worlds/scape/Sound.java b/NET/worlds/scape/Sound.java new file mode 100644 index 0000000..256bde9 --- /dev/null +++ b/NET/worlds/scape/Sound.java @@ -0,0 +1,940 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.Main; +/* */ import NET.worlds.console.MainCallback; +/* */ import NET.worlds.core.IniFile; +/* */ import NET.worlds.network.CacheFile; +/* */ import NET.worlds.network.URL; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class Sound +/* */ extends Action +/* */ implements BGLoaded, StateContext +/* */ { +/* */ static int debugLevel; +/* */ private String cachedName; +/* */ private URL soundURL; +/* */ +/* */ static +/* */ { +/* 81 */ debugLevel = IniFile.gamma().getIniInt("sounddebug", 0); +/* 82 */ debugOut(1, "SOUND DEBUGGING LEVEL = " + debugLevel); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static void debugOut(int n, String s) +/* */ { +/* 92 */ if (debugLevel > n) { System.out.println(s); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 102 */ protected CacheFile cachedFile = null; +/* */ +/* */ +/* */ +/* */ +/* 107 */ protected float soundVolume = 1.0F; +/* 108 */ protected float stopDistance = 1000.0F; +/* */ +/* */ +/* */ +/* */ +/* 113 */ private int repeat = 1; +/* 114 */ private boolean continuous = false; +/* */ +/* */ +/* */ +/* */ +/* 119 */ private boolean attenuateOn = true; +/* */ +/* */ +/* */ +/* */ +/* 124 */ private boolean panningOn = true; +/* */ +/* */ +/* */ protected SuperRoot activeSeq; +/* */ +/* */ +/* */ SoundPlayer player; +/* */ +/* */ +/* */ +/* */ public Sound(URL soundURL) +/* */ { +/* 136 */ Transform.countClass(this, 1); +/* 137 */ debugOut(9, "Sound " + soundURL); +/* 138 */ setURL(soundURL); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public Sound() +/* */ { +/* 146 */ Transform.countClass(this, 1); +/* 147 */ debugOut(9, "Sound "); +/* 148 */ setURL(null); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 159 */ AudibilityFilter aFilter = null; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final void setURL(URL url) +/* */ { +/* 168 */ if (this.activeSeq != null) +/* 169 */ closePlayer(); +/* 170 */ this.soundURL = url; +/* */ } +/* */ +/* */ +/* */ public final URL getURL() +/* */ { +/* 176 */ return this.soundURL; +/* */ } +/* */ +/* */ public final void setSoundVolume(float vol) +/* */ { +/* 181 */ this.soundVolume = vol; +/* */ } +/* */ +/* */ public final float getSoundVolume() +/* */ { +/* 186 */ return this.soundVolume; +/* */ } +/* */ +/* */ public final void setStopDistance(float i) { +/* 190 */ this.stopDistance = i; +/* */ } +/* */ +/* */ public final float getStopDistance() +/* */ { +/* 195 */ return this.stopDistance; +/* */ } +/* */ +/* */ public final void setRepeat(int i) +/* */ { +/* 200 */ this.repeat = i; +/* */ } +/* */ +/* */ public final int getRepeat() +/* */ { +/* 205 */ return this.repeat; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final void setContinuous(boolean c) +/* */ { +/* 215 */ this.continuous = c; +/* */ } +/* */ +/* */ public final boolean isContinuous() +/* */ { +/* 220 */ return this.continuous; +/* */ } +/* */ +/* */ public final void setAttenuate(boolean b) +/* */ { +/* 225 */ this.attenuateOn = b; +/* */ } +/* */ +/* */ public final boolean getAttenuate() +/* */ { +/* 230 */ return this.attenuateOn; +/* */ } +/* */ +/* */ +/* */ public final void setPanning(boolean b) +/* */ { +/* 236 */ this.panningOn = b; +/* */ } +/* */ +/* */ public final boolean getPanning() +/* */ { +/* 241 */ return this.panningOn; +/* */ } +/* */ +/* */ public final int getState() +/* */ { +/* 246 */ return this.player.getState(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 253 */ private int maxHopcount = 1; +/* */ +/* */ public final int getHopcount() { +/* 256 */ return this.maxHopcount; +/* */ } +/* */ +/* */ public final void setHopcount(int i) { +/* 260 */ this.maxHopcount = i; +/* 261 */ if (this.aFilter != null) { +/* 262 */ this.aFilter.setHopcount(this.maxHopcount); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 270 */ private boolean doorMovementFlag = false; +/* */ +/* */ public boolean getDoorMovementFlag() { +/* 273 */ return this.doorMovementFlag; +/* */ } +/* */ +/* */ public void setDoorMovementFlag(boolean b) { +/* 277 */ this.doorMovementFlag = b; +/* 278 */ if (this.aFilter != null) +/* 279 */ startAudibilityFilter(); +/* */ } +/* */ +/* */ private void startAudibilityFilter() { +/* 283 */ debugOut(9, "startAudibilityFilter " + getURL()); +/* 284 */ WObject owner = (WObject)getOwner(); +/* */ +/* 286 */ if (owner != null) { +/* 287 */ if (this.doorMovementFlag) { +/* 288 */ this.aFilter = new DoorBasedFilter(this, owner, this.maxHopcount, +/* 289 */ this.stopDistance); +/* */ } else { +/* 291 */ this.aFilter = new AudibilityFilter(this, owner, this.maxHopcount); +/* */ } +/* 293 */ this.aFilter.moveEmitter(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 300 */ private static boolean soundOn = true; +/* */ +/* */ +/* */ +/* */ public static void turnSoundOn() +/* */ { +/* 306 */ soundOn = true; +/* */ } +/* */ +/* */ +/* */ +/* */ public static void turnSoundOff() +/* */ { +/* 313 */ soundOn = false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 322 */ boolean playAfterLoading = true; +/* */ +/* */ public void setPlayAfterLoading(boolean b) { +/* 325 */ this.playAfterLoading = b; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ protected boolean isRealAudio(URL s) +/* */ { +/* 333 */ return (s.endsWith(".ram")) || (s.endsWith(".ra")) || (s.endsWith(".rm")); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 339 */ protected int state = 0; +/* */ protected static final int SYNC = 1; +/* */ protected static final int ASYNC = 2; +/* */ +/* 343 */ public void changeState(int s) { debugOut(9, "changeState to " + s); +/* 344 */ this.state = s; +/* */ } +/* */ +/* */ protected Object doState(Object obj) +/* */ { +/* 349 */ return SoundState.instance().doState(this, obj); +/* */ } +/* */ +/* */ +/* */ private boolean isBackgroundProcessing() +/* */ { +/* 355 */ if (this.state != 0) { +/* 356 */ debugOut(9, "backgroundProcessing " + this.state); +/* */ } +/* 358 */ return this.state != 0; +/* */ } +/* */ +/* */ +/* */ +/* 363 */ protected int backgroundState = 1; +/* */ +/* */ +/* */ private static SoundCallback closer; +/* */ +/* */ +/* */ static Vector<CacheFile> cachedEntries; +/* */ +/* */ +/* */ private boolean mainRan; +/* */ +/* */ +/* */ private boolean opened; +/* */ +/* */ +/* */ +/* */ private void startSound() +/* */ { +/* 381 */ this.backgroundState = 1; +/* 382 */ if (this.aFilter == null) +/* 383 */ startAudibilityFilter(); +/* 384 */ if (this.aFilter != null) { +/* 385 */ this.aFilter.setEmitterOn(true); +/* */ } +/* 387 */ if (this.state == 0) +/* 388 */ this.state = 1; +/* 389 */ doState(this.soundURL); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Object asyncBackgroundLoad(String localName, URL remoteName) +/* */ { +/* 404 */ this.backgroundState = 2; +/* 405 */ return doState(URL.make(localName)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean syncBackgroundLoad(Object obj, URL remoteURL) +/* */ { +/* 419 */ this.backgroundState = 1; +/* 420 */ doState(obj); +/* 421 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Room getBackgroundLoadRoom() +/* */ { +/* 430 */ WObject owner = (WObject)getOwner(); +/* 431 */ return owner == null ? null : owner.getRoom(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void ensureClosure() +/* */ { +/* 458 */ if (closer == null) { +/* 459 */ closer = new SoundCallback(); +/* 460 */ Main.register(closer); +/* */ } +/* 462 */ if (cachedEntries == null) +/* 463 */ cachedEntries = new Vector(); +/* 464 */ cachedEntries.addElement(this.cachedFile); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void unlockCache() +/* */ { +/* 473 */ if (this.cachedFile != null) { +/* 474 */ debugOut(6, "unlocking " + this.soundURL); +/* 475 */ this.cachedFile.finalize(); +/* */ +/* 477 */ assert (cachedEntries != null); +/* 478 */ assert (cachedEntries.indexOf(this.cachedFile, 0) >= 0); +/* 479 */ cachedEntries.removeElement(this.cachedFile); +/* 480 */ this.cachedFile = null; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ synchronized boolean openPlayer(URL url) +/* */ { +/* 494 */ assert (this.player == null); +/* */ +/* 496 */ this.cachedName = url.unalias(); +/* 497 */ debugOut(4, "openPlayer on:: " + this.cachedName); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 505 */ if (url.endsWith(".wav")) { +/* 506 */ this.player = new WavSoundPlayer(this); +/* 507 */ } else if (url.endsWith(".mid")) { +/* 508 */ this.player = new MCISoundPlayer(this); +/* */ } else { +/* 510 */ this.player = new WMPSoundPlayer(this); +/* */ } +/* */ +/* 513 */ if (Main.isMainThread()) { +/* 514 */ openInMainThread(); +/* */ } +/* */ else { +/* 517 */ this.mainRan = false; +/* 518 */ Main.register(new MainCallback() { +/* */ public void mainCallback() { +/* 520 */ Sound.this.openInMainThread(); +/* 521 */ Main.unregister(this); +/* */ } +/* */ }); +/* */ +/* 525 */ while (!this.mainRan) { +/* */ try { +/* 527 */ wait(); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* */ } +/* 532 */ return this.opened; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void openInMainThread() +/* */ { +/* 540 */ this.opened = this.player.open(this.soundVolume, this.stopDistance, +/* 541 */ this.attenuateOn, this.panningOn); +/* 542 */ if (!this.opened) { +/* 543 */ closePlayer(); +/* */ } +/* 545 */ this.mainRan = true; +/* 546 */ notify(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void closePlayer() +/* */ { +/* 555 */ if (this.player != null) { +/* 556 */ this.player.stop(); +/* 557 */ unlockCache(); +/* 558 */ if (SoundResource.instance().syncUnlock()) +/* 559 */ this.player.close(); +/* 560 */ this.player = null; +/* */ } +/* 562 */ debugOut(2, " closePlayer"); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Persister trigger(Event e, Persister seqID) +/* */ { +/* 583 */ debugOut(9, "trigger in: seqID " + seqID + " activeSeq " + this.activeSeq); +/* 584 */ if (isBackgroundProcessing()) +/* 585 */ return this.activeSeq; +/* 586 */ if (seqID == null) +/* */ { +/* 588 */ if ((this.soundURL == null) || (getOwner() == null)) { +/* 589 */ return null; +/* */ } +/* */ +/* 592 */ if (this.activeSeq != null) { +/* 593 */ closePlayer(); +/* */ } +/* */ +/* 596 */ this.activeSeq = this; +/* 597 */ seqID = this.activeSeq; +/* 598 */ debugOut(6, "triggering new sound " + seqID); +/* 599 */ startSound(); +/* 600 */ } else if (seqID != this.activeSeq) +/* */ { +/* */ +/* */ +/* 604 */ unlockCache(); +/* 605 */ if (!isContinuous()) +/* 606 */ this.aFilter.setEmitterOn(false); +/* 607 */ return null; +/* */ } +/* */ +/* 610 */ if ((this.player != null) && (this.player.getState() != 0) && +/* 611 */ (!isContinuous())) { +/* 612 */ this.aFilter.setEmitterOn(false); +/* */ } +/* 614 */ if (((!isBackgroundProcessing()) && ( +/* 615 */ (!updateSound()) || (this.player.getState() != 0))) || +/* 616 */ (getOwner() == null)) +/* */ { +/* 618 */ this.activeSeq = null; +/* 619 */ closePlayer(); +/* 620 */ return null; +/* */ } +/* 622 */ return this.activeSeq; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ boolean updateSound() +/* */ { +/* 648 */ debugOut(9, "Sound::updateSound:: in"); +/* 649 */ if (this.player == null) { +/* 650 */ debugOut(6, "update returning false because player is null"); +/* 651 */ return false; +/* */ } +/* */ +/* */ +/* 655 */ if (!SoundResource.instance().isOK()) { +/* 656 */ debugOut(2, "update registering not OK"); +/* 657 */ return false; +/* */ } +/* */ +/* 660 */ if (!this.aFilter.isAudible()) { +/* 661 */ debugOut(4, "update stopping sound because isAudible false"); +/* 662 */ return false; +/* */ } +/* */ +/* 665 */ Point3Temp pilot = Point3Temp.make(); +/* 666 */ Point3Temp up = Point3Temp.make(); +/* 667 */ Point3Temp forward = Point3Temp.make(); +/* 668 */ Point3Temp obj = Point3Temp.make(); +/* */ +/* 670 */ this.aFilter.getListenerPosition(pilot, up, forward); +/* 671 */ this.aFilter.getEmitterPosition(obj); +/* */ +/* 673 */ if (!this.player.position(pilot, obj, forward, up)) { +/* 674 */ debugOut(6, "update returning false because position false"); +/* 675 */ return false; +/* */ } +/* */ +/* 678 */ float vol = -1.0F; +/* 679 */ if (soundOn) { +/* 680 */ vol = this.aFilter.getEmitterVolume(); +/* */ } +/* 682 */ if (!this.player.setVolume(vol * this.soundVolume)) { +/* 683 */ debugOut(6, "update returning false because volume false"); +/* 684 */ return false; +/* */ } +/* */ +/* 687 */ return true; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void postRestore(int version) +/* */ { +/* 697 */ super.postRestore(version); +/* 698 */ startAudibilityFilter(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 707 */ Object ret = null; +/* 708 */ switch (index - offset) +/* */ { +/* */ case 0: +/* 711 */ if (mode == 0) { +/* 712 */ ret = URLPropertyEditor.make( +/* 713 */ new Property(this, index, "Sound File URL") +/* 714 */ .allowSetNull(), +/* 715 */ "asf;wav;mid;ram;ra;rm;mp3"); +/* 716 */ } else if (mode == 1) { +/* 717 */ ret = this.soundURL; +/* 718 */ } else if (mode == 2) +/* 719 */ this.soundURL = ((URL)value); +/* 720 */ break; +/* */ case 1: +/* 722 */ if (mode == 0) { +/* 723 */ ret = FloatPropertyEditor.make( +/* 724 */ new Property(this, index, "Max Volume")); +/* 725 */ } else if (mode == 1) { +/* 726 */ ret = new Float(this.soundVolume); +/* 727 */ } else if (mode == 2) +/* 728 */ this.soundVolume = ((Float)value).floatValue(); +/* 729 */ break; +/* */ case 2: +/* 731 */ if (mode == 0) { +/* 732 */ ret = FloatPropertyEditor.make( +/* 733 */ new Property(this, index, "Stop Distance")); +/* 734 */ } else if (mode == 1) { +/* 735 */ ret = new Float(this.stopDistance); +/* 736 */ } else if (mode == 2) +/* 737 */ this.stopDistance = ((Float)value).floatValue(); +/* 738 */ break; +/* */ case 3: +/* 740 */ if (mode == 0) { +/* 741 */ ret = IntegerPropertyEditor.make( +/* 742 */ new Property(this, index, "Times to Repeat")); +/* 743 */ } else if (mode == 1) { +/* 744 */ ret = new Integer(this.repeat); +/* 745 */ } else if (mode == 2) +/* 746 */ this.repeat = ((Integer)value).intValue(); +/* 747 */ break; +/* */ case 4: +/* 749 */ if (mode == 0) { +/* 750 */ ret = BooleanPropertyEditor.make( +/* 751 */ new Property(this, index, "Attenuate With Distance"), +/* 752 */ "No", "Yes"); +/* 753 */ } else if (mode == 1) { +/* 754 */ ret = new Boolean(this.attenuateOn); +/* 755 */ } else if (mode == 2) +/* 756 */ this.attenuateOn = ((Boolean)value).booleanValue(); +/* 757 */ break; +/* */ case 5: +/* 759 */ if (mode == 0) { +/* 760 */ ret = BooleanPropertyEditor.make( +/* 761 */ new Property(this, index, "Do panning"), +/* 762 */ "No", "Yes"); +/* 763 */ } else if (mode == 1) { +/* 764 */ ret = new Boolean(this.panningOn); +/* 765 */ } else if (mode == 2) +/* 766 */ this.panningOn = ((Boolean)value).booleanValue(); +/* 767 */ break; +/* */ case 6: +/* 769 */ if (mode == 0) { +/* 770 */ ret = IntegerPropertyEditor.make( +/* 771 */ new Property(this, index, +/* 772 */ "Room hops till sound dies")); +/* 773 */ } else if (mode == 1) { +/* 774 */ ret = new Integer(this.maxHopcount); +/* 775 */ } else if (mode == 2) +/* 776 */ setHopcount(((Integer)value).intValue()); +/* 777 */ break; +/* */ case 7: +/* 779 */ if (mode == 0) { +/* 780 */ ret = BooleanPropertyEditor.make( +/* 781 */ new Property(this, index, "Door based audibility"), +/* 782 */ "No", "Yes"); +/* 783 */ } else if (mode == 1) { +/* 784 */ ret = new Boolean(getDoorMovementFlag()); +/* 785 */ } else if (mode == 2) +/* 786 */ setDoorMovementFlag(((Boolean)value).booleanValue()); +/* 787 */ break; +/* */ case 8: +/* 789 */ if (mode == 0) { +/* 790 */ ret = BooleanPropertyEditor.make( +/* 791 */ new Property(this, index, "Play after loading"), +/* 792 */ "No", "Yes"); +/* 793 */ } else if (mode == 1) { +/* 794 */ ret = new Boolean(this.playAfterLoading); +/* 795 */ } else if (mode == 2) +/* 796 */ setPlayAfterLoading(((Boolean)value).booleanValue()); +/* 797 */ break; +/* */ case 9: +/* 799 */ if (mode == 0) { +/* 800 */ ret = BooleanPropertyEditor.make( +/* 801 */ new Property(this, index, "Loop Infinite"), +/* 802 */ "No", "Yes"); +/* 803 */ } else if (mode == 1) { +/* 804 */ ret = new Boolean(this.continuous); +/* 805 */ } else if (mode == 2) +/* 806 */ setContinuous(((Boolean)value).booleanValue()); +/* 807 */ break; +/* */ +/* */ default: +/* 810 */ ret = super.properties(index, offset + 10, mode, value); +/* */ } +/* */ +/* 813 */ return ret; +/* */ } +/* */ +/* */ +/* */ +/* 818 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) throws IOException +/* */ { +/* 822 */ s.saveVersion(7, classCookie); +/* 823 */ s.saveBoolean(this.playAfterLoading); +/* 824 */ s.saveBoolean(this.doorMovementFlag); +/* 825 */ s.saveBoolean(this.panningOn); +/* 826 */ s.saveBoolean(this.attenuateOn); +/* 827 */ s.saveInt(this.maxHopcount); +/* 828 */ super.saveState(s); +/* 829 */ URL.save(s, this.soundURL); +/* 830 */ s.saveFloat(this.soundVolume); +/* 831 */ s.saveFloat(this.stopDistance); +/* 832 */ s.saveInt(this.repeat); +/* 833 */ s.saveBoolean(this.continuous); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) +/* */ throws IOException, TooNewException +/* */ { +/* 839 */ int vers = r.restoreVersion(classCookie); +/* 840 */ switch (vers) { +/* */ case 7: +/* 842 */ setPlayAfterLoading(r.restoreBoolean()); +/* 843 */ setDoorMovementFlag(r.restoreBoolean()); +/* 844 */ setPanning(r.restoreBoolean()); +/* 845 */ setAttenuate(r.restoreBoolean()); +/* 846 */ setHopcount(r.restoreInt()); +/* 847 */ super.restoreState(r); +/* 848 */ setURL(URL.restore(r)); +/* 849 */ this.soundVolume = r.restoreFloat(); +/* 850 */ this.stopDistance = r.restoreFloat(); +/* 851 */ this.repeat = r.restoreInt(); +/* 852 */ setContinuous(r.restoreBoolean()); +/* 853 */ break; +/* */ case 6: +/* 855 */ setPlayAfterLoading(r.restoreBoolean()); +/* 856 */ setDoorMovementFlag(r.restoreBoolean()); +/* 857 */ setPanning(r.restoreBoolean()); +/* 858 */ setAttenuate(r.restoreBoolean()); +/* 859 */ setHopcount(r.restoreInt()); +/* 860 */ super.restoreState(r); +/* 861 */ setURL(URL.restore(r)); +/* 862 */ this.soundVolume = r.restoreFloat(); +/* 863 */ this.stopDistance = r.restoreFloat(); +/* 864 */ this.repeat = r.restoreInt(); +/* 865 */ if (this.repeat < 0) +/* 866 */ setContinuous(true); +/* 867 */ break; +/* */ case 5: +/* 869 */ setPlayAfterLoading(r.restoreBoolean()); +/* 870 */ setDoorMovementFlag(r.restoreBoolean()); +/* 871 */ setPanning(r.restoreBoolean()); +/* 872 */ setAttenuate(r.restoreBoolean()); +/* 873 */ setHopcount(r.restoreInt()); +/* 874 */ super.restoreState(r); +/* 875 */ setURL(URL.restore(r)); +/* 876 */ this.soundVolume = r.restoreFloat(); +/* 877 */ this.stopDistance = r.restoreFloat(); +/* 878 */ this.repeat = r.restoreInt(); +/* 879 */ if (this.repeat < 0) +/* 880 */ setContinuous(true); +/* 881 */ break; +/* */ case 4: +/* 883 */ setDoorMovementFlag(r.restoreBoolean()); +/* 884 */ setPanning(r.restoreBoolean()); +/* 885 */ setAttenuate(r.restoreBoolean()); +/* 886 */ setHopcount(r.restoreInt()); +/* 887 */ super.restoreState(r); +/* 888 */ setURL(URL.restore(r)); +/* 889 */ this.soundVolume = r.restoreFloat(); +/* 890 */ this.stopDistance = r.restoreFloat(); +/* 891 */ this.repeat = r.restoreInt(); +/* 892 */ if (this.repeat < 0) +/* 893 */ setContinuous(true); +/* 894 */ break; +/* */ case 3: +/* 896 */ setHopcount(r.restoreInt()); +/* 897 */ super.restoreState(r); +/* 898 */ setURL(URL.restore(r)); +/* 899 */ this.soundVolume = r.restoreFloat(); +/* 900 */ this.stopDistance = r.restoreFloat(); +/* 901 */ this.repeat = r.restoreInt(); +/* 902 */ if (this.repeat < 0) +/* 903 */ setContinuous(true); +/* 904 */ break; +/* */ case 2: +/* 906 */ super.restoreState(r); +/* 907 */ setURL(URL.restore(r)); +/* 908 */ this.soundVolume = r.restoreFloat(); +/* 909 */ this.stopDistance = r.restoreFloat(); +/* 910 */ this.repeat = r.restoreInt(); +/* 911 */ if (this.repeat < 0) +/* 912 */ setContinuous(true); +/* 913 */ break; +/* */ case 1: +/* 915 */ setURL(URL.restore(r)); +/* 916 */ this.soundVolume = r.restoreFloat(); +/* 917 */ this.stopDistance = r.restoreFloat(); +/* 918 */ this.repeat = r.restoreInt(); +/* 919 */ if (this.repeat < 0) +/* 920 */ setContinuous(true); +/* 921 */ break; +/* */ case 0: +/* 923 */ setURL(URL.restore(r)); +/* 924 */ break; +/* */ default: +/* 926 */ throw new TooNewException(); +/* */ } +/* */ +/* */ +/* 930 */ if ((vers < 6) && (this.continuous)) { +/* 931 */ setContinuous(false); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\Sound.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |