Пример #1
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     if (m_AudRecorder != null && false == String.IsNullOrEmpty(sWavToSend))
     {
         CReadWavFile          wf   = new CReadWavFile(sWavToSend);
         ZelloPTTLib.IContacts cnts = ptt.Contacts;
         ZelloPTTLib.IMessage  msg  = null;
         List <string>         lst  = new List <string>();
         try
         {
             foreach (object chk in cbSendAudioFile.CheckedItems)
             {
                 ContactInfo ci = chk as ContactInfo;
                 if (ci != null)
                 {
                     lst.Add(ci.id);
                 }
             }
         }
         catch (System.Exception)
         {}
         if (lst.Count > 0)
         {
             ZelloPTTLib.IAudioStream strm = m_AudRecorder.MessageOutBeginEx(lst.ToArray(), string.Empty, out msg);
             if (strm != null && msg != null)
             {
                 pbSendProgress.Visible = true;
                 AudioMessageRecording rec = new AudioMessageRecording(wf);
                 rec.AllDataWritten += new EventHandler(SendFile_AllDataWritten);
                 lstOutMessages.Add(rec);
                 rec.SetStream(strm);
             }
         }
     }
 }
Пример #2
0
 public void ptt_SignOutComplete()
 {
     BeginInvoke((MethodInvoker) delegate
     {
         this.Text = "Zello client #" + ZelloClientId.ToString();
         tmUpdateOnlineContacts.Stop();
         if (null != contactsMesh)
         {
             System.Runtime.InteropServices.Marshal.FinalReleaseComObject(contactsMesh);
         }
         contactsMesh = null;
         // Destroy hidden main window if sign out was initiated earlier
         // when user tried to exit while Loudtalks Mesh control was signed into network.
         if (bExitOnSignout)
         {
             if (ptt != null)
             {
                 ptt = null;
             }
             Close();
         }
         else
         {
             UpdateMenuState();
             UpdateControlsState();
         }
     });                 // Sign out process has finished
 }
Пример #3
0
 public void ptt_SignOutStarted()
 {
     // Sign out process has started
     BeginInvoke((MethodInvoker) delegate
     {
         UpdateMenuState();
         UpdateControlsState();
         tmUpdateOnlineContacts.Stop();
         if (null != contactsMesh)
         {
             System.Runtime.InteropServices.Marshal.FinalReleaseComObject(contactsMesh);
         }
         contactsMesh = null;
     });
 }
Пример #4
0
 public void ptt_SignInSucceeded()
 {
     // Sign in process has finished successfully
     BeginInvoke((MethodInvoker) delegate
     {
         this.Text = "Zello client #" + ZelloClientId.ToString() + " : " + comboUsername.Text;
         UpdateMenuState();
         UpdateControlsState();
         tmUpdateOnlineContacts.Start();
         if (null != contactsMesh)
         {
             System.Runtime.InteropServices.Marshal.FinalReleaseComObject(contactsMesh);
         }
         contactsMesh = ptt.Contacts;
         UpdateIntegrationControlsState();
     });
 }
Пример #5
0
 void tmUpdateOnlineContacts_Tick(object sender, EventArgs e)
 {
     if (bUpdateOnlineContats)
     {
         List <ContactInfo> lst     = new List <ContactInfo>(10);
         List <ContactInfo> lstLive = new List <ContactInfo>(10);
         bUpdateOnlineContats = false;
         ZelloPTTLib.IContacts cnts = ptt.Contacts;
         int idxMax = cnts.Count;
         for (int idx = 0; idx < idxMax; ++idx)
         {
             ZelloPTTLib.IContact      cnt = cnts.get_Item(idx);
             ZelloPTTLib.ONLINE_STATUS st  = cnt.Status;
             if (st == ZelloPTTLib.ONLINE_STATUS.OSAVAILABLE || st == ZelloPTTLib.ONLINE_STATUS.OSSTANDBY || st == ZelloPTTLib.ONLINE_STATUS.OSHEADPHONES ||
                 st == ZelloPTTLib.ONLINE_STATUS.OSAWAY || st == ZelloPTTLib.ONLINE_STATUS.OSBUSY)
             {
                 ContactInfo cn = new ContactInfo();
                 cn.id = cnt.Id;
                 if (cnt.Type == ZelloPTTLib.CONTACT_TYPE.CTCHANNEL)
                 {
                     cn.name = cnt.Name + "(channel)";
                 }
                 else if (cnt.Type == ZelloPTTLib.CONTACT_TYPE.CTGROUP)
                 {
                     cn.name = cnt.Name + "(group)";
                 }
                 else
                 {
                     cn.name = cnt.Name;
                 }
                 lst.Add(cn);
                 if (st != ZelloPTTLib.ONLINE_STATUS.OSSTANDBY)
                 {
                     lstLive.Add(cn);
                 }
             }
         }
         reloadList(cbForwardAudio, lstLive);
         reloadList(cbSendAudioFile, lst);
     }
 }