/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="path">The path to the file or folder that contains the sound.</param> /// /// <param name="radius">The sound radius</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public override bool RegisterSound(string path, double radius, out OpenBveApi.Sounds.SoundHandle handle) { if (System.IO.File.Exists(path) || System.IO.Directory.Exists(path)) { handle = Program.Sounds.RegisterBuffer(path, radius); return(true); } ReportProblem(OpenBveApi.Hosts.ProblemType.PathNotFound, path); handle = null; return(false); }
/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="path">The path to the file or folder that contains the sound.</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public override bool RegisterSound(string path, out OpenBveApi.Sounds.SoundHandle handle) { if (System.IO.File.Exists(path) || System.IO.Directory.Exists(path)) { handle = Sounds.RegisterBuffer(path, 0.0); } else { ReportProblem(OpenBveApi.Hosts.ProblemType.PathNotFound, path); } handle = null; return(false); }
/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="path">The path to the file or folder that contains the sound.</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public override bool RegisterSound(string path, out OpenBveApi.Sounds.SoundHandle handle) { if (File.Exists(path) || Directory.Exists(path)) { // Sounds.SoundBuffer data; // data = Sounds.RegisterBuffer(path, 0.0); // TODO } else { ReportProblem(ProblemType.PathNotFound, path); } handle = null; return(false); }
/// <summary>Plays a sound.</summary> /// <param name="buffer">The sound buffer.</param> /// <param name="pitch">The pitch change factor.</param> /// <param name="volume">The volume change factor.</param> /// <param name="position">The position. If a train car is specified, the position is relative to the car, otherwise absolute.</param> /// <param name="parent">The parent object the sound is attached to, or a null reference.</param> /// <param name="looped">Whether to play the sound in a loop.</param> /// <returns>The sound source.</returns> public virtual object PlaySound(SoundHandle buffer, double pitch, double volume, OpenBveApi.Math.Vector3 position, object parent, bool looped) { return(null); }
/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="sound">The sound data.</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public virtual bool RegisterSound(Sounds.Sound sound, out SoundHandle handle) { handle = null; return(false); }
/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="path">The path to the file or folder that contains the sound.</param> /// <param name="radius">The sound radius</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public virtual bool RegisterSound(string path, double radius, out SoundHandle handle) { handle = null; return(false); }
/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="sound">The sound data.</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public override bool RegisterSound(OpenBveApi.Sounds.Sound sound, out OpenBveApi.Sounds.SoundHandle handle) { handle = Program.Sounds.RegisterBuffer(sound, 0.0); return(true); }
/// <summary>Registers a sound and returns a handle to the sound.</summary> /// <param name="sound">The sound data.</param> /// <param name="handle">Receives a handle to the sound.</param> /// <returns>Whether loading the sound was successful.</returns> public override bool RegisterSound(OpenBveApi.Sounds.Sound sound, out OpenBveApi.Sounds.SoundHandle handle) { //handle = Sounds.RegisterBuffer(sound, 0.0); // TODO handle = null; return(true); }