public void SetEnabled(bool enabled) { if (enabled) { if (this.inputStatus == eTodoOscStatus.Idle || this.inputStatus == eTodoOscStatus.Error && enabled) { try { this.receiver = new OSCReceiver(this.localport); this.Start(); this.inputStatus = eTodoOscStatus.Started; this.ChangeInputStatus(this.inputStatus); } catch { this.inputStatus = eTodoOscStatus.Error; this.ChangeInputStatus(this.inputStatus); } } } else { if (this.inputStatus == eTodoOscStatus.Started) { this.Stop(); this.inputStatus = eTodoOscStatus.Idle; this.ChangeInputStatus(this.inputStatus); } } }
private void ChangeInputStatus(eTodoOscStatus status) { if (this.OscInputStatusChanged != null) { this.OscInputStatusChanged(status); } }
void Osc_OscInputStatusChanged(eTodoOscStatus status) { this.Reset(); }