private eInstance prePlay() { eUtils.fmodCheck(this.engine.fmod.playSound(this.handle, this.engine.default3dGroup.handle, true, out Channel channel)); eInstance instance = new eInstance(channel, this.engine); this.instances.Add(instance); return(instance); }
public void play(loopMode loop = loopMode.noLoop, bool paused = false) { eInstance instance = prePlay(); instance.addToGroup(this.engine.defaultMusicGroup); instance.is3d = false; instance.setLoop(loop); instance.paused = paused; }
public void stop() { if (this.instance == null) { return; } this.instance.stop(); this.instance.release(); this.instance = null; }
public eInstance play(float pan = 0, loopMode loop = loopMode.noLoop, bool paused = false) { eInstance instance = prePlay(); instance.pan = pan; instance.addToGroup(this.engine.default2dGroup); instance.is3d = false; instance.setLoop(loop); instance.paused = paused; return(instance); }
public eInstance play3d(float x, float y, float z, loopMode loop = loopMode.noLoop, bool paused = false) { eInstance instance = prePlay(); instance.x = x; instance.y = y; instance.z = z; instance.setLoop(loop); instance.is3d = true; instance.paused = paused; return(instance); }
private eInstance prePlay() { if (this.instance != null) { this.stop(); } eUtils.fmodCheck(this.engine.fmod.playSound(this.handle, this.engine.defaultMusicGroup.handle, true, out Channel channel)); eInstance instance = new eInstance(channel, this.engine); this.instance = instance; return(instance); }
public override void update() { if (this.instance != null) { if (this.instance.playing) { this.instance.update(); } else { this.instance.release(); this.instance = null; } } }