MCPcopy Create free account
hub / github.com/Card-Forge/forge / play

Method play

forge-gui/src/main/java/forge/sound/SoundSystem.java:111–128  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 1

receiveEventMethod · 0.95

Calls 11

isUsingAltSystemMethod · 0.95
getSoundResourceMethod · 0.95
getInterfaceMethod · 0.95
fetchResourceMethod · 0.95
isDoneMethod · 0.95
playMethod · 0.95
getPreferencesMethod · 0.95
getResourceFileNameMethod · 0.80
startAltSoundSystemMethod · 0.65
getPathMethod · 0.45
getPrefIntMethod · 0.45

Tested by

no test coverage detected