private void SaveSettingsFromControl(SoundTriggerControl control, SoundPlaySettings soundSettings) { soundSettings.SoundDirectory = control.SoundDirectoryPath; soundSettings.SoundFile = control.SoundFilePath; soundSettings.SoundVolume = control.VolumeLevel; soundSettings.PlaySoundType = control.SoundType; }
private void LoadSettingsToControl(SoundTriggerControl control, SoundPlaySettings soundSettings) { control.SoundDirectoryPath = soundSettings.SoundDirectory; control.SoundFilePath = soundSettings.SoundFile; control.VolumeLevel = soundSettings.SoundVolume; control.SoundType = soundSettings.PlaySoundType; control.RefreshFields(); }
/// <summary> /// Plays a test sound for a specific file or from a directory of sound files. /// </summary> /// <param name="soundType"></param> /// <param name="path"></param> private void PlayTestSound(PlaySoundType soundType, string path) { SoundPlaySettings tempSettings = new SoundPlaySettings(); tempSettings.PlaySoundType = soundType; switch (soundType) { case PlaySoundType.FromDirectory: tempSettings.SoundDirectory = path; break; case PlaySoundType.FromFile: tempSettings.SoundFile = path; break; default: return; } tempSettings.SoundVolume = this.uiVolumeTrackBar.Value; this.ParentView.Engine.SoundPlayer.ScheduleSound(1, tempSettings); }