Beispiel #1
0
        private void wfrm_Receive_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (m_pTimer != null)
            {
                m_pTimer.Dispose();
                m_pTimer = null;
            }

            if (m_pAudioOut != null)
            {
                m_pAudioOut.Dispose();
                m_pAudioOut = null;
            }
        }
 static public void Stop()
 {
     if (session != null)
     {
         ao.Stop();
         ao.Dispose();
         ao = null;
         session.Close("Closed.");
         session.Dispose();
         session = null;
         execute = null;
     }
 }
        private void wndMain_Closing_1(object sender, System.ComponentModel.CancelEventArgs e)
        {
            var config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            SaveParam(config, "LastPartnerIp", tbxPartnerIp.Text);
            SaveParam(config, "LastAudioInDevice", (cbAudioInDevices.SelectedValue as AudioInDevice).Name);
            SaveParam(config, "LastAudioOutDevice", (cbAudioOutDevices.SelectedValue as AudioOutDevice).Name);
            SaveParam(config, "SamplesPerSecond", _samplesPerSecond.ToString());

            config.Save();

            //StopSoundReceiver();
            // StopSoundSender();
            if (d_RecieveStream != null)
            {
                d_RecieveStream.Dispatcher.InvokeShutdown();
            }

            if (d_SendStream != null)
            {
                d_SendStream.Dispatcher.InvokeShutdown();
            }

            if (m_pAudioInRTP != null)
            {
                m_pAudioInRTP.Dispose();
            }

            if (m_pSendStream != null)
            {
                m_pSendStream.Close();
            }

            if (m_pAudioOut != null)
            {
                m_pAudioOut.Dispose();
            }

            if (m_pRtpSession != null)
            {
                m_pRtpSession.Dispose();
            }

            StopMessageServer();
        }