Protocol-independent device
Instance of this class are reference counted and are automatically deleted when the reference count falls to zero. All references to class instances must have been removed before Core.Library.Close() is called.
Inheritance: ICpDevice
コード例 #1
0
 private void PollSubscribe()
 {
     iSubscriptionSem = new Semaphore(0, 1);
     for (int i = 0; i < iDeviceList.Count; i++)
     {
         ControlPoint.CpDevice device = iDeviceList[i];
         string udn = device.Udn();
         if (udn == "896659847466-a4badbeaacbc-737837" ||
             udn == "541d0cb5-3b34-4264-8ff0-d8653acf6425")
         {
             continue;
         }
         uint countBefore = iSubscriptionCount;
         Console.Write("Device " + device.Udn());
         ControlPoint.Proxies.CpProxyUpnpOrgConnectionManager1 connMgr = new ControlPoint.Proxies.CpProxyUpnpOrgConnectionManager1(device);
         connMgr.SetPropertyChanged(PropertyChanged);
         DateTime startTime = DateTime.Now;
         while (true)
         {
             connMgr.Subscribe();
             iSubscriptionSem.WaitOne((int)(2 * kDevicePollMs));
             connMgr.Unsubscribe();
             DateTime now = DateTime.Now;
             if (now.Subtract(startTime).TotalSeconds > kDevicePollSecs)
             {
                 break;
             }
             iSubscriptionCount++;
         }
         Console.Write("    " + (iSubscriptionCount - countBefore) + "\n");
         connMgr.Dispose();
     }
 }
コード例 #2
0
 private void InvokeSync()
 {
     // trivial validation of the sync wrappers to all APIs
     // single sync call to whichever device happens to be first in our list
     if (iDeviceList.Count == 0)
     {
         Console.Write("No devices found, so nothing to test\n");
         return;
     }
     ControlPoint.CpDevice device = iDeviceList[0];
     Console.Write("\n\nSync call to device " + device.Udn() + "\n");
     ControlPoint.Proxies.CpProxyUpnpOrgConnectionManager1 connMgr = new ControlPoint.Proxies.CpProxyUpnpOrgConnectionManager1(device);
     try
     {
         string source;
         string sink;
         connMgr.SyncGetProtocolInfo(out source, out sink);
         Console.Write("source is " + source + "\nsink is " + sink + "\n");
     }
     catch (ControlPoint.ProxyError)
     {
         Console.WriteLine("...failed.  (This may be expected but shouldn't be easily reproducible.)");
     }
     connMgr.Dispose();
 }
コード例 #3
0
 private void PollInvoke()
 {
     iActionPollStop = new Semaphore(0, 1);
     System.Timers.Timer timer = new System.Timers.Timer();
     timer.Elapsed  += TimerElapsed;
     timer.AutoReset = false;
     for (int i = 0; i < iDeviceList.Count; i++)
     {
         ControlPoint.CpDevice device = iDeviceList[i];
         uint countBefore             = iActionCount;
         Console.Write("Device " + device.Udn());
         iConnMgr            = new ControlPoint.Proxies.CpProxyUpnpOrgConnectionManager1(device);
         iActionPollStopTime = DateTime.Now.AddMilliseconds(kDevicePollMs);
         timer.Interval      = kDevicePollMs;
         timer.Enabled       = false;
         timer.Enabled       = true;
         for (int j = 0; j < 4; j++)
         {
             iConnMgr.BeginGetProtocolInfo(GetProtocolInfoComplete);
         }
         iActionPollStop.WaitOne();
         Console.Write("    " + (iActionCount - countBefore) + "\n");
         iConnMgr.Dispose();
         lock (this)
         {
             iExpectedSink = null;
         }
     }
 }
コード例 #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgNetworkMonitor1(CpDevice aDevice)
            : base("av-openhome-org", "NetworkMonitor", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionName = new OpenHome.Net.Core.Action("Name");
            param = new ParameterString("Name", allowedValues);
            iActionName.AddOutputParameter(param);

            iActionPorts = new OpenHome.Net.Core.Action("Ports");
            param = new ParameterUint("Sender");
            iActionPorts.AddOutputParameter(param);
            param = new ParameterUint("Receiver");
            iActionPorts.AddOutputParameter(param);
            param = new ParameterUint("Results");
            iActionPorts.AddOutputParameter(param);

            iName = new PropertyString("Name", NamePropertyChanged);
            AddProperty(iName);
            iSender = new PropertyUint("Sender", SenderPropertyChanged);
            AddProperty(iSender);
            iReceiver = new PropertyUint("Receiver", ReceiverPropertyChanged);
            AddProperty(iReceiver);
            iResults = new PropertyUint("Results", ResultsPropertyChanged);
            AddProperty(iResults);

            iPropertyLock = new Mutex();
        }
コード例 #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyOpenhomeOrgTestLights1(CpDevice aDevice)
            : base("openhome-org", "TestLights", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionGetCount = new OpenHome.Net.Core.Action("GetCount");
            param = new ParameterUint("Count");
            iActionGetCount.AddOutputParameter(param);

            iActionGetRoom = new OpenHome.Net.Core.Action("GetRoom");
            param = new ParameterUint("Index");
            iActionGetRoom.AddInputParameter(param);
            param = new ParameterString("RoomName", allowedValues);
            iActionGetRoom.AddOutputParameter(param);

            iActionGetName = new OpenHome.Net.Core.Action("GetName");
            param = new ParameterUint("Index");
            iActionGetName.AddInputParameter(param);
            param = new ParameterString("FriendlyName", allowedValues);
            iActionGetName.AddOutputParameter(param);

            iActionGetPosition = new OpenHome.Net.Core.Action("GetPosition");
            param = new ParameterUint("Index");
            iActionGetPosition.AddInputParameter(param);
            param = new ParameterUint("X");
            iActionGetPosition.AddOutputParameter(param);
            param = new ParameterUint("Y");
            iActionGetPosition.AddOutputParameter(param);
            param = new ParameterUint("Z");
            iActionGetPosition.AddOutputParameter(param);

            iActionSetColor = new OpenHome.Net.Core.Action("SetColor");
            param = new ParameterUint("Index");
            iActionSetColor.AddInputParameter(param);
            param = new ParameterUint("Color");
            iActionSetColor.AddInputParameter(param);

            iActionGetColor = new OpenHome.Net.Core.Action("GetColor");
            param = new ParameterUint("Index");
            iActionGetColor.AddInputParameter(param);
            param = new ParameterUint("Color");
            iActionGetColor.AddOutputParameter(param);

            iActionGetColorComponents = new OpenHome.Net.Core.Action("GetColorComponents");
            param = new ParameterUint("Color");
            iActionGetColorComponents.AddInputParameter(param);
            param = new ParameterUint("Brightness");
            iActionGetColorComponents.AddOutputParameter(param);
            param = new ParameterUint("Red");
            iActionGetColorComponents.AddOutputParameter(param);
            param = new ParameterUint("Green");
            iActionGetColorComponents.AddOutputParameter(param);
            param = new ParameterUint("Blue");
            iActionGetColorComponents.AddOutputParameter(param);
        }
コード例 #6
0
 private void DeviceAdded(CpDeviceList aList, CpDevice aDevice)
 {
     lock (this)
     {
         if (iDeviceList.Count == 0 && aDevice.Udn() == DeviceBasic.gDeviceName)
         {
             aDevice.AddRef();
             iDeviceList.Add(aDevice);
         }
     }
 }
コード例 #7
0
        protected static void Removed(IntPtr aPtr, IntPtr aHandle)
        {
            CpDevice     device = new CpDevice(aHandle);
            GCHandle     gch    = GCHandle.FromIntPtr(aPtr);
            CpDeviceList list   = (CpDeviceList)gch.Target;

            if (list.iRemoved != null)
            {
                CallListChangedDelegate(list.iRemoved, list, device);
            }
        }
コード例 #8
0
ファイル: CpProxy.cs プロジェクト: hacx/ohNet
 protected unsafe CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice)
 {
     IntPtr domain = InteropUtils.StringToHGlobalUtf8(aDomain);
     IntPtr name = InteropUtils.StringToHGlobalUtf8(aName);
     iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle());
     Marshal.FreeHGlobal(domain);
     Marshal.FreeHGlobal(name);
     IntPtr serviceHandle = CpProxyService(iHandle);
     iService = new CpService(serviceHandle);
     iGchProxy = GCHandle.Alloc(this);
     iSubscriptionStatusLock = new Mutex();
 }
コード例 #9
0
 private void DeviceAdded(ControlPoint.CpDeviceList aList, ControlPoint.CpDevice aDevice)
 {
     lock (this)
     {
         if (!iListFrozen)
         {
             PrintDeviceInfo("Added", aDevice);
             aDevice.AddRef();
             iDeviceList.Add(aDevice);
         }
     }
 }
コード例 #10
0
ファイル: CpProxy.cs プロジェクト: wifigeek/ohNet
 protected unsafe CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice)
 {
     char* domain = (char*)Marshal.StringToHGlobalAnsi(aDomain);
     char* name = (char*)Marshal.StringToHGlobalAnsi(aName);
     iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle());
     Marshal.FreeHGlobal((IntPtr)domain);
     Marshal.FreeHGlobal((IntPtr)name);
     IntPtr serviceHandle = CpProxyService(iHandle);
     iService = new CpService(serviceHandle);
     iGchProxy = GCHandle.Alloc(this);
     iSubscriptionStatusLock = new Mutex();
 }
コード例 #11
0
        private void PrintDeviceInfo(string aPrologue, ControlPoint.CpDevice aDevice)
        {
            string location;

            aDevice.GetAttribute("Upnp.Location", out location);
            string friendlyName;

            aDevice.GetAttribute("Upnp.FriendlyName", out friendlyName);
            Console.Write(aPrologue +
                          "\n    udn = " + aDevice.Udn() +
                          "\n    location = " + location +
                          "\n    name = " + friendlyName + "\n");
        }
コード例 #12
0
        protected CpProxy(String aDomain, String aName, uint aVersion, CpDevice aDevice)
        {
            IntPtr domain = InteropUtils.StringToHGlobalUtf8(aDomain);
            IntPtr name   = InteropUtils.StringToHGlobalUtf8(aName);

            iHandle = CpProxyCreate(domain, name, aVersion, aDevice.Handle());
            Marshal.FreeHGlobal(domain);
            Marshal.FreeHGlobal(name);
            IntPtr serviceHandle = CpProxyService(iHandle);

            iService  = new CpService(serviceHandle);
            iGchProxy = GCHandle.Alloc(this);
            iSubscriptionStatusLock = new Mutex();
        }
コード例 #13
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyOpenhomeOrgTestDimmableLight1(CpDevice aDevice)
            : base("openhome-org", "TestDimmableLight", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;

            iActionGetLevel = new OpenHome.Net.Core.Action("GetLevel");
            param = new ParameterUint("Level");
            iActionGetLevel.AddOutputParameter(param);

            iActionSetLevel = new OpenHome.Net.Core.Action("SetLevel");
            param = new ParameterUint("Level");
            iActionSetLevel.AddInputParameter(param);

            iA_ARG_Level = new PropertyUint("A_ARG_Level", A_ARG_LevelPropertyChanged);
            AddProperty(iA_ARG_Level);

            iPropertyLock = new Mutex();
        }
コード例 #14
0
 private void DeviceRemoved(CpDeviceList aList, CpDevice aDevice)
 {
     /* The device stack sends byebyes then alives for each newly enabled device.
        These can be interleaved with responses to a msearch and can cause tests to misbehave,
        thinking a device has been removed.  The simplest way to work around this is to say
        our test guarantees that a device remains available as long as its needed then take
        advantage of this by ignoring device removed callbacks. */
     /*lock (this)
     {
         string udn = aDevice.Udn();
         int count = iDeviceList.Count;
         for (int i = 0; i < count; i++)
         {
             if (iDeviceList[i].Udn() == udn)
             {
                 iDeviceList.RemoveAt(i);
                 iDeviceList[i].RemoveRef();
             }
         }
     }*/
 }
コード例 #15
0
 private void DeviceRemoved(ControlPoint.CpDeviceList aList, ControlPoint.CpDevice aDevice)
 {
     lock (this)
     {
         if (!iListFrozen)
         {
             PrintDeviceInfo("Removed", aDevice);
             string udn   = aDevice.Udn();
             int    count = iDeviceList.Count;
             for (int i = 0; i < count; i++)
             {
                 if (iDeviceList[i].Udn() == udn)
                 {
                     iDeviceList[i].RemoveRef();
                     iDeviceList.RemoveAt(i);
                     break;
                 }
             }
         }
     }
 }
コード例 #16
0
ファイル: CpAvOpenhomeOrgTime1.cs プロジェクト: nterry/ohNet
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgTime1(CpDevice aDevice)
            : base("av-openhome-org", "Time", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;

            iActionTime = new OpenHome.Net.Core.Action("Time");
            param = new ParameterUint("TrackCount");
            iActionTime.AddOutputParameter(param);
            param = new ParameterUint("Duration");
            iActionTime.AddOutputParameter(param);
            param = new ParameterUint("Seconds");
            iActionTime.AddOutputParameter(param);

            iTrackCount = new PropertyUint("TrackCount", TrackCountPropertyChanged);
            AddProperty(iTrackCount);
            iDuration = new PropertyUint("Duration", DurationPropertyChanged);
            AddProperty(iDuration);
            iSeconds = new PropertyUint("Seconds", SecondsPropertyChanged);
            AddProperty(iSeconds);

            iPropertyLock = new Mutex();
        }
コード例 #17
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgSwitchPower1(CpDevice aDevice)
            : base("schemas-upnp-org", "SwitchPower", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;

            iActionSetTarget = new OpenHome.Net.Core.Action("SetTarget");
            param = new ParameterBool("newTargetValue");
            iActionSetTarget.AddInputParameter(param);

            iActionGetTarget = new OpenHome.Net.Core.Action("GetTarget");
            param = new ParameterBool("RetTargetValue");
            iActionGetTarget.AddOutputParameter(param);

            iActionGetStatus = new OpenHome.Net.Core.Action("GetStatus");
            param = new ParameterBool("ResultStatus");
            iActionGetStatus.AddOutputParameter(param);

            iStatus = new PropertyBool("Status", StatusPropertyChanged);
            AddProperty(iStatus);

            iPropertyLock = new Mutex();
        }
