/// <summary> /// The default Constructor. /// </summary> internal MixerInput(Mixer mixer, IEnumerable <QsysControl> fromControls) : base(mixer, fromControls, MixerItemType.Input) { foreach (var control in fromControls) { if (control == null) { continue; } var details = Regex.Match(control.Name, ControlNameRegexPattern); var controlType = details.Groups[2].Value; switch (controlType) { case "trim": _trimControl = control; break; case "pan": _panControl = control; break; case "solo": _soloControl = control; break; } } }
private void OnValueChange(QsysControl control, QsysControlValueChangeEventArgs args) { if (!(args.NewValue > 0)) { return; } var match = Regex.Match(control.Name, @"(\w+).(\d+)"); if (!match.Success) { return; } var type = match.Groups[1].Value; var value = int.Parse(match.Groups[2].Value); if (type != "last" && type != "match") { return; } if (value == _lastFeedbackValue) { return; } _lastFeedbackValue = value; if (ValueLoadedChange == null) { return; } ValueLoadedChange(this, _lastFeedbackValue); }
private void ControlOnValueChange(QsysControl control, QsysControlValueChangeEventArgs args) { Debug.WriteInfo("IOFrame control change: " + control); switch (control.Name) { case "status": OnStatusChanged(this); break; } }
protected virtual void ControlOnValueChange(QsysControl control, QsysControlValueChangeEventArgs args) { if (control == _gainControl) { OnAudioLevelChange(control.PositionScaled); } else if (control == _muteControl) { OnAudioMuteChange(control.Value > 0); } }
private void ControlOnValueChange(QsysControl control, QsysControlValueChangeEventArgs args) { if (!(args.NewValue > 0) || !_controls.Values.Contains(control)) { return; } _selectedInput = _controls.First(k => k.Value == control).Key; CloudLog.Debug("Router \"{0}\" Selected Input = {1}", Name, _selectedInput); if (SelectedInputChange != null) { SelectedInputChange(this, _selectedInput); } }
private void ControlOnValueChange(QsysControl control, QsysControlValueChangeEventArgs args) { switch (control.Name) { case "gain": OnAudioLevelChange(control.PositionScaled); break; case "mute": OnAudioMuteChange(control.Value > 0); break; } }
internal override void OnControlChange(QsysControl control, QsysControlValueChangeEventArgs args) { //Debug.WriteInfo("OnControlChange", "{0}", control.ToString()); base.OnControlChange(control, args); try { if (control.Name == "signal.presence") { SignalPresenceChanged(args.NewValue > 0); } //Debug.WriteInfo("SignalPresenceChanged"); } catch (Exception e) { //Debug.WriteError("OnControlChange", e.Message); } }
/// <summary> /// The default Constructor. /// </summary> internal MixerItem(Mixer mixer, IEnumerable <QsysControl> fromControls, MixerItemType type) { _mixer = mixer; ItemType = type; ControlNameRegexPattern = string.Format("{0}\\.(\\d+)\\.(\\w+)", type.ToString().ToLower()); foreach (var control in fromControls) { if (control == null) { continue; } var details = Regex.Match(control.Name, ControlNameRegexPattern); _index = uint.Parse(details.Groups[1].Value); var controlType = details.Groups[2].Value; switch (controlType) { case "gain": _gainControl = control; break; case "mute": _muteControl = control; break; case "label": _labelControl = control; break; case "invert": _invertControl = control; break; } control.ValueChange += ControlOnValueChange; } }
internal override void OnControlChange(QsysControl control, QsysControlValueChangeEventArgs args) { base.OnControlChange(control, args); }
internal override void OnControlChange(QsysControl control, QsysControlValueChangeEventArgs args) { try { switch (control.Name) { case "call.state": try { State = (PhoneState)Enum.Parse(typeof(PhoneState), control.String, true); } catch (Exception e) { CloudLog.Error("Could not parse call state value \"{0}\" into enum type {1}", control.String, typeof(PhoneState).Name); } break; case "call.status": var match = Regex.Match(args.StringValue, @"(\w+)(?:[\ \-]+)?([\d\*\#]+)?"); if (!match.Success) { return; } try { Status = (PhoneStatus)Enum.Parse(typeof(PhoneStatus), match.Groups[1].Value, true); } catch (Exception e) { CloudLog.Error("Could not parse call status value \"{0}\" into enum type {1}", match.Groups[1].Value, typeof(PhoneStatus).Name); } _dialedNumber = match.Groups[2].Value; OnCallStatusChange(this, new CallStatusChangeEventArgs(Status, _dialedNumber)); break; case "call.connect.time": OnCallTimerChange(this, CallTimer); break; case "call.ringing": if (Ringing) { OnCallStatusChange(this, new CallStatusChangeEventArgs(PhoneStatus.Ringing, string.Empty)); } break; case "call.cid.number": case "call.cid.name": if (!Controls.ContainsKey("call.cid.number") || !Controls.ContainsKey("call.cid.name")) { return; } OnCallNameChange(this, DisplayName); break; case "call.number": OnNumberChange(args.StringValue); break; } } catch (Exception e) { CloudLog.Exception(e); } base.OnControlChange(control, args); }
protected override void ControlOnValueChange(QsysControl control, QsysControlValueChangeEventArgs args) { base.ControlOnValueChange(control, args); }