public FIS(ref MMI.EBuLa.Tools.XMLLoader state, ref SoundInterface sound) { /* NaechsterHalt = "Ostbahnhof"; Netz = "München"; Linie = "S1"; Start = "Ostbahnhof"; Ziel = "München Flughafen"; Zugnummer = "99132";*/ /* NaechsterHalt = "Neunkirchen(Saar)Hbf"; Netz = "Saarland"; Linie = "RB73"; Start = "Saarbrücken Hbf"; Ziel = "Türkismühle"; Zugnummer = "";*/ NaechsterHalt = ""; Netz = ""; Linie = ""; Start = ""; Ziel = ""; Zugnummer = ""; dx = sound; localconf = state; FillFIS(); }
void Awake() { // BitBenderGames mobileTouchCamera = FindObjectOfType <BitBenderGames.MobileTouchCamera>(); costs = FindObjectOfType <Costs>(); soundInterface = FindObjectOfType <SoundInterface>(); }
private void ParseActions(XElement root, Dictionary <Event, List <Action> > events, Event ev, EventType evType) { foreach (var notify in root.Element("actions").Elements("notify")) { Balloon ballonData = null; var balloon = notify.Element("balloon"); if (balloon != null) { var titleText = balloon.Attribute("title_text").Value; var bodyText = balloon.Attribute("body_text").Value; var displayDuration = int.Parse(balloon.Attribute("display_time").Value); ballonData = new Balloon(titleText, bodyText, displayDuration, evType); } SoundInterface soundInterface = null; var music = notify.Descendants("music"); var beeps = notify.Descendants("beeps"); var textToSpeech = notify.Descendants("text_to_speech"); if (music.Any() && beeps.Any() || music.Any() && textToSpeech.Any() || textToSpeech.Any() && beeps.Any()) { throw new Exception("Only 1 type of sound allowed by notifyAction"); } if (music.Any()) { var musicFile = music.First().Attribute("file").Value; var volume = float.Parse(music.First().Attribute("volume").Value, CultureInfo.InvariantCulture) / 100; var duration = int.Parse(music.First().Attribute("duration").Value); soundInterface = new Music(musicFile, volume, duration); } if (beeps.Any()) { var beepsList = new List <Beep>(); foreach (var beep in beeps.First().Elements()) { var frequency = int.Parse(beep.Attribute("frequency").Value); var duration = int.Parse(beep.Attribute("duration").Value); beepsList.Add(new Beep(frequency, duration)); } soundInterface = new Beeps(beepsList); } if (textToSpeech.Any()) { var tts = textToSpeech.First(); var text = tts.Attribute("text").Value; var voiceGender = (VoiceGender)Enum.Parse(typeof(VoiceGender), tts.Attribute("voice_gender")?.Value ?? "Female", true); var voiceAge = (VoiceAge)Enum.Parse(typeof(VoiceAge), tts.Attribute("voice_age")?.Value ?? "Adult", true); var culture = tts.Attribute("culture")?.Value ?? LP.Culture.ToString(); var voicePosition = int.Parse(tts.Attribute("voice_position")?.Value ?? "0"); var volume = int.Parse(tts.Attribute("volume")?.Value ?? "30"); var rate = int.Parse(tts.Attribute("rate")?.Value ?? "0"); soundInterface = new TextToSpeech(text, voiceGender, voiceAge, voicePosition, culture, volume, rate); } var notifyAction = new NotifyAction(soundInterface, ballonData); events[ev].Add(notifyAction); } }
public ET42XState(ref MMI.EBuLa.Tools.XMLLoader conf, ref SoundInterface sound) { HBL_Druck = 5f; HL_Druck = 5f; //störungmgr.Add(new Störung(ENUMStörung.S02_Trennschütz)); störungmgr.Add(new Störung(ENUMStörung.S01_ZUSIKomm)); localconf = conf; fis = new FIS(ref conf, ref sound); }
private static void DumpInterface(SoundInterface soundInterface, InterfaceInfo info, int number) { Console.WriteLine("\t#{0} [{1}] ----------", number, info.Name); Console.WriteLine("\tDelay: {0} ms", soundInterface.Delay); Console.WriteLine("\tLowLevelAPI: {0}support", soundInterface.IsSupportingLowLevelApi ? "" : "not "); Console.WriteLine("\tChip Count: {0}", soundInterface.SoundChipCount); var chipCount = soundInterface.SoundChipCount; for (var i = 0; i < chipCount; i++) { using (var chip = soundInterface.GetSoundChip(i)) DumpChip(chip, i); } Console.WriteLine(); }
static void DumpInterface(SoundInterface soundInterface, InterfaceInfo info, int number) { Console.WriteLine("\t#{0} [{1}] ----------", number, info.Name); Console.WriteLine("\tDelay: {0} ms", soundInterface.Delay); Console.WriteLine("\tLowLevelAPI: {0}support", soundInterface.IsSupportingLowLevelApi ? "" : "not "); Console.WriteLine("\tChip Count: {0}", soundInterface.SoundChipCount); var chipCount = soundInterface.SoundChipCount; for (int i = 0; i < chipCount; i++) { using (var chip = soundInterface.GetSoundChip(i)) DumpChip(chip, i); } Console.WriteLine(); }
/** * Get a list of active sounds that pass a filter. */ public static IEnumerable <SoundInterface> ActiveSounds(Func <SoundInterface, bool> filter) { TryCreate(); if (I.activePool.Count > 0) { var current = I.activePool.First; do { var si = new SoundInterface(current.Value); if (filter(si)) { yield return(si); } current = current.Next; } while (current != null); } }
// --- constructors --- /// <summary>Creates a new instance of this class.</summary> /// <param name="file">The plugin file.</param> internal Plugin(string file) { File = file; Title = Path.GetFileName(file); Sound = null; }
public NotifyAction(SoundInterface sound, Balloon balloon) { Sound = sound; Balloon = balloon; }
public void DisableSound() { Sound = new NullSound(); }
public DIAGNOSEControl(MMI.EBuLa.Tools.XMLLoader conf, ref MMI.MMIBR185.BR185Control mmi) { if (!conf.DoubleBuffer) { //This turns off internal double buffering of all custom GDI+ drawing this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); USE_DOUBLE_BUFFER = false; } else USE_DOUBLE_BUFFER = true; InitializeComponent(); center = new Point(468+80, 30+80); uhrAußenList = (new ISphere(468+80, 30+80, 74)).PointList(); uhrInnenklList = (new ISphere(468+80, 30+80, 69)).PointList(); uhrInnengrList = (new ISphere(468+80, 30+80, 62)).PointList(); uhrminList = (new ISphere(468+80, 30+80, 60)).PointList(); uhrstdList = (new ISphere(468+80, 30+80, 47)).PointList(); uhrsecList = (new ISphere(468+80, 30+80, 60)).PointList(); uhrrestList = (new ISphere(468+80, 30+80, 10)).PointList(); m_conf = conf; mmi_widget = mmi; localstate = new MMI.DIAGNOSE.DIAGNOSEState(); localstate.Energie = conf.Energie; something_changed = true; // NOTBREMSE und E-BREMSE fehlen vtime = DateTime.Now; zugkraft_thread = new Thread(new ThreadStart(MoveZugkraft)); int interval = Convert.ToInt32(Math.Round((1d/(double)conf.FramesPerSecondLow)*1000d)); timer1.Interval = interval; timer1.Enabled = true; switch (m_conf.Sound) { case 1: Sound = new APISound(); break; case 2: Sound = new DxSound(); break; default: Sound = new NullSound(); break; } Button_SW_Pressed(this, new EventArgs()); mmi_widget.PREVENT_DRAW = true; /* try { // Now setup our D3D stuff Microsoft.DirectX.Direct3D.PresentParameters presentParams = new Microsoft.DirectX.Direct3D.PresentParameters(); presentParams.Windowed=true; presentParams.SwapEffect = Microsoft.DirectX.Direct3D.SwapEffect.Discard; device = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, this, Microsoft.DirectX.Direct3D.CreateFlags.HardwareVertexProcessing, presentParams); } catch (Exception) {} */ }
public NotifyFlashMessage(SoundInterface sound, Balloon balloon, int priority) { Sound = sound; Balloon = balloon; Priority = priority; }
public ET42XControl(MMI.EBuLa.Tools.XMLLoader conf, ref Network net) { if (!conf.DoubleBuffer) { //This turns off internal double buffering of all custom GDI+ drawing this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); USE_DOUBLE_BUFFER = false; } else USE_DOUBLE_BUFFER = true; InitializeComponent(); m_net = net; uhrAußen = new ISphere(508+60, 41+60, 57); uhrInnengr = new ISphere(508+60, 41+60, 45); uhrInnenkl = new ISphere(508+60, 41+60, 52); uhrsec = new ISphere(508+60, 41+60, 43); uhrmin = new ISphere(508+60, 41+60, 43); uhrstd = new ISphere(508+60, 41+60, 28); uhrrest = new ISphere(508+60, 41+60, 7); center = new Point(508+60, 41+60); m_conf = conf; // NOTBREMSE und E-BREMSE fehlen switch (m_conf.Sound) { case 1: Sound = new APISound(); break; case 2: Sound = new DxSound(); break; default: Sound = new NullSound(); break; } localstate = new MMI.ET42X.ET42XState(ref conf, ref Sound); SetButtons(); localstate.Energie = conf.Energie; vtime = DateTime.Now; zugkraft_thread = new Thread(new ThreadStart(MoveZugkraft)); int interval = Convert.ToInt32(Math.Round((1d/(double)conf.FramesPerSecondLow)*1000d)); timer1.Interval = interval; timer1.Enabled = true; Button_SW_Pressed(this, new EventArgs()); /*if (localstate.ET42Xtype1 == ET42XTYPE.ET423) localstate.FISType = FIS_TYPE.FIS;*/ timer2.Enabled = true; if (vtime.DayOfYear > 100 && vtime.DayOfYear < 300) localstate.Kuehlung = true; else localstate.Kuehlung = false; }
public ICE3Control(MMI.EBuLa.Tools.XMLLoader conf, ControlContainer cc) { if (!conf.DoubleBuffer) { //This turns off internal double buffering of all custom GDI+ drawing this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); USE_DOUBLE_BUFFER = false; } else USE_DOUBLE_BUFFER = true; InitializeComponent(); schw.Initialize(); tür.Initialize(); m_conf = conf; this.cc = cc; localstate = new ICE3State(); localstate.ICEtype1 = ICE3TYPE.ICE403; localstate.ICEtype2 = ICE3TYPE.NONE; //localstate.Type = TYPE.David2; if (localstate.Type == TYPE.David1) { localstate.DISPLAY = CURRENT_DISPLAY.D1_Grundb; } else { localstate.DISPLAY = CURRENT_DISPLAY.D2_Zustand; } //olddisplay = CURRENT_DISPLAY.D1_Grundb; switch (m_conf.Sound) { case 1: sound = new APISound(); break; case 2: sound = new DxSound(); break; default: sound = new NullSound(); break; } //SetButtons(); vtime = DateTime.Now; InitC_druck(); threadDelegate_Türen = new ThreadStart(SetUpTüren); int interval = Convert.ToInt32(Math.Round((1d/(double)FramesPerSecond)*1000d)); timer1.Interval = interval; timer1.Enabled = true; Button_SW_Pressed(this, new EventArgs()); }
public DavidControl(MMI.EBuLa.Tools.XMLLoader conf, ControlContainer cc) { if (!conf.DoubleBuffer) { //This turns off internal double buffering of all custom GDI+ drawing this.SetStyle(ControlStyles.DoubleBuffer, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); USE_DOUBLE_BUFFER = false; } else { USE_DOUBLE_BUFFER = true; } InitializeComponent(); m_conf = conf; this.cc = cc; localstate = new DavidState(); localstate.ICEtype = ICETYPE.ICE1; localstate.Type = TYPE.David2; localstate.DISPLAY = CURRENT_DISPLAY.D2_B; olddisplay = CURRENT_DISPLAY.D1_I; //SetButtons(); vtime = DateTime.Now; InitC_druck(); int interval = Convert.ToInt32(Math.Round((1d/(double)FramesPerSecond)*1000d)); timer1.Interval = interval; timer1.Enabled = true; switch (m_conf.Sound) { case 1: sound = new APISound(); break; case 2: sound = new DxSound(); break; default: sound = new NullSound(); break; } Button_SW_Pressed(this, new EventArgs()); }