void IRestartable.Restart() { if (this.output is IRestartable restartable) { restartable.Restart(); } this.allowWspBeforeFollowingTag = false; this.lastWhitespace = false; this.lineLength = 0; this.longestLineLength = 0; this.literalWhitespaceNesting = 0; this.literalTags = false; this.literalEntities = false; this.cssEscaping = false; this.tagNameIndex = HtmlNameIndex._NOTANAME; this.previousTagNameIndex = HtmlNameIndex._NOTANAME; this.isEndTag = false; this.isEmptyScopeTag = false; this.copyPending = false; this.outputState = OutputState.OutsideTag; }
private void onRecordingStateChange(OBSWebsocket sender, OutputState newState) { string state; switch (newState) { case OutputState.Starting: state = "Recording starting..."; break; case OutputState.Started: state = "Stop recording"; break; case OutputState.Stopping: state = "Recording stopping..."; break; case OutputState.Stopped: state = "Start recording"; break; default: state = "State unknown"; break; } Debug.Log($"RecordingStateChange: {state}"); updateRecordingText = state; }
public void SetOutputState(OutputState state) { if (state == null) { return; } lock (listOutputslock) { var results = outputs.Where(x => x.hash == state.hash && x.idx == state.idx).ToList(); if (results.Count > 0) { var oldstate = results[0]; oldstate.spent = state.spent; oldstate.units = state.units; oldstate.hasoptreturn = state.hasoptreturn; } else { state.Id = state.ToId(); outputs.Add(state); } } }
public UnspentTx(UInt256 txHash, int blockIndex, int txIndex, int length, OutputState state) { this.txHash = txHash; this.blockIndex = blockIndex; this.txIndex = txIndex; this.outputStates = new OutputStates(length, state); }
private void UpdateButton(Button button, OutputState state, string label) { color color1 = new color(); string key = (string)null; //TODO: add localization for Playing strings/MetaGen in general switch (state) { case OutputState.Starting: color1 = color.Yellow; //key = label=="Recording"?"CameraControl.OBS." + label + ".Starting" : "Play Starting"; key = "Starting " + label; break; case OutputState.Started: color1 = color.Green; //key = label=="Recording"?"CameraControl.OBS." + label + ".Stop" : "Stop Play"; key = "Stop " + label; break; case OutputState.Stopping: color1 = color.Orange; //key = label=="Recording"?"CameraControl.OBS." + label + ".Stopping" : "Stopping Play"; key = "Stopping " + label; break; case OutputState.Stopped: color1 = color.Red; //key = label=="Recording"?"CameraControl.OBS." + label + ".Start" : "Start Play"; key = "Start " + label; break; } Button button1 = button; ref color local1 = ref color1;
public override void Finish() { if (state_ == OutputState.Header) { WriteHeader(); } if (state_ == OutputState.Footer) { state_ = OutputState.Finished; base.Finish(); uint num = (uint)(deflater_.TotalIn & 0xFFFFFFFFu); uint num2 = (uint)(crc.Value & 0xFFFFFFFFu); byte[] array = new byte[8] { (byte)num2, (byte)(num2 >> 8), (byte)(num2 >> 16), (byte)(num2 >> 24), (byte)num, (byte)(num >> 8), (byte)(num >> 16), (byte)(num >> 24) }; baseOutputStream_.Write(array, 0, array.Length); } }
void WriteHeader() { if (state_ == OutputState.Header) { state_ = OutputState.Footer; int mod_time = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000L); // Ticks give back 100ns intervals byte[] gzipHeader = { // The two magic bytes (byte)(GZipConstants.GZIP_MAGIC >> 8), (byte)(GZipConstants.GZIP_MAGIC & 0xff), // The compression type (byte)Deflater.DEFLATED, // The flags (not set) 0, // The modification time (byte)mod_time, (byte)(mod_time >> 8), (byte)(mod_time >> 16), (byte)(mod_time >> 24), // The extra flags 0, // The OS type (unknown) (byte)255 }; baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length); } }
private void Ws_StreamingStateChanged(OBSWebsocket sender, OutputState type) { switch (type) { case OutputState.Started: _state.Stream = EOBSStreamingState.Started; break; case OutputState.Starting: _state.Stream = EOBSStreamingState.Starting; break; case OutputState.Stopping: _state.Stream = EOBSStreamingState.Stopping; break; case OutputState.Stopped: _state.Stream = EOBSStreamingState.Stopped; break; } if (StreamingStatusChanged != null) { StreamingStatusChanged(this, _state); } }
private void onRecordingStateChange(OBSWebsocket sender, OutputState newState) { string state = ""; switch (newState) { case OutputState.Starting: state = "Recording starting..."; break; case OutputState.Started: state = "Stop recording"; break; case OutputState.Stopping: state = "Recording stopping..."; break; case OutputState.Stopped: state = "Start recording"; break; default: state = "State unknown"; break; } BeginInvoke((MethodInvoker) delegate { btnToggleRecording.Text = state; }); }
private void WriteHeader() { if (state_ == OutputState.Header) { state_ = OutputState.Footer; int num = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000); byte[] array = new byte[10] { 31, 139, 8, 0, 0, 0, 0, 0, 0, 255 }; array[4] = (byte)num; array[5] = (byte)(num >> 8); array[6] = (byte)(num >> 16); array[7] = (byte)(num >> 24); byte[] array2 = array; baseOutputStream_.Write(array2, 0, array2.Length); } }
/// <summary> /// Set the state of the general output I/O /// </summary> /// <param name="Channel">This should be 0 to 7</param> /// <param name="State">OFF/ON</param> /// <returns></returns> public bool SetGeneralOutput(int Channel, OutputState State) { // if the controller is not connected, return if (!this.IsConnected) { this.LastError = string.Format("The controller is not connected."); return(false); } try { CommandStruct cmd = new CommandStruct() { Command = EnumCommand.GENOUT, AxisIndex = Channel / 2, // calculate axis index by channel GenOutPort = Channel % 2, // calculate port by channel GenOutState = State }; _hid_device.Write(cmd.ToBytes()); return(true); } catch (Exception ex) { this.LastError = ex.Message; return(false); } }
protected void OnRecordingStateChanged(OBSWebsocket sender, OutputState outputState) { foreach (var handler in _recordingStateChangedHandlers) { handler.Invoke(this, outputState); } }
private void OutputAttributeName(string name) { output.Write(' '); output.Write(name); lineLength += name.Length + 1; outputState = OutputState.AfterAttributeName; }
void WriteHeader() { if (state_ == OutputState.Header) { state_ = OutputState.Footer; int mod_time = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000L); byte[] gzipHeader = { (byte)(GZipConstants.GZIP_MAGIC >> 8), (byte)(GZipConstants.GZIP_MAGIC & 0xff), (byte)Deflater.DEFLATED, 0, (byte)mod_time, (byte)(mod_time >> 8), (byte)(mod_time >> 16), (byte)(mod_time >> 24), 0, (byte)255 }; baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length); } }
public override void Finish() { if ( state_ == OutputState.Header ) { WriteHeader(); } if( state_ == OutputState.Footer) { state_=OutputState.Finished; base.Finish(); uint totalin=(uint)(deflater_.TotalIn&0xffffffff); uint crcval=(uint)(crc.Value&0xffffffff); byte[] gzipFooter; unchecked { gzipFooter=new byte[] { (byte) crcval, (byte) (crcval >> 8), (byte) (crcval >> 16), (byte) (crcval >> 24), (byte) totalin, (byte) (totalin >> 8), (byte) (totalin >> 16), (byte) (totalin >> 24) }; } baseOutputStream_.Write(gzipFooter, 0, gzipFooter.Length); } }
/// <summary> /// Finish compression and write any footer information required to stream /// </summary> public override void Finish() { // If no data has been written a header should be added. if (state_ == OutputState.Header) { WriteHeader(); } if (state_ == OutputState.Footer) { state_ = OutputState.Finished; base.Finish(); uint totalin = (uint)(deflater_.TotalIn & 0xffffffff); uint crcval = (uint)(crc.Value & 0xffffffff); byte[] gzipFooter; unchecked { gzipFooter = new byte[] { (byte)crcval, (byte)(crcval >> 8), (byte)(crcval >> 16), (byte)(crcval >> 24), (byte)totalin, (byte)(totalin >> 8), (byte)(totalin >> 16), (byte)(totalin >> 24) }; } baseOutputStream_.Write(gzipFooter, 0, gzipFooter.Length); } }
private void WriteHeader() { if (state_ == OutputState.Header) { state_ = OutputState.Footer; int num = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000); byte[] obj = new byte[10] { 31, 139, 8, 0, 0, 0, 0, 0, 0, byte.MaxValue }; obj[4] = (byte)num; obj[5] = (byte)(num >> 8); obj[6] = (byte)(num >> 16); obj[7] = (byte)(num >> 24); byte[] array = obj; baseOutputStream_.Write(array, 0, array.Length); } }
public bool QueryState(OutputState outputState) { bool inStatus = false; Adapter.ViSessionStatusCheck(IviDCPwrInterop.QueryOutputState(Adapter.Session, ChannelName, DCPwrOutputState.getC_Value(outputState), ref inStatus)); return(inStatus); }
private void onStreamingStateChange(OBSWebsocket sender, OutputState newState) { string state; switch (newState) { case OutputState.Starting: state = "Stream starting..."; break; case OutputState.Started: state = "Stop streaming"; break; case OutputState.Stopping: state = "Stream stopping..."; break; case OutputState.Stopped: state = "Start streaming"; break; default: state = "State unknown"; break; } Debug.Log($"StreamingStateChange: {state}"); if (tbStreaming) { tbStreaming.text = state; } }
public bool Parse(byte[] Buffer) { byte temp = 0x0; using (MemoryStream stream = new MemoryStream(Buffer)) { using (BinaryReader reader = new BinaryReader(stream)) { this.AbsPosition = reader.ReadInt32(); // parse Usability temp = reader.ReadByte(); this.IsHomed = ((temp >> 0) & 0x1) > 0 ? true : false; this.IsRunning = ((temp >> 1) & 0x1) > 0 ? true : false; // parse input signal temp = reader.ReadByte(); this.CWLS = ((temp >> 0) & 0x1) > 0 ? InputState.Triggered : InputState.Untriggered; this.CCWLS = ((temp >> 1) & 0x1) > 0 ? InputState.Triggered : InputState.Untriggered; this.ORG = ((temp >> 2) & 0x1) > 0 ? InputState.Triggered : InputState.Untriggered; this.ZeroOut = ((temp >> 3) & 0x1) > 0 ? InputState.Triggered : InputState.Untriggered; this.IN_A = ((temp >> 4) & 0x1) > 0 ? InputState.Untriggered : InputState.Triggered; this.IN_B = ((temp >> 5) & 0x1) > 0 ? InputState.Untriggered : InputState.Triggered; this.OUT_A = ((temp >> 6) & 0x1) > 0 ? OutputState.Enabled : OutputState.Disabled; this.OUT_B = ((temp >> 7) & 0x1) > 0 ? OutputState.Enabled : OutputState.Disabled; this.Error = reader.ReadByte(); this.CommandOrder = reader.ReadByte(); } } return(true); }
private void Obs_RecordingStateChanged(object sender, OutputState type) { Logger.log?.Info($"Recording State Changed: {type}"); switch (type) { case OutputState.Starting: recordingCurrentLevel = true; break; case OutputState.Started: recordingCurrentLevel = true; Task.Run(() => _obs?.SetFilenameFormatting(DefaultFileFormat)); break; case OutputState.Stopping: recordingCurrentLevel = false; break; case OutputState.Stopped: recordingCurrentLevel = false; RenameLastRecording(RenameString); RenameString = null; break; default: break; } }
public void StartPlaying(int recording_index = 0, Slot avatar_template = null) { UniLog.Log("Start playing"); SetUpConfigSlot(); //playing = true; playing_state = OutputState.Started; playingBeginTime = DateTime.UtcNow; playing_frame_index = 0; if (use_grpc_player) { grpcStreamPlayer.generateAnimation = generate_animation_play; grpcStreamPlayer.generateBvh = recording_bvh; if (!grpcStreamPlayer.isPlaying) { grpcStreamPlayer.StartPlaying(avatar_template); } } else { streamPlayer.generateAnimation = generate_animation_play; streamPlayer.generateBvh = recording_bvh; if (!streamPlayer.isPlaying) { streamPlayer.StartPlaying(recording_index, avatar_template); } } }
public void StopRecording() { UniLog.Log("Stop recording"); metaDataManager.WriteUserMetaData(); if (recording) { foreach (var item in userMetaData) { User user = item.Key; UserMetadata metadata = item.Value; if (metadata.isRecording) { dataBase.UpdateRecordedTime(user.UserID, recording_time / 1000, metadata.isPublic); //in seconds } } } recording = false; recording_state = OutputState.Stopping; if (metaRecorder.isRecording) { metaRecorder.StopRecording(); } }
public void StartRecording() { UniLog.Log("Start recording"); SetUpConfigSlot(); if (!dataManager.have_started_recording_session) { dataManager.StartRecordingSession(); } if (!recording) { dataManager.StartSection(); } recording = true; recording_state = OutputState.Starting; recording_frame_index = 0; //Set the recordings time to now utcNow = DateTime.UtcNow; recordingBeginTime = DateTime.UtcNow; if (!metaRecorder.isRecording) { metaRecorder.StartRecording(); } recording_state = OutputState.Started; }
internal ITextSinkEx WriteAttributeName() { InternalDebug.Assert(this.outputState >= OutputState.WritingTagName); if (this.outputState != OutputState.WritingAttributeName) { if (this.outputState > OutputState.BeforeAttribute) { this.OutputAttributeEnd(); } #if false if (this.lineLength > 255 && this.autoNewLines) { if (this.lineLength > this.longestLineLength) { this.longestLineLength = this.lineLength; } this.output.Write("\r\n"); this.lineLength = 0; } #endif this.output.Write(' '); this.lineLength++; } this.outputState = OutputState.WritingAttributeName; this.fallback = null; return(this); }
public UnspentTx(UInt256 txHash, int blockIndex, int txIndex, int length, OutputState state) { TxHash = txHash; BlockIndex = blockIndex; TxIndex = txIndex; OutputStates = new OutputStates(length, state); IsFullySpent = state == OutputState.Spent; }
/// <summary> /// Disconnects from Websocket and Closes OBS /// </summary> /// <param name="sender"></param> /// <param name="outputState"></param> private void disconnectAndCloseOBS(OBSWebsocket sender, OutputState outputState) { _obs.ReplayBufferStateChanged -= disconnectAndCloseOBS; Thread.Sleep(3000); //_obs.Disconnect(); closingOBS = true; supporterForm.writeInConsole(System.Drawing.Color.Red, "CLOSING OBS..."); obsProcess.CloseMainWindow(); }
public GPSTrackerOutput(string trackerId, int number, OutputState newState, OutputState lastState, OutputTriggerType triggerType) { this.TrackerId = trackerId; this.Number = number; //don't need to know the type from Server POV this.Type = OutputType.Unknown; this.ProposedState = newState; this.LastVerifiedState = lastState; this.TriggerType = triggerType; }
internal ITextSinkEx WriteTagName() { InternalDebug.Assert(this.outputState == OutputState.TagStarted || this.outputState == OutputState.WritingTagName); this.outputState = OutputState.WritingTagName; this.fallback = null; return(this); }
private void OutputAttributeValue(char[] value, int index, int count) { if (outputState < OutputState.WritingAttributeValue) { output.Write("=\""); lineLength += 2; } output.Write(value, index, count, this); lineLength += count; outputState = OutputState.WritingAttributeValue; }
public void StopInteracting() { UniLog.Log("Stop interacting"); interacting = false; interacting_state = OutputState.Stopping; if (metaInteraction.isInteracting) { metaInteraction.StopInteracting(); } interacting_state = OutputState.Stopped; }
private void ObsManager_StateChanged(object sender, OutputState e) { if (e == OutputState.Started) { StartStreaming(); } else if (e == OutputState.Stopped) { StopStreaming(); } }
public override void Close() { try { Finish(); } finally { if ( state_ != OutputState.Closed ) { state_ = OutputState.Closed; if( IsStreamOwner ) { baseOutputStream_.Close(); } } } }
public override void Finish() { if (state_ == OutputState.Header) { WriteHeader(); } if (state_ == OutputState.Footer) { state_ = OutputState.Finished; base.Finish(); uint num = (uint)(((ulong)deflater_.TotalIn) & 0xffffffffL); uint num2 = (uint)(((ulong)crc.Value) & 0xffffffffL); byte[] buffer = { (byte)num2, (byte)(num2 >> 8), (byte)(num2 >> 0x10), (byte)(num2 >> 0x18), (byte)num, (byte)(num >> 8), (byte)(num >> 0x10), (byte)(num >> 0x18) }; baseOutputStream_.Write(buffer, 0, buffer.Length); } }
public override void Close() { try { Finish(); } finally { if (_state != OutputState.Closed) { _state = OutputState.Closed; if (IsStreamOwner) { BaseOutputStream.Close(); } } } }
void WriteHeader() { if ( state_ == OutputState.Header ) { state_=OutputState.Footer; int mod_time = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000L); // Ticks give back 100ns intervals byte[] gzipHeader = { // The two magic bytes (byte) (GZipConstants.GZIP_MAGIC >> 8), (byte) (GZipConstants.GZIP_MAGIC & 0xff), // The compression type (byte) Deflater.DEFLATED, // The flags (not set) 0, // The modification time (byte) mod_time, (byte) (mod_time >> 8), (byte) (mod_time >> 16), (byte) (mod_time >> 24), // The extra flags 0, // The OS type (unknown) (byte) 255 }; baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length); } }
protected override void Dispose(bool disposing) { if(disposing){ if(!disposed_){ try { Finish(); } finally { if (state_!=OutputState.Closed) { state_=OutputState.Closed; if (IsStreamOwner) { baseOutputStream_.Dispose(); } } } disposed_ = true; } } base.Dispose(disposing); }
void WriteHeader() { if (state_ == OutputState.Header) { state_ = OutputState.Footer; int mod_time = (int)((DateTime.Now.Ticks - new DateTime(1970, 1, 1).Ticks) / 10000000L); byte[] gzipHeader = { (byte) (0x1F8B >> 8), (byte) (0x1F8B & 0xff), (byte) Deflater.DEFLATED, 0, (byte) mod_time, (byte) (mod_time >> 8), (byte) (mod_time >> 16), (byte) (mod_time >> 24), 0, (byte) 255 }; baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length); } }
private void WriteHeader() { if (_state == OutputState.Header) { _state = OutputState.Footer; DateTime time2 = new DateTime(0x7b2, 1, 1); int num = (int)((DateTime.Now.Ticks - time2.Ticks) / 0x989680L); byte[] buffer2 = { 0x1f, 0x8b, 8, 0, 0, 0, 0, 0, 0, 0xff }; buffer2[4] = (byte)num; buffer2[5] = (byte)(num >> 8); buffer2[6] = (byte)(num >> 0x10); buffer2[7] = (byte)(num >> 0x18); byte[] buffer = buffer2; BaseOutputStream.Write(buffer, 0, buffer.Length); } }
/// <summary> /// Finish compression and write any footer information required to stream /// </summary> public override void Finish() { // If no data has been written a header should be added. if ( state_ == OutputState.Header ) { WriteHeader(); } if( state_ == OutputState.Footer) { state_=OutputState.Finished; base.Finish(); var totalin=(uint)(deflater_.TotalIn&0xffffffff); var crcval=(uint)(crc.Value&0xffffffff); byte[] gzipFooter; unchecked { gzipFooter=new[] { (byte) crcval, (byte) (crcval >> 8), (byte) (crcval >> 16), (byte) (crcval >> 24), (byte) totalin, (byte) (totalin >> 8), (byte) (totalin >> 16), (byte) (totalin >> 24) }; } baseOutputStream_.Write(gzipFooter, 0, gzipFooter.Length); } }
public UnspentTx SetOutputState(int index, OutputState value) { return new UnspentTx(this.TxHash, this.BlockIndex, this.TxIndex, this.TxVersion, this.IsCoinbase, this.OutputStates.Set(index, value)); }
public UnspentTx(UInt256 txHash, int blockIndex, int txIndex, uint txVersion, bool isCoinbase, int length, OutputState state) : this(txHash, blockIndex, txIndex, txVersion, isCoinbase, new OutputStates(length, state)) { }