Beispiel #1
0
        private void cbEnableAI_CheckedChanged(object sender, EventArgs e)
        {
            UpdateIntegrationControlsState();
            if (cbEnableAI.Checked)
            {
                m_AudPlayback = new AudioMessagePlaybackImpl(this.startAudioForwarding);
                m_AudRecorder = ptt.StartAudioMessageIntegration(m_AudPlayback);
            }
            else
            {
                ptt.StopAudioMessageIntegration();

                m_AudPlayback = null;
                m_AudRecorder = null;
                GC.Collect();
                lstForwardContactIds.Clear();
                foreach (int idx in cbForwardAudio.CheckedIndices)
                {
                    cbForwardAudio.SetItemCheckState(idx, CheckState.Unchecked);
                }
                foreach (int idx2 in this.cbSendAudioFile.CheckedIndices)
                {
                    cbSendAudioFile.SetItemCheckState(idx2, CheckState.Unchecked);
                }
            }
            ptt.Chorus               = cbEnableAI.Checked;
            lbSendAudio.ForeColor    = cbEnableAI.Checked ? System.Drawing.SystemColors.ControlText : System.Drawing.SystemColors.GrayText;
            lbForwardAudio.ForeColor = cbEnableAI.Checked ? System.Drawing.SystemColors.ControlText : System.Drawing.SystemColors.GrayText;;
        }