public SoundBase(string importPath, PrivateSettings programSettings) { this.programSettings = programSettings; userDB = new Dictionary <string, DateTime>(); SoundPlayererStack = new List <NSoundPlayer>(); rng = new Random(); this.delay = programSettings.Delay; this.SoundBaseFile = importPath; this.speechSynthesizer = new SpeechSynthesizer(); this.speechSynthesizer.SelectVoice(GetSafeVoice(programSettings.VoiceSynthesizer)); this.speechSynthesizer.Volume = 100; this.speechSynthesizer.Rate = -2; soundlist = SoundStorageXML.LoadSoundBase(importPath); }
internal void Marge(List <SoundEntry> importedEntries) { foreach (var entry in importedEntries) { if (soundlist.Any(x => x.GetCommand() == entry.GetCommand())) { soundlist.First(x => x.GetCommand() == entry.GetCommand()).AddFiles(entry.GetAllFiles()); } else { soundlist.Add(entry); } SoundStorageXML.SaveSoundBase(SoundBaseFile, soundlist); } }
internal void RemoveSound(IRC.OldIRCClient irc, string text) { text = text.Split(' ').Last(); if (text.StartsWith("!")) { text = text.Remove(0, 1); } for (int i = 0; i < soundlist.Count; i++) { if (soundlist[i].GetCommand() == text) { soundlist.RemoveAt(i); SoundStorageXML.SaveSoundBase(SoundBaseFile, soundlist); irc.SendChatMessage("Removed sound entry #" + i.ToString() + "."); return; } } irc.SendChatMessage("Nothing found."); }
internal void Save() { SoundStorageXML.SaveSoundBase(SoundBaseFile, soundlist); }