コード例 #1
0
        public SinkDevice()
        {
            //Creates root device
            device = UPnPDevice.CreateRootDevice(1800, 1.0 , "\\");

            //Device information:
            device.FriendlyName = "Caspers homemade Renderer";
            device.Manufacturer = "Awesome Casper";
            device.DeviceURN = "urn:schemas-upnp-org:device:MediaRenderer:1";

            //Create stacks
            DvAVTransport AVTransport = new DvAVTransport();
            DvConnectionManager connectionManager = new DvConnectionManager();
            DvRenderingControl renderingControl = new DvRenderingControl();

            //Add stacks to device (and network visibility)
            device.AddService(AVTransport);
            device.AddService(connectionManager);
            device.AddService(renderingControl);

            AVTransport.Evented_LastChange = "Sample string";
        }
コード例 #2
0
        public SampleDevice()
        {
            device = UPnPDevice.CreateRootDevice(1800,1.0,"\\");

            device.FriendlyName = "Media Renderer (Casper-laptop)";
            device.Manufacturer = "OpenSource";
            device.ManufacturerURL = "http://opentools.homeip.net/";
            device.ModelName = "AV Renderer";
            device.ModelDescription = "Media Renderer Device";
            device.HasPresentation = false;
            device.DeviceURN = "urn:schemas-upnp-org:device:MediaRenderer:1";
            OpenSource.DeviceBuilder.DvAVTransport AVTransport = new OpenSource.DeviceBuilder.DvAVTransport();
            AVTransport.External_GetCurrentTransportActions = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_GetCurrentTransportActions(AVTransport_GetCurrentTransportActions);
            AVTransport.External_GetDeviceCapabilities = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_GetDeviceCapabilities(AVTransport_GetDeviceCapabilities);
            AVTransport.External_GetMediaInfo = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_GetMediaInfo(AVTransport_GetMediaInfo);
            AVTransport.External_GetPositionInfo = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_GetPositionInfo(AVTransport_GetPositionInfo);
            AVTransport.External_GetTransportInfo = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_GetTransportInfo(AVTransport_GetTransportInfo);
            AVTransport.External_GetTransportSettings = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_GetTransportSettings(AVTransport_GetTransportSettings);
            AVTransport.External_Next = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_Next(AVTransport_Next);
            AVTransport.External_Pause = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_Pause(AVTransport_Pause);
            AVTransport.External_Play = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_Play(AVTransport_Play);
            AVTransport.External_Previous = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_Previous(AVTransport_Previous);
            AVTransport.External_Seek = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_Seek(AVTransport_Seek);
            AVTransport.External_SetAVTransportURI = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_SetAVTransportURI(AVTransport_SetAVTransportURI);
            AVTransport.External_SetPlayMode = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_SetPlayMode(AVTransport_SetPlayMode);
            AVTransport.External_Stop = new OpenSource.DeviceBuilder.DvAVTransport.Delegate_Stop(AVTransport_Stop);
            device.AddService(AVTransport);
            OpenSource.DeviceBuilder.DvConnectionManager ConnectionManager = new OpenSource.DeviceBuilder.DvConnectionManager();
            ConnectionManager.External_GetCurrentConnectionIDs = new OpenSource.DeviceBuilder.DvConnectionManager.Delegate_GetCurrentConnectionIDs(ConnectionManager_GetCurrentConnectionIDs);
            ConnectionManager.External_GetCurrentConnectionInfo = new OpenSource.DeviceBuilder.DvConnectionManager.Delegate_GetCurrentConnectionInfo(ConnectionManager_GetCurrentConnectionInfo);
            ConnectionManager.External_GetProtocolInfo = new OpenSource.DeviceBuilder.DvConnectionManager.Delegate_GetProtocolInfo(ConnectionManager_GetProtocolInfo);
            device.AddService(ConnectionManager);
            OpenSource.DeviceBuilder.DvRenderingControl RenderingControl = new OpenSource.DeviceBuilder.DvRenderingControl();
            RenderingControl.External_GetBlueVideoBlackLevel = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetBlueVideoBlackLevel(RenderingControl_GetBlueVideoBlackLevel);
            RenderingControl.External_GetBlueVideoGain = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetBlueVideoGain(RenderingControl_GetBlueVideoGain);
            RenderingControl.External_GetBrightness = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetBrightness(RenderingControl_GetBrightness);
            RenderingControl.External_GetColorTemperature = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetColorTemperature(RenderingControl_GetColorTemperature);
            RenderingControl.External_GetContrast = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetContrast(RenderingControl_GetContrast);
            RenderingControl.External_GetGreenVideoBlackLevel = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetGreenVideoBlackLevel(RenderingControl_GetGreenVideoBlackLevel);
            RenderingControl.External_GetGreenVideoGain = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetGreenVideoGain(RenderingControl_GetGreenVideoGain);
            RenderingControl.External_GetHorizontalKeystone = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetHorizontalKeystone(RenderingControl_GetHorizontalKeystone);
            RenderingControl.External_GetLoudness = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetLoudness(RenderingControl_GetLoudness);
            RenderingControl.External_GetMute = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetMute(RenderingControl_GetMute);
            RenderingControl.External_GetRedVideoBlackLevel = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetRedVideoBlackLevel(RenderingControl_GetRedVideoBlackLevel);
            RenderingControl.External_GetRedVideoGain = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetRedVideoGain(RenderingControl_GetRedVideoGain);
            RenderingControl.External_GetSharpness = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetSharpness(RenderingControl_GetSharpness);
            RenderingControl.External_GetVerticalKeystone = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetVerticalKeystone(RenderingControl_GetVerticalKeystone);
            RenderingControl.External_GetVolume = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetVolume(RenderingControl_GetVolume);
            RenderingControl.External_GetVolumeDB = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetVolumeDB(RenderingControl_GetVolumeDB);
            RenderingControl.External_GetVolumeDBRange = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_GetVolumeDBRange(RenderingControl_GetVolumeDBRange);
            RenderingControl.External_ListPresets = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_ListPresets(RenderingControl_ListPresets);
            RenderingControl.External_SelectPreset = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SelectPreset(RenderingControl_SelectPreset);
            RenderingControl.External_SetBlueVideoBlackLevel = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetBlueVideoBlackLevel(RenderingControl_SetBlueVideoBlackLevel);
            RenderingControl.External_SetBlueVideoGain = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetBlueVideoGain(RenderingControl_SetBlueVideoGain);
            RenderingControl.External_SetBrightness = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetBrightness(RenderingControl_SetBrightness);
            RenderingControl.External_SetColorTemperature = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetColorTemperature(RenderingControl_SetColorTemperature);
            RenderingControl.External_SetContrast = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetContrast(RenderingControl_SetContrast);
            RenderingControl.External_SetGreenVideoBlackLevel = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetGreenVideoBlackLevel(RenderingControl_SetGreenVideoBlackLevel);
            RenderingControl.External_SetGreenVideoGain = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetGreenVideoGain(RenderingControl_SetGreenVideoGain);
            RenderingControl.External_SetHorizontalKeystone = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetHorizontalKeystone(RenderingControl_SetHorizontalKeystone);
            RenderingControl.External_SetLoudness = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetLoudness(RenderingControl_SetLoudness);
            RenderingControl.External_SetMute = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetMute(RenderingControl_SetMute);
            RenderingControl.External_SetRedVideoBlackLevel = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetRedVideoBlackLevel(RenderingControl_SetRedVideoBlackLevel);
            RenderingControl.External_SetRedVideoGain = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetRedVideoGain(RenderingControl_SetRedVideoGain);
            RenderingControl.External_SetSharpness = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetSharpness(RenderingControl_SetSharpness);
            RenderingControl.External_SetVerticalKeystone = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetVerticalKeystone(RenderingControl_SetVerticalKeystone);
            RenderingControl.External_SetVolume = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetVolume(RenderingControl_SetVolume);
            RenderingControl.External_SetVolumeDB = new OpenSource.DeviceBuilder.DvRenderingControl.Delegate_SetVolumeDB(RenderingControl_SetVolumeDB);
            device.AddService(RenderingControl);

            // Setting the initial value of evented variables
            AVTransport.Evented_LastChange = "Sample String";
            ConnectionManager.Evented_SourceProtocolInfo = "Sample String";
            ConnectionManager.Evented_SinkProtocolInfo = "Sample String";
            ConnectionManager.Evented_CurrentConnectionIDs = "Sample String";
            RenderingControl.Evented_LastChange = "Sample String";
        }
