Exemplo n.º 1
0
        public bool InitializeSound(CameraListenerBase listener, FreeSL.FSL_SOUND_SYSTEM soundSystem)
        {
            lock (LockSync)
            {
                _listener = new FSLListener(listener);
                if (_initSound)
                {
                    return(true);
                }

                if (!FreeSL.fslInit(soundSystem)) //Change if desire
                {
                    return(false);
                }

                _initSound = true;

                /*FreeSL.ErrorCallbackDelegate ErrorDelegate = new FreeSL.ErrorCallbackDelegate(ErrorCallback);
                 * GCHandle AllocatedDelegate = GCHandle.Alloc(ErrorDelegate);
                 * FreeSL.fslSetErrorCallback(ErrorDelegate);*/


                updaterThread      = new Thread(new ThreadStart((UpdateSoundObjects)));
                updaterThread.Name = "Wof - sound updater thread " + updaterThread.GetHashCode();
                updaterThread.Start();
                return(true);
            }
        }
        public bool InitializeSound(Mogre.Camera listener)
        {
            _listener = new FSLListener(listener);
            if (_initSound)
			    return true;

	        if (!FreeSL.fslInit(FreeSL.FSL_SOUND_SYSTEM.FSL_SS_DIRECTSOUND3D)) //Change if desire
			    return false;
            
	        _initSound = true;
	        return true;
        }
        public void Destroy(){
	        if (_soundObjectVector.Count != 0){
		       	foreach (FSLSoundObject sound in _soundObjectVector)
                {
                    sound.Destroy();
                }
                _soundObjectVector.Clear();
	        }
	        if ( _listener != null)
		        _listener = null;
	        if (_initSound)
		        ShutDown();
        }
Exemplo n.º 4
0
        public virtual void Destroy()
        {
            lock (LockSync)
            {
                updaterRunning = false;
                killUpdater    = true;
            }

            if (updaterThread != null)
            {
                while (updaterThread.ThreadState != ThreadState.Stopped && updaterThread.ThreadState != ThreadState.Unstarted)
                {
                    Thread.Sleep(100);
                }
            }



            killUpdater   = false;
            updaterThread = new Thread(UpdateSoundObjects);

            if (SoundObjectVector.Count != 0)
            {
                for (int i = 0; i < SoundObjectVector.Count; i++)
                {
                    LogManager.Singleton.LogMessage(LogMessageLevel.LML_NORMAL, "Disposing sound object: " + SoundObjectVector[i].Name);

                    SoundObjectVector[i].Destroy();
                }
                SoundObjectVector.Clear();
            }
            if (_listener != null)
            {
                _listener = null;
            }
            if (_initSound)
            {
                ShutDown();
            }
            _initSound = false;
        }
Exemplo n.º 5
0
 protected FSLSoundManager() // changed private -> protected
 {
     _initSound = false;
     _listener  = null;
 }
Exemplo n.º 6
0
 public void SetListener(CameraListenerBase listener, Wof.Model.Level.Planes.Plane plane)
 {
     _listener = new FSLListener(listener, plane);
 }
Exemplo n.º 7
0
 public void SetListener(CameraListenerBase listener)
 {
     _listener = new FSLListener(listener);
 }
 FSLSoundManager()
 {
     _initSound = false;
     _listener = null;
 }
        public void SetListener(Mogre.Camera listener)
        {
	        _listener = new FSLListener( listener );
        }