Play the sound associated with the resource specified by the file name ("synchronized" with other sounds of the same kind means: only one can play at a time).
(final String resourceFileName, final boolean isSynchronized)
| 109 | * ("synchronized" with other sounds of the same kind means: only one can play at a time). |
| 110 | */ |
| 111 | public void play(final String resourceFileName, final boolean isSynchronized) { |
| 112 | if (ignorePlayRequests) { |
| 113 | return; |
| 114 | } |
| 115 | |
| 116 | if (isUsingAltSystem()) { |
| 117 | File file = getSoundResource(resourceFileName); |
| 118 | if(file == null) |
| 119 | return; |
| 120 | GuiBase.getInterface().startAltSoundSystem(file.getPath(), isSynchronized); |
| 121 | } |
| 122 | else { |
| 123 | final IAudioClip snd = fetchResource(resourceFileName); |
| 124 | if (!isSynchronized || snd.isDone()) { |
| 125 | snd.play(FModel.getPreferences().getPrefInt(FPref.UI_VOL_SOUNDS)/100f); |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Play the sound associated with the Sounds enumeration element. |
no test coverage detected