Exemplo n.º 1
0
        public RendererForm(AVConnection connection)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            _connection = connection;
            _connection.OnPlay += new AVConnection.PlayHandler(PlaySink);
            _connection.OnPause += new AVConnection.StopPauseRecordHandler(PauseSink);
            _connection.OnStop += new AVConnection.StopPauseRecordHandler(StopSink);
            _connection.OnNext += new AVConnection.PreviousNextHandler(NextSink);
            _connection.OnPrevious += new AVConnection.PreviousNextHandler(PreviousSink);
            _connection.OnMuteChanged += new AVConnection.MuteChangedHandler(MuteSink);
            _connection.OnVolumeChanged += new AVConnection.VolumeChangedHandler(VolumeSink);
            _connection.OnCurrentURIChanged += new AVConnection.VariableChangedHandler(UriChangeSink);
            _connection.OnNextURIChanged += new AVConnection.VariableChangedHandler(NextUriChangeSink);
            _connection.OnSeek += new AVConnection.SeekHandler(SeekSink);
            _connection.OnRecord += new AVConnection.StopPauseRecordHandler(RecordSink);
            _connection.OnCurrentPreset += new AVConnection.VariableChangedHandler(PresetSink);
            _connection.OnCurrentRecordQualityModeChanged += new AVConnection.VariableChangedHandler(RecModeSink);
            _connection.OnCurrentPlayModeChanged += new AVConnection.VariableChangedHandler(PlayModeSink);

            this.Text = "Media Renderer [" + connection.ID.ToString() + "] <" + connection.WhoCreatedMe.ToString() + ">";
            PresetLabel.Text = connection.CurrentPreset;
            this.RecordQualityModeLabel.Text = DvAVTransport.Enum_CurrentRecordQualityMode_ToString(_connection.CurrentRecordQualityMode);
            this.PlayModeLabel.Text = DvAVTransport.Enum_CurrentPlayMode_ToString(_connection.CurrentPlayMode);

            muteButton.Image = mutePictureBox.Image;
            contentUriLabel.Text = player.URL;
            toolTip.SetToolTip(contentUriLabel, player.URL);

            SetVolume(50, DvRenderingControl.Enum_A_ARG_TYPE_Channel.MASTER);
            SetVolume(100, DvRenderingControl.Enum_A_ARG_TYPE_Channel.LF);
            SetVolume(100, DvRenderingControl.Enum_A_ARG_TYPE_Channel.RF);
            connection.SetVolume(DvRenderingControl.Enum_A_ARG_TYPE_Channel.MASTER, 50);
            connection.SetVolume(DvRenderingControl.Enum_A_ARG_TYPE_Channel.LF, 100);
            connection.SetVolume(DvRenderingControl.Enum_A_ARG_TYPE_Channel.RF, 100);

            VolumeSink(connection, DvRenderingControl.Enum_A_ARG_TYPE_Channel.MASTER, (UInt16)50);
        }