コード例 #3
0
 public void AVTransport_SetPlayMode(System.UInt32 InstanceID, DvAVTransport.Enum_CurrentPlayMode NewPlayMode)
 {
     Console.WriteLine("AVTransport_SetPlayMode(" + InstanceID.ToString() + NewPlayMode.ToString() + ")");
 }
コード例 #4
0
 public void AVTransport_Seek(System.UInt32 InstanceID, DvAVTransport.Enum_A_ARG_TYPE_SeekMode Unit, System.String Target)
 {
     Console.WriteLine("AVTransport_Seek(" + InstanceID.ToString() + Unit.ToString() + Target.ToString() + ")");
 }
コード例 #5
0
 public void AVTransport_Play(System.UInt32 InstanceID, DvAVTransport.Enum_TransportPlaySpeed Speed)
 {
     Console.WriteLine("AVTransport_Play(" + InstanceID.ToString() + Speed.ToString() + ")");
 }
コード例 #6
0
 public void AVTransport_GetTransportSettings(System.UInt32 InstanceID, out DvAVTransport.Enum_CurrentPlayMode PlayMode, out DvAVTransport.Enum_CurrentRecordQualityMode RecQualityMode)
 {
     PlayMode = DvAVTransport.Enum_CurrentPlayMode.NORMAL;
     RecQualityMode = DvAVTransport.Enum_CurrentRecordQualityMode._0_EP;
     Console.WriteLine("AVTransport_GetTransportSettings(" + InstanceID.ToString() + ")");
 }
