Exemple #1
0
        public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
            : base(key, name, device)
        {
            AirMedia = device;

            DeviceConfig = dc;

            PropertiesConfig = props;

            InputPorts  = new RoutingPortCollection <RoutingInputPort>();
            OutputPorts = new RoutingPortCollection <RoutingOutputPort>();

            InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));

            if (AirMedia is Am300)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
            }

            AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);

            IsInSessionFeedback            = new BoolFeedback(new Func <bool>(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0));
            ErrorFeedback                  = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
            NumberOfUsersConnectedFeedback = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
            LoginCodeFeedback              = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
            ConnectionAddressFeedback      = new StringFeedback(new Func <string>(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue));
            HostnameFeedback               = new StringFeedback(new Func <string>(() => AirMedia.AirMedia.HostNameFeedback.StringValue));

            // TODO: Figure out if we can actually get the TSID/Serial
            SerialNumberFeedback = new StringFeedback(new Func <string>(() => "unknown"));

            AirMedia.DisplayControl.DisplayControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(DisplayControl_DisplayControlChange);

            VideoOutFeedback = new IntFeedback(new Func <int>(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback)));
            AutomaticInputRoutingEnabledFeedback = new BoolFeedback(new Func <bool>(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue));

            AirMedia.HdmiIn.StreamChange += new Crestron.SimplSharpPro.DeviceSupport.StreamEventHandler(HdmiIn_StreamChange);

            HdmiVideoSyncDetectedFeedback = new BoolFeedback(new Func <bool>(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue));
        }
Exemple #2
0
        public override EssentialsDevice BuildDevice(DeviceConfig dc)
        {
            var type = dc.Type.ToLower();

            Debug.Console(1, "Factory Attempting to create new AirMedia Device");

            var   props    = JsonConvert.DeserializeObject <AirMediaPropertiesConfig>(dc.Properties.ToString());
            AmX00 amDevice = null;

            if (type == "am200")
            {
                amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
            }
            else if (type == "am300")
            {
                amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
            }

            return(new AirMediaController(dc.Key, dc.Name, amDevice, dc, props));
        }
        public static IKeyed GetDevice(DeviceConfig dc)
        {
            var key        = dc.Key;
            var name       = dc.Name;
            var type       = dc.Type;
            var properties = dc.Properties;

            var typeName = dc.Type.ToLower();

            if (typeName.StartsWith("am"))
            {
                if (typeName == "am200" || typeName == "am300")
                {
                    var   props    = JsonConvert.DeserializeObject <AirMediaPropertiesConfig>(properties.ToString());
                    AmX00 amDevice = null;
                    if (typeName == "am200")
                    {
                        amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
                    }
                    else if (typeName == "am300")
                    {
                        amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
                    }

                    return(new AirMediaController(key, name, amDevice, dc, props));
                }
            }
            else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
            {
                var props = JsonConvert.DeserializeObject
                            <PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
                return(PepperDash.Essentials.DM.DmChassisController.
                       GetDmChassisController(key, name, type, props));
            }
            else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x"))
            {
                var props = JsonConvert.DeserializeObject
                            <PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
                return(PepperDash.Essentials.DM.DmBladeChassisController.
                       GetDmChassisController(key, name, type, props));
            }
            // Hand off to DmTxHelper class
            else if (typeName.StartsWith("dmtx"))
            {
                var props = JsonConvert.DeserializeObject
                            <PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
                return(PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props));
            }

            // Hand off to DmRmcHelper class
            else if (typeName.StartsWith("dmrmc"))
            {
                var props = JsonConvert.DeserializeObject
                            <PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
                return(PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props));
            }

            else if (typeName.Equals("hdmd4x14ke"))
            {
                var props = JsonConvert.DeserializeObject
                            <PepperDash.Essentials.DM.Config.HdMdNxM4kEPropertiesConfig>(properties.ToString());
                return(PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props));
            }

            else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge"))
            {
                var props = JsonConvert.DeserializeObject
                            <PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());

                if (typeName.Equals("hdmd400ce"))
                {
                    return(new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
                                                                            new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem)));
                }
                else if (typeName.Equals("hdmd300ce"))
                {
                    return(new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
                                                                            new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem)));
                }
                else if (typeName.Equals("hdmd200ce"))
                {
                    return(new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
                                                                            new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem)));
                }
                else if (typeName.Equals("hdmd200c1ge"))
                {
                    return(new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
                                                                            new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem)));
                }
            }

            return(null);
        }
Exemple #4
0
 public AirMediaSwitcher(AmX00 device) : base()
 {
     _airmedia = device;
 }