Exemple #1
0
 public StoryPlugin(IMessageDispatcher remote, IUIThreadDispatcher uiThreadDispatcher)
 {
     this._remote             = remote;
     this._uiThreadDispatcher = uiThreadDispatcher;
     uiThreadDispatcher.BlockingInvoke(() =>
     {
         story                 = new StoryPage();
         pluginContainer       = new Viewbox();
         pluginContainer.Child = story;
     });
     _remote.RegisterReceiveHandler("story.stopRecording",
                                    new MessageHandlerDelegateWrapper(m => endVideoCapture()));
     _remote.RegisterReceiveHandler("story.startRecording",
                                    new MessageHandlerDelegateWrapper(m => startVideoCapture(m)));
 }
Exemple #2
0
        public StoryPlugin(IMessageDispatcher remote, IUIThreadDispatcher uiThreadDispatcher)
        {
            this._remote             = remote;
            this._uiThreadDispatcher = uiThreadDispatcher;
            uiThreadDispatcher.BlockingInvoke(() =>
            {
                story                 = new StoryPage();
                pluginContainer       = new Viewbox();
                pluginContainer.Child = story;
            });
            _remote.RegisterReceiveHandler("story.stopRecording",
                                           new MessageHandlerDelegateWrapper(m => endVideoCapture()));
            _remote.RegisterReceiveHandler("story.startRecording",
                                           new MessageHandlerDelegateWrapper(m => startVideoCapture(m)));
            _remote.RegisterReceiveHandler("story.saveRecording",
                                           new MessageHandlerDelegateWrapper(m => saveRecording(m)));

            foreach (EncoderDevice edv in EncoderDevices.FindDevices(EncoderDeviceType.Video))
            {
                //Debug.WriteLine("found a video deviced named: " + edv.Name);
                videoDevice = edv;
            }
            foreach (EncoderDevice edv in EncoderDevices.FindDevices(EncoderDeviceType.Audio))
            {
                //Debug.WriteLine("found a audio deviced named: " + edv.Name);
                if (edv.Name.ToLower().Contains("microphone"))
                {
                    audioDevice = edv;
                }
            }

            story.SizeChanged += new System.Windows.SizeChangedEventHandler(story_SizeChanged);
            job = new LiveJob();


            if (!System.IO.Directory.Exists("C:\\Dropbox\\" + System.Windows.Forms.SystemInformation.ComputerName + "\\videos\\"))
            {
                System.IO.Directory.CreateDirectory("C:\\Dropbox\\" + System.Windows.Forms.SystemInformation.ComputerName + "\\videos\\");
            }

            fileOut = new FileArchivePublishFormat();
            fileOut.OutputFileName = "C:\\Dropbox\\" + System.Windows.Forms.SystemInformation.ComputerName + "\\videos\\tempVideo.wmv";
            System.Console.WriteLine(fileOut.OutputFileName);
        }