コード例 #7
0
 public void AVTransport_GetTransportInfo(System.UInt32 InstanceID, out DvAVTransport.Enum_TransportState CurrentTransportState, out DvAVTransport.Enum_TransportStatus CurrentTransportStatus, out DvAVTransport.Enum_TransportPlaySpeed CurrentSpeed)
 {
     CurrentTransportState = DvAVTransport.Enum_TransportState.STOPPED;
     CurrentTransportStatus = DvAVTransport.Enum_TransportStatus.OK;
     CurrentSpeed = DvAVTransport.Enum_TransportPlaySpeed._1;
     Console.WriteLine("AVTransport_GetTransportInfo(" + InstanceID.ToString() + ")");
 }
コード例 #8
0
 public void AVTransport_GetMediaInfo(System.UInt32 InstanceID, out System.UInt32 NrTracks, out System.String MediaDuration, out System.String CurrentURI, out System.String CurrentURIMetaData, out System.String NextURI, out System.String NextURIMetaData, out DvAVTransport.Enum_PlaybackStorageMedium PlayMedium, out DvAVTransport.Enum_RecordStorageMedium RecordMedium, out DvAVTransport.Enum_RecordMediumWriteStatus WriteStatus)
 {
     NrTracks = 0;
     MediaDuration = "Sample String";
     CurrentURI = "Sample String";
     CurrentURIMetaData = "Sample String";
     NextURI = "Sample String";
     NextURIMetaData = "Sample String";
     PlayMedium = DvAVTransport.Enum_PlaybackStorageMedium.UNKNOWN;
     RecordMedium = DvAVTransport.Enum_RecordStorageMedium.UNKNOWN;
     WriteStatus = DvAVTransport.Enum_RecordMediumWriteStatus.WRITABLE;
     Console.WriteLine("AVTransport_GetMediaInfo(" + InstanceID.ToString() + ")");
 }
コード例 #9
0
 internal _DvAVTransport(DvAVTransport n)
 {
     Outer = n;
     S = BuildUPnPService();
 }