public UPnP_SinkFunctions(CpAVTransport av, CpConnectionManager cm, CpRenderingControl rc)
        {
            InstanceID = 0;
            _AVTransport = av;
            _ConnectionManager = cm;
            _RenderingControl = rc;
            _channel = "1";
            _speed = "1";

            _RenderingControl.OnResult_GetVolume += RenderingControlOnOnResultGetVolume;
            _ConnectionManager.OnResult_GetIPAddress += ConnectionManagerOnOnResultGetIpAddress;
            _RenderingControl.OnResult_GetPosition += RenderingControlOnOnResultGetPosition;

            _AVTransport.OnStateVariable_TransportState += AvTransportOnOnStateVariableTransportState;
            _AVTransport._subscribe(30);

            Timer subscribeTimer = new Timer();
            subscribeTimer.Elapsed += new ElapsedEventHandler(timerEventFunc);
            subscribeTimer.Interval = 30000;
            subscribeTimer.Enabled = true;
        }
        private void RenderingControlOnOnResultGetPosition(CpRenderingControl sender, uint instanceId, ushort currentPosition, ushort duration, UPnPInvokeException upnPInvokeException, object tag)
        {
            var list = new List<ushort>{currentPosition, duration};

            var args = new EventArgsContainer<List<ushort>>(list);

            getPositionEvent(this, args);
        }
        private void RenderingControlOnOnResultGetVolume(CpRenderingControl sender, uint instanceId, string channel, ushort currentVolume, UPnPInvokeException upnPInvokeException, object tag)
        {
            EventArgsContainer<ushort> argsContainer = new EventArgsContainer<ushort>(currentVolume);

            getVolEvent(this, argsContainer);
        }
 /// <summary>
 /// Event that is called when there is a result from a GetVolume call
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="instanceId"></param>
 /// <param name="channel"></param>
 /// <param name="currentVolume">The current volume on the device</param>
 /// <param name="upnPInvokeException"></param>
 /// <param name="tag"></param>
 private void RenderingControlOnOnResultGetVolume(CpRenderingControl sender, uint instanceId, string channel, ushort currentVolume, UPnPInvokeException upnPInvokeException, object tag)
 {
     getVolEvent(this, currentVolume);
 }