コード例 #18
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyOpenhomeOrgSubscriptionLongPoll1(CpDevice aDevice)
            : base("openhome-org", "SubscriptionLongPoll", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionSubscribe = new OpenHome.Net.Core.Action("Subscribe");
            param = new ParameterString("ClientId", allowedValues);
            iActionSubscribe.AddInputParameter(param);
            param = new ParameterString("Udn", allowedValues);
            iActionSubscribe.AddInputParameter(param);
            param = new ParameterString("Service", allowedValues);
            iActionSubscribe.AddInputParameter(param);
            param = new ParameterUint("RequestedDuration");
            iActionSubscribe.AddInputParameter(param);
            param = new ParameterString("Sid", allowedValues);
            iActionSubscribe.AddOutputParameter(param);
            param = new ParameterUint("Duration");
            iActionSubscribe.AddOutputParameter(param);

            iActionUnsubscribe = new OpenHome.Net.Core.Action("Unsubscribe");
            param = new ParameterString("Sid", allowedValues);
            iActionUnsubscribe.AddInputParameter(param);

            iActionRenew = new OpenHome.Net.Core.Action("Renew");
            param = new ParameterString("Sid", allowedValues);
            iActionRenew.AddInputParameter(param);
            param = new ParameterUint("RequestedDuration");
            iActionRenew.AddInputParameter(param);
            param = new ParameterUint("Duration");
            iActionRenew.AddOutputParameter(param);

            iActionGetPropertyUpdates = new OpenHome.Net.Core.Action("GetPropertyUpdates");
            param = new ParameterString("ClientId", allowedValues);
            iActionGetPropertyUpdates.AddInputParameter(param);
            param = new ParameterString("Updates", allowedValues);
            iActionGetPropertyUpdates.AddOutputParameter(param);
        }
コード例 #19
0
        public static void Main(string[] aArgs)
        {
            Console.WriteLine("TestPerformanceCpCs - starting");
            InitParams initParams = new InitParams();

            using (Library lib = Library.Create(initParams))
            {
                SubnetList     subnetList = new SubnetList();
                NetworkAdapter nif        = subnetList.SubnetAt(0);
                uint           subnet     = nif.Subnet();
                subnetList.Dispose();
                var       deviceListFactory = new CpUpnpDeviceListFactory(lib.StartCp(subnet));
                CpDevice  device            = null;
                Semaphore sem        = new Semaphore(0, 1);
                var       deviceList = deviceListFactory.CreateListServiceType("openhome.org", "TestBasic", 1,
                                                                               (aDeviceList, aDevice) =>
                {
                    if (device != null)
                    {
                        throw new Exception("Found more than one device.  Giving up as test results will probably be invalid.");
                    }
                    device = aDevice;
                    device.AddRef();
                    sem.Release();
                },
                                                                               (aDeviceList, aDevice) =>
                {
                    throw new Exception("ERROR: Device removed while test is running.");
                });
                sem.WaitOne();

                // actions
                Console.WriteLine("");
                int[] threadCounts = { 1, 2, 4 };
                foreach (int threadCount in threadCounts)
                {
                    List <Thread> threads = new List <Thread>();
                    for (int i = 0; i < threadCount; i++)
                    {
                        threads.Add(new Thread(ActionThread));
                    }
                    ThreadArgs threadArgs = new ThreadArgs(device, kTestDurationMs);
                    for (int i = 0; i < threadCount; i++)
                    {
                        threads[i].Start(threadArgs);
                    }
                    for (int i = 0; i < threadCount; i++)
                    {
                        threads[i].Join();
                    }
                    Console.WriteLine("Invoked {0} actions in {1}ms using {2} threads", threadArgs.Count, kTestDurationMs, threadCount);
                }

                // subscriptions
                Thread     thread = new Thread(SubscriptionThread);
                ThreadArgs args   = new ThreadArgs(device, kTestDurationMs);
                thread.Start(args);
                thread.Join();
                Console.WriteLine("\nCompleted {0} subscriptions in {1}ms\n", args.Count, kTestDurationMs);

                device.RemoveRef();
                deviceList.Dispose();
                Console.WriteLine("\nTests complete.  Press 'q' to exit.");
                while (Console.ReadKey(true).KeyChar != 'q')
                {
                    ;
                }
            }
        }
コード例 #20
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyRaumfeldComConfigService1(CpDevice aDevice)
            : base("schemas-raumfeld-com", "ConfigService", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionGetPublicKey = new OpenHome.Net.Core.Action("GetPublicKey");
            param = new ParameterString("Key", allowedValues);
            iActionGetPublicKey.AddOutputParameter(param);

            iActionGetRevision = new OpenHome.Net.Core.Action("GetRevision");
            param = new ParameterUint("Revision");
            iActionGetRevision.AddOutputParameter(param);

            iActionSetPreferences = new OpenHome.Net.Core.Action("SetPreferences");
            param = new ParameterString("Preferences", allowedValues);
            iActionSetPreferences.AddInputParameter(param);
            param = new ParameterString("LeastCommonChangedNode", allowedValues);
            iActionSetPreferences.AddInputParameter(param);
            param = new ParameterUint("ExpectedRevision");
            iActionSetPreferences.AddInputParameter(param);
            allowedValues.Add("ForceOverwrite");
            allowedValues.Add("Cancel");
            param = new ParameterString("OnConflict", allowedValues);
            iActionSetPreferences.AddInputParameter(param);
            allowedValues.Clear();

            iActionGetPreferences = new OpenHome.Net.Core.Action("GetPreferences");
            param = new ParameterString("PublicKey", allowedValues);
            iActionGetPreferences.AddInputParameter(param);
            param = new ParameterString("Preferences", allowedValues);
            iActionGetPreferences.AddOutputParameter(param);
            param = new ParameterUint("Revision");
            iActionGetPreferences.AddOutputParameter(param);

            iActionGetDevice = new OpenHome.Net.Core.Action("GetDevice");
            allowedValues.Add("meta-server");
            allowedValues.Add("renderer");
            param = new ParameterString("Service", allowedValues);
            iActionGetDevice.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("UniqueDeviceName", allowedValues);
            iActionGetDevice.AddOutputParameter(param);

            iLastChange = new PropertyString("LastChange", LastChangePropertyChanged);
            AddProperty(iLastChange);
            iRevision = new PropertyUint("Revision", RevisionPropertyChanged);
            AddProperty(iRevision);
            iARG_TYPE_OnConflict = new PropertyString("ARG_TYPE_OnConflict", ARG_TYPE_OnConflictPropertyChanged);
            AddProperty(iARG_TYPE_OnConflict);

            iPropertyLock = new Mutex();
        }
コード例 #21
0
ファイル: TestDvDevice.cs プロジェクト: nterry/ohNet
 private void DeviceRemoved(CpDeviceList aList, CpDevice aDevice)
 {
     lock (this)
     {
         string udn = aDevice.Udn();
         int count = iDeviceList.Count;
         for (int i = 0; i < count; i++)
         {
             if (iDeviceList[i].Udn() == udn)
             {
                 iDeviceList.RemoveAt(i);
                 iDeviceList[i].RemoveRef();
             }
         }
     }
 }
コード例 #22
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgExakt1(CpDevice aDevice)
            : base("av-openhome-org", "Exakt", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionDeviceList = new OpenHome.Net.Core.Action("DeviceList");
            param = new ParameterString("List", allowedValues);
            iActionDeviceList.AddOutputParameter(param);

            iActionDeviceSettings = new OpenHome.Net.Core.Action("DeviceSettings");
            param = new ParameterString("DeviceId", allowedValues);
            iActionDeviceSettings.AddInputParameter(param);
            param = new ParameterString("Settings", allowedValues);
            iActionDeviceSettings.AddOutputParameter(param);

            iActionConnectionStatus = new OpenHome.Net.Core.Action("ConnectionStatus");
            param = new ParameterString("ConnectionStatus", allowedValues);
            iActionConnectionStatus.AddOutputParameter(param);

            iActionSet = new OpenHome.Net.Core.Action("Set");
            param = new ParameterString("DeviceId", allowedValues);
            iActionSet.AddInputParameter(param);
            param = new ParameterUint("BankId");
            iActionSet.AddInputParameter(param);
            param = new ParameterString("FileUri", allowedValues);
            iActionSet.AddInputParameter(param);
            param = new ParameterBool("Mute");
            iActionSet.AddInputParameter(param);
            param = new ParameterBool("Persist");
            iActionSet.AddInputParameter(param);

            iActionReprogram = new OpenHome.Net.Core.Action("Reprogram");
            param = new ParameterString("DeviceId", allowedValues);
            iActionReprogram.AddInputParameter(param);
            param = new ParameterString("FileUri", allowedValues);
            iActionReprogram.AddInputParameter(param);

            iActionReprogramFallback = new OpenHome.Net.Core.Action("ReprogramFallback");
            param = new ParameterString("DeviceId", allowedValues);
            iActionReprogramFallback.AddInputParameter(param);
            param = new ParameterString("FileUri", allowedValues);
            iActionReprogramFallback.AddInputParameter(param);

            iDeviceList = new PropertyString("DeviceList", DeviceListPropertyChanged);
            AddProperty(iDeviceList);
            iConnectionStatus = new PropertyString("ConnectionStatus", ConnectionStatusPropertyChanged);
            AddProperty(iConnectionStatus);

            iPropertyLock = new Mutex();
        }
コード例 #23
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgConnectionManager1(CpDevice aDevice)
            : base("schemas-upnp-org", "ConnectionManager", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionGetProtocolInfo = new OpenHome.Net.Core.Action("GetProtocolInfo");
            param = new ParameterString("Source", allowedValues);
            iActionGetProtocolInfo.AddOutputParameter(param);
            param = new ParameterString("Sink", allowedValues);
            iActionGetProtocolInfo.AddOutputParameter(param);

            iActionPrepareForConnection = new OpenHome.Net.Core.Action("PrepareForConnection");
            param = new ParameterString("RemoteProtocolInfo", allowedValues);
            iActionPrepareForConnection.AddInputParameter(param);
            param = new ParameterString("PeerConnectionManager", allowedValues);
            iActionPrepareForConnection.AddInputParameter(param);
            param = new ParameterInt("PeerConnectionID");
            iActionPrepareForConnection.AddInputParameter(param);
            allowedValues.Add("Input");
            allowedValues.Add("Output");
            param = new ParameterString("Direction", allowedValues);
            iActionPrepareForConnection.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterInt("ConnectionID");
            iActionPrepareForConnection.AddOutputParameter(param);
            param = new ParameterInt("AVTransportID");
            iActionPrepareForConnection.AddOutputParameter(param);
            param = new ParameterInt("RcsID");
            iActionPrepareForConnection.AddOutputParameter(param);

            iActionConnectionComplete = new OpenHome.Net.Core.Action("ConnectionComplete");
            param = new ParameterInt("ConnectionID");
            iActionConnectionComplete.AddInputParameter(param);

            iActionGetCurrentConnectionIDs = new OpenHome.Net.Core.Action("GetCurrentConnectionIDs");
            param = new ParameterString("ConnectionIDs", allowedValues);
            iActionGetCurrentConnectionIDs.AddOutputParameter(param);

            iActionGetCurrentConnectionInfo = new OpenHome.Net.Core.Action("GetCurrentConnectionInfo");
            param = new ParameterInt("ConnectionID");
            iActionGetCurrentConnectionInfo.AddInputParameter(param);
            param = new ParameterInt("RcsID");
            iActionGetCurrentConnectionInfo.AddOutputParameter(param);
            param = new ParameterInt("AVTransportID");
            iActionGetCurrentConnectionInfo.AddOutputParameter(param);
            param = new ParameterString("ProtocolInfo", allowedValues);
            iActionGetCurrentConnectionInfo.AddOutputParameter(param);
            param = new ParameterString("PeerConnectionManager", allowedValues);
            iActionGetCurrentConnectionInfo.AddOutputParameter(param);
            param = new ParameterInt("PeerConnectionID");
            iActionGetCurrentConnectionInfo.AddOutputParameter(param);
            allowedValues.Add("Input");
            allowedValues.Add("Output");
            param = new ParameterString("Direction", allowedValues);
            iActionGetCurrentConnectionInfo.AddOutputParameter(param);
            allowedValues.Clear();
            allowedValues.Add("OK");
            allowedValues.Add("ContentFormatMismatch");
            allowedValues.Add("InsufficientBandwidth");
            allowedValues.Add("UnreliableChannel");
            allowedValues.Add("Unknown");
            param = new ParameterString("Status", allowedValues);
            iActionGetCurrentConnectionInfo.AddOutputParameter(param);
            allowedValues.Clear();

            iSourceProtocolInfo = new PropertyString("SourceProtocolInfo", SourceProtocolInfoPropertyChanged);
            AddProperty(iSourceProtocolInfo);
            iSinkProtocolInfo = new PropertyString("SinkProtocolInfo", SinkProtocolInfoPropertyChanged);
            AddProperty(iSinkProtocolInfo);
            iCurrentConnectionIDs = new PropertyString("CurrentConnectionIDs", CurrentConnectionIDsPropertyChanged);
            AddProperty(iCurrentConnectionIDs);

            iPropertyLock = new Mutex();
        }
コード例 #24
0
 public ThreadArgs(CpDevice aDevice, double aDurationMs)
 {
     Device    = aDevice;
     iStopTime = DateTime.Now.AddMilliseconds(aDurationMs);
 }
コード例 #25
0
ファイル: CpDevice.cs プロジェクト: MatthewMiddleweek/ohNet
 protected static void Removed(IntPtr aPtr, IntPtr aHandle)
 {
     CpDevice device = new CpDevice(aHandle);
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     CpDeviceList list = (CpDeviceList)gch.Target;
     if (list.iRemoved != null) {
         CallListChangedDelegate(list.iRemoved, list, device);
     }
 }
