Example #1
0
        public InCallForm(Call c, NoneCallback ncb)
        {
            this.updateFriendViewOnClosing = ncb;
            this.call = c;
            updateGlobalCallVar();
            this.callId = new Id(c.callId);
            InitializeComponent();
            this.Text = "(" + Program.username + ") Aktywne połączenie";
            StringCallback callback2 = addUser;
            StringCallback callback3 = removeUser;

            LoggedInService.AddUserToCall      = callback2;
            LoggedInService.RemoveUserFromCall = callback3;

            updateUsersInCall();
            ByteCallback callback  = incomingTraffic;
            NoneCallback callback4 = closeCall;

            CallProcessing.ReceiveMsgCallback = callback;
            CallProcessing.CloseCallCallback  = callback4;
            CallProcessing.Start();
            Program.isInCall = true;

            packetsCounterTimer.Interval  = 1000;
            packetsCounterTimer.Elapsed  += packetsCounterTimer_OnTimerElapsed;
            packetsCounterTimer.AutoReset = true;
            packetsCounterTimer.Start();

            ByteCallback sendCb = sendSound;

            sp = new SoundProcessing(sendCb);
            Program.spGlobal = sp;

            tokenSource = new System.Threading.CancellationTokenSource();
            token       = tokenSource.Token;

            Task.Run(() => sp.startUp(this.call.usernames, token), token);
        }
 public SoundProcessing(ByteCallback voiceSendCallback)
 {
     this.voiceSendCallback = voiceSendCallback;
 }
 public static extern byte ExecuteCharCallback(ByteCallback callback, byte param);