private void OnMessage(string ID, BaseMessage payload) { switch (payload) { case AbsoluteZoomRES zM: System.Diagnostics.Debug.WriteLine($"Encoder: {zM.EncoderValue}"); var zoomValue = GetZoomFromEncoder(zM.EncoderValue); if (zoomValue >= 0) { CameraParameterChangedEvent?.Invoke(ID, ViscaParameters.AbsoluteZoom, zoomValue); } break; case AddressRES zAdr: System.Diagnostics.Debug.WriteLine($"Address: {zAdr.Address}"); CameraParameterChangedEvent?.Invoke(ID, ViscaParameters.Address, (double)zAdr.Address); CameraConnectedEvent?.Invoke(ID, true); break; case CompletedRES completedRES: // Send zoom inquiry System.Diagnostics.Debug.WriteLine("Completed zoom. Sending inquiry"); SendMessage(AbsoluteZoomInquiryCMD.RentFromPool()); break; } payload.Dispose(); }
public void RefreshParameter(string parameter) { switch (parameter) { case ViscaParameters.AbsoluteZoom: SendMessage(AbsoluteZoomInquiryCMD.RentFromPool()); break; } }