internal void Say( string who, string what, Vector3 where, AssignedVoice v, bool doRotate, BeepType beep) { if (queue == null) { return; } QueuedSpeech e = new QueuedSpeech( subs.FixExpressions(who), subs.FixExpressions(what), where, v, false, doRotate, beep); // Put that on the queue and wake up the background thread. lock (queue) { queue.Enqueue(e); Monitor.Pulse(queue); } }
/// <summary> /// Play the specified sound (as defined in the Sound control panel). /// </summary> public static void MessageBeep(BeepType type = BeepType.SimpleBeep) { if (!Imports.MessageBeep(type)) { throw Errors.GetIoExceptionForLastError(); } }
public void Beep_Template(EngineState s, string rawCode, BeepType beepType) { CodeParser parser = new CodeParser(EngineTests.DummySection(), Global.Setting, EngineTests.Project.Compat); CodeCommand cmd = parser.ParseStatement(rawCode); CodeInfo_Beep info = cmd.Info.Cast <CodeInfo_Beep>(); Assert.IsTrue(info.Type == beepType); }
void OnBeep(BeepType type) { if (Beeped != null) { var e = new BeepEventArgs(); e.Type = type; Beeped(this, e); } }
public void Beep_Template(EngineState s, string rawCode, BeepType beepType) { SectionAddress addr = EngineTests.DummySectionAddress(); CodeCommand cmd = CodeParser.ParseStatement(rawCode, addr); Debug.Assert(cmd.Info.GetType() == typeof(CodeInfo_Beep)); CodeInfo_Beep info = cmd.Info as CodeInfo_Beep; Assert.IsTrue(info.Type == beepType); }
internal QueuedSpeech(string who, string what, Vector3 where, AssignedVoice v, bool action, bool doRotate, BeepType b) { speaker = who; message = what; position = where; voice = v; isAction = action; isSpatial = doRotate; beep = b; }
public static void Beep(BeepType type) { uint beeptype = 0; if (type == BeepType.Default) { beeptype = 0xffffffff; } else { beeptype = Convert.ToUInt32(type); } MessageBeep(beeptype); }
private MifareResponse sendBeepRequest(BeepType beepType) { byte[] readBuffer = new byte[64]; int offset = 0; int bytesToRead = 0; WriteCommand(Command.SET_BUZZER_BEEP, NODE_BROADCAST, (byte)beepType); // Naive busy way. Rewrite to consumer stream pull! do { Thread.Sleep(50); bytesToRead = port.BytesToRead; } while (bytesToRead == 0); // TODO: Use callback, make response parser able to read lazily from input stream int bytesRead = port.Read(readBuffer, offset, bytesToRead); // Evaluate data in buffer MifareResponse response = new MifareResponse(); ushort length = readBuffer.Subset(2, 2).ToUInt16(); //Console.WriteLine ("Length: {0} ( {1})", length, readBuffer.Subset (2, 2).ToHex ()); ushort nodeID = readBuffer.Subset(4, 2).ToUInt16(); //Console.WriteLine ("NodeID: {0} ( {1})", nodeID, readBuffer.Subset (4, 2).ToHex ()); response.NodeId = nodeID; ushort commandCode = readBuffer.Subset(6, 2).ToUInt16(); //Console.WriteLine ("Command: {0} ( {1})", Enum.GetName (typeof(CommandCode), commandCode), readBuffer.Subset (6, 2).ToHex ()); response.Command = (Command)commandCode; byte responseCode = readBuffer[8]; //Console.WriteLine ("Response Code: {0} ( {1})", Enum.GetName (typeof(ResponseCode), responseCode), responseCode.ToHex ()); response.Response = (Response)responseCode; //byte checksum = readBuffer [readBuffer.Length-1]; byte checksum = readBuffer[4 + length]; byte calculatedChecksum = CalcCheckSum(readBuffer, 4, 4 + length); validateChecksum(checksum, calculatedChecksum); return(response); }
/// <summary> /// Beeps the specified type. /// </summary> /// <param name="type">The type.</param> public void Beep(BeepType type) { Thread beeperThread = new Thread(new ThreadStart(delegate() { switch (type) { case BeepType.TicketRedeemed: beeper.OnTime = 1; beeper.OffTime = 2; beeper.Count = 2; beeper.Frequency = 1; DNWA.BHTCL.Beep.Settings.Volume = DNWA.BHTCL.Beep.Settings.EN_VOLUME.LEVEL3; beeper[DNWA.BHTCL.Beep.Settings.EN_DEVICE.BUZZER] = DNWA.BHTCL.Beep.EN_CTRL.ON; break; case BeepType.Error: beeper.OnTime = 5; beeper.OffTime = 5; beeper.Count = 1; beeper.Frequency = 0; DNWA.BHTCL.Beep.Settings.Volume = DNWA.BHTCL.Beep.Settings.EN_VOLUME.LEVEL5; beeper[DNWA.BHTCL.Beep.Settings.EN_DEVICE.BUZZER] = DNWA.BHTCL.Beep.EN_CTRL.ON; break; case BeepType.Attention: beeper.OnTime = 1; beeper.OffTime = 1; beeper.Count = 10; beeper.Frequency = 2; DNWA.BHTCL.Beep.Settings.Volume = DNWA.BHTCL.Beep.Settings.EN_VOLUME.LEVEL5; beeper[DNWA.BHTCL.Beep.Settings.EN_DEVICE.BUZZER] = DNWA.BHTCL.Beep.EN_CTRL.ON; break; default: beeper.OnTime = 10; beeper.Count = 1; beeper.Frequency = 1; DNWA.BHTCL.Beep.Settings.Volume = DNWA.BHTCL.Beep.Settings.EN_VOLUME.LEVEL1; beeper[DNWA.BHTCL.Beep.Settings.EN_DEVICE.BUZZER] = DNWA.BHTCL.Beep.EN_CTRL.ON; break; } })); beeperThread.IsBackground = true; beeperThread.Start(); }
/// <summary> /// Beeps the specified type. /// </summary> /// <param name="type">The type.</param> public void Beep(BeepType type) { Thread beeper = new Thread(new ThreadStart(delegate() { switch (type) { case BeepType.TicketRedeemed: beep.Duration = 100; beep.Frequency = 5000; beep.Volume = 3; beep.State = NotifyState.CYCLE; Thread.Sleep(150); beep.State = NotifyState.CYCLE; break; case BeepType.Error: beep.Duration = 500; beep.Frequency = 1000; beep.Volume = 5; beep.State = NotifyState.CYCLE; break; case BeepType.Attention: beep.Duration = 50; beep.Frequency = 7500; beep.Volume = 5; for (int i = 0; i < 10; ++i) { beep.State = NotifyState.CYCLE; Thread.Sleep(75); } break; default: beep.Duration = 1000; beep.Frequency = 3000; beep.Volume = 1; beep.State = NotifyState.CYCLE; break; } })); beeper.IsBackground = true; beeper.Start(); }
public static void Beep(BeepType type = BeepType.SimpleBeep) { MessageBeep((uint)type); }
public static void Beep(BeepType type) { uint beeptype = 0; if(type==BeepType.Default) { beeptype = 0xffffffff; } else { beeptype = Convert.ToUInt32(type); } MessageBeep(beeptype); }
/// <summary> /// Method to call interop for system beep /// </summary> /// <remarks>Calls Windows to make computer beep</remarks> /// <param name="type">The kind of beep you would like to hear</param> public static void MessageBeep(BeepType type) { MessageBeep((uint)type); }
/// <summary> /// Play the specified sound (as defined in the Sound control panel). /// </summary> public static void MessageBeep(BeepType type = BeepType.SimpleBeep) => Error.ThrowLastErrorIfFalse(Imports.MessageBeep(type));
internal void Say( string who, string what, Vector3 where, AssignedVoice v, bool doRotate, BeepType beep) { if (queue == null) return; QueuedSpeech e = new QueuedSpeech( subs.FixExpressions(who), subs.FixExpressions(what), where, v, false, doRotate, beep); // Put that on the queue and wake up the background thread. lock (queue) { queue.Enqueue(e); Monitor.Pulse(queue); } }
public static extern bool MessageBeep(BeepType beepType);
public static extern bool Play(BeepType BeepType);
internal void SayMore(string message, BeepType beep) { FirstCheck(); Say(null, message, SYSTEMPOSITION, SystemVoice, false, beep); }
public static void MessageBeep(BeepType type = BeepType.SimpleBeep) => ErrorMethods.MessageBeep(type);
internal static extern bool MessageBeep(BeepType type);
public void BasicMessageBeep(BeepType type) { ErrorMethods.MessageBeep(type); }
static extern bool MessageBeep(BeepType uType);
public void BasicMessageBeep(BeepType type) { Windows.MessageBeep(type); }
public static extern bool MessageBeep(BeepType Type);
/* Methode zur Ausgabe eines Piepstons */ public static bool MessageBeep(BeepType beepType) { return(MessageBeep((uint)beepType) != 0); }