Example #1
0
        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);
        }
Example #2
0
        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;
        }
Example #3
0
 public void stop()
 {
     if (this.instance == null)
     {
         return;
     }
     this.instance.stop();
     this.instance.release();
     this.instance = null;
 }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
        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);
        }
Example #7
0
 public override void update()
 {
     if (this.instance != null)
     {
         if (this.instance.playing)
         {
             this.instance.update();
         }
         else
         {
             this.instance.release();
             this.instance = null;
         }
     }
 }