Esempio n. 1
0
 public void AddLocalMicrophone(LocalMicrophoneModel mic)
 {
     if (LocalMicrophones.FirstOrDefault(x => x.Id == mic.Id) == null)
     {
         System.Windows.Application.Current.Dispatcher.Invoke(() => { LocalMicrophones.Add(mic); });
         Log.Info(string.Format("Added local microphone: name={0} id={1}", mic.DisplayName, mic.Id));
     }
 }
Esempio n. 2
0
        private void ShareAudioContent()
        {
            var contentToShare = LocalMicrophones.FirstOrDefault(x => x.IsSharingContent);

            if (contentToShare != null)
            {
                _connector.SelectAudioContentShare(contentToShare.Object);
                Log.InfoFormat("Set selected audio content sharing: name={0} id={1}", contentToShare.DisplayName,
                               contentToShare.Id);
            }
        }
Esempio n. 3
0
        private void SelectLocalMicrophone()
        {
            var micToSelect = LocalMicrophones.FirstOrDefault(x => x.IsStreamingAudio);

            if (micToSelect != null)
            {
                _connector.SelectLocalMicrophone(micToSelect.Object);
                Log.Info(string.Format("Set selected local microphone: name={0} id={1}", micToSelect.DisplayName,
                                       micToSelect.Id));
            }
        }
Esempio n. 4
0
        public void RemoveLocalMicrophone(LocalMicrophoneModel mic)
        {
            var micToRemove = LocalMicrophones.FirstOrDefault(x => x.Id == mic.Id);

            if (micToRemove != null)
            {
                System.Windows.Application.Current.Dispatcher.Invoke(() => { LocalMicrophones.Remove(micToRemove); });
                Log.Info(string.Format("Removed local microphone: name={0} id={1}", micToRemove.DisplayName,
                                       micToRemove.Id));
            }
        }
Esempio n. 5
0
        public void SetSelectedAudioContent(LocalMicrophoneModel mic)
        {
            var micToSelect = LocalMicrophones.FirstOrDefault(x => x.Id == mic.Id);

            if (micToSelect != null)
            {
                LocalMicrophones.Select(x =>
                {
                    x.IsSharingContent = false;
                    return(x);
                })
                .ToList();
                micToSelect.IsSharingContent = true;

                Log.InfoFormat("Audio content share selected: name={0} id={1}", micToSelect.DisplayName, micToSelect.IsSharingContent);
            }
        }
Esempio n. 6
0
        public void SetSelectedLocalMicrophone(LocalMicrophoneModel mic)
        {
            var micToSelect = LocalMicrophones.FirstOrDefault(x => x.Id == mic.Id);

            if (micToSelect != null)
            {
                LocalMicrophones.Select(x =>
                {
                    x.IsStreamingAudio = false;
                    return(x);
                })
                .ToList();
                micToSelect.IsStreamingAudio = true;

                Log.Info(string.Format("Local microphone selected: name={0} id={1}", micToSelect.DisplayName,
                                       micToSelect.Id));
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Entry point. Prepares and launches Vidyo functionality.
        /// </summary>
        /// <param name="handle">Control's handler where video will be rendered.</param>
        /// <param name="width">Width of video area.</param>
        /// <param name="height">Height of video area.</param>
        public void Init(IntPtr handle1, IntPtr handle2, IntPtr handle3, IntPtr handle4, IntPtr handle5, IntPtr localHandle)
        {
            ConnectorPKG.Initialize();
            DisplayName = "DemoUser";
            Portal      = "https://vidyocloud.com";
            _sortedHandles.Add(1, handle1);
            _sortedHandles.Add(2, handle2);
            _sortedHandles.Add(3, handle3);
            _sortedHandles.Add(4, handle4);
            _sortedHandles.Add(5, handle5);
            Log.Info("VidyoConnector initialized.");
            _localHandle = localHandle;

            _connector = new Connector(IntPtr.Zero, Connector.ConnectorViewStyle.ConnectorviewstyleDefault, 8, "all@VidyoClient all@LmiCsEpClient", "VidyoClient.log", 0);

            // This should be called on each window resizing.

            // Adding Null's to devices collection, which is 'None' in GUI. Selecting 'None' means no device will be used.
            LocalCameras.Add(new LocalCameraModel(null));
            LocalMicrophones.Add(new LocalMicrophoneModel(null));
            LocalSpeakers.Add(new LocalSpeakerModel(null));

            // Registering to events we want to handle.
            _connector.RegisterLocalCameraEventListener(new LocalCameraListener(this));
            _connector.RegisterLocalWindowShareEventListener(new LocalWindowShareListener(this));
            _connector.RegisterLocalMicrophoneEventListener(new LocalMicropfoneListener(this));
            _connector.RegisterLocalSpeakerEventListener(new LocalSpeakerListener(this));
            _connector.RegisterParticipantEventListener(new ParticipantListener(this));
            _connector.RegisterLocalMonitorEventListener(new LocalMonitorListener(this));
            _connector.RegisterRemoteCameraEventListener(new RemoteCameraListener(this));
            _connector.RegisterMessageEventListener(new MessageListener(this));

            // We are not in call when application started.
            ConnectionState = ConnectionState.NotConnected;

            // On application start Vidyo turns on default camera.
            IsCameraOn = true;
            // On application start Vidyo turns on default microphone.
            IsMicrophoneOn = true;
            EnableDebug    = false;

            ParseCommandLineArgs();
        }
Esempio n. 8
0
        /// <summary>
        /// Entry point. Prepares and launches Vidyo functionality.
        /// </summary>
        /// <param name="handle">Control's handler where video will be rendered.</param>
        /// <param name="width">Width of video area.</param>
        /// <param name="height">Height of video area.</param>
        public void Init(IntPtr handle, uint width, uint height)
        {
            ConnectorPKG.Initialize();
            Log.Info("VidyoConnector initialized.");

            _connector = new Connector(handle, Connector.ConnectorViewStyle.ConnectorviewstyleDefault, 8, "all@VidyoClient", "VidyoClient.log", 0);

            // This should be called on each window resizing.
            _connector.ShowViewAtPoints(handle, 0, 0, width, height);
            Log.Info(string.Format("Showing view with width={0} and height={1}", width, height));

            // Adding Null's to devices collection, which is 'None' in GUI. Selecting 'None' means no device will be used.
            LocalCameras.Add(new LocalCameraModel(null));
            LocalMicrophones.Add(new LocalMicrophoneModel(null));
            LocalSpeakers.Add(new LocalSpeakerModel(null));

            // Registering to events we want to handle.
            _connector.RegisterLocalCameraEventListener(new LocalCameraListener(this));
            _connector.RegisterLocalWindowShareEventListener(new LocalWindowShareListener(this));
            _connector.RegisterLocalMicrophoneEventListener(new LocalMicropfoneListener(this));
            _connector.RegisterLocalSpeakerEventListener(new LocalSpeakerListener(this));
            _connector.RegisterParticipantEventListener(new ParticipantListener(this));
            _connector.RegisterLocalMonitorEventListener(new LocalMonitorListener(this));
            //_connector.RegisterLogEventListener(new LogListener(this), "*@VidyoClient");
            _connector.RegisterMessageEventListener(new MessageListener(this));

            // We are not in call when application started.
            ConnectionState = ConnectionState.NotConnected;

            // On application start Vidyo turns on default camera.
            IsCameraOn = true;
            // On application start Vidyo turns on default microphone.
            IsMicrophoneOn = true;
            EnableDebug    = false;

            ParseCommandLineArgs();
        }