public void Play(SoundKind SoundKind) { if (_settings.Items.TryGetValue(SoundKind, out var value)) { PlaySound(value); } }
public static void Play(SoundKind kind, bool one = false) { if (!Instance) { return; } Instance.PlaySound(kind, one); }
public SoundsViewModelItem(SoundKind SoundKind, IDialogService DialogService, SoundSettings Settings) { this.SoundKind = SoundKind; _settings = Settings; ResetCommand = new DelegateCommand(() => FileName = null); SetCommand = new DelegateCommand(() => { var folder = DialogService.PickFile(Path.GetDirectoryName(FileName), ""); if (folder != null) { FileName = folder; } }); }
public void PlaySound(SoundKind kind, bool one) { int snd = (int)kind; if (snd >= sounds.Length) { return; } if (sounds[snd]) { if (!one) { sounds[snd].Play(); } else { sounds[snd].PlayOneShot(sounds[snd].clip); } } }
public GMSound(ProjectReader reader) { Name = reader.ReadString(); LastChanged = reader.ReadDate(); Version = reader.ReadInt32(); if (Version != 800) { throw new InvalidDataException("This library only supports .gmk GM8.0 files."); } Kind = (SoundKind)reader.ReadInt32(); FileType = reader.ReadString(); FileName = reader.ReadString(); Data = null; if (reader.ReadBoolean()) { int size = reader.ReadInt32(); Data = reader.ReadBytes(size); } int eff = reader.ReadInt32(); int efflen = (int)SoundEffects.__LENGTH; Effects = new bool[efflen]; for (int i = 0; i < efflen; i++) { Effects[i] = (eff & 1) != 0; eff >>= 1; } // to check for an effect you do: // if (Effects[(int)SoundEffects.CHORUS]) { } Volume = reader.ReadDouble(); Panning = reader.ReadDouble(); Preload = reader.ReadBoolean(); reader.Dispose(); }
public SoundsViewModelItem(SoundKind SoundKind, IDialogService DialogService, SoundSettings Settings) { this.SoundKind = SoundKind; _settings = Settings; }
public void Play(SoundKind soundKind) { }