public override void Update() { FreeSL.fslSoundSetPosition(_sound, _renderable.WorldPosition.x, _renderable.WorldPosition.y, _renderable.WorldPosition.z); }
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 void SetSound(string soundFile, bool loop, bool streaming) { RemoveSound(); if (File.Exists(soundFile) == false) { throw new FileNotFoundException("The sound file at : " + soundFile + " does not exist."); } lock (SoundManager3D.Instance.LockSync) { if (streaming) { Console.WriteLine("Streaming sound: " + soundFile); _sound = FreeSL.fslStreamSound(soundFile); } else { _sound = FreeSL.fslLoadSound(soundFile); } _streaming = streaming; if (!streaming) { LoopSound(loop); } } _loop = loop; _soundFile = soundFile; _withSound = true; }
public void Update() { unsafe { if (_listener == null || _listener.NativePtr == null) { return; } } if (!_listener.IsReady()) { return; } try { int zflip = (ZFlipped) ? -1 : 1; // added FreeSL.fslSetListenerPosition(_listener.CameraLastRealPosition.Value.x, _listener.CameraLastRealPosition.Value.y, _listener.CameraLastRealPosition.Value.z); Mogre.Vector3 yVec, zVec; yVec = _listener.CameraLastRealOrientation.Value.YAxis; zVec = _listener.CameraLastRealOrientation.Value.ZAxis * zflip;// change FreeSL.fslSetListenerOrientation(zVec.x, zVec.y, zVec.z, yVec.x, yVec.y, yVec.z); } catch (Exception exception) { // Console.WriteLine("AAAA " + exception.Message + " " + exception.InnerException + " " + exception.Source); } }
public void LoopSound(bool loop) { if (EngineConfig.SoundSystem == FreeSL.FSL_SOUND_SYSTEM.FSL_SS_NOSYSTEM) { return; } FreeSL.fslSoundSetLooping(_sound, loop); }
public bool IsPaused() { if (EngineConfig.SoundSystem == FreeSL.FSL_SOUND_SYSTEM.FSL_SS_NOSYSTEM) { return(false); } return(FreeSL.fslSoundIsPaused(_sound)); }
public void Pause() { if (EngineConfig.SoundSystem == FreeSL.FSL_SOUND_SYSTEM.FSL_SS_NOSYSTEM) { return; } FreeSL.fslSoundPause(_sound); }
public void RemoveSound() { if (_withSound) { FreeSL.fslFreeSound(_sound, true); _withSound = false; } }
public void ShutDown() { lock (LockSync) { FreeSL.fslShutDown(); _initSound = false; } // this.updaterThread = new Thread(new ThreadStart(UpdateSoundObjects)); }
protected void SetGain(float gain) { if (EngineConfig.SoundSystem == FreeSL.FSL_SOUND_SYSTEM.FSL_SS_NOSYSTEM) { return; } //LogManager.Singleton.LogMessage(LogMessageLevel.LML_CRITICAL, "SETTING GAIN: " + this.Name + " Base: " + this.GetBaseGain() + ", final gain:" + gain); FreeSL.fslSoundSetGain(_sound, gain); }
public void Stop() { if (EngineConfig.SoundSystem == FreeSL.FSL_SOUND_SYSTEM.FSL_SS_NOSYSTEM) { return; } _shouldBePlaying = false; FreeSL.fslSoundStop(_sound); _playing = false; }
public void Update() { FreeSL.fslSetListenerPosition(_renderable.Position.x, _renderable.Position.y, _renderable.Position.z); Mogre.Vector3 yVec, zVec; yVec = _renderable.Orientation.YAxis; zVec = _renderable.Orientation.ZAxis; FreeSL.fslSetListenerOrientation(zVec.x, zVec.y, zVec.z, yVec.x, yVec.y, yVec.z); }
public void SetSound(string package, string soundFile, bool loop) { RemoveSound(); if (System.IO.File.Exists(package) == false) { throw new System.IO.FileNotFoundException("The sound file at : " + soundFile + " does not exist."); } FreeSL.fslLoadSoundFromZip(package, soundFile); LoopSound(loop); _withSound = 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 SetSound(string package, string soundFile, bool loop) { RemoveSound(); if (File.Exists(package) == false) { throw new FileNotFoundException("The sound file at : " + soundFile + " does not exist."); } lock (SoundManager3D.Instance.LockSync) { FreeSL.fslLoadSoundFromZip(package, soundFile); LoopSound(loop); } _withSound = true; }
public void RemoveSound() { if (_withSound) { try{ Console.WriteLine("Destroying: " + this._soundFile); FreeSL.fslSoundSetGain(_sound, 0.1f); FreeSL.fslFreeSound(_sound, true); _withSound = false; } catch (Exception ex) { LogManager.Singleton.LogMessage(LogMessageLevel.LML_CRITICAL, "Exception while trying to remove sound: " + _soundFile + " (" + ex.Message + ") " + ex.StackTrace); } } }
public override void Update() { base.Update(); // if (_renderable != null) try { FreeSL.fslSoundSetPosition(_sound, _renderable._getDerivedPosition().x, _renderable._getDerivedPosition().y, _renderable._getDerivedPosition().z); } catch (Exception e) { LogManager.Singleton.LogMessage(LogMessageLevel.LML_CRITICAL, "Error while updating 3D sound object position: " + e.Message + e.StackTrace); } }
public virtual void Play() { if (EngineConfig.SoundSystem == FreeSL.FSL_SOUND_SYSTEM.FSL_SS_NOSYSTEM) { return; } // dzwieki powinny miec ustawiona lokalna glosnosc (niezalezna od muzyki) przed rozpoczeciem pierwszego odtworzenia // SetGain(GetBaseGain() * EngineConfig.SoundVolume / 100.0f); ApplyGain(); try{ FreeSL.fslSoundPlay(_sound); } catch (Exception ex) { LogManager.Singleton.LogMessage(LogMessageLevel.LML_CRITICAL, "Exception while trying to play sound: " + _soundFile + " (" + ex.Message + ") " + ex.StackTrace); } _shouldBePlaying = true; _playing = true; }
public void SetSound(string soundFile, bool loop, bool streaming) { RemoveSound(); if (System.IO.File.Exists(soundFile) == false) { throw new System.IO.FileNotFoundException("The sound file at : " + soundFile + " does not exist."); } if (streaming) { _sound = FreeSL.fslStreamSound(soundFile); } else { _sound = FreeSL.fslLoadSound(soundFile); } LoopSound(loop); _withSound = true; }
public bool IsPlaying() { if (EngineConfig.SoundSystem == FreeSL.FSL_SOUND_SYSTEM.FSL_SS_NOSYSTEM) { return(false); } //return FreeSL.fslSoundIsPlaying(_sound); // uwagi na bugi w streamingu w FreeSL trzeba zrobic workaround... if (FreeSL.fslSoundIsPlaying(_sound)) { // nie wierzymy freeslowi return(_playing); } else { // wierzymy ze dzwiek sie zakonczyl _playing = false; return(false); } }
public void SetReferenceDistance(float distance) { FreeSL.fslSoundSetReferenceDistance(_sound, distance); }
public void SetMaxDistance(float distance) { FreeSL.fslSoundSetMaxDistance(_sound, distance); }
public bool IsPlaying() { return(FreeSL.fslSoundIsPlaying(_sound)); }
public void Stop() { FreeSL.fslSoundStop(_sound); }
public void Play() { FreeSL.fslSoundPlay(_sound); }
public void Pause() { FreeSL.fslSoundPause(_sound); }
public void SetGain(float gain) { FreeSL.fslSoundSetGain(_sound, gain); }
public bool IsLooping() { return(FreeSL.fslSoundIsLooping(_sound)); }
public void LoopSound(bool loop) { FreeSL.fslSoundSetLooping(_sound, loop); }
public bool IsPaused() { return(FreeSL.fslSoundIsPaused(_sound)); }