コード例 #26
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgAVTransport2(CpDevice aDevice)
            : base("schemas-upnp-org", "AVTransport", 2, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionSetAVTransportURI = new OpenHome.Net.Core.Action("SetAVTransportURI");
            param = new ParameterUint("InstanceID");
            iActionSetAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionSetAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionSetAVTransportURI.AddInputParameter(param);

            iActionSetNextAVTransportURI = new OpenHome.Net.Core.Action("SetNextAVTransportURI");
            param = new ParameterUint("InstanceID");
            iActionSetNextAVTransportURI.AddInputParameter(param);
            param = new ParameterString("NextURI", allowedValues);
            iActionSetNextAVTransportURI.AddInputParameter(param);
            param = new ParameterString("NextURIMetaData", allowedValues);
            iActionSetNextAVTransportURI.AddInputParameter(param);

            iActionGetMediaInfo = new OpenHome.Net.Core.Action("GetMediaInfo");
            param = new ParameterUint("InstanceID");
            iActionGetMediaInfo.AddInputParameter(param);
            param = new ParameterUint("NrTracks", 0, 2147483647);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("MediaDuration", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("NextURI", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("NextURIMetaData", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("PlayMedium", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("RecordMedium", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Add("WRITABLE");
            allowedValues.Add("PROTECTED");
            allowedValues.Add("NOT_WRITABLE");
            allowedValues.Add("UNKNOWN");
            allowedValues.Add("NOT_IMPLEMENTED");
            param = new ParameterString("WriteStatus", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Clear();

            iActionGetMediaInfo_Ext = new OpenHome.Net.Core.Action("GetMediaInfo_Ext");
            param = new ParameterUint("InstanceID");
            iActionGetMediaInfo_Ext.AddInputParameter(param);
            allowedValues.Add("NO_MEDIA");
            allowedValues.Add("TRACK_AWARE");
            allowedValues.Add("TRACK_UNAWARE");
            param = new ParameterString("CurrentType", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            allowedValues.Clear();
            param = new ParameterUint("NrTracks", 0, 2147483647);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            param = new ParameterString("MediaDuration", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            param = new ParameterString("NextURI", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            param = new ParameterString("NextURIMetaData", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            param = new ParameterString("PlayMedium", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            param = new ParameterString("RecordMedium", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            allowedValues.Add("WRITABLE");
            allowedValues.Add("PROTECTED");
            allowedValues.Add("NOT_WRITABLE");
            allowedValues.Add("UNKNOWN");
            allowedValues.Add("NOT_IMPLEMENTED");
            param = new ParameterString("WriteStatus", allowedValues);
            iActionGetMediaInfo_Ext.AddOutputParameter(param);
            allowedValues.Clear();

            iActionGetTransportInfo = new OpenHome.Net.Core.Action("GetTransportInfo");
            param = new ParameterUint("InstanceID");
            iActionGetTransportInfo.AddInputParameter(param);
            param = new ParameterString("CurrentTransportState", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentTransportStatus", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentSpeed", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);

            iActionGetPositionInfo = new OpenHome.Net.Core.Action("GetPositionInfo");
            param = new ParameterUint("InstanceID");
            iActionGetPositionInfo.AddInputParameter(param);
            param = new ParameterUint("Track", 0, 2147483647, 1);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackDuration", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackMetaData", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackURI", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("RelTime", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("AbsTime", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterInt("RelCount");
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterInt("AbsCount");
            iActionGetPositionInfo.AddOutputParameter(param);

            iActionGetDeviceCapabilities = new OpenHome.Net.Core.Action("GetDeviceCapabilities");
            param = new ParameterUint("InstanceID");
            iActionGetDeviceCapabilities.AddInputParameter(param);
            param = new ParameterString("PlayMedia", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);
            param = new ParameterString("RecMedia", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);
            param = new ParameterString("RecQualityModes", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);

            iActionGetTransportSettings = new OpenHome.Net.Core.Action("GetTransportSettings");
            param = new ParameterUint("InstanceID");
            iActionGetTransportSettings.AddInputParameter(param);
            allowedValues.Add("NORMAL");
            allowedValues.Add("SHUFFLE");
            allowedValues.Add("REPEAT_ONE");
            allowedValues.Add("REPEAT_ALL");
            allowedValues.Add("RANDOM");
            allowedValues.Add("DIRECT_1");
            allowedValues.Add("INTRO");
            param = new ParameterString("PlayMode", allowedValues);
            iActionGetTransportSettings.AddOutputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("RecQualityMode", allowedValues);
            iActionGetTransportSettings.AddOutputParameter(param);

            iActionStop = new OpenHome.Net.Core.Action("Stop");
            param = new ParameterUint("InstanceID");
            iActionStop.AddInputParameter(param);

            iActionPlay = new OpenHome.Net.Core.Action("Play");
            param = new ParameterUint("InstanceID");
            iActionPlay.AddInputParameter(param);
            param = new ParameterString("Speed", allowedValues);
            iActionPlay.AddInputParameter(param);

            iActionPause = new OpenHome.Net.Core.Action("Pause");
            param = new ParameterUint("InstanceID");
            iActionPause.AddInputParameter(param);

            iActionRecord = new OpenHome.Net.Core.Action("Record");
            param = new ParameterUint("InstanceID");
            iActionRecord.AddInputParameter(param);

            iActionSeek = new OpenHome.Net.Core.Action("Seek");
            param = new ParameterUint("InstanceID");
            iActionSeek.AddInputParameter(param);
            allowedValues.Add("ABS_TIME");
            allowedValues.Add("REL_TIME");
            allowedValues.Add("ABS_COUNT");
            allowedValues.Add("REL_COUNT");
            allowedValues.Add("TRACK_NR");
            allowedValues.Add("CHANNEL_FREQ");
            allowedValues.Add("TAPE-INDEX");
            allowedValues.Add("FRAME");
            param = new ParameterString("Unit", allowedValues);
            iActionSeek.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("Target", allowedValues);
            iActionSeek.AddInputParameter(param);

            iActionNext = new OpenHome.Net.Core.Action("Next");
            param = new ParameterUint("InstanceID");
            iActionNext.AddInputParameter(param);

            iActionPrevious = new OpenHome.Net.Core.Action("Previous");
            param = new ParameterUint("InstanceID");
            iActionPrevious.AddInputParameter(param);

            iActionSetPlayMode = new OpenHome.Net.Core.Action("SetPlayMode");
            param = new ParameterUint("InstanceID");
            iActionSetPlayMode.AddInputParameter(param);
            allowedValues.Add("NORMAL");
            allowedValues.Add("SHUFFLE");
            allowedValues.Add("REPEAT_ONE");
            allowedValues.Add("REPEAT_ALL");
            allowedValues.Add("RANDOM");
            allowedValues.Add("DIRECT_1");
            allowedValues.Add("INTRO");
            param = new ParameterString("NewPlayMode", allowedValues);
            iActionSetPlayMode.AddInputParameter(param);
            allowedValues.Clear();

            iActionSetRecordQualityMode = new OpenHome.Net.Core.Action("SetRecordQualityMode");
            param = new ParameterUint("InstanceID");
            iActionSetRecordQualityMode.AddInputParameter(param);
            param = new ParameterString("NewRecordQualityMode", allowedValues);
            iActionSetRecordQualityMode.AddInputParameter(param);

            iActionGetCurrentTransportActions = new OpenHome.Net.Core.Action("GetCurrentTransportActions");
            param = new ParameterUint("InstanceID");
            iActionGetCurrentTransportActions.AddInputParameter(param);
            param = new ParameterString("Actions", allowedValues);
            iActionGetCurrentTransportActions.AddOutputParameter(param);

            iActionGetDRMState = new OpenHome.Net.Core.Action("GetDRMState");
            param = new ParameterUint("InstanceID");
            iActionGetDRMState.AddInputParameter(param);
            allowedValues.Add("OK");
            allowedValues.Add("UNKNOWN");
            allowedValues.Add("PROCESSING_CONTENT_KEY");
            allowedValues.Add("CONTENT_KEY_FAILURE");
            allowedValues.Add("ATTEMPTING_AUTHENTICATION");
            allowedValues.Add("FAILED_AUTHENTICATION");
            allowedValues.Add("NOT_AUTHENTICATED");
            allowedValues.Add("DEVICE_REVOCATION");
            param = new ParameterString("CurrentDRMState", allowedValues);
            iActionGetDRMState.AddOutputParameter(param);
            allowedValues.Clear();

            iActionGetStateVariables = new OpenHome.Net.Core.Action("GetStateVariables");
            param = new ParameterUint("InstanceID");
            iActionGetStateVariables.AddInputParameter(param);
            param = new ParameterString("StateVariableList", allowedValues);
            iActionGetStateVariables.AddInputParameter(param);
            param = new ParameterString("StateVariableValuePairs", allowedValues);
            iActionGetStateVariables.AddOutputParameter(param);

            iActionSetStateVariables = new OpenHome.Net.Core.Action("SetStateVariables");
            param = new ParameterUint("InstanceID");
            iActionSetStateVariables.AddInputParameter(param);
            param = new ParameterString("AVTransportUDN", allowedValues);
            iActionSetStateVariables.AddInputParameter(param);
            param = new ParameterString("ServiceType", allowedValues);
            iActionSetStateVariables.AddInputParameter(param);
            param = new ParameterString("ServiceId", allowedValues);
            iActionSetStateVariables.AddInputParameter(param);
            param = new ParameterString("StateVariableValuePairs", allowedValues);
            iActionSetStateVariables.AddInputParameter(param);
            param = new ParameterString("StateVariableList", allowedValues);
            iActionSetStateVariables.AddOutputParameter(param);

            iLastChange = new PropertyString("LastChange", LastChangePropertyChanged);
            AddProperty(iLastChange);
            iDRMState = new PropertyString("DRMState", DRMStatePropertyChanged);
            AddProperty(iDRMState);

            iPropertyLock = new Mutex();
        }
コード例 #27
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyOpenhomeOrgTestBasic1(CpDevice aDevice)
            : base("openhome-org", "TestBasic", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionIncrement = new OpenHome.Net.Core.Action("Increment");
            param = new ParameterUint("Value");
            iActionIncrement.AddInputParameter(param);
            param = new ParameterUint("Result");
            iActionIncrement.AddOutputParameter(param);

            iActionEchoAllowedRangeUint = new OpenHome.Net.Core.Action("EchoAllowedRangeUint");
            param = new ParameterUint("Value", 10, 20);
            iActionEchoAllowedRangeUint.AddInputParameter(param);
            param = new ParameterUint("Result");
            iActionEchoAllowedRangeUint.AddOutputParameter(param);

            iActionDecrement = new OpenHome.Net.Core.Action("Decrement");
            param = new ParameterInt("Value");
            iActionDecrement.AddInputParameter(param);
            param = new ParameterInt("Result");
            iActionDecrement.AddOutputParameter(param);

            iActionToggle = new OpenHome.Net.Core.Action("Toggle");
            param = new ParameterBool("Value");
            iActionToggle.AddInputParameter(param);
            param = new ParameterBool("Result");
            iActionToggle.AddOutputParameter(param);

            iActionEchoString = new OpenHome.Net.Core.Action("EchoString");
            param = new ParameterString("Value", allowedValues);
            iActionEchoString.AddInputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionEchoString.AddOutputParameter(param);

            iActionEchoAllowedValueString = new OpenHome.Net.Core.Action("EchoAllowedValueString");
            allowedValues.Add("One");
            allowedValues.Add("Two");
            allowedValues.Add("Three");
            allowedValues.Add("Four");
            param = new ParameterString("Value", allowedValues);
            iActionEchoAllowedValueString.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("Result", allowedValues);
            iActionEchoAllowedValueString.AddOutputParameter(param);

            iActionEchoBinary = new OpenHome.Net.Core.Action("EchoBinary");
            param = new ParameterBinary("Value");
            iActionEchoBinary.AddInputParameter(param);
            param = new ParameterBinary("Result");
            iActionEchoBinary.AddOutputParameter(param);

            iActionSetUint = new OpenHome.Net.Core.Action("SetUint");
            param = new ParameterUint("ValueUint");
            iActionSetUint.AddInputParameter(param);

            iActionGetUint = new OpenHome.Net.Core.Action("GetUint");
            param = new ParameterUint("ValueUint");
            iActionGetUint.AddOutputParameter(param);

            iActionSetInt = new OpenHome.Net.Core.Action("SetInt");
            param = new ParameterInt("ValueInt");
            iActionSetInt.AddInputParameter(param);

            iActionGetInt = new OpenHome.Net.Core.Action("GetInt");
            param = new ParameterInt("ValueInt");
            iActionGetInt.AddOutputParameter(param);

            iActionSetBool = new OpenHome.Net.Core.Action("SetBool");
            param = new ParameterBool("ValueBool");
            iActionSetBool.AddInputParameter(param);

            iActionGetBool = new OpenHome.Net.Core.Action("GetBool");
            param = new ParameterBool("ValueBool");
            iActionGetBool.AddOutputParameter(param);

            iActionSetMultiple = new OpenHome.Net.Core.Action("SetMultiple");
            param = new ParameterUint("ValueUint");
            iActionSetMultiple.AddInputParameter(param);
            param = new ParameterInt("ValueInt");
            iActionSetMultiple.AddInputParameter(param);
            param = new ParameterBool("ValueBool");
            iActionSetMultiple.AddInputParameter(param);

            iActionGetMultiple = new OpenHome.Net.Core.Action("GetMultiple");
            param = new ParameterUint("ValueUint");
            iActionGetMultiple.AddOutputParameter(param);
            param = new ParameterInt("ValueInt");
            iActionGetMultiple.AddOutputParameter(param);
            param = new ParameterBool("ValueBool");
            iActionGetMultiple.AddOutputParameter(param);

            iActionSetString = new OpenHome.Net.Core.Action("SetString");
            param = new ParameterString("ValueStr", allowedValues);
            iActionSetString.AddInputParameter(param);

            iActionGetString = new OpenHome.Net.Core.Action("GetString");
            param = new ParameterString("ValueStr", allowedValues);
            iActionGetString.AddOutputParameter(param);

            iActionSetBinary = new OpenHome.Net.Core.Action("SetBinary");
            param = new ParameterBinary("ValueBin");
            iActionSetBinary.AddInputParameter(param);

            iActionGetBinary = new OpenHome.Net.Core.Action("GetBinary");
            param = new ParameterBinary("ValueBin");
            iActionGetBinary.AddOutputParameter(param);

            iActionToggleBool = new OpenHome.Net.Core.Action("ToggleBool");

            iActionWriteFile = new OpenHome.Net.Core.Action("WriteFile");
            param = new ParameterString("Data", allowedValues);
            iActionWriteFile.AddInputParameter(param);
            param = new ParameterString("FileFullName", allowedValues);
            iActionWriteFile.AddInputParameter(param);

            iActionShutdown = new OpenHome.Net.Core.Action("Shutdown");

            iVarUint = new PropertyUint("VarUint", VarUintPropertyChanged);
            AddProperty(iVarUint);
            iVarInt = new PropertyInt("VarInt", VarIntPropertyChanged);
            AddProperty(iVarInt);
            iVarBool = new PropertyBool("VarBool", VarBoolPropertyChanged);
            AddProperty(iVarBool);
            iVarStr = new PropertyString("VarStr", VarStrPropertyChanged);
            AddProperty(iVarStr);
            iVarBin = new PropertyBinary("VarBin", VarBinPropertyChanged);
            AddProperty(iVarBin);
            
            iPropertyLock = new Mutex();
        }
コード例 #28
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgAVTransport1(CpDevice aDevice)
            : base("schemas-upnp-org", "AVTransport", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionSetAVTransportURI = new OpenHome.Net.Core.Action("SetAVTransportURI");
            param = new ParameterUint("InstanceID");
            iActionSetAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionSetAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionSetAVTransportURI.AddInputParameter(param);

            iActionBendAVTransportURI = new OpenHome.Net.Core.Action("BendAVTransportURI");
            param = new ParameterUint("InstanceID");
            iActionBendAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionBendAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionBendAVTransportURI.AddInputParameter(param);

            iActionLoveCurrentTrack = new OpenHome.Net.Core.Action("LoveCurrentTrack");
            param = new ParameterUint("InstanceID");
            iActionLoveCurrentTrack.AddInputParameter(param);

            iActionBanCurrentTrack = new OpenHome.Net.Core.Action("BanCurrentTrack");
            param = new ParameterUint("InstanceID");
            iActionBanCurrentTrack.AddInputParameter(param);

            iActionSetResourceForCurrentStream = new OpenHome.Net.Core.Action("SetResourceForCurrentStream");
            param = new ParameterString("ResourceURI", allowedValues);
            iActionSetResourceForCurrentStream.AddInputParameter(param);

            iActionGetStreamProperties = new OpenHome.Net.Core.Action("GetStreamProperties");
            param = new ParameterString("CurrentContentType", allowedValues);
            iActionGetStreamProperties.AddOutputParameter(param);
            param = new ParameterUint("CurrentBitrate");
            iActionGetStreamProperties.AddOutputParameter(param);

            iActionPause = new OpenHome.Net.Core.Action("Pause");
            param = new ParameterUint("InstanceID");
            iActionPause.AddInputParameter(param);

            iActionGetMediaInfo = new OpenHome.Net.Core.Action("GetMediaInfo");
            param = new ParameterUint("InstanceID");
            iActionGetMediaInfo.AddInputParameter(param);
            param = new ParameterUint("NrTracks");
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("MediaDuration", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("NextURI", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("NextURIMetaData", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Add("NETWORK");
            param = new ParameterString("PlayMedium", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Clear();
            allowedValues.Add("NOT_IMPLEMENTED");
            param = new ParameterString("RecordMedium", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Clear();
            allowedValues.Add("NOT_IMPLEMENTED");
            param = new ParameterString("WriteStatus", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Clear();

            iActionGetTransportInfo = new OpenHome.Net.Core.Action("GetTransportInfo");
            param = new ParameterUint("InstanceID");
            iActionGetTransportInfo.AddInputParameter(param);
            allowedValues.Add("STOPPED");
            allowedValues.Add("PLAYING");
            allowedValues.Add("TRANSITIONING");
            allowedValues.Add("NO_MEDIA_PRESENT");
            param = new ParameterString("CurrentTransportState", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);
            allowedValues.Clear();
            allowedValues.Add("OK");
            allowedValues.Add("ERROR_OCCURRED");
            param = new ParameterString("CurrentTransportStatus", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);
            allowedValues.Clear();
            allowedValues.Add("1");
            param = new ParameterString("CurrentSpeed", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);
            allowedValues.Clear();

            iActionGetPositionInfo = new OpenHome.Net.Core.Action("GetPositionInfo");
            param = new ParameterUint("InstanceID");
            iActionGetPositionInfo.AddInputParameter(param);
            param = new ParameterUint("Track");
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackDuration", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackMetaData", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackURI", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("RelTime", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("AbsTime", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterInt("RelCount");
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterInt("AbsCount");
            iActionGetPositionInfo.AddOutputParameter(param);

            iActionGetDeviceCapabilities = new OpenHome.Net.Core.Action("GetDeviceCapabilities");
            param = new ParameterUint("InstanceID");
            iActionGetDeviceCapabilities.AddInputParameter(param);
            param = new ParameterString("PlayMedia", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);
            param = new ParameterString("RecMedia", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);
            param = new ParameterString("RecQualityModes", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);

            iActionGetTransportSettings = new OpenHome.Net.Core.Action("GetTransportSettings");
            param = new ParameterUint("InstanceID");
            iActionGetTransportSettings.AddInputParameter(param);
            allowedValues.Add("NORMAL");
            param = new ParameterString("PlayMode", allowedValues);
            iActionGetTransportSettings.AddOutputParameter(param);
            allowedValues.Clear();
            allowedValues.Add("NOT_IMPLEMENTED");
            param = new ParameterString("RecQualityMode", allowedValues);
            iActionGetTransportSettings.AddOutputParameter(param);
            allowedValues.Clear();

            iActionStop = new OpenHome.Net.Core.Action("Stop");
            param = new ParameterUint("InstanceID");
            iActionStop.AddInputParameter(param);

            iActionPlay = new OpenHome.Net.Core.Action("Play");
            param = new ParameterUint("InstanceID");
            iActionPlay.AddInputParameter(param);
            allowedValues.Add("1");
            param = new ParameterString("Speed", allowedValues);
            iActionPlay.AddInputParameter(param);
            allowedValues.Clear();

            iActionSeek = new OpenHome.Net.Core.Action("Seek");
            param = new ParameterUint("InstanceID");
            iActionSeek.AddInputParameter(param);
            allowedValues.Add("TRACK_NR");
            allowedValues.Add("ABS_TIME");
            param = new ParameterString("Unit", allowedValues);
            iActionSeek.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("Target", allowedValues);
            iActionSeek.AddInputParameter(param);

            iActionNext = new OpenHome.Net.Core.Action("Next");
            param = new ParameterUint("InstanceID");
            iActionNext.AddInputParameter(param);

            iActionPrevious = new OpenHome.Net.Core.Action("Previous");
            param = new ParameterUint("InstanceID");
            iActionPrevious.AddInputParameter(param);

            iActionSetPlayMode = new OpenHome.Net.Core.Action("SetPlayMode");
            param = new ParameterUint("InstanceID");
            iActionSetPlayMode.AddInputParameter(param);
            allowedValues.Add("NORMAL");
            allowedValues.Add("SHUFFLE");
            allowedValues.Add("RANDOM");
            allowedValues.Add("REPEAT_ONE");
            allowedValues.Add("REPEAT_ALL");
            param = new ParameterString("NewPlayMode", allowedValues);
            iActionSetPlayMode.AddInputParameter(param);
            allowedValues.Clear();

            iActionGetCurrentTransportActions = new OpenHome.Net.Core.Action("GetCurrentTransportActions");
            param = new ParameterUint("InstanceID");
            iActionGetCurrentTransportActions.AddInputParameter(param);
            param = new ParameterString("Actions", allowedValues);
            iActionGetCurrentTransportActions.AddOutputParameter(param);

            iActionSetNextStartTriggerTime = new OpenHome.Net.Core.Action("SetNextStartTriggerTime");
            param = new ParameterUint("InstanceID");
            iActionSetNextStartTriggerTime.AddInputParameter(param);
            param = new ParameterString("TimeService", allowedValues);
            iActionSetNextStartTriggerTime.AddInputParameter(param);
            param = new ParameterString("StartTime", allowedValues);
            iActionSetNextStartTriggerTime.AddInputParameter(param);

            iBufferFilled = new PropertyUint("BufferFilled", BufferFilledPropertyChanged);
            AddProperty(iBufferFilled);
            iLastChange = new PropertyString("LastChange", LastChangePropertyChanged);
            AddProperty(iLastChange);

            iPropertyLock = new Mutex();
        }
コード例 #29
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgVolume1(CpDevice aDevice)
            : base("av-openhome-org", "Volume", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;

            iActionCharacteristics = new OpenHome.Net.Core.Action("Characteristics");
            param = new ParameterUint("VolumeMax");
            iActionCharacteristics.AddOutputParameter(param);
            param = new ParameterUint("VolumeUnity");
            iActionCharacteristics.AddOutputParameter(param);
            param = new ParameterUint("VolumeSteps");
            iActionCharacteristics.AddOutputParameter(param);
            param = new ParameterUint("VolumeMilliDbPerStep");
            iActionCharacteristics.AddOutputParameter(param);
            param = new ParameterUint("BalanceMax");
            iActionCharacteristics.AddOutputParameter(param);
            param = new ParameterUint("FadeMax");
            iActionCharacteristics.AddOutputParameter(param);

            iActionSetVolume = new OpenHome.Net.Core.Action("SetVolume");
            param = new ParameterUint("Value");
            iActionSetVolume.AddInputParameter(param);

            iActionVolumeInc = new OpenHome.Net.Core.Action("VolumeInc");

            iActionVolumeDec = new OpenHome.Net.Core.Action("VolumeDec");

            iActionVolume = new OpenHome.Net.Core.Action("Volume");
            param = new ParameterUint("Value");
            iActionVolume.AddOutputParameter(param);

            iActionSetBalance = new OpenHome.Net.Core.Action("SetBalance");
            param = new ParameterInt("Value");
            iActionSetBalance.AddInputParameter(param);

            iActionBalanceInc = new OpenHome.Net.Core.Action("BalanceInc");

            iActionBalanceDec = new OpenHome.Net.Core.Action("BalanceDec");

            iActionBalance = new OpenHome.Net.Core.Action("Balance");
            param = new ParameterInt("Value");
            iActionBalance.AddOutputParameter(param);

            iActionSetFade = new OpenHome.Net.Core.Action("SetFade");
            param = new ParameterInt("Value");
            iActionSetFade.AddInputParameter(param);

            iActionFadeInc = new OpenHome.Net.Core.Action("FadeInc");

            iActionFadeDec = new OpenHome.Net.Core.Action("FadeDec");

            iActionFade = new OpenHome.Net.Core.Action("Fade");
            param = new ParameterInt("Value");
            iActionFade.AddOutputParameter(param);

            iActionSetMute = new OpenHome.Net.Core.Action("SetMute");
            param = new ParameterBool("Value");
            iActionSetMute.AddInputParameter(param);

            iActionMute = new OpenHome.Net.Core.Action("Mute");
            param = new ParameterBool("Value");
            iActionMute.AddOutputParameter(param);

            iActionVolumeLimit = new OpenHome.Net.Core.Action("VolumeLimit");
            param = new ParameterUint("Value");
            iActionVolumeLimit.AddOutputParameter(param);

            iVolume = new PropertyUint("Volume", VolumePropertyChanged);
            AddProperty(iVolume);
            iMute = new PropertyBool("Mute", MutePropertyChanged);
            AddProperty(iMute);
            iBalance = new PropertyInt("Balance", BalancePropertyChanged);
            AddProperty(iBalance);
            iFade = new PropertyInt("Fade", FadePropertyChanged);
            AddProperty(iFade);
            iVolumeLimit = new PropertyUint("VolumeLimit", VolumeLimitPropertyChanged);
            AddProperty(iVolumeLimit);
            iVolumeMax = new PropertyUint("VolumeMax", VolumeMaxPropertyChanged);
            AddProperty(iVolumeMax);
            iVolumeUnity = new PropertyUint("VolumeUnity", VolumeUnityPropertyChanged);
            AddProperty(iVolumeUnity);
            iVolumeSteps = new PropertyUint("VolumeSteps", VolumeStepsPropertyChanged);
            AddProperty(iVolumeSteps);
            iVolumeMilliDbPerStep = new PropertyUint("VolumeMilliDbPerStep", VolumeMilliDbPerStepPropertyChanged);
            AddProperty(iVolumeMilliDbPerStep);
            iBalanceMax = new PropertyUint("BalanceMax", BalanceMaxPropertyChanged);
            AddProperty(iBalanceMax);
            iFadeMax = new PropertyUint("FadeMax", FadeMaxPropertyChanged);
            AddProperty(iFadeMax);

            iPropertyLock = new Mutex();
        }
コード例 #30
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgScheduledRecording2(CpDevice aDevice)
            : base("schemas-upnp-org", "ScheduledRecording", 2, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionGetSortCapabilities = new OpenHome.Net.Core.Action("GetSortCapabilities");
            param = new ParameterString("SortCaps", allowedValues);
            iActionGetSortCapabilities.AddOutputParameter(param);
            param = new ParameterUint("SortLevelCap");
            iActionGetSortCapabilities.AddOutputParameter(param);

            iActionGetPropertyList = new OpenHome.Net.Core.Action("GetPropertyList");
            allowedValues.Add("A_ARG_TYPE_RecordSchedule");
            allowedValues.Add("A_ARG_TYPE_RecordTask");
            allowedValues.Add("A_ARG_TYPE_RecordScheduleParts");
            param = new ParameterString("DataTypeID", allowedValues);
            iActionGetPropertyList.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("PropertyList", allowedValues);
            iActionGetPropertyList.AddOutputParameter(param);

            iActionGetAllowedValues = new OpenHome.Net.Core.Action("GetAllowedValues");
            allowedValues.Add("A_ARG_TYPE_RecordSchedule");
            allowedValues.Add("A_ARG_TYPE_RecordTask");
            allowedValues.Add("A_ARG_TYPE_RecordScheduleParts");
            param = new ParameterString("DataTypeID", allowedValues);
            iActionGetAllowedValues.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("Filter", allowedValues);
            iActionGetAllowedValues.AddInputParameter(param);
            param = new ParameterString("PropertyInfo", allowedValues);
            iActionGetAllowedValues.AddOutputParameter(param);

            iActionGetStateUpdateID = new OpenHome.Net.Core.Action("GetStateUpdateID");
            param = new ParameterUint("Id");
            iActionGetStateUpdateID.AddOutputParameter(param);

            iActionBrowseRecordSchedules = new OpenHome.Net.Core.Action("BrowseRecordSchedules");
            param = new ParameterString("Filter", allowedValues);
            iActionBrowseRecordSchedules.AddInputParameter(param);
            param = new ParameterUint("StartingIndex");
            iActionBrowseRecordSchedules.AddInputParameter(param);
            param = new ParameterUint("RequestedCount");
            iActionBrowseRecordSchedules.AddInputParameter(param);
            param = new ParameterString("SortCriteria", allowedValues);
            iActionBrowseRecordSchedules.AddInputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionBrowseRecordSchedules.AddOutputParameter(param);
            param = new ParameterUint("NumberReturned");
            iActionBrowseRecordSchedules.AddOutputParameter(param);
            param = new ParameterUint("TotalMatches");
            iActionBrowseRecordSchedules.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionBrowseRecordSchedules.AddOutputParameter(param);

            iActionBrowseRecordTasks = new OpenHome.Net.Core.Action("BrowseRecordTasks");
            param = new ParameterString("RecordScheduleID", allowedValues);
            iActionBrowseRecordTasks.AddInputParameter(param);
            param = new ParameterString("Filter", allowedValues);
            iActionBrowseRecordTasks.AddInputParameter(param);
            param = new ParameterUint("StartingIndex");
            iActionBrowseRecordTasks.AddInputParameter(param);
            param = new ParameterUint("RequestedCount");
            iActionBrowseRecordTasks.AddInputParameter(param);
            param = new ParameterString("SortCriteria", allowedValues);
            iActionBrowseRecordTasks.AddInputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionBrowseRecordTasks.AddOutputParameter(param);
            param = new ParameterUint("NumberReturned");
            iActionBrowseRecordTasks.AddOutputParameter(param);
            param = new ParameterUint("TotalMatches");
            iActionBrowseRecordTasks.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionBrowseRecordTasks.AddOutputParameter(param);

            iActionCreateRecordSchedule = new OpenHome.Net.Core.Action("CreateRecordSchedule");
            param = new ParameterString("Elements", allowedValues);
            iActionCreateRecordSchedule.AddInputParameter(param);
            param = new ParameterString("RecordScheduleID", allowedValues);
            iActionCreateRecordSchedule.AddOutputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionCreateRecordSchedule.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionCreateRecordSchedule.AddOutputParameter(param);

            iActionDeleteRecordSchedule = new OpenHome.Net.Core.Action("DeleteRecordSchedule");
            param = new ParameterString("RecordScheduleID", allowedValues);
            iActionDeleteRecordSchedule.AddInputParameter(param);

            iActionGetRecordSchedule = new OpenHome.Net.Core.Action("GetRecordSchedule");
            param = new ParameterString("RecordScheduleID", allowedValues);
            iActionGetRecordSchedule.AddInputParameter(param);
            param = new ParameterString("Filter", allowedValues);
            iActionGetRecordSchedule.AddInputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionGetRecordSchedule.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionGetRecordSchedule.AddOutputParameter(param);

            iActionEnableRecordSchedule = new OpenHome.Net.Core.Action("EnableRecordSchedule");
            param = new ParameterString("RecordScheduleID", allowedValues);
            iActionEnableRecordSchedule.AddInputParameter(param);

            iActionDisableRecordSchedule = new OpenHome.Net.Core.Action("DisableRecordSchedule");
            param = new ParameterString("RecordScheduleID", allowedValues);
            iActionDisableRecordSchedule.AddInputParameter(param);

            iActionDeleteRecordTask = new OpenHome.Net.Core.Action("DeleteRecordTask");
            param = new ParameterString("RecordTaskID", allowedValues);
            iActionDeleteRecordTask.AddInputParameter(param);

            iActionGetRecordTask = new OpenHome.Net.Core.Action("GetRecordTask");
            param = new ParameterString("RecordTaskID", allowedValues);
            iActionGetRecordTask.AddInputParameter(param);
            param = new ParameterString("Filter", allowedValues);
            iActionGetRecordTask.AddInputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionGetRecordTask.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionGetRecordTask.AddOutputParameter(param);

            iActionEnableRecordTask = new OpenHome.Net.Core.Action("EnableRecordTask");
            param = new ParameterString("RecordTaskID", allowedValues);
            iActionEnableRecordTask.AddInputParameter(param);

            iActionDisableRecordTask = new OpenHome.Net.Core.Action("DisableRecordTask");
            param = new ParameterString("RecordTaskID", allowedValues);
            iActionDisableRecordTask.AddInputParameter(param);

            iActionResetRecordTask = new OpenHome.Net.Core.Action("ResetRecordTask");
            param = new ParameterString("RecordTaskID", allowedValues);
            iActionResetRecordTask.AddInputParameter(param);

            iActionGetRecordScheduleConflicts = new OpenHome.Net.Core.Action("GetRecordScheduleConflicts");
            param = new ParameterString("RecordScheduleID", allowedValues);
            iActionGetRecordScheduleConflicts.AddInputParameter(param);
            param = new ParameterString("RecordScheduleConflictIDList", allowedValues);
            iActionGetRecordScheduleConflicts.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionGetRecordScheduleConflicts.AddOutputParameter(param);

            iActionGetRecordTaskConflicts = new OpenHome.Net.Core.Action("GetRecordTaskConflicts");
            param = new ParameterString("RecordTaskID", allowedValues);
            iActionGetRecordTaskConflicts.AddInputParameter(param);
            param = new ParameterString("RecordTaskConflictIDList", allowedValues);
            iActionGetRecordTaskConflicts.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionGetRecordTaskConflicts.AddOutputParameter(param);

            iLastChange = new PropertyString("LastChange", LastChangePropertyChanged);
            AddProperty(iLastChange);

            iPropertyLock = new Mutex();
        }
コード例 #31
0
ファイル: CpUpnpOrgDimming1.cs プロジェクト: nterry/ohNet
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgDimming1(CpDevice aDevice)
            : base("schemas-upnp-org", "Dimming", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionSetLoadLevelTarget = new OpenHome.Net.Core.Action("SetLoadLevelTarget");
            param = new ParameterUint("newLoadlevelTarget", 0, 100);
            iActionSetLoadLevelTarget.AddInputParameter(param);

            iActionGetLoadLevelTarget = new OpenHome.Net.Core.Action("GetLoadLevelTarget");
            param = new ParameterUint("GetLoadlevelTarget", 0, 100);
            iActionGetLoadLevelTarget.AddOutputParameter(param);

            iActionGetLoadLevelStatus = new OpenHome.Net.Core.Action("GetLoadLevelStatus");
            param = new ParameterUint("retLoadlevelStatus", 0, 100);
            iActionGetLoadLevelStatus.AddOutputParameter(param);

            iActionSetOnEffectLevel = new OpenHome.Net.Core.Action("SetOnEffectLevel");
            param = new ParameterUint("newOnEffectLevel", 0, 100);
            iActionSetOnEffectLevel.AddInputParameter(param);

            iActionSetOnEffect = new OpenHome.Net.Core.Action("SetOnEffect");
            allowedValues.Add("OnEffectLevel");
            allowedValues.Add("LastSetting");
            allowedValues.Add("Default");
            param = new ParameterString("newOnEffect", allowedValues);
            iActionSetOnEffect.AddInputParameter(param);
            allowedValues.Clear();

            iActionGetOnEffectParameters = new OpenHome.Net.Core.Action("GetOnEffectParameters");
            allowedValues.Add("OnEffectLevel");
            allowedValues.Add("LastSetting");
            allowedValues.Add("Default");
            param = new ParameterString("retOnEffect", allowedValues);
            iActionGetOnEffectParameters.AddOutputParameter(param);
            allowedValues.Clear();
            param = new ParameterUint("retOnEffectLevel", 0, 100);
            iActionGetOnEffectParameters.AddOutputParameter(param);

            iActionStepUp = new OpenHome.Net.Core.Action("StepUp");

            iActionStepDown = new OpenHome.Net.Core.Action("StepDown");

            iActionStartRampUp = new OpenHome.Net.Core.Action("StartRampUp");

            iActionStartRampDown = new OpenHome.Net.Core.Action("StartRampDown");

            iActionStopRamp = new OpenHome.Net.Core.Action("StopRamp");

            iActionStartRampToLevel = new OpenHome.Net.Core.Action("StartRampToLevel");
            param = new ParameterUint("newLoadLevelTarget", 0, 100);
            iActionStartRampToLevel.AddInputParameter(param);
            param = new ParameterUint("newRampTime");
            iActionStartRampToLevel.AddInputParameter(param);

            iActionSetStepDelta = new OpenHome.Net.Core.Action("SetStepDelta");
            param = new ParameterUint("newStepDelta", 1, 100);
            iActionSetStepDelta.AddInputParameter(param);

            iActionGetStepDelta = new OpenHome.Net.Core.Action("GetStepDelta");
            param = new ParameterUint("retStepDelta", 1, 100);
            iActionGetStepDelta.AddOutputParameter(param);

            iActionSetRampRate = new OpenHome.Net.Core.Action("SetRampRate");
            param = new ParameterUint("newRampRate", 0, 100);
            iActionSetRampRate.AddInputParameter(param);

            iActionGetRampRate = new OpenHome.Net.Core.Action("GetRampRate");
            param = new ParameterUint("retRampRate", 0, 100);
            iActionGetRampRate.AddOutputParameter(param);

            iActionPauseRamp = new OpenHome.Net.Core.Action("PauseRamp");

            iActionResumeRamp = new OpenHome.Net.Core.Action("ResumeRamp");

            iActionGetIsRamping = new OpenHome.Net.Core.Action("GetIsRamping");
            param = new ParameterBool("retIsRamping");
            iActionGetIsRamping.AddOutputParameter(param);

            iActionGetRampPaused = new OpenHome.Net.Core.Action("GetRampPaused");
            param = new ParameterBool("retRampPaused");
            iActionGetRampPaused.AddOutputParameter(param);

            iActionGetRampTime = new OpenHome.Net.Core.Action("GetRampTime");
            param = new ParameterUint("retRampTime");
            iActionGetRampTime.AddOutputParameter(param);

            iLoadLevelStatus = new PropertyUint("LoadLevelStatus", LoadLevelStatusPropertyChanged);
            AddProperty(iLoadLevelStatus);
            iStepDelta = new PropertyUint("StepDelta", StepDeltaPropertyChanged);
            AddProperty(iStepDelta);
            iRampRate = new PropertyUint("RampRate", RampRatePropertyChanged);
            AddProperty(iRampRate);
            iIsRamping = new PropertyBool("IsRamping", IsRampingPropertyChanged);
            AddProperty(iIsRamping);
            iRampPaused = new PropertyBool("RampPaused", RampPausedPropertyChanged);
            AddProperty(iRampPaused);

            iPropertyLock = new Mutex();
        }
コード例 #32
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgContentDirectory2(CpDevice aDevice)
            : base("schemas-upnp-org", "ContentDirectory", 2, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionGetSearchCapabilities = new OpenHome.Net.Core.Action("GetSearchCapabilities");
            param = new ParameterString("SearchCaps", allowedValues);
            iActionGetSearchCapabilities.AddOutputParameter(param);

            iActionGetSortCapabilities = new OpenHome.Net.Core.Action("GetSortCapabilities");
            param = new ParameterString("SortCaps", allowedValues);
            iActionGetSortCapabilities.AddOutputParameter(param);

            iActionGetSortExtensionCapabilities = new OpenHome.Net.Core.Action("GetSortExtensionCapabilities");
            param = new ParameterString("SortExtensionCaps", allowedValues);
            iActionGetSortExtensionCapabilities.AddOutputParameter(param);

            iActionGetFeatureList = new OpenHome.Net.Core.Action("GetFeatureList");
            param = new ParameterString("FeatureList", allowedValues);
            iActionGetFeatureList.AddOutputParameter(param);

            iActionGetSystemUpdateID = new OpenHome.Net.Core.Action("GetSystemUpdateID");
            param = new ParameterUint("Id");
            iActionGetSystemUpdateID.AddOutputParameter(param);

            iActionBrowse = new OpenHome.Net.Core.Action("Browse");
            param = new ParameterString("ObjectID", allowedValues);
            iActionBrowse.AddInputParameter(param);
            allowedValues.Add("BrowseMetadata");
            allowedValues.Add("BrowseDirectChildren");
            param = new ParameterString("BrowseFlag", allowedValues);
            iActionBrowse.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("Filter", allowedValues);
            iActionBrowse.AddInputParameter(param);
            param = new ParameterUint("StartingIndex");
            iActionBrowse.AddInputParameter(param);
            param = new ParameterUint("RequestedCount");
            iActionBrowse.AddInputParameter(param);
            param = new ParameterString("SortCriteria", allowedValues);
            iActionBrowse.AddInputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionBrowse.AddOutputParameter(param);
            param = new ParameterUint("NumberReturned");
            iActionBrowse.AddOutputParameter(param);
            param = new ParameterUint("TotalMatches");
            iActionBrowse.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionBrowse.AddOutputParameter(param);

            iActionSearch = new OpenHome.Net.Core.Action("Search");
            param = new ParameterString("ContainerID", allowedValues);
            iActionSearch.AddInputParameter(param);
            param = new ParameterString("SearchCriteria", allowedValues);
            iActionSearch.AddInputParameter(param);
            param = new ParameterString("Filter", allowedValues);
            iActionSearch.AddInputParameter(param);
            param = new ParameterUint("StartingIndex");
            iActionSearch.AddInputParameter(param);
            param = new ParameterUint("RequestedCount");
            iActionSearch.AddInputParameter(param);
            param = new ParameterString("SortCriteria", allowedValues);
            iActionSearch.AddInputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionSearch.AddOutputParameter(param);
            param = new ParameterUint("NumberReturned");
            iActionSearch.AddOutputParameter(param);
            param = new ParameterUint("TotalMatches");
            iActionSearch.AddOutputParameter(param);
            param = new ParameterUint("UpdateID");
            iActionSearch.AddOutputParameter(param);

            iActionCreateObject = new OpenHome.Net.Core.Action("CreateObject");
            param = new ParameterString("ContainerID", allowedValues);
            iActionCreateObject.AddInputParameter(param);
            param = new ParameterString("Elements", allowedValues);
            iActionCreateObject.AddInputParameter(param);
            param = new ParameterString("ObjectID", allowedValues);
            iActionCreateObject.AddOutputParameter(param);
            param = new ParameterString("Result", allowedValues);
            iActionCreateObject.AddOutputParameter(param);

            iActionDestroyObject = new OpenHome.Net.Core.Action("DestroyObject");
            param = new ParameterString("ObjectID", allowedValues);
            iActionDestroyObject.AddInputParameter(param);

            iActionUpdateObject = new OpenHome.Net.Core.Action("UpdateObject");
            param = new ParameterString("ObjectID", allowedValues);
            iActionUpdateObject.AddInputParameter(param);
            param = new ParameterString("CurrentTagValue", allowedValues);
            iActionUpdateObject.AddInputParameter(param);
            param = new ParameterString("NewTagValue", allowedValues);
            iActionUpdateObject.AddInputParameter(param);

            iActionMoveObject = new OpenHome.Net.Core.Action("MoveObject");
            param = new ParameterString("ObjectID", allowedValues);
            iActionMoveObject.AddInputParameter(param);
            param = new ParameterString("NewParentID", allowedValues);
            iActionMoveObject.AddInputParameter(param);
            param = new ParameterString("NewObjectID", allowedValues);
            iActionMoveObject.AddOutputParameter(param);

            iActionImportResource = new OpenHome.Net.Core.Action("ImportResource");
            param = new ParameterString("SourceURI", allowedValues);
            iActionImportResource.AddInputParameter(param);
            param = new ParameterString("DestinationURI", allowedValues);
            iActionImportResource.AddInputParameter(param);
            param = new ParameterUint("TransferID");
            iActionImportResource.AddOutputParameter(param);

            iActionExportResource = new OpenHome.Net.Core.Action("ExportResource");
            param = new ParameterString("SourceURI", allowedValues);
            iActionExportResource.AddInputParameter(param);
            param = new ParameterString("DestinationURI", allowedValues);
            iActionExportResource.AddInputParameter(param);
            param = new ParameterUint("TransferID");
            iActionExportResource.AddOutputParameter(param);

            iActionDeleteResource = new OpenHome.Net.Core.Action("DeleteResource");
            param = new ParameterString("ResourceURI", allowedValues);
            iActionDeleteResource.AddInputParameter(param);

            iActionStopTransferResource = new OpenHome.Net.Core.Action("StopTransferResource");
            param = new ParameterUint("TransferID");
            iActionStopTransferResource.AddInputParameter(param);

            iActionGetTransferProgress = new OpenHome.Net.Core.Action("GetTransferProgress");
            param = new ParameterUint("TransferID");
            iActionGetTransferProgress.AddInputParameter(param);
            allowedValues.Add("COMPLETED");
            allowedValues.Add("ERROR");
            allowedValues.Add("IN_PROGRESS");
            allowedValues.Add("STOPPED");
            param = new ParameterString("TransferStatus", allowedValues);
            iActionGetTransferProgress.AddOutputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("TransferLength", allowedValues);
            iActionGetTransferProgress.AddOutputParameter(param);
            param = new ParameterString("TransferTotal", allowedValues);
            iActionGetTransferProgress.AddOutputParameter(param);

            iActionCreateReference = new OpenHome.Net.Core.Action("CreateReference");
            param = new ParameterString("ContainerID", allowedValues);
            iActionCreateReference.AddInputParameter(param);
            param = new ParameterString("ObjectID", allowedValues);
            iActionCreateReference.AddInputParameter(param);
            param = new ParameterString("NewID", allowedValues);
            iActionCreateReference.AddOutputParameter(param);

            iSystemUpdateID = new PropertyUint("SystemUpdateID", SystemUpdateIDPropertyChanged);
            AddProperty(iSystemUpdateID);
            iContainerUpdateIDs = new PropertyString("ContainerUpdateIDs", ContainerUpdateIDsPropertyChanged);
            AddProperty(iContainerUpdateIDs);
            iTransferIDs = new PropertyString("TransferIDs", TransferIDsPropertyChanged);
            AddProperty(iTransferIDs);

            iPropertyLock = new Mutex();
        }
コード例 #33
0
ファイル: CpUpnpOrgAVTransport1.cs プロジェクト: Wodath/ohNet
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgAVTransport1(CpDevice aDevice)
            : base("schemas-upnp-org", "AVTransport", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionSetAVTransportURI = new OpenHome.Net.Core.Action("SetAVTransportURI");
            param = new ParameterUint("InstanceID");
            iActionSetAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionSetAVTransportURI.AddInputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionSetAVTransportURI.AddInputParameter(param);

            iActionSetNextAVTransportURI = new OpenHome.Net.Core.Action("SetNextAVTransportURI");
            param = new ParameterUint("InstanceID");
            iActionSetNextAVTransportURI.AddInputParameter(param);
            param = new ParameterString("NextURI", allowedValues);
            iActionSetNextAVTransportURI.AddInputParameter(param);
            param = new ParameterString("NextURIMetaData", allowedValues);
            iActionSetNextAVTransportURI.AddInputParameter(param);

            iActionGetMediaInfo = new OpenHome.Net.Core.Action("GetMediaInfo");
            param = new ParameterUint("InstanceID");
            iActionGetMediaInfo.AddInputParameter(param);
            param = new ParameterUint("NrTracks", 0, 2147483647);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("MediaDuration", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentURI", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("CurrentURIMetaData", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("NextURI", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("NextURIMetaData", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("PlayMedium", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            param = new ParameterString("RecordMedium", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Add("WRITABLE");
            allowedValues.Add("PROTECTED");
            allowedValues.Add("NOT_WRITABLE");
            allowedValues.Add("UNKNOWN");
            allowedValues.Add("NOT_IMPLEMENTED");
            param = new ParameterString("WriteStatus", allowedValues);
            iActionGetMediaInfo.AddOutputParameter(param);
            allowedValues.Clear();

            iActionGetTransportInfo = new OpenHome.Net.Core.Action("GetTransportInfo");
            param = new ParameterUint("InstanceID");
            iActionGetTransportInfo.AddInputParameter(param);
            allowedValues.Add("STOPPED");
            allowedValues.Add("PLAYING");
            allowedValues.Add("TRANSITIONING");
            allowedValues.Add("PAUSED_PLAYBACK");
            allowedValues.Add("PAUSED_RECORDING");
            allowedValues.Add("RECORDING");
            allowedValues.Add("NO_MEDIA_PRESENT");
            param = new ParameterString("CurrentTransportState", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);
            allowedValues.Clear();
            allowedValues.Add("OK");
            allowedValues.Add("ERROR_OCCURRED");
            param = new ParameterString("CurrentTransportStatus", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("CurrentSpeed", allowedValues);
            iActionGetTransportInfo.AddOutputParameter(param);

            iActionGetPositionInfo = new OpenHome.Net.Core.Action("GetPositionInfo");
            param = new ParameterUint("InstanceID");
            iActionGetPositionInfo.AddInputParameter(param);
            param = new ParameterUint("Track", 0, 2147483647, 1);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackDuration", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackMetaData", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("TrackURI", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("RelTime", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterString("AbsTime", allowedValues);
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterInt("RelCount");
            iActionGetPositionInfo.AddOutputParameter(param);
            param = new ParameterInt("AbsCount");
            iActionGetPositionInfo.AddOutputParameter(param);

            iActionGetDeviceCapabilities = new OpenHome.Net.Core.Action("GetDeviceCapabilities");
            param = new ParameterUint("InstanceID");
            iActionGetDeviceCapabilities.AddInputParameter(param);
            param = new ParameterString("PlayMedia", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);
            param = new ParameterString("RecMedia", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);
            param = new ParameterString("RecQualityModes", allowedValues);
            iActionGetDeviceCapabilities.AddOutputParameter(param);

            iActionGetTransportSettings = new OpenHome.Net.Core.Action("GetTransportSettings");
            param = new ParameterUint("InstanceID");
            iActionGetTransportSettings.AddInputParameter(param);
            allowedValues.Add("NORMAL");
            param = new ParameterString("PlayMode", allowedValues);
            iActionGetTransportSettings.AddOutputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("RecQualityMode", allowedValues);
            iActionGetTransportSettings.AddOutputParameter(param);

            iActionStop = new OpenHome.Net.Core.Action("Stop");
            param = new ParameterUint("InstanceID");
            iActionStop.AddInputParameter(param);

            iActionPlay = new OpenHome.Net.Core.Action("Play");
            param = new ParameterUint("InstanceID");
            iActionPlay.AddInputParameter(param);
            param = new ParameterString("Speed", allowedValues);
            iActionPlay.AddInputParameter(param);

            iActionPause = new OpenHome.Net.Core.Action("Pause");
            param = new ParameterUint("InstanceID");
            iActionPause.AddInputParameter(param);

            iActionRecord = new OpenHome.Net.Core.Action("Record");
            param = new ParameterUint("InstanceID");
            iActionRecord.AddInputParameter(param);

            iActionSeek = new OpenHome.Net.Core.Action("Seek");
            param = new ParameterUint("InstanceID");
            iActionSeek.AddInputParameter(param);
            allowedValues.Add("TRACK_NR");
            allowedValues.Add("ABS_TIME");
            allowedValues.Add("REL_TIME");
            allowedValues.Add("ABS_COUNT");
            allowedValues.Add("REL_COUNT");
            allowedValues.Add("CHANNEL_FREQ");
            allowedValues.Add("TAPE-INDEX");
            allowedValues.Add("FRAME");
            param = new ParameterString("Unit", allowedValues);
            iActionSeek.AddInputParameter(param);
            allowedValues.Clear();
            param = new ParameterString("Target", allowedValues);
            iActionSeek.AddInputParameter(param);

            iActionNext = new OpenHome.Net.Core.Action("Next");
            param = new ParameterUint("InstanceID");
            iActionNext.AddInputParameter(param);

            iActionPrevious = new OpenHome.Net.Core.Action("Previous");
            param = new ParameterUint("InstanceID");
            iActionPrevious.AddInputParameter(param);

            iActionSetPlayMode = new OpenHome.Net.Core.Action("SetPlayMode");
            param = new ParameterUint("InstanceID");
            iActionSetPlayMode.AddInputParameter(param);
            allowedValues.Add("NORMAL");
            param = new ParameterString("NewPlayMode", allowedValues);
            iActionSetPlayMode.AddInputParameter(param);
            allowedValues.Clear();

            iActionSetRecordQualityMode = new OpenHome.Net.Core.Action("SetRecordQualityMode");
            param = new ParameterUint("InstanceID");
            iActionSetRecordQualityMode.AddInputParameter(param);
            param = new ParameterString("NewRecordQualityMode", allowedValues);
            iActionSetRecordQualityMode.AddInputParameter(param);

            iActionGetCurrentTransportActions = new OpenHome.Net.Core.Action("GetCurrentTransportActions");
            param = new ParameterUint("InstanceID");
            iActionGetCurrentTransportActions.AddInputParameter(param);
            param = new ParameterString("Actions", allowedValues);
            iActionGetCurrentTransportActions.AddOutputParameter(param);

            iLastChange = new PropertyString("LastChange", LastChangePropertyChanged);
            AddProperty(iLastChange);

            iPropertyLock = new Mutex();
        }
コード例 #34
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgPlaylist1(CpDevice aDevice)
            : base("av-openhome-org", "Playlist", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionPlay = new OpenHome.Net.Core.Action("Play");

            iActionPause = new OpenHome.Net.Core.Action("Pause");

            iActionStop = new OpenHome.Net.Core.Action("Stop");

            iActionNext = new OpenHome.Net.Core.Action("Next");

            iActionPrevious = new OpenHome.Net.Core.Action("Previous");

            iActionSetRepeat = new OpenHome.Net.Core.Action("SetRepeat");
            param = new ParameterBool("Value");
            iActionSetRepeat.AddInputParameter(param);

            iActionRepeat = new OpenHome.Net.Core.Action("Repeat");
            param = new ParameterBool("Value");
            iActionRepeat.AddOutputParameter(param);

            iActionSetShuffle = new OpenHome.Net.Core.Action("SetShuffle");
            param = new ParameterBool("Value");
            iActionSetShuffle.AddInputParameter(param);

            iActionShuffle = new OpenHome.Net.Core.Action("Shuffle");
            param = new ParameterBool("Value");
            iActionShuffle.AddOutputParameter(param);

            iActionSeekSecondAbsolute = new OpenHome.Net.Core.Action("SeekSecondAbsolute");
            param = new ParameterUint("Value");
            iActionSeekSecondAbsolute.AddInputParameter(param);

            iActionSeekSecondRelative = new OpenHome.Net.Core.Action("SeekSecondRelative");
            param = new ParameterInt("Value");
            iActionSeekSecondRelative.AddInputParameter(param);

            iActionSeekId = new OpenHome.Net.Core.Action("SeekId");
            param = new ParameterUint("Value");
            iActionSeekId.AddInputParameter(param);

            iActionSeekIndex = new OpenHome.Net.Core.Action("SeekIndex");
            param = new ParameterUint("Value");
            iActionSeekIndex.AddInputParameter(param);

            iActionTransportState = new OpenHome.Net.Core.Action("TransportState");
            allowedValues.Add("Playing");
            allowedValues.Add("Paused");
            allowedValues.Add("Stopped");
            allowedValues.Add("Buffering");
            param = new ParameterString("Value", allowedValues);
            iActionTransportState.AddOutputParameter(param);
            allowedValues.Clear();

            iActionId = new OpenHome.Net.Core.Action("Id");
            param = new ParameterUint("Value");
            iActionId.AddOutputParameter(param);

            iActionRead = new OpenHome.Net.Core.Action("Read");
            param = new ParameterUint("Id");
            iActionRead.AddInputParameter(param);
            param = new ParameterString("Uri", allowedValues);
            iActionRead.AddOutputParameter(param);
            param = new ParameterString("Metadata", allowedValues);
            iActionRead.AddOutputParameter(param);

            iActionReadList = new OpenHome.Net.Core.Action("ReadList");
            param = new ParameterString("IdList", allowedValues);
            iActionReadList.AddInputParameter(param);
            param = new ParameterString("TrackList", allowedValues);
            iActionReadList.AddOutputParameter(param);

            iActionInsert = new OpenHome.Net.Core.Action("Insert");
            param = new ParameterUint("AfterId");
            iActionInsert.AddInputParameter(param);
            param = new ParameterString("Uri", allowedValues);
            iActionInsert.AddInputParameter(param);
            param = new ParameterString("Metadata", allowedValues);
            iActionInsert.AddInputParameter(param);
            param = new ParameterUint("NewId");
            iActionInsert.AddOutputParameter(param);

            iActionDeleteId = new OpenHome.Net.Core.Action("DeleteId");
            param = new ParameterUint("Value");
            iActionDeleteId.AddInputParameter(param);

            iActionDeleteAll = new OpenHome.Net.Core.Action("DeleteAll");

            iActionTracksMax = new OpenHome.Net.Core.Action("TracksMax");
            param = new ParameterUint("Value");
            iActionTracksMax.AddOutputParameter(param);

            iActionIdArray = new OpenHome.Net.Core.Action("IdArray");
            param = new ParameterUint("Token");
            iActionIdArray.AddOutputParameter(param);
            param = new ParameterBinary("Array");
            iActionIdArray.AddOutputParameter(param);

            iActionIdArrayChanged = new OpenHome.Net.Core.Action("IdArrayChanged");
            param = new ParameterUint("Token");
            iActionIdArrayChanged.AddInputParameter(param);
            param = new ParameterBool("Value");
            iActionIdArrayChanged.AddOutputParameter(param);

            iActionProtocolInfo = new OpenHome.Net.Core.Action("ProtocolInfo");
            param = new ParameterString("Value", allowedValues);
            iActionProtocolInfo.AddOutputParameter(param);

            iTransportState = new PropertyString("TransportState", TransportStatePropertyChanged);
            AddProperty(iTransportState);
            iRepeat = new PropertyBool("Repeat", RepeatPropertyChanged);
            AddProperty(iRepeat);
            iShuffle = new PropertyBool("Shuffle", ShufflePropertyChanged);
            AddProperty(iShuffle);
            iId = new PropertyUint("Id", IdPropertyChanged);
            AddProperty(iId);
            iIdArray = new PropertyBinary("IdArray", IdArrayPropertyChanged);
            AddProperty(iIdArray);
            iTracksMax = new PropertyUint("TracksMax", TracksMaxPropertyChanged);
            AddProperty(iTracksMax);
            iProtocolInfo = new PropertyString("ProtocolInfo", ProtocolInfoPropertyChanged);
            AddProperty(iProtocolInfo);

            iPropertyLock = new Mutex();
        }
コード例 #35
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgReceiver1(CpDevice aDevice)
            : base("av-openhome-org", "Receiver", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionPlay = new OpenHome.Net.Core.Action("Play");

            iActionStop = new OpenHome.Net.Core.Action("Stop");

            iActionSetSender = new OpenHome.Net.Core.Action("SetSender");
            param = new ParameterString("Uri", allowedValues);
            iActionSetSender.AddInputParameter(param);
            param = new ParameterString("Metadata", allowedValues);
            iActionSetSender.AddInputParameter(param);

            iActionSender = new OpenHome.Net.Core.Action("Sender");
            param = new ParameterString("Uri", allowedValues);
            iActionSender.AddOutputParameter(param);
            param = new ParameterString("Metadata", allowedValues);
            iActionSender.AddOutputParameter(param);

            iActionProtocolInfo = new OpenHome.Net.Core.Action("ProtocolInfo");
            param = new ParameterString("Value", allowedValues);
            iActionProtocolInfo.AddOutputParameter(param);

            iActionTransportState = new OpenHome.Net.Core.Action("TransportState");
            allowedValues.Add("Stopped");
            allowedValues.Add("Playing");
            allowedValues.Add("Waiting");
            allowedValues.Add("Buffering");
            param = new ParameterString("Value", allowedValues);
            iActionTransportState.AddOutputParameter(param);
            allowedValues.Clear();

            iUri = new PropertyString("Uri", UriPropertyChanged);
            AddProperty(iUri);
            iMetadata = new PropertyString("Metadata", MetadataPropertyChanged);
            AddProperty(iMetadata);
            iTransportState = new PropertyString("TransportState", TransportStatePropertyChanged);
            AddProperty(iTransportState);
            iProtocolInfo = new PropertyString("ProtocolInfo", ProtocolInfoPropertyChanged);
            AddProperty(iProtocolInfo);

            iPropertyLock = new Mutex();
        }
コード例 #36
0
ファイル: CpDevice.cs プロジェクト: MatthewMiddleweek/ohNet
 private static void CallListChangedDelegate(ChangeHandler aDelegate, CpDeviceList aList, CpDevice aDevice)
 {
     try
     {
         aDelegate(aList, aDevice);
     }
     catch (ProxyError e)
     {
         Console.WriteLine("WARNING: ProxyError ({0}:{1}) thrown from {2} in device list change delegate", e.Code, (e.Description != null ? e.Description : "<none>"), e.TargetSite.Name);
     }
 }
コード例 #37
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgRadio1(CpDevice aDevice)
            : base("av-openhome-org", "Radio", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionPlay = new OpenHome.Net.Core.Action("Play");

            iActionPause = new OpenHome.Net.Core.Action("Pause");

            iActionStop = new OpenHome.Net.Core.Action("Stop");

            iActionSeekSecondAbsolute = new OpenHome.Net.Core.Action("SeekSecondAbsolute");
            param = new ParameterUint("Value");
            iActionSeekSecondAbsolute.AddInputParameter(param);

            iActionSeekSecondRelative = new OpenHome.Net.Core.Action("SeekSecondRelative");
            param = new ParameterInt("Value");
            iActionSeekSecondRelative.AddInputParameter(param);

            iActionChannel = new OpenHome.Net.Core.Action("Channel");
            param = new ParameterString("Uri", allowedValues);
            iActionChannel.AddOutputParameter(param);
            param = new ParameterString("Metadata", allowedValues);
            iActionChannel.AddOutputParameter(param);

            iActionSetChannel = new OpenHome.Net.Core.Action("SetChannel");
            param = new ParameterString("Uri", allowedValues);
            iActionSetChannel.AddInputParameter(param);
            param = new ParameterString("Metadata", allowedValues);
            iActionSetChannel.AddInputParameter(param);

            iActionTransportState = new OpenHome.Net.Core.Action("TransportState");
            allowedValues.Add("Stopped");
            allowedValues.Add("Playing");
            allowedValues.Add("Paused");
            allowedValues.Add("Buffering");
            param = new ParameterString("Value", allowedValues);
            iActionTransportState.AddOutputParameter(param);
            allowedValues.Clear();

            iActionId = new OpenHome.Net.Core.Action("Id");
            param = new ParameterUint("Value");
            iActionId.AddOutputParameter(param);

            iActionSetId = new OpenHome.Net.Core.Action("SetId");
            param = new ParameterUint("Value");
            iActionSetId.AddInputParameter(param);
            param = new ParameterString("Uri", allowedValues);
            iActionSetId.AddInputParameter(param);

            iActionRead = new OpenHome.Net.Core.Action("Read");
            param = new ParameterUint("Id");
            iActionRead.AddInputParameter(param);
            param = new ParameterString("Metadata", allowedValues);
            iActionRead.AddOutputParameter(param);

            iActionReadList = new OpenHome.Net.Core.Action("ReadList");
            param = new ParameterString("IdList", allowedValues);
            iActionReadList.AddInputParameter(param);
            param = new ParameterString("ChannelList", allowedValues);
            iActionReadList.AddOutputParameter(param);

            iActionIdArray = new OpenHome.Net.Core.Action("IdArray");
            param = new ParameterUint("Token");
            iActionIdArray.AddOutputParameter(param);
            param = new ParameterBinary("Array");
            iActionIdArray.AddOutputParameter(param);

            iActionIdArrayChanged = new OpenHome.Net.Core.Action("IdArrayChanged");
            param = new ParameterUint("Token");
            iActionIdArrayChanged.AddInputParameter(param);
            param = new ParameterBool("Value");
            iActionIdArrayChanged.AddOutputParameter(param);

            iActionChannelsMax = new OpenHome.Net.Core.Action("ChannelsMax");
            param = new ParameterUint("Value");
            iActionChannelsMax.AddOutputParameter(param);

            iActionProtocolInfo = new OpenHome.Net.Core.Action("ProtocolInfo");
            param = new ParameterString("Value", allowedValues);
            iActionProtocolInfo.AddOutputParameter(param);

            iUri = new PropertyString("Uri", UriPropertyChanged);
            AddProperty(iUri);
            iMetadata = new PropertyString("Metadata", MetadataPropertyChanged);
            AddProperty(iMetadata);
            iTransportState = new PropertyString("TransportState", TransportStatePropertyChanged);
            AddProperty(iTransportState);
            iId = new PropertyUint("Id", IdPropertyChanged);
            AddProperty(iId);
            iIdArray = new PropertyBinary("IdArray", IdArrayPropertyChanged);
            AddProperty(iIdArray);
            iChannelsMax = new PropertyUint("ChannelsMax", ChannelsMaxPropertyChanged);
            AddProperty(iChannelsMax);
            iProtocolInfo = new PropertyString("ProtocolInfo", ProtocolInfoPropertyChanged);
            AddProperty(iProtocolInfo);

            iPropertyLock = new Mutex();
        }
コード例 #38
0
 private static void CallListChangedDelegate(ChangeHandler aDelegate, CpDeviceList aList, CpDevice aDevice)
 {
     try
     {
         aDelegate(aList, aDevice);
     }
     catch (ProxyError e)
     {
         Console.WriteLine("WARNING: ProxyError ({0}:{1}) thrown from {2} in device list change delegate", e.Code, (e.Description != null ? e.Description : "<none>"), e.TargetSite.Name);
     }
 }
コード例 #39
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgMediaServer1(CpDevice aDevice)
            : base("av-openhome-org", "MediaServer", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionManufacturer = new OpenHome.Net.Core.Action("Manufacturer");
            param = new ParameterString("Name", allowedValues);
            iActionManufacturer.AddOutputParameter(param);
            param = new ParameterString("Info", allowedValues);
            iActionManufacturer.AddOutputParameter(param);
            param = new ParameterString("Url", allowedValues);
            iActionManufacturer.AddOutputParameter(param);
            param = new ParameterString("ImageUri", allowedValues);
            iActionManufacturer.AddOutputParameter(param);

            iActionModel = new OpenHome.Net.Core.Action("Model");
            param = new ParameterString("Name", allowedValues);
            iActionModel.AddOutputParameter(param);
            param = new ParameterString("Info", allowedValues);
            iActionModel.AddOutputParameter(param);
            param = new ParameterString("Url", allowedValues);
            iActionModel.AddOutputParameter(param);
            param = new ParameterString("ImageUri", allowedValues);
            iActionModel.AddOutputParameter(param);

            iActionProduct = new OpenHome.Net.Core.Action("Product");
            param = new ParameterString("Name", allowedValues);
            iActionProduct.AddOutputParameter(param);
            param = new ParameterString("Info", allowedValues);
            iActionProduct.AddOutputParameter(param);
            param = new ParameterString("Url", allowedValues);
            iActionProduct.AddOutputParameter(param);
            param = new ParameterString("ImageUri", allowedValues);
            iActionProduct.AddOutputParameter(param);

            iActionAttributes = new OpenHome.Net.Core.Action("Attributes");
            param = new ParameterString("Value", allowedValues);
            iActionAttributes.AddOutputParameter(param);

            iActionQueryPort = new OpenHome.Net.Core.Action("QueryPort");
            param = new ParameterUint("Value");
            iActionQueryPort.AddOutputParameter(param);

            iActionBrowsePort = new OpenHome.Net.Core.Action("BrowsePort");
            param = new ParameterUint("Value");
            iActionBrowsePort.AddOutputParameter(param);

            iActionUpdateCount = new OpenHome.Net.Core.Action("UpdateCount");
            param = new ParameterUint("Value");
            iActionUpdateCount.AddOutputParameter(param);

            iManufacturerName = new PropertyString("ManufacturerName", ManufacturerNamePropertyChanged);
            AddProperty(iManufacturerName);
            iManufacturerInfo = new PropertyString("ManufacturerInfo", ManufacturerInfoPropertyChanged);
            AddProperty(iManufacturerInfo);
            iManufacturerUrl = new PropertyString("ManufacturerUrl", ManufacturerUrlPropertyChanged);
            AddProperty(iManufacturerUrl);
            iManufacturerImageUri = new PropertyString("ManufacturerImageUri", ManufacturerImageUriPropertyChanged);
            AddProperty(iManufacturerImageUri);
            iModelName = new PropertyString("ModelName", ModelNamePropertyChanged);
            AddProperty(iModelName);
            iModelInfo = new PropertyString("ModelInfo", ModelInfoPropertyChanged);
            AddProperty(iModelInfo);
            iModelUrl = new PropertyString("ModelUrl", ModelUrlPropertyChanged);
            AddProperty(iModelUrl);
            iModelImageUri = new PropertyString("ModelImageUri", ModelImageUriPropertyChanged);
            AddProperty(iModelImageUri);
            iProductName = new PropertyString("ProductName", ProductNamePropertyChanged);
            AddProperty(iProductName);
            iProductInfo = new PropertyString("ProductInfo", ProductInfoPropertyChanged);
            AddProperty(iProductInfo);
            iProductUrl = new PropertyString("ProductUrl", ProductUrlPropertyChanged);
            AddProperty(iProductUrl);
            iProductImageUri = new PropertyString("ProductImageUri", ProductImageUriPropertyChanged);
            AddProperty(iProductImageUri);
            iAttributes = new PropertyString("Attributes", AttributesPropertyChanged);
            AddProperty(iAttributes);
            iQueryPort = new PropertyUint("QueryPort", QueryPortPropertyChanged);
            AddProperty(iQueryPort);
            iBrowsePort = new PropertyUint("BrowsePort", BrowsePortPropertyChanged);
            AddProperty(iBrowsePort);
            iUpdateCount = new PropertyUint("UpdateCount", UpdateCountPropertyChanged);
            AddProperty(iUpdateCount);

            iPropertyLock = new Mutex();
        }
コード例 #40
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyAvOpenhomeOrgProduct1(CpDevice aDevice)
            : base("av-openhome-org", "Product", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionManufacturer = new OpenHome.Net.Core.Action("Manufacturer");
            param = new ParameterString("Name", allowedValues);
            iActionManufacturer.AddOutputParameter(param);
            param = new ParameterString("Info", allowedValues);
            iActionManufacturer.AddOutputParameter(param);
            param = new ParameterString("Url", allowedValues);
            iActionManufacturer.AddOutputParameter(param);
            param = new ParameterString("ImageUri", allowedValues);
            iActionManufacturer.AddOutputParameter(param);

            iActionModel = new OpenHome.Net.Core.Action("Model");
            param = new ParameterString("Name", allowedValues);
            iActionModel.AddOutputParameter(param);
            param = new ParameterString("Info", allowedValues);
            iActionModel.AddOutputParameter(param);
            param = new ParameterString("Url", allowedValues);
            iActionModel.AddOutputParameter(param);
            param = new ParameterString("ImageUri", allowedValues);
            iActionModel.AddOutputParameter(param);

            iActionProduct = new OpenHome.Net.Core.Action("Product");
            param = new ParameterString("Room", allowedValues);
            iActionProduct.AddOutputParameter(param);
            param = new ParameterString("Name", allowedValues);
            iActionProduct.AddOutputParameter(param);
            param = new ParameterString("Info", allowedValues);
            iActionProduct.AddOutputParameter(param);
            param = new ParameterString("Url", allowedValues);
            iActionProduct.AddOutputParameter(param);
            param = new ParameterString("ImageUri", allowedValues);
            iActionProduct.AddOutputParameter(param);

            iActionStandby = new OpenHome.Net.Core.Action("Standby");
            param = new ParameterBool("Value");
            iActionStandby.AddOutputParameter(param);

            iActionSetStandby = new OpenHome.Net.Core.Action("SetStandby");
            param = new ParameterBool("Value");
            iActionSetStandby.AddInputParameter(param);

            iActionSourceCount = new OpenHome.Net.Core.Action("SourceCount");
            param = new ParameterUint("Value");
            iActionSourceCount.AddOutputParameter(param);

            iActionSourceXml = new OpenHome.Net.Core.Action("SourceXml");
            param = new ParameterString("Value", allowedValues);
            iActionSourceXml.AddOutputParameter(param);

            iActionSourceIndex = new OpenHome.Net.Core.Action("SourceIndex");
            param = new ParameterUint("Value");
            iActionSourceIndex.AddOutputParameter(param);

            iActionSetSourceIndex = new OpenHome.Net.Core.Action("SetSourceIndex");
            param = new ParameterUint("Value");
            iActionSetSourceIndex.AddInputParameter(param);

            iActionSetSourceIndexByName = new OpenHome.Net.Core.Action("SetSourceIndexByName");
            param = new ParameterString("Value", allowedValues);
            iActionSetSourceIndexByName.AddInputParameter(param);

            iActionSource = new OpenHome.Net.Core.Action("Source");
            param = new ParameterUint("Index");
            iActionSource.AddInputParameter(param);
            param = new ParameterString("SystemName", allowedValues);
            iActionSource.AddOutputParameter(param);
            param = new ParameterString("Type", allowedValues);
            iActionSource.AddOutputParameter(param);
            param = new ParameterString("Name", allowedValues);
            iActionSource.AddOutputParameter(param);
            param = new ParameterBool("Visible");
            iActionSource.AddOutputParameter(param);

            iActionAttributes = new OpenHome.Net.Core.Action("Attributes");
            param = new ParameterString("Value", allowedValues);
            iActionAttributes.AddOutputParameter(param);

            iActionSourceXmlChangeCount = new OpenHome.Net.Core.Action("SourceXmlChangeCount");
            param = new ParameterUint("Value");
            iActionSourceXmlChangeCount.AddOutputParameter(param);

            iManufacturerName = new PropertyString("ManufacturerName", ManufacturerNamePropertyChanged);
            AddProperty(iManufacturerName);
            iManufacturerInfo = new PropertyString("ManufacturerInfo", ManufacturerInfoPropertyChanged);
            AddProperty(iManufacturerInfo);
            iManufacturerUrl = new PropertyString("ManufacturerUrl", ManufacturerUrlPropertyChanged);
            AddProperty(iManufacturerUrl);
            iManufacturerImageUri = new PropertyString("ManufacturerImageUri", ManufacturerImageUriPropertyChanged);
            AddProperty(iManufacturerImageUri);
            iModelName = new PropertyString("ModelName", ModelNamePropertyChanged);
            AddProperty(iModelName);
            iModelInfo = new PropertyString("ModelInfo", ModelInfoPropertyChanged);
            AddProperty(iModelInfo);
            iModelUrl = new PropertyString("ModelUrl", ModelUrlPropertyChanged);
            AddProperty(iModelUrl);
            iModelImageUri = new PropertyString("ModelImageUri", ModelImageUriPropertyChanged);
            AddProperty(iModelImageUri);
            iProductRoom = new PropertyString("ProductRoom", ProductRoomPropertyChanged);
            AddProperty(iProductRoom);
            iProductName = new PropertyString("ProductName", ProductNamePropertyChanged);
            AddProperty(iProductName);
            iProductInfo = new PropertyString("ProductInfo", ProductInfoPropertyChanged);
            AddProperty(iProductInfo);
            iProductUrl = new PropertyString("ProductUrl", ProductUrlPropertyChanged);
            AddProperty(iProductUrl);
            iProductImageUri = new PropertyString("ProductImageUri", ProductImageUriPropertyChanged);
            AddProperty(iProductImageUri);
            iStandby = new PropertyBool("Standby", StandbyPropertyChanged);
            AddProperty(iStandby);
            iSourceIndex = new PropertyUint("SourceIndex", SourceIndexPropertyChanged);
            AddProperty(iSourceIndex);
            iSourceCount = new PropertyUint("SourceCount", SourceCountPropertyChanged);
            AddProperty(iSourceCount);
            iSourceXml = new PropertyString("SourceXml", SourceXmlPropertyChanged);
            AddProperty(iSourceXml);
            iAttributes = new PropertyString("Attributes", AttributesPropertyChanged);
            AddProperty(iAttributes);

            iPropertyLock = new Mutex();
        }
コード例 #41
0
ファイル: CpDevice.cs プロジェクト: RoonLabs/ohNet
 private static void CallListChangedDelegate(ChangeHandler aDelegate, CpDeviceList aList, CpDevice aDevice)
 {
     try
     {
         aDelegate(aList, aDevice);
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine(String.Format("WARNING: Unhandled exception in device list change delegate.\n\tDevice is {0}\n\tException is {1}", aDevice.Udn(), new object[] { e }));
     }
 }
コード例 #42
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <remarks>Use CpProxy::[Un]Subscribe() to enable/disable querying of state variable and reporting of their changes.</remarks>
        /// <param name="aDevice">The device to use</param>
        public CpProxyUpnpOrgRenderingControl1(CpDevice aDevice)
            : base("schemas-upnp-org", "RenderingControl", 1, aDevice)
        {
            OpenHome.Net.Core.Parameter param;
            List<String> allowedValues = new List<String>();

            iActionListPresets = new OpenHome.Net.Core.Action("ListPresets");
            param = new ParameterUint("InstanceID");
            iActionListPresets.AddInputParameter(param);
            param = new ParameterString("CurrentPresetNameList", allowedValues);
            iActionListPresets.AddOutputParameter(param);

            iActionSelectPreset = new OpenHome.Net.Core.Action("SelectPreset");
            param = new ParameterUint("InstanceID");
            iActionSelectPreset.AddInputParameter(param);
            param = new ParameterString("PresetName", allowedValues);
            iActionSelectPreset.AddInputParameter(param);

            iActionGetBrightness = new OpenHome.Net.Core.Action("GetBrightness");
            param = new ParameterUint("InstanceID");
            iActionGetBrightness.AddInputParameter(param);
            param = new ParameterUint("CurrentBrightness", 0, 2147483647, 1);
            iActionGetBrightness.AddOutputParameter(param);

            iActionSetBrightness = new OpenHome.Net.Core.Action("SetBrightness");
            param = new ParameterUint("InstanceID");
            iActionSetBrightness.AddInputParameter(param);
            param = new ParameterUint("DesiredBrightness", 0, 2147483647, 1);
            iActionSetBrightness.AddInputParameter(param);

            iActionGetContrast = new OpenHome.Net.Core.Action("GetContrast");
            param = new ParameterUint("InstanceID");
            iActionGetContrast.AddInputParameter(param);
            param = new ParameterUint("CurrentContrast", 0, 2147483647, 1);
            iActionGetContrast.AddOutputParameter(param);

            iActionSetContrast = new OpenHome.Net.Core.Action("SetContrast");
            param = new ParameterUint("InstanceID");
            iActionSetContrast.AddInputParameter(param);
            param = new ParameterUint("DesiredContrast", 0, 2147483647, 1);
            iActionSetContrast.AddInputParameter(param);

            iActionGetSharpness = new OpenHome.Net.Core.Action("GetSharpness");
            param = new ParameterUint("InstanceID");
            iActionGetSharpness.AddInputParameter(param);
            param = new ParameterUint("CurrentSharpness", 0, 2147483647, 1);
            iActionGetSharpness.AddOutputParameter(param);

            iActionSetSharpness = new OpenHome.Net.Core.Action("SetSharpness");
            param = new ParameterUint("InstanceID");
            iActionSetSharpness.AddInputParameter(param);
            param = new ParameterUint("DesiredSharpness", 0, 2147483647, 1);
            iActionSetSharpness.AddInputParameter(param);

            iActionGetRedVideoGain = new OpenHome.Net.Core.Action("GetRedVideoGain");
            param = new ParameterUint("InstanceID");
            iActionGetRedVideoGain.AddInputParameter(param);
            param = new ParameterUint("CurrentRedVideoGain", 0, 2147483647, 1);
            iActionGetRedVideoGain.AddOutputParameter(param);

            iActionSetRedVideoGain = new OpenHome.Net.Core.Action("SetRedVideoGain");
            param = new ParameterUint("InstanceID");
            iActionSetRedVideoGain.AddInputParameter(param);
            param = new ParameterUint("DesiredRedVideoGain", 0, 2147483647, 1);
            iActionSetRedVideoGain.AddInputParameter(param);

            iActionGetGreenVideoGain = new OpenHome.Net.Core.Action("GetGreenVideoGain");
            param = new ParameterUint("InstanceID");
            iActionGetGreenVideoGain.AddInputParameter(param);
            param = new ParameterUint("CurrentGreenVideoGain", 0, 2147483647, 1);
            iActionGetGreenVideoGain.AddOutputParameter(param);

            iActionSetGreenVideoGain = new OpenHome.Net.Core.Action("SetGreenVideoGain");
            param = new ParameterUint("InstanceID");
            iActionSetGreenVideoGain.AddInputParameter(param);
            param = new ParameterUint("DesiredGreenVideoGain", 0, 2147483647, 1);
            iActionSetGreenVideoGain.AddInputParameter(param);

            iActionGetBlueVideoGain = new OpenHome.Net.Core.Action("GetBlueVideoGain");
            param = new ParameterUint("InstanceID");
            iActionGetBlueVideoGain.AddInputParameter(param);
            param = new ParameterUint("CurrentBlueVideoGain", 0, 2147483647, 1);
            iActionGetBlueVideoGain.AddOutputParameter(param);

            iActionSetBlueVideoGain = new OpenHome.Net.Core.Action("SetBlueVideoGain");
            param = new ParameterUint("InstanceID");
            iActionSetBlueVideoGain.AddInputParameter(param);
            param = new ParameterUint("DesiredBlueVideoGain", 0, 2147483647, 1);
            iActionSetBlueVideoGain.AddInputParameter(param);

            iActionGetRedVideoBlackLevel = new OpenHome.Net.Core.Action("GetRedVideoBlackLevel");
            param = new ParameterUint("InstanceID");
            iActionGetRedVideoBlackLevel.AddInputParameter(param);
            param = new ParameterUint("CurrentRedVideoBlackLevel", 0, 2147483647, 1);
            iActionGetRedVideoBlackLevel.AddOutputParameter(param);

            iActionSetRedVideoBlackLevel = new OpenHome.Net.Core.Action("SetRedVideoBlackLevel");
            param = new ParameterUint("InstanceID");
            iActionSetRedVideoBlackLevel.AddInputParameter(param);
            param = new ParameterUint("DesiredRedVideoBlackLevel", 0, 2147483647, 1);
            iActionSetRedVideoBlackLevel.AddInputParameter(param);

            iActionGetGreenVideoBlackLevel = new OpenHome.Net.Core.Action("GetGreenVideoBlackLevel");
            param = new ParameterUint("InstanceID");
            iActionGetGreenVideoBlackLevel.AddInputParameter(param);
            param = new ParameterUint("CurrentGreenVideoBlackLevel", 0, 2147483647, 1);
            iActionGetGreenVideoBlackLevel.AddOutputParameter(param);

            iActionSetGreenVideoBlackLevel = new OpenHome.Net.Core.Action("SetGreenVideoBlackLevel");
            param = new ParameterUint("InstanceID");
            iActionSetGreenVideoBlackLevel.AddInputParameter(param);
            param = new ParameterUint("DesiredGreenVideoBlackLevel", 0, 2147483647, 1);
            iActionSetGreenVideoBlackLevel.AddInputParameter(param);

            iActionGetBlueVideoBlackLevel = new OpenHome.Net.Core.Action("GetBlueVideoBlackLevel");
            param = new ParameterUint("InstanceID");
            iActionGetBlueVideoBlackLevel.AddInputParameter(param);
            param = new ParameterUint("CurrentBlueVideoBlackLevel", 0, 2147483647, 1);
            iActionGetBlueVideoBlackLevel.AddOutputParameter(param);

            iActionSetBlueVideoBlackLevel = new OpenHome.Net.Core.Action("SetBlueVideoBlackLevel");
            param = new ParameterUint("InstanceID");
            iActionSetBlueVideoBlackLevel.AddInputParameter(param);
            param = new ParameterUint("DesiredBlueVideoBlackLevel", 0, 2147483647, 1);
            iActionSetBlueVideoBlackLevel.AddInputParameter(param);

            iActionGetColorTemperature = new OpenHome.Net.Core.Action("GetColorTemperature");
            param = new ParameterUint("InstanceID");
            iActionGetColorTemperature.AddInputParameter(param);
            param = new ParameterUint("CurrentColorTemperature", 0, 2147483647, 1);
            iActionGetColorTemperature.AddOutputParameter(param);

            iActionSetColorTemperature = new OpenHome.Net.Core.Action("SetColorTemperature");
            param = new ParameterUint("InstanceID");
            iActionSetColorTemperature.AddInputParameter(param);
            param = new ParameterUint("DesiredColorTemperature", 0, 2147483647, 1);
            iActionSetColorTemperature.AddInputParameter(param);

            iActionGetHorizontalKeystone = new OpenHome.Net.Core.Action("GetHorizontalKeystone");
            param = new ParameterUint("InstanceID");
            iActionGetHorizontalKeystone.AddInputParameter(param);
            param = new ParameterInt("CurrentHorizontalKeystone");
            iActionGetHorizontalKeystone.AddOutputParameter(param);

            iActionSetHorizontalKeystone = new OpenHome.Net.Core.Action("SetHorizontalKeystone");
            param = new ParameterUint("InstanceID");
            iActionSetHorizontalKeystone.AddInputParameter(param);
            param = new ParameterInt("DesiredHorizontalKeystone");
            iActionSetHorizontalKeystone.AddInputParameter(param);

            iActionGetVerticalKeystone = new OpenHome.Net.Core.Action("GetVerticalKeystone");
            param = new ParameterUint("InstanceID");
            iActionGetVerticalKeystone.AddInputParameter(param);
            param = new ParameterInt("CurrentVerticalKeystone");
            iActionGetVerticalKeystone.AddOutputParameter(param);

            iActionSetVerticalKeystone = new OpenHome.Net.Core.Action("SetVerticalKeystone");
            param = new ParameterUint("InstanceID");
            iActionSetVerticalKeystone.AddInputParameter(param);
            param = new ParameterInt("DesiredVerticalKeystone");
            iActionSetVerticalKeystone.AddInputParameter(param);

            iActionGetMute = new OpenHome.Net.Core.Action("GetMute");
            param = new ParameterUint("InstanceID");
            iActionGetMute.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionGetMute.AddInputParameter(param);
            param = new ParameterBool("CurrentMute");
            iActionGetMute.AddOutputParameter(param);

            iActionSetMute = new OpenHome.Net.Core.Action("SetMute");
            param = new ParameterUint("InstanceID");
            iActionSetMute.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionSetMute.AddInputParameter(param);
            param = new ParameterBool("DesiredMute");
            iActionSetMute.AddInputParameter(param);

            iActionGetVolume = new OpenHome.Net.Core.Action("GetVolume");
            param = new ParameterUint("InstanceID");
            iActionGetVolume.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionGetVolume.AddInputParameter(param);
            param = new ParameterUint("CurrentVolume", 0, 2147483647, 1);
            iActionGetVolume.AddOutputParameter(param);

            iActionSetVolume = new OpenHome.Net.Core.Action("SetVolume");
            param = new ParameterUint("InstanceID");
            iActionSetVolume.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionSetVolume.AddInputParameter(param);
            param = new ParameterUint("DesiredVolume", 0, 2147483647, 1);
            iActionSetVolume.AddInputParameter(param);

            iActionGetVolumeDB = new OpenHome.Net.Core.Action("GetVolumeDB");
            param = new ParameterUint("InstanceID");
            iActionGetVolumeDB.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionGetVolumeDB.AddInputParameter(param);
            param = new ParameterInt("CurrentVolume");
            iActionGetVolumeDB.AddOutputParameter(param);

            iActionSetVolumeDB = new OpenHome.Net.Core.Action("SetVolumeDB");
            param = new ParameterUint("InstanceID");
            iActionSetVolumeDB.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionSetVolumeDB.AddInputParameter(param);
            param = new ParameterInt("DesiredVolume");
            iActionSetVolumeDB.AddInputParameter(param);

            iActionGetVolumeDBRange = new OpenHome.Net.Core.Action("GetVolumeDBRange");
            param = new ParameterUint("InstanceID");
            iActionGetVolumeDBRange.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionGetVolumeDBRange.AddInputParameter(param);
            param = new ParameterInt("MinValue");
            iActionGetVolumeDBRange.AddOutputParameter(param);
            param = new ParameterInt("MaxValue");
            iActionGetVolumeDBRange.AddOutputParameter(param);

            iActionGetLoudness = new OpenHome.Net.Core.Action("GetLoudness");
            param = new ParameterUint("InstanceID");
            iActionGetLoudness.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionGetLoudness.AddInputParameter(param);
            param = new ParameterBool("CurrentLoudness");
            iActionGetLoudness.AddOutputParameter(param);

            iActionSetLoudness = new OpenHome.Net.Core.Action("SetLoudness");
            param = new ParameterUint("InstanceID");
            iActionSetLoudness.AddInputParameter(param);
            param = new ParameterString("Channel", allowedValues);
            iActionSetLoudness.AddInputParameter(param);
            param = new ParameterBool("DesiredLoudness");
            iActionSetLoudness.AddInputParameter(param);

            iLastChange = new PropertyString("LastChange", LastChangePropertyChanged);
            AddProperty(iLastChange);

            iPropertyLock = new Mutex();
        }
コード例 #43
0
 private static void CallListChangedDelegate(ChangeHandler aDelegate, CpDeviceList aList, CpDevice aDevice)
 {
     try
     {
         aDelegate(aList, aDevice);
     }
     catch (ProxyError e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: ProxyError thrown in device list change delegate: {0}", new object[] { e });
     }
 }