Пример #1
0
 private void SaveSettingsFromControl(SoundTriggerControl control, SoundPlaySettings soundSettings)
 {
     soundSettings.SoundDirectory = control.SoundDirectoryPath;
     soundSettings.SoundFile      = control.SoundFilePath;
     soundSettings.SoundVolume    = control.VolumeLevel;
     soundSettings.PlaySoundType  = control.SoundType;
 }
Пример #2
0
        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();
        }
Пример #3
0
        /// <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);
        }