Ejemplo n.º 1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="owner">Main UI.</param>
        /// <param name="session">RTP session.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>owner</b> or <b>session</b> is null reference.</exception>
        public wfrm_SendMic(Robot1 owner, RTP_Session session)
        {
            if(owner == null){
                throw new ArgumentNullException("owner");
            }
            if(session == null){
                throw new ArgumentNullException("session");
            }

            m_pMainUI  = owner;
            m_pSession = session;

            InitUI();

            // Load input devices.
            m_pInDevices.Items.Clear();
            foreach(AudioInDevice device in AudioIn.Devices){
                m_pInDevices.Items.Add(device.Name);
            }
            if(m_pInDevices.Items.Count > 0){
                m_pInDevices.SelectedIndex = 0;
            }

            m_pRtpPacket = new RTP_Packet();
            m_pRtpPacket.Data = new byte[400];
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="stream">RTP receive stream.</param>
        public wfrm_Receive2(RTP_ReceiveStream stream, Robot1 owner)
        {
            if(stream == null){
                throw new ArgumentNullException("stream");
            }
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            m_pMainUI = owner;

            // Force window handle creation.
            ////////////////////////////////IntPtr handle = this.Handle;

            m_pStream = stream;
            m_pStream.PacketReceived += new EventHandler<RTP_PacketEventArgs>(m_pStream_PacketReceived);

            m_RtpMap = new Dictionary<int,AudioCodec>();
            m_RtpMap.Add(0,new PCMU());
            m_RtpMap.Add(8,new PCMA());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="owner">Main UI.</param>
        /// <param name="session">RTP session.</param>
        /// <param name="sendFile">File which data to send.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>owner</b>, <b>session</b> or <b>sendFile</b> is null reference.</exception>
        public wfrm_SendAudio(Robot1 owner, RTP_Session session, string sendFile)
        {
            if(owner == null){
                throw new ArgumentNullException("owner");
            }
            if(session == null){
                throw new ArgumentNullException("session");
            }
            if(sendFile == null){
                throw new ArgumentNullException("sendFile");
            }

            m_pMainUI  = owner;
            m_pSession = session;
            m_SendFile = sendFile;

            InitUI();

            ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object state){
                SendAudio();
            }));
        }