You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
760 B
37 lines
760 B
11 years ago
|
package mightypork.rogue.audio;
|
||
11 years ago
|
|
||
11 years ago
|
|
||
11 years ago
|
import mightypork.utils.math.coord.Coord;
|
||
|
import mightypork.utils.objects.Mutable;
|
||
|
|
||
|
|
||
11 years ago
|
public class EffectPlayer extends BaseAudioPlayer {
|
||
11 years ago
|
|
||
11 years ago
|
public EffectPlayer(DeferredAudio track, double basePitch, double baseGain, Mutable<Double> gainMultiplier) {
|
||
11 years ago
|
super(track, (float) basePitch, (float) baseGain, gainMultiplier);
|
||
|
}
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
public int play(double pitch, double gain)
|
||
|
{
|
||
11 years ago
|
if (!hasAudio()) return -1;
|
||
11 years ago
|
|
||
11 years ago
|
return getAudio().playAsEffect(getPitch(pitch), getGain(gain), false);
|
||
11 years ago
|
}
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
public int play(double gain)
|
||
|
{
|
||
|
return play(1, gain);
|
||
|
}
|
||
11 years ago
|
|
||
|
|
||
11 years ago
|
public int play(double pitch, double gain, Coord pos)
|
||
|
{
|
||
11 years ago
|
if (!hasAudio()) return -1;
|
||
11 years ago
|
|
||
11 years ago
|
return getAudio().playAsEffect(getPitch(pitch), getGain(gain), false, pos);
|
||
11 years ago
|
}
|
||
11 years ago
|
|
||
11 years ago
|
}
|